From da186dd540c6f7a90c403c4e85eaf21e1228d2ab Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Wed, 25 Jan 2017 13:42:07 -0800 Subject: [PATCH 01/15] Command scripts are finally identical between the Node and Jekyll web server --- modules/markout/lib/markout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/markout/lib/markout.js b/modules/markout/lib/markout.js index 241a96bdb..6f0db504f 100644 --- a/modules/markout/lib/markout.js +++ b/modules/markout/lib/markout.js @@ -534,7 +534,7 @@ MarkOut.prototype.convertMD = function(sIndent) * command lines, followed by the second command name, followed by one or more command lines, and so on. */ for (var iCommand = 1; iCommand < aCommands.length; iCommand += 2) { - this.aCommandDefs[aCommands[iCommand]] = aCommands[iCommand+1].trim().replace(/\n[ \t]*/g, "").replace(/"/g, """); + this.aCommandDefs[aCommands[iCommand]] = aCommands[iCommand+1].replace(/\n[ \t]*/g, " ").trim().replace(/"/g, """); } } From 94fd473b0a785840cfa6cd953c3a359cc41a54da Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Wed, 25 Jan 2017 14:18:19 -0800 Subject: [PATCH 02/15] Tidied up some status messages --- .../1170/panel/debugger/xxdp/README.md | 6 +- docs/pcx86/examples/pcx86-dbg.js | 2 +- docs/pcx86/examples/pcx86.js | 2 +- modules/pc8080/lib/serial.js | 2 +- modules/pcx86/lib/serial.js | 2 +- modules/pdp11/lib/bus.js | 2 +- modules/pdp11/lib/cpu.js | 2 +- modules/pdp11/lib/rom.js | 5 +- modules/pdp11/lib/serial.js | 2 +- versions/pc8080/1.32.2/pc8080-dbg.js | 2 +- versions/pc8080/1.32.2/pc8080.js | 2 +- versions/pdpjs/1.32.2/pdp11-dbg.js | 10 +-- versions/pdpjs/1.32.2/pdp11.js | 68 +++++++++---------- 13 files changed, 53 insertions(+), 54 deletions(-) diff --git a/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md b/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md index dd4bade4a..72e413ca9 100644 --- a/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md +++ b/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md @@ -17,11 +17,11 @@ commands: select rl11 listDrives RL0; select rl11 listDisks "XXDP+ Diagnostics"; click rl11 loadDisk; - click rl11 bootDisk + click rl11 bootDisk; --- -This machine is ready to boot [XXDP+ Diagnostics](/disks/dec/rl02k/xxdp/) ("BOOT RL0") and run -diagnostics (e.g., "R EKBEE1"): +This machine is ready to boot [XXDP+ Diagnostics](/disks/dec/rl02k/xxdp/) ("BOOT RL0") and run diagnostics +(e.g., "R EKBEE1"): - [EKBAD0: 11/70 CPU DIAGNOSTIC (PART 1)](/disks/dec/rl02k/xxdp/ekbad0/) - [EKBBF0: 11/70 CPU DIAGNOSTIC (PART 2)](/disks/dec/rl02k/xxdp/ekbbf0/) diff --git a/docs/pcx86/examples/pcx86-dbg.js b/docs/pcx86/examples/pcx86-dbg.js index 53c9b5b90..a8f6930f1 100644 --- a/docs/pcx86/examples/pcx86-dbg.js +++ b/docs/pcx86/examples/pcx86-dbg.js @@ -601,7 +601,7 @@ function uo(a){a.N&&a.C&&(a.Df&16&&!(a.Yb&64)?jg(a.N,a.C):ig(a.N,a.C))}var ro={0 function vo(a){this.Ca=a.adapter;switch(this.Ca){case 1:this.va=1016;this.ia=4;break;case 2:this.va=760;this.ia=3;break;default:w("Unrecognized serial adapter #"+this.Ca);return}this.V=this.W=null;this.Ga=a.tabSize;this.Ea=a.charBOL;this.ea=0;this.Ja=wo|xo;this.pa=!0;db.call(this,"SerialPort",a,vo,8388608);a=a.binding;"console"==a?this.W="":ob(this,a,yo);this.L=this.ua=this.Cc=null;this.exports={connect:this.zj,receiveData:this.hg,receiveStatus:this.ll}}gb(vo);var yo="buffer",wo=16,xo=32;l=vo.prototype; l.bj=function(a,b,c){var d=null;a!=this.xd||this.L||(this.L=b,this.Cc=c,this.pa=!1,d=this);return d};l.Pb=function(a,b,c){var d=this;switch(b){case yo:return this.qa[b]=this.V=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64");if(2==c.length){var d=qa(c[0]);if(d!=this.xd)return;c=qa(c[1]);if(this.L=lb(c)){var e=this.L.exports;if(e){var f=e.connect;f&&f.call(this.L,this.pa);if(this.ua=e.receiveData){this.pa=a;this.Cc=e.receiveStatus;this.status(this.ce+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +l.zj=function(a){if(!this.L){var b=Vc(this.X,"connection");if(b){var c=b.split("->");if(2==c.length){var d=qa(c[0]);if(d!=this.xd)return;c=qa(c[1]);if(this.L=lb(c)){var e=this.L.exports;if(e){var f=e.connect;f&&f.call(this.L,this.pa);if(this.ua=e.receiveData){this.pa=a;this.Cc=e.receiveStatus;this.status("Connected "+this.ce+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; l.hc=function(a,b){if(!b)if(this.zj(this.pa),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.gc=function(a){return a?this.save():!0};l.reset=function(){Bo(this)};l.save=function(){var a=new nf(this),b=0,c=[];c[b++]=this.ya;c[b++]=this.Da;c[b++]=this.fa;c[b++]=this.ka;c[b++]=this.U;c[b++]=this.C;c[b++]=this.ra;c[b++]=this.B;c[b++]=this.A;c[b]=this.aa;a.set(0,c);return a.data()};l.restore=function(a){return Bo(this,a[0])}; function Bo(a,b){var c=0;b||(b=[0,0,384,0,1,0,0,96,a.Ja,[]]);a.ya=b[c++];a.Da=b[c++];a.fa=b[c++];a.ka=b[c++];a.U=b[c++];a.C=b[c++];a.ra=b[c++];a.B=b[c++];a.A=b[c++];a.aa=b[c];return!0}l.hg=function(a){if("number"==typeof a)this.aa.push(a);else if("string"==typeof a)for(var b=0;b>8:this.ka;x(this,a,null,b,this.C&128?"DLM":"IER",c);return c};l.rm=function(a,b){var c=this.U;x(this,a,null,b,"IIR",c);return c};l.sm=function(a,b){var c=this.C;x(this,a,null,b,"LCR",c);return c};l.um=function(a,b){var c=this.ra;x(this,a,null,b,"MCR",c);return c}; diff --git a/docs/pcx86/examples/pcx86.js b/docs/pcx86/examples/pcx86.js index 9bfd2ee60..d10c0ba12 100644 --- a/docs/pcx86/examples/pcx86.js +++ b/docs/pcx86/examples/pcx86.js @@ -562,7 +562,7 @@ l.gm=function(a,b){this.Me=b;Ml(this)};function Ml(a){a.S&&a.D&&(a.Me&16&&!(a.Db function Nl(a){this.oa=a.adapter;switch(this.oa){case 1:this.ka=1016;this.W=4;break;case 2:this.ka=760;this.W=3;break;default:r("Unrecognized serial adapter #"+this.oa);return}this.G=this.I=null;this.ra=a.tabSize;this.qa=a.charBOL;this.R=0;this.sa=Ol|Pl;this.Z=!0;Ma.call(this,"SerialPort",a,Nl);a=a.binding;"console"==a?this.I="":Xa(this,a,Ql);this.D=this.ga=this.Rc=null;this.exports={connect:this.wi,receiveData:this.jf,receiveStatus:this.$j}}Pa(Nl);var Ql="buffer",Ol=16,Pl=32;l=Nl.prototype; l.fi=function(a,b,c){var d=null;a!=this.Td||this.D||(this.D=b,this.Rc=c,this.Z=!1,d=this);return d};l.zb=function(a,b,c){var d=this;switch(b){case Ql:return this.la[b]=this.G=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64");if(2==c.length){var d=la(c[0]);if(d!=this.Td)return;c=la(c[1]);if(this.D=Ua(c)){var e=this.D.exports;if(e){var f=e.connect;f&&f.call(this.D,this.Z);if(this.ga=e.receiveData){this.Z=a;this.Rc=e.receiveStatus;this.status(this.Fe+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +l.wi=function(a){if(!this.D){var b=kc(this.ba,"connection");if(b){var c=b.split("->");if(2==c.length){var d=la(c[0]);if(d!=this.Td)return;c=la(c[1]);if(this.D=Ua(c)){var e=this.D.exports;if(e){var f=e.connect;f&&f.call(this.D,this.Z);if(this.ga=e.receiveData){this.Z=a;this.Rc=e.receiveStatus;this.status("Connected "+this.Fe+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; l.Ub=function(a,b){if(!b)if(this.wi(this.Z),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.Tb=function(a){return a?this.save():!0};l.reset=function(){Tl(this)};l.save=function(){var a=new ae(this),b=0,c=[];c[b++]=this.ma;c[b++]=this.pa;c[b++]=this.P;c[b++]=this.Y;c[b++]=this.H;c[b++]=this.L;c[b++]=this.da;c[b++]=this.C;c[b++]=this.B;c[b]=this.K;a.set(0,c);return a.data()};l.restore=function(a){return Tl(this,a[0])}; function Tl(a,b){var c=0;b||(b=[0,0,384,0,1,0,0,96,a.sa,[]]);a.ma=b[c++];a.pa=b[c++];a.P=b[c++];a.Y=b[c++];a.H=b[c++];a.L=b[c++];a.da=b[c++];a.C=b[c++];a.B=b[c++];a.K=b[c];return!0}l.jf=function(a){if("number"==typeof a)this.K.push(a);else if("string"==typeof a)for(var b=0;b>8:this.Y};l.cl=function(){return this.H};l.dl=function(){return this.L};l.fl=function(){return this.da};l.el=function(){return this.C};l.kl=function(){var a=this.B;this.B&=-4;return a}; diff --git a/modules/pc8080/lib/serial.js b/modules/pc8080/lib/serial.js index ca8df8056..76ab67554 100644 --- a/modules/pc8080/lib/serial.js +++ b/modules/pc8080/lib/serial.js @@ -397,7 +397,7 @@ class SerialPort8080 extends Component { if (this.sendData) { this.fNullModem = fNullModem; this.updateStatus = exports['receiveStatus']; - this.status(this.idMachine + '.' + sSourceID + " connected to " + sTargetID); + this.status("Connected " + this.idMachine + '.' + sSourceID + " to " + sTargetID); return; } } diff --git a/modules/pcx86/lib/serial.js b/modules/pcx86/lib/serial.js index 3c3accf01..532390013 100644 --- a/modules/pcx86/lib/serial.js +++ b/modules/pcx86/lib/serial.js @@ -507,7 +507,7 @@ SerialPort.prototype.initConnection = function(fNullModem) if (this.sendData) { this.fNullModem = fNullModem; this.updateStatus = exports['receiveStatus']; - this.status(this.idMachine + '.' + sSourceID + " connected to " + sTargetID); + this.status("Connected " + this.idMachine + '.' + sSourceID + " to " + sTargetID); return; } } diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index 768f2a949..ffb4a7d9d 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -456,7 +456,7 @@ class BusPDP11 extends Component { } if (sizeLeft <= 0) { - this.status((size >> 10) + "Kb " + MemoryPDP11.TYPE_NAMES[type] + " at " + Str.toOct(addr)); + this.status("Added " + (size >> 10) + "Kb " + MemoryPDP11.TYPE_NAMES[type] + " at " + Str.toOct(addr)); return true; } diff --git a/modules/pdp11/lib/cpu.js b/modules/pdp11/lib/cpu.js index 64cd360ec..f130f483e 100644 --- a/modules/pdp11/lib/cpu.js +++ b/modules/pdp11/lib/cpu.js @@ -267,7 +267,7 @@ class CPUPDP11 extends Component { * However, we don't actually need to check all that; it's always safe use println(), regardless whether * a Control Panel with a "print" control is present or not. */ - this.println("No debugger detected"); + this.status("No debugger detected"); } if (!this.flags.autoStart) { this.println("CPU will not be auto-started " + (this.panel? "(click Run to start)" : "(type 'go' to start)")); diff --git a/modules/pdp11/lib/rom.js b/modules/pdp11/lib/rom.js index 0b7646120..816b63a74 100644 --- a/modules/pdp11/lib/rom.js +++ b/modules/pdp11/lib/rom.js @@ -268,14 +268,12 @@ class ROMPDP11 extends Component { */ addROM(addr) { - this.status(this.sizeROM + "-byte ROM at " + Str.toOct(addr)); - if (addr >= BusPDP11.IOPAGE_16BIT && addr < BusPDP11.IOPAGE_16BIT + BusPDP11.IOPAGE_LENGTH) { /* * This code has been added as a work-around to effectively allow us to install small ROMs into portions * of the IOPAGE address space, by installing I/O handlers for the entire range that return the corresponding * bytes of the current ROM image on reads, and ignore any writes (which I'm only assuming is how a typical - * ROM "device" deals with writes; if we remove the write handler, then writes will fault). + * ROM "device" deals with writes; we could remove the write handler, but then writes would fault). * * TODO: It would be more efficient if we parsed ROM data as words rather than bytes, and then installed * only word handlers instead of only byte handlers. It was done this way purely for historical reasons (ie, @@ -286,6 +284,7 @@ class ROMPDP11 extends Component { [addr]: [ROMPDP11.prototype.readROMByte, ROMPDP11.prototype.writeROMByte, null, null, null, this.sizeROM >> 1] }; if (this.bus.addIOTable(this, IOTable)) { + this.status("Added " + this.sizeROM + "-byte ROM at " + Str.toOct(addr)); this.fRetainROM = true; return true; } diff --git a/modules/pdp11/lib/serial.js b/modules/pdp11/lib/serial.js index 06f44ebe9..77993f9f4 100644 --- a/modules/pdp11/lib/serial.js +++ b/modules/pdp11/lib/serial.js @@ -389,7 +389,7 @@ class SerialPortPDP11 extends Component { if (this.sendData) { this.fNullModem = fNullModem; this.updateStatus = exports['receiveStatus']; - this.status(this.idMachine + '.' + sSourceID + " connected to " + sTargetID); + this.status("Connected " + this.idMachine + '.' + sSourceID + " to " + sTargetID); return; } } diff --git a/versions/pc8080/1.32.2/pc8080-dbg.js b/versions/pc8080/1.32.2/pc8080-dbg.js index ed250fac8..49d35e9d1 100644 --- a/versions/pc8080/1.32.2/pc8080-dbg.js +++ b/versions/pc8080/1.32.2/pc8080-dbg.js @@ -177,7 +177,7 @@ function rf(a){n.call(this,"SerialPort",a,0,8388608);this.T=+a.adapter;switch(th ba(rf,n);k=rf.prototype; k.ca=function(a,b,c,d){var e=this;switch(b){case sf:return this.P[b]=this.g=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64");if(2==c.length){var d=Na(c[0]);if(d!=this.$a)return;c=Na(c[1]);if(this.b=ka(c)){var e=this.b.exports;if(e){var f=e.connect;f&&f.call(this.b,this.D);if(this.Ra=e.receiveData){this.D=a;this.I=e.receiveStatus;this.status(this.ab+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +k.ic=function(a){if(!this.b){var b=vc(this.S,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Na(c[0]);if(d!=this.$a)return;c=Na(c[1]);if(this.b=ka(c)){var e=this.b.exports;if(e){var f=e.connect;f&&f.call(this.b,this.D);if(this.Ra=e.receiveData){this.D=a;this.I=e.receiveStatus;this.status("Connected "+this.ab+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; k.ua=function(a,b){if(!b)if(this.ic(this.D),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.wa=function(a){return a?this.save():!0};k.reset=function(){wf(this)};k.save=function(){var a=new Vc(this),b=0,c=[];c[b++]=this.F;c[b++]=this.M;c[b++]=this.O;c[b++]=this.ia;c[b++]=this.B;c[b++]=this.C;c[b]=this.L;a.set(0,c);return a.data()};k.restore=function(a){return wf(this,a[0])}; function wf(a,b){var c=0;b||(b=xf);a.F=b[c++];a.M=b[c++];a.O=b[c++];a.ia=b[c++];a.B=b[c++];a.C=b[c++];a.L=b[c];return!0}function yf(a,b){var c=a.L&b;b&15||(c>>=4);b=zf[c];c=((a.B&Af)>>2)+6;a.B&Bf&&c++;c+=((a.B&Cf)>>6)+1>>1;return 1E3/Math.round(b/c)}function tf(a,b){xa(a,"receiveByte("+Da(b)+"), status="+Da(a.ia));return a.N||a.ia&Df?!1:(a.M=b,a.ia|=Df,Dd(a.u,a.X),!0)} k.Kb=function(a){null!=a&&(this.A="number"!=typeof a?a:this.A+String.fromCharCode(a));this.A&&(tf(this,this.A.charCodeAt(0))&&(this.A=this.A.substr(1)),this.A&&this.u&&Jc(this.u,this.Y,yf(this,Ef)));return!0};k.be=function(a){this.ia&=~Ff;a&64&&(this.ia|=Ff)};function Ee(a,b){a.ia=a.ia|Pd|Gf;b&&a.Ra&&a.Ra.call(a.b,b)}k.zd=function(a,b){var c=this.M;v(this,a,null,b,"DATA",c);this.ia&=~Df;return c};k.yd=function(a,b){var c=this.ia;v(this,a,null,b,"STATUS",c);return c}; diff --git a/versions/pc8080/1.32.2/pc8080.js b/versions/pc8080/1.32.2/pc8080.js index e7534b14a..e1ed1306c 100644 --- a/versions/pc8080/1.32.2/pc8080.js +++ b/versions/pc8080/1.32.2/pc8080.js @@ -168,7 +168,7 @@ function zd(a){q.call(this,"SerialPort",a);this.H=+a.adapter;switch(this.H){case k=zd.prototype; k.S=function(a,b,c,d){var e=this;switch(b){case Ad:return this.w[b]=this.b=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64");if(2==c.length){var d=ua(c[0]);if(d!=this.Wa)return;c=ua(c[1]);if(this.a=ha(c)){var e=this.a.exports;if(e){var f=e.connect;f&&f.call(this.a,this.l);if(this.Ba=e.receiveData){this.l=a;this.s=e.receiveStatus;this.status(this.Ia+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +k.Fb=function(a){if(!this.a){var b=yb(this.F,"connection");if(b){var c=b.split("->");if(2==c.length){var d=ua(c[0]);if(d!=this.Wa)return;c=ua(c[1]);if(this.a=ha(c)){var e=this.a.exports;if(e){var f=e.connect;f&&f.call(this.a,this.l);if(this.Ba=e.receiveData){this.l=a;this.s=e.receiveStatus;this.status("Connected "+this.Ia+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; k.ba=function(a,b){if(!b)if(this.Fb(this.l),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.fa=function(a){return a?this.save():!0};k.reset=function(){Ed(this)};k.save=function(){var a=new G(this),b=0,c=[];c[b++]=this.o;c[b++]=this.A;c[b++]=this.C;c[b++]=this.T;c[b++]=this.h;c[b++]=this.j;c[b]=this.v;a.set(0,c);return a.data()};k.restore=function(a){return Ed(this,a[0])}; function Ed(a,b){var c=0;b||(b=Fd);a.o=b[c++];a.A=b[c++];a.C=b[c++];a.T=b[c++];a.h=b[c++];a.j=b[c++];a.v=b[c];return!0}function Gd(a,b){var c=a.v&b;b&15||(c>>=4);b=Hd[c];c=((a.h&Id)>>2)+6;a.h&Jd&&c++;c+=((a.h&Kd)>>6)+1>>1;return 1E3/Math.round(b/c)}function Bd(a,b){return a.B||a.T&Ld?!1:(a.A=b,a.T|=Ld,kc(a.m,a.O),!0)} k.mb=function(a){null!=a&&(this.g="number"!=typeof a?a:this.g+String.fromCharCode(a));this.g&&(Bd(this,this.g.charCodeAt(0))&&(this.g=this.g.substr(1)),this.g&&this.m&&Jb(this.m,this.P,Gd(this,Md)));return!0};k.yd=function(a){this.T&=~Nd;a&64&&(this.T|=Nd)};function Mc(a,b){a.T=a.T|rc|Od;b&&a.Ba&&a.Ba.call(a.a,b)}k.Vc=function(){var a=this.A;this.T&=~Ld;return a};k.Uc=function(){return this.T}; diff --git a/versions/pdpjs/1.32.2/pdp11-dbg.js b/versions/pdpjs/1.32.2/pdp11-dbg.js index 09e3c30e3..5b1ab9999 100644 --- a/versions/pdpjs/1.32.2/pdp11-dbg.js +++ b/versions/pdpjs/1.32.2/pdp11-dbg.js @@ -77,7 +77,7 @@ h.qf=function(a){this.vb=a};function ac(){for(var a=y(document,x,"panel"),b=0;b< function Lc(a,b,c){q.call(this,"Bus",a,0,16);this.f=b;this.F=c;this.V=+a.busWidth||16;this.M=1<>2;this.i=this.j-1;this.H=this.M/this.j|0;this.T=this.H-1;this.Ma=[];this.ja=0;this.G=!1;this.N=[];this.Hd=[Nc,Oc,Pc,Qc];this.b=this.v=[];this.C=this.L=this.w=this.P=this.R=0;a=new L(this);Rc(a,this.F);this.b=Array(this.H);this.v=Array(this.H);for(b=0;b>>this.g;this.L=0;this.w=this.I;A(this)}p(Lc,q);function Uc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.v[a.R]=a.b[a.P])}}h=Lc.prototype;h.reset=function(){for(var a=0;a>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.K)return l.Jb+=l.K-f,l.K=f,!0;if(f>=l.K+l.Jb){n=l.size-(f-m);n>g&&(n=g);l.Jb=f-l.K+n;f=m+a.j;g-=n;k++;continue}}return Wc(Xc,f,g)}f=new L(a,f,n,a.j,d,e);Rc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status((c>>10)+"Kb "+Yc[d]+" at "+H(b)),!0):Wc(Zc,b,c)}h.Jc=function(a){return this.v[(a&this.w)>>>this.g].ub(a&this.i,a)}; +function Sc(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.K)return l.Jb+=l.K-f,l.K=f,!0;if(f>=l.K+l.Jb){n=l.size-(f-m);n>g&&(n=g);l.Jb=f-l.K+n;f=m+a.j;g-=n;k++;continue}}return Wc(Xc,f,g)}f=new L(a,f,n,a.j,d,e);Rc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Yc[d]+" at "+H(b)),!0):Wc(Zc,b,c)}h.Jc=function(a){return this.v[(a&this.w)>>>this.g].ub(a&this.i,a)}; h.ac=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Ob||b!=this.i?this.v[c].ka(b,a):this.v[c++].ub(b,a)|this.v[c&this.T].ub(0,a+1)<<8};h.Kc=function(a,b){this.v[(a&this.w)>>>this.g].wb(a&this.i,b,a)};h.Nb=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Ob||c!=this.i?this.v[d].xb(c,b,a):(this.v[d++].wb(c,b&255,a),this.v[d&this.T].wb(0,b>>8&255,a+1))};function $c(a,b){return a.b[(b&a.I)>>>a.g]} function Dc(a,b){var c;a.G=!1;a.ja++;var d=b&a.i,e=$c(a,b);Ob||d!=a.i?c=e.C(d,b):c=e.j(d,b)|$c(a,b+1).j(0,b+1)<<8;a.ja--;return c}function ad(a,b,c){a.G=!1;a.ja++;$c(a,b).D(b&a.i,c&255,b);a.ja--}function qc(a,b,c){a.G=!1;a.ja++;var d=b&a.i,e=$c(a,b);Ob||d!=a.i?e.G(d,c&65535,b):(e.D(d,c&255,b),$c(a,b+1).D(0,c>>8&255,b+1));a.ja--} function Vc(a){for(var b=0,c=[],d=0;d=a.Bb&&(a.Bb+=a.Ab,c=!0);0<=a.Cb&&a.Cb<=ee(a)&&(a.Ab=a.Cb=-1,ae(a),a.Z(),c=!0);c&&a.u(ee(a)+" cycles: checksum="+I(a.Sb))}} h.pa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.B[b]=c,!0;case "run":return this.B[b]=c,c.onclick=function(){var a;if(a=d.J)if(a=d.J,a.A.fa)a=!0;else{var b=null,c,k=za(a.id);for(c=0;cthis.ba?U.call(this,a):qh[a>>6&3].call(this,a)},U,U],qh=[function(a){U.call(this,a)},function(a){a=Ie(this,a,65536);this.Ba(a);Be(this,a);this.b-=11},function(a){var b=De(this);this.ga=this.b;this.Ba(b);Je(this,a,65536,b);this.b=this.ga-Cg[this.v]},function(a){U.call(this,a)}]; function rh(a){q.call(this,"ROM",a,0,128);this.ea=this.g=null;this.v=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.C=Pa(this.j);if(this.j){a=this.j;var b=Qa(this.C);"json"!=b&&"hex"!=b&&(a=db()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;bb(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(ua(c.mb,a,b),(a=cb(a,b))?(c.g=a.ca,c.ea=a.ea):c.j=null);sh(c)})}}p(rh,q); h=rh.prototype;h.ta=function(a,b,c,d){this.D=b;this.f=c;this.F=d;sh(this)};h.za=function(){this.ea&&(this.F&&th(this.F,this.id,this.v,this.b,this.ea),delete this.ea);return!0};h.ya=function(){return!0}; -function sh(a){if(!Ja(a)){if(a.j){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Da(a,"ROM size ("+I(a.g.length,8,!0)+") does not match specified size ("+I(a.b,8,!0)+")");else{var b;a:{b=a.v;a.status(a.b+"-byte ROM at "+H(b));if(57344<=b&&b<57344+Mc){var c={};b=(c[b]=[rh.prototype.Me,rh.prototype.Xf,null,null,null,a.b>>1],c);if(Wb(a.D,a,b)){b=a.w=!0;break a}}else if(Sc(a.D,b,a.b,Id)){for(c=0;c>>f.g;0>>=f.g;0>1],c);if(Wb(a.D,a,c)){a.status("Added "+a.b+"-byte ROM at "+H(b));b=a.w=!0;break a}}else if(Sc(a.D,b,a.b,Id)){for(c=0;c>>f.g;0>>=f.g;0=sa.Ic&&c<=sa.Gd&&(b=c-(sa.Ic-sa.ud));b&&(a.preventDefault&&a.preventDefault(),d.ec(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==sa.wd&&(b=sa.vd);d.ec(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ec(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; h.ta=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;var e=this;this.R=jd(this.f,this.M?-1:48,4,262144);this.S=gd(this.f,function(){var a;a=-1;e.v.length&&(a=e.v.shift()&255,C(e,"receiveByte("+I(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),id(e.f,e.S,1E3/Math.round(e.T/10)));0<=a&&(e.G=a,e.b&128?e.G|=49152:e.b|=128,e.b&64&&hd(c,e.R))});this.N=jd(this.f,this.M?-1:52,4,262144);this.Y=gd(this.f,function(){e.g|=128;e.g&64&&hd(c,e.N)});Wb(b,this,Ah,this.M?64832+8*(this.M-1)-65392:0);Yb(b,this.reset.bind(this)); -A(this)};h.md=function(a){if(!this.i){var b=Zd(this.J,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ya(c[0]);if(d!=this.lb)return;c=Ya(c[1]);if(this.i=Aa(c)){var e=this.i.exports;if(e){var f=e.connect;f&&f.call(this.i,this.I);if(this.H=e.receiveData){this.I=a;this.P=e.receiveStatus;this.status(this.mb+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +A(this)};h.md=function(a){if(!this.i){var b=Zd(this.J,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ya(c[0]);if(d!=this.lb)return;c=Ya(c[1]);if(this.i=Aa(c)){var e=this.i.exports;if(e){var f=e.connect;f&&f.call(this.i,this.I);if(this.H=e.receiveData){this.I=a;this.P=e.receiveStatus;this.status("Connected "+this.mb+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; h.za=function(a,b){if(!b)if(this.md(this.I),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ya=function(a){return a?this.save():!0};h.reset=function(){Bh(this)};h.save=function(){var a=new M(this);a.set(0,[]);return a.data()};h.restore=function(){return Bh(this)};function Bh(a){a.G=0;a.b=8192;a.g=128;a.v=[];return!0} h.ec=function(a){if("number"==typeof a)this.v.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d>2;this.f=this.g-1;this.s=this.F/this.g|0;this.L=this.s-1;this.Ha=[];this.m=0;this.o=!1;this.G=[];this.Vc=[Ob,Pb,Qb,Rb];this.a=this.b=[];this.C=this.w=this.i=this.H=this.I=0;a=new I(this);Sb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.v;D(this)}n(Mb,r);function Vb(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Mb.prototype;h.reset=function(){for(var a=0;a>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Sa)return l.vb+=l.Sa-f,l.Sa=f,!0;if(f>=l.Sa+l.vb){p=l.size-(f-m);p>g&&(p=g);l.vb=f-l.Sa+p;f=m+a.g;g-=p;k++;continue}}return Xb(Yb,f,g)}f=new I(a,f,p,a.g,d,e);Sb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Zb[d]+" at "+za(b)),!0):Xb($b,b,c)}h.Ec=function(a){return this.b[(a&this.i)>>>this.h].hb(a&this.f,a)}; -h.xb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return eb||b!=this.f?this.b[c].W(b,a):this.b[c++].hb(b,a)|this.b[c&this.L].hb(0,a+1)<<8};h.Fc=function(a,b){this.b[(a&this.i)>>>this.h].kb(a&this.f,b,a)};h.yb=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;eb||c!=this.f?this.b[d].nb(c,b,a):(this.b[d++].kb(c,b&255,a),this.b[d&this.L].kb(0,b>>8&255,a+1))};function ac(a,b){return a.a[(b&a.v)>>>a.h]} +function Tb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Sa)return l.vb+=l.Sa-f,l.Sa=f,!0;if(f>=l.Sa+l.vb){p=l.size-(f-m);p>g&&(p=g);l.vb=f-l.Sa+p;f=m+a.g;g-=p;k++;continue}}return Xb(Yb,f,g)}f=new I(a,f,p,a.g,d,e);Sb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Zb[d]+" at "+za(b)),!0):Xb($b,b,c)}h.Ec=function(a){return this.b[(a&this.i)>>>this.h].hb(a&this.f,a)}; +h.xb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return eb||b!=this.f?this.b[c].V(b,a):this.b[c++].hb(b,a)|this.b[c&this.L].hb(0,a+1)<<8};h.Fc=function(a,b){this.b[(a&this.i)>>>this.h].kb(a&this.f,b,a)};h.yb=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;eb||c!=this.f?this.b[d].nb(c,b,a):(this.b[d++].kb(c,b&255,a),this.b[d&this.L].kb(0,b>>8&255,a+1))};function ac(a,b){return a.a[(b&a.v)>>>a.h]} function Hb(a,b){var c;a.o=!1;a.m++;var d=b&a.f,e=ac(a,b);eb||d!=a.f?c=e.D(d,b):c=e.i(d,b)|ac(a,b+1).i(0,b+1)<<8;a.m--;return c}function bc(a,b,c){a.o=!1;a.m++;ac(a,b).j(b&a.f,c&255,b);a.m--}function Fb(a,b,c){a.o=!1;a.m++;var d=b&a.f,e=ac(a,b);eb||d!=a.f?e.m(d,c&65535,b):(e.j(d,c&255,b),ac(a,b+1).j(0,c>>8&255,b+1));a.m--} function Wb(a){for(var b=0,c=[],d=0;db.pa&&(a&=-49);b.la!=a&&(b.la=a,b.Ba=a&16?4194303:262143,oc(b))};h.me=function(a){a=a>>1&63;var b=this.c.Ga[a>>1];return a&1?b>>16:b&65535};h.yf=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ga[c]=b&1?this.c.Ga[c]&65535|(a&63)<<16:this.c.Ga[c]&-65536|a&65534};h.fe=function(a){return this.c.s[1][a>>1&7]};h.rf=function(a,b){this.c.s[1][b>>1&7]=a&65295};h.de=function(a){return this.c.s[1][(a>>1&7)+8]};h.pf=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295}; h.ee=function(a){return this.c.I[1][a>>1&7]};h.qf=function(a,b){b=b>>1&7;this.c.I[1][b]=a;this.c.s[1][b]&=65295};h.ce=function(a){return this.c.I[1][(a>>1&7)+8]};h.nf=function(a,b){b=(b>>1&7)+8;this.c.I[1][b]=a;this.c.s[1][b]&=65295};h.zd=function(a){return this.c.s[0][a>>1&7]};h.Le=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.xd=function(a){return this.c.s[0][(a>>1&7)+8]};h.Je=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.yd=function(a){return this.c.I[0][a>>1&7]}; h.Ke=function(a,b){b=b>>1&7;this.c.I[0][b]=a;this.c.s[0][b]&=65295};h.wd=function(a){return this.c.I[0][(a>>1&7)+8]};h.Ie=function(a,b){b=(b>>1&7)+8;this.c.I[0][b]=a;this.c.s[0][b]&=65295};h.le=function(a){return this.c.s[3][a>>1&7]};h.xf=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.je=function(a){return this.c.s[3][(a>>1&7)+8]};h.vf=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295};h.ke=function(a){return this.c.I[3][a>>1&7]};h.wf=function(a,b){b=b>>1&7;this.c.I[3][b]=a;this.c.s[3][b]&=65295}; -h.ie=function(a){return this.c.I[3][(a>>1&7)+8]};h.uf=function(a,b){b=(b>>1&7)+8;this.c.I[3][b]=a;this.c.s[3][b]&=65295};h.ib=function(a){a&=7;return this.c.i&2048?this.c.qa[a]:this.c.b[a]};h.lb=function(a,b){b&=7;this.c.i&2048?this.c.qa[b]=a:this.c.b[b]=a};h.Kd=function(){return this.c.i&49152?this.c.X[0]:this.c.b[6]};h.Ue=function(a){this.c.i&49152?this.c.X[0]=a:this.c.b[6]=a};h.Nd=function(){return this.c.b[7]};h.Xe=function(a){this.c.b[7]=a}; -h.jb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.qa[a]};h.mb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.qa[b]=a};h.Ld=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.X[1]};h.Ve=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.X[1]=a};h.Md=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.X[3]};h.We=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.X[3]=a};h.vd=function(a){return this.c.tb[a-65504>>1]}; +h.ie=function(a){return this.c.I[3][(a>>1&7)+8]};h.uf=function(a,b){b=(b>>1&7)+8;this.c.I[3][b]=a;this.c.s[3][b]&=65295};h.ib=function(a){a&=7;return this.c.i&2048?this.c.qa[a]:this.c.b[a]};h.lb=function(a,b){b&=7;this.c.i&2048?this.c.qa[b]=a:this.c.b[b]=a};h.Kd=function(){return this.c.i&49152?this.c.W[0]:this.c.b[6]};h.Ue=function(a){this.c.i&49152?this.c.W[0]=a:this.c.b[6]=a};h.Nd=function(){return this.c.b[7]};h.Xe=function(a){this.c.b[7]=a}; +h.jb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.qa[a]};h.mb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.qa[b]=a};h.Ld=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.W[1]};h.Ve=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.W[1]=a};h.Md=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.W[3]};h.We=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.W[3]=a};h.vd=function(a){return this.c.tb[a-65504>>1]}; h.He=function(a,b){this.c.tb[b-65504>>1]=a};h.zc=function(a){return 65520==a?(cc(this.u)>>6)-1:0};h.Cc=function(){};h.he=function(){return 1};h.tf=function(){};h.ud=function(){return this.c.G};h.Ge=function(){this.c.G=0};h.Bd=function(){return this.c.sb};h.Ne=function(a,b){b&1||(a&=255);this.c.sb=a};h.Gd=function(a,b){return b?0:this.c.Ra};h.Qe=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Ra=a};h.ge=function(a,b){return b?0:this.c.Fa&65280}; h.sf=function(a){this.c.Fa=a|255};h.Jd=function(){return pc(this.c)};h.Te=function(a){qc(this.c,a)};h.Bc=function(){}; var O={},lc=(O[61568]=[null,null,M.prototype.me,M.prototype.yf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.fe,M.prototype.rf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.de,M.prototype.pf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.ee,M.prototype.qf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.ce,M.prototype.nf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.zd,M.prototype.Le,"KIPDR",8,1140,64],O[62672]=[null,null,M.prototype.xd,M.prototype.Je,"KDPDR",8,1145,64],O[62688]= @@ -97,48 +97,48 @@ M.prototype.lb,"R4SET0"],O[65477]=[null,null,M.prototype.ib,M.prototype.lb,"R5SE M.prototype.mb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.jb,M.prototype.mb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Ld,M.prototype.Ve,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.Md,M.prototype.We,"R6USER",1,1145],O[65504]=[null,null,M.prototype.vd,M.prototype.He,"CTRL",8,1170],O[65520]=[null,null,M.prototype.zc,M.prototype.Cc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.zc,M.prototype.Cc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.he,M.prototype.tf,"SYSID",1,1170],O[65526]= [null,null,M.prototype.ud,M.prototype.Ge,"ERR",1,1170],O[65528]=[null,null,M.prototype.Bd,M.prototype.Ne,"MBR",1,1170],O[65530]=[null,null,M.prototype.Gd,M.prototype.Qe,"PIR"],O[65532]=[null,null,M.prototype.ge,M.prototype.sf,"SLR"],O[65534]=[null,null,M.prototype.Jd,M.prototype.Te,"PSW"],O); Ua(function(){for(var a=C(document,B,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),vc(this,wc?xc:yc);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.sd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.re=function(a,b){db&&a&1&&K(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; h.Ee=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.xa=!0};h.qd=function(a,b){return this.i(a,b)};h.oe=function(a,b){return this.D(a,b)};h.Ce=function(a,b,c){this.A?this.wb(0,0,c):this.j(a,b,c)};h.Af=function(a,b,c){this.A?this.wb(0,0,c):this.m(a,b,c)};h.pd=function(a){return this.a[a]}; h.rd=function(a){return this.a[a]};h.ne=function(a,b){db&&a&1&&K(this.b,b,64);return this.u.getUint16(a,!0)};h.qe=function(a,b){db&&a&1&&K(this.b,b,64);return!eb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Be=function(a,b){this.a[a]=b;this.xa=!0};h.De=function(a,b){this.a[a]=b;this.xa=!0};h.zf=function(a,b,c){db&&a&1&&K(this.b,c,64);this.u.setUint16(a,b,!0);this.xa=!0};h.Bf=function(a,b,c){db&&a&1&&K(this.b,c,64);!eb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.xa=!0}; var tc=0,dc=1,uc=2,Ub=4,Zb=["NONE","RAM","ROM","VID","H/W"],sc=0,Bc=[],Ac=[I.prototype.sd,I.prototype.Ee,I.prototype.re,I.prototype.Cf],Ec=[I.prototype.qd,I.prototype.Ce,I.prototype.oe,I.prototype.Af];if(bb)var yc=[I.prototype.pd,I.prototype.Be,I.prototype.ne,I.prototype.zf],xc=[I.prototype.rd,I.prototype.De,I.prototype.qe,I.prototype.Bf];var Fc;if(bb){var Gc=new ArrayBuffer(2);(new DataView(Gc)).setUint16(0,256,!0);Fc=256===(new Uint16Array(Gc))[0]}else Fc=!1;var wc=Fc; function Hc(a,b){r.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.ec=0;this.Lb=b;this.Qa=c;this.Tb=Math.round(this.Lb/1E4)/100;this.Wa=this.Tb*this.Qa;this.Ub=this.rb=this.Za=this.Mb=0;this.l.P=!1;this.l.ac=!1;this.l.ma=a.autoStart;"string"==typeof this.l.ma&&(this.l.ma="true"==this.l.ma);this.l.zb=!1;this.Jb=this.Ya=0;this.Kb=+a.csStart;this.pb=+a.csInterval;this.qb=+a.csStop;this.sa=[];this.pc=this.ve.bind(this);this.Ea=this.va=this.Da=this.a=this.S=this.ua=this.ob=this.Ca=this.$a= this.Vb=this.Na=0;this.ka=null;D(this)}n(Hc,r);h=Hc.prototype;h.aa=function(a,b,c,d){this.A=a;this.u=b;this.D=d;this.ka=a.f;for(a=0;a=a.Ya&&(a.Ya+=a.pb,c=!0);0<=a.qb&&a.qb<=Mc(a)&&(a.pb=a.qb=-1,Lc(a),H(a),c=!0);c&&a.V(Mc(a)+" cycles: checksum="+Aa(a.Jb))}} +h.ha=function(a,b){var c=Jc(this.A,"autoStart");null!=c?this.l.ma="true"==c?!0:"false"==c?!1:!!c:null==this.l.ma&&(this.l.ma=void 0===this.j.run);if(!b){if(a){Kc(this);if(!this.restore(a))return!1;Lc(this)}else this.reset();this.status("No debugger detected");this.l.ma||this.X("CPU will not be auto-started "+(this.ka?"(click Run to start)":"(type 'go' to start)"))}return!0};h.ga=function(a){return a?this.save():!0};h.ma=function(){return this.l.P?!0:this.l.ma?(yb(this),!0):!1};h.wc=function(){return 0}; +function Lc(a){void 0===a.Kb&&(a.Kb=0);void 0===a.pb&&(a.pb=-1);void 0===a.qb&&(a.qb=-1);a.l.zb=0<=a.Kb&&0=a.Ya&&(a.Ya+=a.pb,c=!0);0<=a.qb&&a.qb<=Mc(a)&&(a.pb=a.qb=-1,Lc(a),H(a),c=!0);c&&a.X(Mc(a)+" cycles: checksum="+Aa(a.Jb))}} h.ca=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.l.R)a=!0;else{var b=null,c,k=y(a.id);for(c=0;ca.Na/a.Wa&&(b=1);a.Qa=b;b=a.Tb*a.Qa;if(a.Wa!=b){a.Wa=b;b=a.Wa.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.V("target speed: "+b)}c&&a.A&&Qc(a.A)}Ab(a,a.va);a.va=0;a.ua=sa();a.Ca=0;Oc(a)}function ic(a,b){var c=a.sa.length;a.sa.push([-1,b]);return c}function jc(a,b,c,d){0<=b&&ba.sa[b][0])&&(c=a.Lb*a.Qa/1E3*c|0,a.l.P&&(c+=Rc(a)),a.sa[b][0]=c)} +function Nc(a,b,c){if(void 0!==b){.8>a.Na/a.Wa&&(b=1);a.Qa=b;b=a.Tb*a.Qa;if(a.Wa!=b){a.Wa=b;b=a.Wa.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.X("target speed: "+b)}c&&a.A&&Qc(a.A)}Ab(a,a.va);a.va=0;a.ua=sa();a.Ca=0;Oc(a)}function ic(a,b){var c=a.sa.length;a.sa.push([-1,b]);return c}function jc(a,b,c,d){0<=b&&ba.sa[b][0])&&(c=a.Lb*a.Qa/1E3*c|0,a.l.P&&(c+=Rc(a)),a.sa[b][0]=c)} function zb(a,b){for(var c=a.sa.length-1;0<=c;c--){var d=a.sa[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Rc(a,b){var c=a.Da-=a.a;a.a=a.S=0;b&&(a.Da=0);return c} h.ve=function(){if(this.l.P){this.Mb>=this.Lb&&Oc(this,!0);this.$a=0;this.ob=sa();if(this.Ca){var a=this.ob-this.Ca;a>this.Ub&&(this.ua+=a,this.ua>this.ob&&(this.ua=this.ob))}try{do{for(var b,c=this.l.zb?1:this.rb,d=this.sa.length-1;0<=d;d--){var e=this.sa[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Qb(b)}catch(f){if("number"!=typeof f)throw f;}b=Rc(this,!0);this.$a+=b;this.va+=b;Bb(this,b);zb(this,b);this.Za-=b;if(0>=this.Za){this.Za+=this.rb;++this.Vb>=Sc&&(this.A&&Cb(this.A,void 0),this.Vb=0);break}}while(this.l.P)}catch(f){H(this); this.A&&this.A.stop(sa(),Mc(this));wa(this,f.stack||f.message);return}if(this.l.P){a=setTimeout;b=this.pc;this.Ca=sa();c=this.Ub;this.$a&&(c=Math.round(c*this.$a/this.rb));c-=this.Ca-this.ob;if(d=this.Ca-this.ua)this.Na=Math.round(this.va/(10*d))/100,864E5<=d&&(this.Ea=0,Nc(this));if(0>c||this.Nac&&(this.ua-=c),c=0;this.Mb+=this.$a;this.Ca+=c;a(b,c)}}}; -function yb(a){var b;a.l.error?(a.V(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.P)a.V(a.toString()+" busy");else{Nc(a);a.l.P=!0;a.l.ac=!0;if(b=a.j.run)b.textContent="Halt";a.A&&a.A.start(a.ua,Mc(a));a.D||a.status("Started");setTimeout(a.pc,0)}}h.Qb=function(){return 0};function H(a){var b=!1;if(a.l.P){Rc(a);Ab(a,a.va);a.va=0;a.l.P=!1;if(b=a.j.run)b.textContent="Run";a.A&&a.A.stop(sa(),Mc(a));b=!0;a.D||a.status("Stopped")}a.l.complete=void 0;return b}var Pc=30,Sc=15,Ic=["power","reset"]; -function Tc(a){var b=+a.model||1170;Hc.call(this,a,6666667);this.pa=b;this.lc=+a.addrReset||0;this.i=this.v=this.m=this.o=this.w=0;this.b=this.qa=this.X=[];this.C=0;this.nc=[];this.s=this.I=this.Ga=this.tb=[];this.Nb=this.za=this.F=this.kc=this.Aa=this.Oa=this.Pa=this.Ba=this.G=this.Ra=this.Fa=this.H=this.cb=this.eb=this.la=this.wa=this.h=this.f=this.Gb=this.K=this.L=this.g=this.sb=0;this.oc=255;1120>=this.pa?(this.jc=Uc.bind(this),this.Xa=this.Zc,this.Nb=8,this.oc=-1,this.rc=255,this.qc=0):(this.jc= -Vc.bind(this),this.Xa=this.$c,this.rc=~(1792|(1140>=this.pa?2048:0))&65535,this.qc=1140=this.pa?(this.jc=Uc.bind(this),this.Xa=this.Zc,this.Nb=8,this.oc=-1,this.rc=255,this.qc=0):(this.jc= +Vc.bind(this),this.Xa=this.$c,this.rc=~(1792|(1140>=this.pa?2048:0))&65535,this.qc=1140e.cc&&(e.cc=c,c+=4)}return Hc.prototype.ha.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.pa);this.l.P&&H(this);this.v=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.lc,-1,-2,-3,-4,-5,-6,-7,-8];this.qa=[0,0,0,0,0,0];this.X=[0,0,0,0];this.C=0;this.nc=[4,2,0,1];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], +h.reset=function(){this.status("Model "+this.pa);this.l.P&&H(this);this.v=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.lc,-1,-2,-3,-4,-5,-6,-7,-8];this.qa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.C=0;this.nc=[4,2,0,1];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ga=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.tb=[0,0,0,0,0,0,0,0];this.h=this.f=this.Gb=this.K=this.L=this.g=this.sb=0;this.wa=-1;wb(this);Kc(this);this.l.error=!1;Hc.prototype.reset.call(this)};function wb(a){a.H=0;a.cb=0;a.eb=0;a.la=0;a.G=0;a.Ra=0;a.Fa=255;a.Aa=0;a.Oa=0;a.Pa=0;a.Ba=262143;a.za=a.b[7];a.F=0;a.ea=null;a.u&&(oc(a),a.kc=cc(a.u))} -function oc(a){a.Db=a.fc;a.Eb=a.gc;a.Ob=a.Pb;a.Fb=a.Rb;a.Aa?(a.ta=65536,a.Cb=a.la&16?4186112:253952,a.oa=a.xc,a.W=a.Ac,a.nb=a.Dc,Vb(a.u,a.la&16?22:18)):(a.ta=0,a.Cb=57344,a.oa=a.cd,a.W=a.pe,a.nb=a.Df,Vb(a.u,16))}function nc(a,b){b&=-3073;if(a.H!=b){b&57344&&!(a.H&57344)&&(a.cb=a.F>>16&65535,a.eb=a.F&65535);a.H=b;a.Oa=(b&96)>>5;a.Pa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Aa!=c&&(a.Aa=c,oc(a))}} -function Wc(a,b,c){a.lc=b;a.u.reset();wb(a);R(a,b);qc(a,0);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.l.P||yb(a)}else a.D?H(a)||a.D.g():!1===c&&H(a);!a.l.P&&a.ka&&a.ka.stop()}h.wc=function(){return 0};h.save=function(){var a=new J(this);a.set(0,[this.b,this.qa,this.X,this.Ga,this.tb,this.G,this.sb,this.Ra,this.Fa,this.wa,this.C,this.g,this.H,this.cb,this.eb,this.la,this.Oa,this.Pa,this.s,this.I,this.Aa,this.Ba,this.za,this.F]);a.set(1,[pc(this)]);a.set(2,[this.Ea,this.Qa]);return a.data()}; -h.restore=function(a){var b;b=a[0];fa();ca();fa();var c=b[Symbol.iterator];b=c?c.call(b):ga(b);this.b=b.next().value;this.qa=b.next().value;this.X=b.next().value;this.Ga=b.next().value;this.tb=b.next().value;this.G=b.next().value;this.sb=b.next().value;this.Ra=b.next().value;this.Fa=b.next().value;this.wa=b.next().value;this.C=b.next().value;this.g=b.next().value;this.H=b.next().value;this.cb=b.next().value;this.eb=b.next().value;this.la=b.next().value;this.Oa=b.next().value;this.Pa=b.next().value; +function oc(a){a.Db=a.fc;a.Eb=a.gc;a.Ob=a.Pb;a.Fb=a.Rb;a.Aa?(a.ta=65536,a.Cb=a.la&16?4186112:253952,a.oa=a.xc,a.V=a.Ac,a.nb=a.Dc,Vb(a.u,a.la&16?22:18)):(a.ta=0,a.Cb=57344,a.oa=a.cd,a.V=a.pe,a.nb=a.Df,Vb(a.u,16))}function nc(a,b){b&=-3073;if(a.H!=b){b&57344&&!(a.H&57344)&&(a.cb=a.F>>16&65535,a.eb=a.F&65535);a.H=b;a.Oa=(b&96)>>5;a.Pa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Aa!=c&&(a.Aa=c,oc(a))}} +function Wc(a,b,c){a.lc=b;a.u.reset();wb(a);R(a,b);qc(a,0);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.l.P||yb(a)}else a.D?H(a)||a.D.g():!1===c&&H(a);!a.l.P&&a.ka&&a.ka.stop()}h.wc=function(){return 0};h.save=function(){var a=new J(this);a.set(0,[this.b,this.qa,this.W,this.Ga,this.tb,this.G,this.sb,this.Ra,this.Fa,this.wa,this.C,this.g,this.H,this.cb,this.eb,this.la,this.Oa,this.Pa,this.s,this.I,this.Aa,this.Ba,this.za,this.F]);a.set(1,[pc(this)]);a.set(2,[this.Ea,this.Qa]);return a.data()}; +h.restore=function(a){var b;b=a[0];fa();ca();fa();var c=b[Symbol.iterator];b=c?c.call(b):ga(b);this.b=b.next().value;this.qa=b.next().value;this.W=b.next().value;this.Ga=b.next().value;this.tb=b.next().value;this.G=b.next().value;this.sb=b.next().value;this.Ra=b.next().value;this.Fa=b.next().value;this.wa=b.next().value;this.C=b.next().value;this.g=b.next().value;this.H=b.next().value;this.cb=b.next().value;this.eb=b.next().value;this.la=b.next().value;this.Oa=b.next().value;this.Pa=b.next().value; this.s=b.next().value;this.I=b.next().value;this.Aa=b.next().value;this.Ba=b.next().value;this.za=b.next().value;this.F=b.next().value;b=a[1];qc(this,b[0]);b=a[2];this.Ea=b[0];Nc(this,b[1]);return!0};function Xc(a){return a.v&65536?1:0}function Yc(a){return a.w&32768?8:0}function Zc(a,b){var c=a.b[7];a.b[7]=c+b&65535;return c}function S(a,b,c){c&&(R(a,a.b[7]+(b<<24>>23)),a.a-=2);a.a-=3}function R(a,b){a.b[7]=b&65535} function kc(a,b,c,d){c={cc:b,gb:c,message:d||0,next:null};c.name=fb[b];a.Sb.push(c);return c}function mc(a,b){var c=a.ea;if(c==b)a.ea=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.ea&&(a.g|=1)}function N(a,b){if(b){if(b!=a.ea){var c=a.ea;if(!c||c.gb<=b.gb)b.next=c,a.ea=b;else{do{var d=c.next;if(!d||d.gb<=b.gb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}function $c(a){return a.g&64?(L(a,168,64,-6),!0):a.g&32?(L(a,4,32,-5),!0):a.g&16?(L(a,12,16,-7),!0):!1} -function pc(a){return a.i=a.i&63728|Yc(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|Xc(a)}function qc(a,b){b&=a.rc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.v=b<<16;if((b^a.i)&a.qc)for(var c=a.qa.length;0<=--c;){var d=a.b[c];a.b[c]=a.qa[c];a.qa[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.X[c]=a.b[6],a.b[6]=a.X[a.C]);a.i=b;a.g&=-3;a.g|=a.ea?2:1}h.da=function(a){this.w=this.o=a;this.m=0};h.Ka=function(a,b){this.w=this.o=this.v=a;this.m=b||0};function ad(a,b){a.w=a.o=a.v=b;a.m=a.w^a.v>>1} -function bd(a,b,c,d){a.w=a.o=a.v=b;a.m=(c^d)&(d^b)}function L(a,b,c,d){if(!a.bb){0>a.wa?a.wa=pc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.C=0;var e=a.W(b|a.ta),f=a.W(b+2&65535|a.ta);qc(a,f&-12289|a.wa>>2&12288);cd(a,a.wa);cd(a,a.b[7]);R(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.Tc=b;a.Sc=d;-1==d&&H(a);if(-4<=d)throw b;}}function dd(a){var b=ed(a),c=ed(a);a.i&49152&&(c=c&-225|a.i&63712);R(a,b);qc(a,c);a.g&=-17} +function pc(a){return a.i=a.i&63728|Yc(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|Xc(a)}function qc(a,b){b&=a.rc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.v=b<<16;if((b^a.i)&a.qc)for(var c=a.qa.length;0<=--c;){var d=a.b[c];a.b[c]=a.qa[c];a.qa[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.W[c]=a.b[6],a.b[6]=a.W[a.C]);a.i=b;a.g&=-3;a.g|=a.ea?2:1}h.da=function(a){this.w=this.o=a;this.m=0};h.Ka=function(a,b){this.w=this.o=this.v=a;this.m=b||0};function ad(a,b){a.w=a.o=a.v=b;a.m=a.w^a.v>>1} +function bd(a,b,c,d){a.w=a.o=a.v=b;a.m=(c^d)&(d^b)}function L(a,b,c,d){if(!a.bb){0>a.wa?a.wa=pc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.C=0;var e=a.V(b|a.ta),f=a.V(b+2&65535|a.ta);qc(a,f&-12289|a.wa>>2&12288);cd(a,a.wa);cd(a,a.b[7]);R(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.Tc=b;a.Sc=d;-1==d&&H(a);if(-4<=d)throw b;}}function dd(a){var b=ed(a),c=ed(a);a.i&49152&&(c=c&-225|a.i&63712);R(a,b);qc(a,c);a.g&=-17} function fd(a,b){var c=b>>13&31;31>c&&(b=a.la&32?a.Ga[c]+(b&8191)&4194303:b&-3932161);return b} function Gb(a,b,c){var d,e,f;if(!(c&a.Aa))return f=b&65535,57344<=f&&(f|=a.Cb),f;d=b>>13;a.la&a.nc[a.C]||(d&=7);e=a.s[a.C][d];f=(a.I[a.C][d]<<6)+(b&8191)&a.Ba;3932160<=f&&(f=fd(a,f));if(a.bb)return f;f>=a.kc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.s[a.C][d]=e;if(f!=(4194170&a.Ba)||a.C)a.Oa=a.C,a.Pa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.H&57344||(g|=a.H&4096|a.Oa<<5|a.Pa<<1,nc(a,a.H&-61695|g&61694)),L(a,168,64,-2)),a.H&61440||!(f<(4191360&a.Ba)||f>(4194239&a.Ba))||(a.H|=4096,a.H&512&&(a.g|=64)));return f}function ed(a){var b=a.W(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function cd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Xa(4,-2,c);a.nb(c,b)} -function gd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return L(a,4,0,-3),0;case 1:return 6==c&&a.Xa(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Xa(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Xa(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.W(e)|g;a.a-=8;break;case 6:return e=a.W(Zc(a,2)),e=e+a.b[c]&65535,6==c&&a.Xa(d,0, -e),a.a-=6,e|g;case 7:return e=a.W(Zc(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.ta),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.Zc=function(a,b,c){!this.C&&0>=b&&c<=this.Fa&&(this.g|=32)};h.$c=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Fa&&(c<=this.Fa-32?L(this,4,0,-4):(this.G|=8,this.g|=32)))};h.bd=function(a){return this.fc(a)};h.dd=function(a){return this.gc(a)};h.ye=function(a,b){this.Pb(a,b)};h.Ae=function(a,b){this.Rb(a,b)}; +(g|=16384));a.s[a.C][d]=e;if(f!=(4194170&a.Ba)||a.C)a.Oa=a.C,a.Pa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.H&57344||(g|=a.H&4096|a.Oa<<5|a.Pa<<1,nc(a,a.H&-61695|g&61694)),L(a,168,64,-2)),a.H&61440||!(f<(4191360&a.Ba)||f>(4194239&a.Ba))||(a.H|=4096,a.H&512&&(a.g|=64)));return f}function ed(a){var b=a.V(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function cd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Xa(4,-2,c);a.nb(c,b)} +function gd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return L(a,4,0,-3),0;case 1:return 6==c&&a.Xa(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Xa(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Xa(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Zc(a,2)),e=e+a.b[c]&65535,6==c&&a.Xa(d,0, +e),a.a-=6,e|g;case 7:return e=a.V(Zc(a,2)),e=e+a.b[c]&65535,e=a.V(e|a.ta),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.Zc=function(a,b,c){!this.C&&0>=b&&c<=this.Fa&&(this.g|=32)};h.$c=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Fa&&(c<=this.Fa-32?L(this,4,0,-4):(this.G|=8,this.g|=32)))};h.bd=function(a){return this.fc(a)};h.dd=function(a){return this.gc(a)};h.ye=function(a,b){this.Pb(a,b)};h.Ae=function(a,b){this.Rb(a,b)}; h.cd=function(a,b,c){return gd(this,a,b,c)};h.xc=function(a,b,c){return Gb(this,gd(this,a,b,c),c)};h.pe=function(a){return this.u.xb(this.za=a)};h.Ac=function(a){return this.u.xb(this.za=Gb(this,a,2))};h.Df=function(a,b){this.u.yb(this.za=a,b)};h.Dc=function(a,b){this.u.yb(this.za=Gb(this,a,4),b)}; -function hd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=gd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.W(d|c&a.ta),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.X[a.i>>12&3];return c}function id(a,b,c,d){a.F=a.F&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=gd(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=Gb(a,e|c&65536,4),a.C=a.i>>14&3,a.Fb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.X[a.i>>12&3]=d} +function hd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=gd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.V(d|c&a.ta),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.W[a.i>>12&3];return c}function id(a,b,c,d){a.F=a.F&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=gd(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=Gb(a,e|c&65536,4),a.C=a.i>>14&3,a.Fb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.W[a.i>>12&3]=d} function jd(a,b){b>>=6;var c=a.L=b&7;return(b=a.K=(b&56)>>3)?a.Db(a.oa(b,c,3)):a.b[c+a.Nb]&a.oc}function kd(a,b){var c;b>>=6;var d=a.L=b&7;(b=a.K=(b&56)>>3)?c=a.Eb(a.oa(b,d,2)):c=a.b[d+a.Nb];return c}function ld(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return gd(a,b,c,8)}function md(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Db(a.oa(b,c,3)):a.b[c]&255}function nd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Eb(a.oa(b,d,2)):c=a.b[d];return c} function T(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Gb=a.oa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.Ob(e,d.call(a,c,a.Db(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function U(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,6),a.Fb(e,d.call(a,0>c?a.b[-c-1]:c,a.Eb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} function od(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.oa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.Ob(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function pd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Fb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} h.Qb=function(a){this.l.complete=!0;var b=a?this.l.ac?0:1:-1;this.l.ac=!1;this.Da=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Ra&224)>>5,e=this.ea&&this.ea.gb>d?this.ea:null;e&&(c=e.cc,d=e.gb);d>(this.i&224)>>5?(this.g&8&&(Zc(this,2),this.g&=-9),L(this,c,0,-10),d=!0):d=!1;d&&(e&&mc(this,e),a=!0);this.ea||this.Ra||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){H(this);break}if(0>b)break}if(this.g&112&&$c(this)){if(this.g& -4&&this.D.b(this.b[7],b)){H(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.jc(e)}while(0b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.V(a);this.b[7]=a+2&65535;this.jc(e)}while(0>1|b<<16;ad(this,a);return a&65535}function vd(a,b){a=b&128|b>>1|b<<8;ad(this,a<<8);return a&255}function wd(a,b){a=b&~a;this.da(a);return a}function xd(a,b){a=b&~a;this.da(a<<8);return a}function yd(a,b){a|=b;this.da(a);return a}function zd(a,b){a|=b;this.da(a<<8);return a} function Ad(a,b){a=~b|65536;this.Ka(a);return a&65535}function Bd(a,b){a=~b|256;this.Ka(a<<8);return a&255}function Cd(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function Dd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function Ed(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function Fd(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function Gd(a,b){a=-b;this.Ka(a,a&b&32768);return a&65535} function Hd(a,b){a=-b;this.Ka(a<<8,(a&b&128)<<8);return a&255}function Id(a,b){a=b<<1|this.v>>16&1;ad(this,a);return a&65535}function Jd(a,b){a=b<<1|this.v>>16&1;ad(this,a<<8);return a&255}function Kd(a,b){a=(this.v&65536|b)>>1|b<<16;ad(this,a);return a&65535}function Ld(a,b){a=((this.v&65536)>>8|b)>>1|b<<8;ad(this,a<<8);return a&255}function Md(a,b){var c=b-a;bd(this,c,a,b);return c&65535}function Nd(a,b){var c=b-a;bd(this,c<<8,a<<8,b<<8);return c&255} @@ -160,30 +160,30 @@ this.a-=this.h?11:6},function(a){U(this,a,Xc(this)?1:0,qd);this.a-=this.h?9:3+(7 [function(a){gf[a&15].call(this,a)},X,X,X,ve,ve,ve,ve,Fe,X,Ue,We,Je,Je,Je,Je],gf=[se,Le,Ge,ke,te,Ee,X,X,X,X,X,X,X,X,X,X],Ve=[De,function(){this.v=0;this.a-=5},function(){this.m=0;this.a-=5},V,function(){this.o=1;this.a-=5},V,V,V,function(){this.w=0;this.a-=5},V,V,V,V,V,V,V],Xe=[De,function(){this.v=65536;this.a-=5},function(){this.m=32768;this.a-=5},W,function(){this.o=0;this.a-=5},W,W,W,function(){this.w=32768;this.a-=5},W,W,W,W,W,W,W],ef=[je,he,de,fe,me,ne,Td,Ud,re,Ke,Ye,$e,bf,X,X,X],Ze=[function(a){od(this, a,0,255,this.Ka);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Bd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Fd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Dd);this.a-=this.h?9:3+(7==this.f?2:0)}],af=[function(a){T(this,a,0,Hd);this.a-=this.h?11:6},function(a){T(this,a,Xc(this)?1:0,rd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,Xc(this)?1:0,Nd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=md(this,a);this.Ka(a<<8);this.a-=this.h?4:3+ (7==this.f?2:0)}],cf=[function(a){T(this,a,0,Ld);this.a-=this.h?9+(this.Gb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Jd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,vd);this.a-=this.h?9+(this.Gb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,td);this.a-=this.h?9:3+(7==this.f?2:0)}];function Vc(a){hf[a>>12].call(this,a)} -var hf=[function(a){jf[a>>8&15].call(this,a)},ze,oe,Zd,Vd,Xd,Qd,function(a){kf[a>>8&15].call(this,a)},function(a){lf[a>>8&15].call(this,a)},Ae,pe,$d,Wd,Yd,Ie,X],jf=[function(a){mf[a>>4&15].call(this,a)},le,ie,ae,be,ge,ce,ee,xe,xe,Oe,Qe,Se,function(a){nf[a>>6&3].call(this,a)},X,X],nf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.ta);R(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=hd(this,a,0);this.da(a);cd(this,a);this.a-=11},function(a){var b=ed(this);this.S= +var hf=[function(a){jf[a>>8&15].call(this,a)},ze,oe,Zd,Vd,Xd,Qd,function(a){kf[a>>8&15].call(this,a)},function(a){lf[a>>8&15].call(this,a)},Ae,pe,$d,Wd,Yd,Ie,X],jf=[function(a){mf[a>>4&15].call(this,a)},le,ie,ae,be,ge,ce,ee,xe,xe,Oe,Qe,Se,function(a){nf[a>>6&3].call(this,a)},X,X],nf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.V(a|this.ta);R(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=hd(this,a,0);this.da(a);cd(this,a);this.a-=11},function(a){var b=ed(this);this.S= this.a;this.da(b);id(this,a,0,b);this.a=this.S-Be[this.h]},function(a){pd(this,a,Yc(this)?65535:0,this.da);this.a-=this.h?9:3+(7==this.f?2:0)}],mf=[function(a){of[a&15].call(this,a)},X,X,X,ve,ve,ve,ve,Fe,function(a){!(a&8)||1145>this.pa?L(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},Ue,We,Je,Je,Je,Je],of=[se,Le,function(){dd(this);this.g|=this.i&16;this.a-=13},ke,te,Ee,Ge,function(){L(this,8,0,-9)},X,X,X,X,X,X,X,X],kf=[Ce,Ce,qe,qe,Rd,Rd,Sd,Sd,Me,Me,X, X,X,X,He,He],lf=[je,he,de,fe,me,ne,Td,Ud,re,Ke,Ye,$e,bf,function(a){1145>this.pa?L(this,8,0,-9):pf[a>>6&3].call(this,a)},X,X],pf=[function(){L(this,8,0,-9)},function(a){a=hd(this,a,65536);this.da(a);cd(this,a);this.a-=11},function(a){var b=ed(this);this.S=this.a;this.da(b);id(this,a,65536,b);this.a=this.S-Be[this.h]},function(){L(this,8,0,-9)}]; function qf(a){r.call(this,"ROM",a,0,128);this.fa=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=F(this.g);if(this.g){a=this.g;var b=Ba(this.m);"json"!=b&&"hex"!=b&&(a=Ka()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;G(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(qa(c.Ma,a,b),(a=Ja(a,b))?(c.b=a.N,c.fa=a.fa):c.g=null);rf(c)})}}n(qf,r); h=qf.prototype;h.aa=function(a,b,c,d){this.u=b;this.c=c;this.D=d;rf(this)};h.ha=function(){this.fa&&(this.D&&this.D.a(this.id,this.h,this.a,this.fa),delete this.fa);return!0};h.ga=function(){return!0}; -function rf(a){if(!xa(a)){if(a.g){if(!a.b||!a.u)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a)wa(a,"ROM size ("+Aa(a.b.length,8,!0)+") does not match specified size ("+Aa(a.a,8,!0)+")");else{var b;a:{b=a.h;a.status(a.a+"-byte ROM at "+za(b));if(57344<=b&&b<57344+Nb){var c={};b=(c[b]=[qf.prototype.be,qf.prototype.mf,null,null,null,a.a>>1],c);if(kb(a.u,a,b)){b=a.i=!0;break a}}else if(Tb(a.u,b,a.a,uc)){for(c=0;c>>f.h;0>>=f.h;0>1],c);if(kb(a.u,a,c)){a.status("Added "+a.a+"-byte ROM at "+za(b));b=a.i=!0;break a}}else if(Tb(a.u,b,a.a,uc)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),x=l,w=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(w)for(;w--;)bc(a.u,t++,b[x++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< b.length;e++)bc(a.u,c+e,b[e]);k=!0}if(k){if(null==d||g)H(a.c),f=!1;null!=d&&Wc(a.c,d,f)}return k}Ua(function(){for(var a=C(document,B,"ram"),b=0;b=q.hc&&c<=q.Uc&&(b=c-(q.hc-q.Gc));b&&(a.preventDefault&&a.preventDefault(),d.Hb(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Ic&&(b=q.Hc);d.Hb(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Hb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.aa=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;var e=this;this.H=kc(this.c,this.C?-1:48,4,262144);this.I=ic(this.c,function(){var a;a=-1;e.h.length&&(a=e.h.shift()&255,e.w&&97<=a&&122>a&&(a-=32),jc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&N(c,e.H))});this.F=kc(this.c,this.C?-1:52,4,262144);this.X=ic(this.c,function(){e.b|=128;e.b&64&&N(c,e.F)});kb(b,this,xf,this.C?64832+8*(this.C-1)-65392:0);mb(b,this.reset.bind(this));D(this)}; -h.yc=function(a){if(!this.f){var b=Jc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ga(c[0]);if(d!=this.La)return;c=Ga(c[1]);if(this.f=ua(c)){var e=this.f.exports;if(e){var f=e.connect;f&&f.call(this.f,this.v);if(this.s=e.receiveData){this.v=a;this.G=e.receiveStatus;this.status(this.Ma+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +h.aa=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;var e=this;this.H=kc(this.c,this.C?-1:48,4,262144);this.I=ic(this.c,function(){var a;a=-1;e.h.length&&(a=e.h.shift()&255,e.w&&97<=a&&122>a&&(a-=32),jc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&N(c,e.H))});this.F=kc(this.c,this.C?-1:52,4,262144);this.W=ic(this.c,function(){e.b|=128;e.b&64&&N(c,e.F)});kb(b,this,xf,this.C?64832+8*(this.C-1)-65392:0);mb(b,this.reset.bind(this));D(this)}; +h.yc=function(a){if(!this.f){var b=Jc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ga(c[0]);if(d!=this.La)return;c=Ga(c[1]);if(this.f=ua(c)){var e=this.f.exports;if(e){var f=e.connect;f&&f.call(this.f,this.v);if(this.s=e.receiveData){this.v=a;this.G=e.receiveStatus;this.status("Connected "+this.Ma+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; h.ha=function(a,b){if(!b)if(this.yc(this.v),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){yf(this)};h.save=function(){var a=new J(this);a.set(0,[]);return a.data()};h.restore=function(){return yf(this)};function yf(a){a.o=0;a.a=8192;a.b=128;a.h=[];return!0} h.Hb=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.m%a,this.S&&(b=" ".slice(0,c)));this.L&&!this.m&&c&&(b=String.fromCharCode(this.L)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.m+=c}}else if(null!= -this.i){if(10==a||1024<=this.i.length)this.V(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}jc(this.c,this.X,1E3/Math.round(this.ea/10));this.b&=-129};var wf="buffer",zf={},xf=(zf[65392]=[null,null,Z.prototype.Pd,Z.prototype.Ze,"RCSR"],zf[65394]=[null,null,Z.prototype.Od,Z.prototype.Ye,"RBUF"],zf[65396]=[null,null,Z.prototype.te,Z.prototype.Ff,"XCSR"],zf[65398]=[null,null,Z.prototype.se,Z.prototype.Ef,"XBUF"],zf); +this.i){if(10==a||1024<=this.i.length)this.X(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}jc(this.c,this.W,1E3/Math.round(this.ea/10));this.b&=-129};var wf="buffer",zf={},xf=(zf[65392]=[null,null,Z.prototype.Pd,Z.prototype.Ze,"RCSR"],zf[65394]=[null,null,Z.prototype.Od,Z.prototype.Ye,"RBUF"],zf[65396]=[null,null,Z.prototype.te,Z.prototype.Ff,"XCSR"],zf[65398]=[null,null,Z.prototype.se,Z.prototype.Ef,"XBUF"],zf); Ua(function(){for(var a=C(document,B,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "readTape":e=Df;case "loadTape":return e||(e=Ef),this.j[b]=c,c.onclick= @@ -250,12 +250,12 @@ h.jf=function(a){this.a=this.a&-1023|a&1022;this.h=this.h&60|(a&48)>>4;if(!(this this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Oc.bind(this)))}a&&(this.a|=129,this.a&64&&N(this.c,this.Ja))}};h.Xd=function(){return this.m};h.gf=function(a){this.m=a&65534};h.$d=function(){return this.f};h.kf=function(a){this.f=a};h.ae=function(){return this.i};h.lf=function(a){this.i=a};h.Yd=function(){return this.h};h.hf=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4}; var zg="",Ag="?",Bg="??",Fg={},xg=(Fg[63744]=[null,null,P.prototype.Zd,P.prototype.jf,"RLCS"],Fg[63746]=[null,null,P.prototype.Xd,P.prototype.gf,"RLBA"],Fg[63748]=[null,null,P.prototype.$d,P.prototype.kf,"RLDA"],Fg[63750]=[null,null,P.prototype.ae,P.prototype.lf,"RLMP"],Fg[63752]=[null,null,P.prototype.Yd,P.prototype.hf,"RLBE"],Fg); function Gg(a,b,c){r.call(this,"Computer",a,0,33554432);this.l.R=!1;this.G=null;Hg(this,b);this.C=Jc(this,"autoPower",a,6);this.g=0;this.K=+a.busWidth||+a.buswidth;this.v=this.s=this.w=null;this.o=this.I=!1;this.i=this.h=null;this.H=this.m=this.F=!1;this.L=Jc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Ig(this);if(this.c=va("CPU",this.id)){this.D=va("Debugger",this.id);this.u=new Mb({id:this.Ma+".bus",busWidth:this.K},this.c,this.D);var d,e=y(this.id);if((this.f=va("Panel",this.id))&&this.f.ab)for(b= -0;b\nLicense: GPL version 3 or later ");this.V("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;b\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bJg){if(Kg(d,this.v)){this.h=new J(this,"1.32.2",Tg);Kg(this.h)&&(Ug(this,d),a=Vg,Yg(this.h));this.h.set(Qg,Ia());Zg(this.h);var e=this.a&&!this.o;if(a==Rg||ta("Click OK to restore the previous "+cb+" machine state, or CANCEL to reset the machine.")){if(c=Pg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Kg(d,g):("error"==f&&"no machine state"!= -g?(this.B("Error: "+g),"unable to verify user"==g&&(Oa($g,""),this.b=null)):this.V(f+": "+g),Yg(d),Kg(d)?(c=Pg(d),e=!0):c=!1))}e&&Ng(this,c?d:null)}else a==Vg&&d.clear()}else Ng(this);delete this.v;delete this.i}e=y(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.l.R=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.c&&(ah(this,this.c,b,c,a),Cb(this),this.c.ma());this.F&&(Ug(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; function Ug(a,b){if(ta("There may be a problem with your "+cb+" machine.\n\nTo help us diagnose it, click OK to send this "+cb+" machine state to http://www.pcjs.org.")){var c=a.L;a=a.b||"";b=b.toString();var d={};d.app=cb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;G("http://www.pcjs.org/api/v1/report",d,!0)}} From fac5c3c57dcf8b226c4444431231eb815ee15659 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Wed, 25 Jan 2017 16:22:07 -0800 Subject: [PATCH 03/15] Added some PDP-11 documentation --- modules/pdp11/lib/cpuops.js | 75 +++++++++++++++++++++++++++++- versions/pcx86/1.32.2/pcx86-dbg.js | 2 +- versions/pcx86/1.32.2/pcx86.js | 2 +- 3 files changed, 75 insertions(+), 4 deletions(-) diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index 9066a4146..18628c21e 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -490,6 +490,33 @@ PDP11.opADCB = function(opCode) /** * opADD(opCode) * + * From the PDP-11/20 Processor HandBook (1971), p. 61: + * + * Add src,dst (06SSDD) + * + * Operation: + * (dst) = (src) + (dst) + * + * Condition Codes: + * N: set if result < 0; cleared otherwise + * Z: set if result = 0; cleared otherwise + * V: set if there was arithmetic overflow as a result of the operation, that is both operands + * were of the same sign and the result was of the opposite sign; cleared otherwise + * C: set if there was a carry from the most significant bit of the result; cleared otherwise + * + * Description: + * Adds the source operand to the destination operand and stores the result at the destination address. + * The original contents of the destination are lost. The contents of the source are not affected. + * Two's complement addition is performed. + * + * Examples: + * Add to register: ADD 20,R0 + * Add to memory: ADD R1,XXX + * Add register to register: ADD R1,R2 + * Add memory to memory: ADD @#17750,XXX + * + * XXX is a programmer-defined mnemonic for a memory location. + * * @this {CPUStatePDP11} * @param {number} opCode */ @@ -1325,6 +1352,7 @@ PDP11.opMFPI = function(opCode) */ PDP11.opMFPS = function(opCode) { + //noinspection JSUnresolvedFunction PDP11.opUndefined.call(this, opCode); }; @@ -1347,6 +1375,7 @@ PDP11.opMFPS = function(opCode) */ PDP11.opMFPT = function(opCode) { + //noinspection JSUnresolvedFunction PDP11.opUndefined.call(this, opCode); }; @@ -1442,6 +1471,7 @@ PDP11.opMTPI = function(opCode) */ PDP11.opMTPS = function(opCode) { + //noinspection JSUnresolvedFunction PDP11.opUndefined.call(this, opCode); }; @@ -1539,8 +1569,20 @@ PDP11.opRESET = function(opCode) * that the last CNSW.writeWord(177570) was for 000101, not 166667. So I'm guessing that the RESET * instruction is supposed to propagate R0 to the console's DISPLAY register. * - * This is similar to what we do for the HALT instruction on the PDP-11/20. None of these Console features - * seem to be very well documented (assuming they exist). + * This is similar to what we do for the HALT instruction (but only if this.model == PDP11.MODEL_1120). + * These Console features do not seem to be very well documented, assuming they exist. + * + * UPDATE: This behavior appears to be confirmed by remarks in the PDP-11/20 Processor Handbook (1971), + * p. 141: + * + * HALT - displays processor register R0 when bus control is transferred to console during a HALT + * instruction. + * + * RESET - displays register R0 for during [duration?] of RESET (70 msec). + * + * I haven't found similar remarks in the PDP-11/70 Processor Handbooks, so I'm not sure if that's an + * oversight or if 11/70 panels are slightly different in this regard. It's also not clear what they meant + * by "for duration of RESET". Is something supposed to happen to the DATA lights after the RESET is done? */ this.panel.setData(this.regsGen[0], true); } @@ -1786,6 +1828,35 @@ PDP11.opSPL = function(opCode) /** * opSUB(opCode) * + * From the PDP-11/20 Processor HandBook (1971), p. 62: + * + * Subtract src,dst (16SSDD) + * + * Operation: + * (dst) = (dst) - (src) [in detail, (dst) + ~(src) + 1 (dst)] + * + * Condition Codes: + * N: set if result < 0; cleared otherwise + * Z: set if result = 0; cleared otherwise + * V: set if there was arithmetic overflow as a result of the operation, that is if operands were of + * opposite signs and the sign of the source was the same as the sign of the result; cleared otherwise + * C: cleared if there was a carry from the most significant bit of the result; set otherwise + * + * Description: + * Subtracts the source operand from the destination operand and leaves the result at the destination address. + * The orignial [sic] contents of the destination are lost. The contents of the source are not affected. + * In double-precision arithmetic the C-bit, when set, indicates a "borrow". + * + * Example: + * SUB R1,R2 + * + * BEFORE AFTER + * (R1) = 011111 (R2) = 012345 + * (R1) = 011111 (R2) = 001234 + * + * NZVC NZVC + * 1111 0001 + * * @this {CPUStatePDP11} * @param {number} opCode */ diff --git a/versions/pcx86/1.32.2/pcx86-dbg.js b/versions/pcx86/1.32.2/pcx86-dbg.js index 53c9b5b90..a8f6930f1 100644 --- a/versions/pcx86/1.32.2/pcx86-dbg.js +++ b/versions/pcx86/1.32.2/pcx86-dbg.js @@ -601,7 +601,7 @@ function uo(a){a.N&&a.C&&(a.Df&16&&!(a.Yb&64)?jg(a.N,a.C):ig(a.N,a.C))}var ro={0 function vo(a){this.Ca=a.adapter;switch(this.Ca){case 1:this.va=1016;this.ia=4;break;case 2:this.va=760;this.ia=3;break;default:w("Unrecognized serial adapter #"+this.Ca);return}this.V=this.W=null;this.Ga=a.tabSize;this.Ea=a.charBOL;this.ea=0;this.Ja=wo|xo;this.pa=!0;db.call(this,"SerialPort",a,vo,8388608);a=a.binding;"console"==a?this.W="":ob(this,a,yo);this.L=this.ua=this.Cc=null;this.exports={connect:this.zj,receiveData:this.hg,receiveStatus:this.ll}}gb(vo);var yo="buffer",wo=16,xo=32;l=vo.prototype; l.bj=function(a,b,c){var d=null;a!=this.xd||this.L||(this.L=b,this.Cc=c,this.pa=!1,d=this);return d};l.Pb=function(a,b,c){var d=this;switch(b){case yo:return this.qa[b]=this.V=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64");if(2==c.length){var d=qa(c[0]);if(d!=this.xd)return;c=qa(c[1]);if(this.L=lb(c)){var e=this.L.exports;if(e){var f=e.connect;f&&f.call(this.L,this.pa);if(this.ua=e.receiveData){this.pa=a;this.Cc=e.receiveStatus;this.status(this.ce+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +l.zj=function(a){if(!this.L){var b=Vc(this.X,"connection");if(b){var c=b.split("->");if(2==c.length){var d=qa(c[0]);if(d!=this.xd)return;c=qa(c[1]);if(this.L=lb(c)){var e=this.L.exports;if(e){var f=e.connect;f&&f.call(this.L,this.pa);if(this.ua=e.receiveData){this.pa=a;this.Cc=e.receiveStatus;this.status("Connected "+this.ce+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; l.hc=function(a,b){if(!b)if(this.zj(this.pa),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.gc=function(a){return a?this.save():!0};l.reset=function(){Bo(this)};l.save=function(){var a=new nf(this),b=0,c=[];c[b++]=this.ya;c[b++]=this.Da;c[b++]=this.fa;c[b++]=this.ka;c[b++]=this.U;c[b++]=this.C;c[b++]=this.ra;c[b++]=this.B;c[b++]=this.A;c[b]=this.aa;a.set(0,c);return a.data()};l.restore=function(a){return Bo(this,a[0])}; function Bo(a,b){var c=0;b||(b=[0,0,384,0,1,0,0,96,a.Ja,[]]);a.ya=b[c++];a.Da=b[c++];a.fa=b[c++];a.ka=b[c++];a.U=b[c++];a.C=b[c++];a.ra=b[c++];a.B=b[c++];a.A=b[c++];a.aa=b[c];return!0}l.hg=function(a){if("number"==typeof a)this.aa.push(a);else if("string"==typeof a)for(var b=0;b>8:this.ka;x(this,a,null,b,this.C&128?"DLM":"IER",c);return c};l.rm=function(a,b){var c=this.U;x(this,a,null,b,"IIR",c);return c};l.sm=function(a,b){var c=this.C;x(this,a,null,b,"LCR",c);return c};l.um=function(a,b){var c=this.ra;x(this,a,null,b,"MCR",c);return c}; diff --git a/versions/pcx86/1.32.2/pcx86.js b/versions/pcx86/1.32.2/pcx86.js index 9bfd2ee60..d10c0ba12 100644 --- a/versions/pcx86/1.32.2/pcx86.js +++ b/versions/pcx86/1.32.2/pcx86.js @@ -562,7 +562,7 @@ l.gm=function(a,b){this.Me=b;Ml(this)};function Ml(a){a.S&&a.D&&(a.Me&16&&!(a.Db function Nl(a){this.oa=a.adapter;switch(this.oa){case 1:this.ka=1016;this.W=4;break;case 2:this.ka=760;this.W=3;break;default:r("Unrecognized serial adapter #"+this.oa);return}this.G=this.I=null;this.ra=a.tabSize;this.qa=a.charBOL;this.R=0;this.sa=Ol|Pl;this.Z=!0;Ma.call(this,"SerialPort",a,Nl);a=a.binding;"console"==a?this.I="":Xa(this,a,Ql);this.D=this.ga=this.Rc=null;this.exports={connect:this.wi,receiveData:this.jf,receiveStatus:this.$j}}Pa(Nl);var Ql="buffer",Ol=16,Pl=32;l=Nl.prototype; l.fi=function(a,b,c){var d=null;a!=this.Td||this.D||(this.D=b,this.Rc=c,this.Z=!1,d=this);return d};l.zb=function(a,b,c){var d=this;switch(b){case Ql:return this.la[b]=this.G=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64");if(2==c.length){var d=la(c[0]);if(d!=this.Td)return;c=la(c[1]);if(this.D=Ua(c)){var e=this.D.exports;if(e){var f=e.connect;f&&f.call(this.D,this.Z);if(this.ga=e.receiveData){this.Z=a;this.Rc=e.receiveStatus;this.status(this.Fe+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +l.wi=function(a){if(!this.D){var b=kc(this.ba,"connection");if(b){var c=b.split("->");if(2==c.length){var d=la(c[0]);if(d!=this.Td)return;c=la(c[1]);if(this.D=Ua(c)){var e=this.D.exports;if(e){var f=e.connect;f&&f.call(this.D,this.Z);if(this.ga=e.receiveData){this.Z=a;this.Rc=e.receiveStatus;this.status("Connected "+this.Fe+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; l.Ub=function(a,b){if(!b)if(this.wi(this.Z),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.Tb=function(a){return a?this.save():!0};l.reset=function(){Tl(this)};l.save=function(){var a=new ae(this),b=0,c=[];c[b++]=this.ma;c[b++]=this.pa;c[b++]=this.P;c[b++]=this.Y;c[b++]=this.H;c[b++]=this.L;c[b++]=this.da;c[b++]=this.C;c[b++]=this.B;c[b]=this.K;a.set(0,c);return a.data()};l.restore=function(a){return Tl(this,a[0])}; function Tl(a,b){var c=0;b||(b=[0,0,384,0,1,0,0,96,a.sa,[]]);a.ma=b[c++];a.pa=b[c++];a.P=b[c++];a.Y=b[c++];a.H=b[c++];a.L=b[c++];a.da=b[c++];a.C=b[c++];a.B=b[c++];a.K=b[c];return!0}l.jf=function(a){if("number"==typeof a)this.K.push(a);else if("string"==typeof a)for(var b=0;b>8:this.Y};l.cl=function(){return this.H};l.dl=function(){return this.L};l.fl=function(){return this.da};l.el=function(){return this.C};l.kl=function(){var a=this.B;this.B&=-4;return a}; From bb24ccaca6085b28617d6ec93088936daf6feb9d Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Wed, 25 Jan 2017 20:31:05 -0800 Subject: [PATCH 04/15] Added resume support for saving/restoring all active timers and IRQs, along with the run/stop state of the CPU --- modules/pdp11/lib/computer.js | 5 +- modules/pdp11/lib/cpu.js | 34 +- modules/pdp11/lib/cpuops.js | 2 +- modules/pdp11/lib/cpustate.js | 164 +++++--- modules/pdp11/lib/debugger.js | 8 +- modules/pdp11/lib/device.js | 159 +++++-- modules/pdp11/lib/pc11.js | 2 +- modules/pdp11/lib/rk11.js | 4 +- modules/pdp11/lib/rl11.js | 4 +- modules/pdp11/lib/serial.js | 4 +- versions/pdpjs/1.32.2/pdp11-dbg.js | 655 +++++++++++++++-------------- versions/pdpjs/1.32.2/pdp11.js | 478 ++++++++++----------- 12 files changed, 846 insertions(+), 673 deletions(-) diff --git a/modules/pdp11/lib/computer.js b/modules/pdp11/lib/computer.js index 5b812aac4..63880cc61 100644 --- a/modules/pdp11/lib/computer.js +++ b/modules/pdp11/lib/computer.js @@ -853,7 +853,10 @@ class ComputerPDP11 extends Component { * after they're no longer ready. */ if (this.cpu && this.cpu.powerDown) { - if (fShutdown) this.cpu.stopCPU(); + if (fShutdown) { + if (fSave) this.cpu.flags.autoStart = this.cpu.flags.running; + this.cpu.stopCPU(); + } data = this.cpu.powerDown(fSave, fShutdown); if (typeof data === "object") stateComputer.set(this.cpu.id, data); if (fShutdown) { diff --git a/modules/pdp11/lib/cpu.js b/modules/pdp11/lib/cpu.js index f130f483e..87e750587 100644 --- a/modules/pdp11/lib/cpu.js +++ b/modules/pdp11/lib/cpu.js @@ -120,8 +120,7 @@ class CPUPDP11 extends Component { /* * We add a number of flags to the set initialized by Component */ - this.flags.running = false; - this.flags.starting = false; + this.flags.running = this.flags.starting = false; this.flags.autoStart = parmsCPU['autoStart']; if (typeof this.flags.autoStart == "string") this.flags.autoStart = (this.flags.autoStart == "true"); @@ -996,6 +995,37 @@ class CPUPDP11 extends Component { return nCycles; } + /** + * saveTimers() + * + * @this {CPUPDP11} + * @return {Array.} + */ + saveTimers() + { + var aTimerCycles = []; + for (var i = 0; i < this.aTimers.length; i++) { + var timer = this.aTimers[i]; + aTimerCycles.push(timer[0]); + } + return aTimerCycles; + } + + /** + * restoreTimers(aTimerCycles) + * + * @this {CPUPDP11} + * @param {Array.} aTimerCycles + */ + restoreTimers(aTimerCycles) + { + this.assert(aTimerCycles.length === this.aTimers.length); + for (var i = 0; i < this.aTimers.length && i < aTimerCycles.length; i++) { + var timer = this.aTimers[i]; + timer[0] = aTimerCycles[i]; + } + } + /** * updateTimers(nCycles) * diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index 18628c21e..e94038843 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -1128,7 +1128,7 @@ PDP11.opDIV = function(opCode) this.regsGen[reg] = this.regsGen[reg | 1] = 1; // etc } } - this.nStepCycles -= (52 + 1); // 52 is the mean of the shortest and longest times + this.nStepCycles -= (52 + 1); // 52 is the average of the shortest and longest times } }; diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 0c9fd85f0..fa1d49eb8 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -117,25 +117,22 @@ class CPUStatePDP11 extends CPUPDP11 { * These properties will be initialized by initCPU() */ this.flagC = this.flagV = this.flagZ = this.flagN = 0; - this.regPSW = 0; - this.regsGen = this.regsAlt = this.regsAltStack = []; - this.pswMode = 0; - this.mapMMR3 = []; - this.mmuPDR = this.mmuPAR = this.regsUniMap = this.regsControl = []; - this.regMBR = 0; - this.opFlags = 0; - this.srcMode = this.srcReg = 0; - this.dstMode = this.dstReg = this.dstAddr = 0; + this.regPSW = this.pswMode = 0; this.pswTrap = 0; + this.regsGen = this.regsAlt = this.regsAltStack = []; + this.regsPAR = this.regsPDR = this.regsUniMap = this.regsControl = []; + this.opFlags = 0; /* * These properties will be initialized by initMMU() */ this.regMMR0 = this.regMMR1 = this.regMMR2 = this.regMMR3 = 0; - this.regErr = this.regPIR = this.regSLR = 0; + this.regErr = this.regMBR = this.regPIR = this.regSLR = 0; this.mmuEnable = this.mmuLastMode = this.mmuLastPage = this.mmuMask = 0; this.addrLast = this.opLast = this.addrInvalid = 0; + this.mapMMR3 = [4,2,0,1]; // map from mode to MMR3 I/D bit + /* * Initialize processor operation to match the requested model. * @@ -167,6 +164,7 @@ class CPUStatePDP11 extends CPUPDP11 { } this.nDisableTraps = 0; + this.trapVector = this.trapReason = 0; /** @type {IRQ|null} */ this.irqNext = null; // the head of the active IRQ list, in priority order @@ -174,8 +172,6 @@ class CPUStatePDP11 extends CPUPDP11 { /** @type {Array.} */ this.aIRQs = []; // list of all IRQs, active or not (to be used for auto-configuration) - this.flags.complete = false; - this.getByte = this.getByteDirect = this.getByteChecked; this.getWord = this.getWordDirect = this.getWordChecked; this.setByte = this.setByteDirect = this.setByteChecked; @@ -187,7 +183,10 @@ class CPUStatePDP11 extends CPUPDP11 { this.readWord = this.readWordFromVirtual; this.writeWord = this.writeWordToVirtual; - this.trapVector = this.trapReason = 0; + this.srcMode = this.srcReg = 0; + this.dstMode = this.dstReg = this.dstAddr = 0; + + this.flags.complete = false; } /** @@ -271,36 +270,37 @@ class CPUStatePDP11 extends CPUPDP11 { this.flagZ = f; // PSW Z bit (TODO: Why do we clear instead of set Z, like other flags?) this.flagN = 0x8000; // PSW N bit this.regPSW = 0x000f; // PSW other bits (TODO: What's the point of setting the flag bits here, too?) + this.regsGen = [ // General R0-R7 0, 0, 0, 0, 0, 0, 0, this.addrReset, -1, -2, -3, -4, -5, -6, -7, -8 ]; - this.regsAlt = [ // Alternate R0-R5 0, 0, 0, 0, 0, 0 ]; this.regsAltStack = [ // Alternate R6 stack pointers (KERNEL, SUPER, UNUSED, USER) 0, 0, 0, 0 ]; - this.pswMode = 0; // current memory management mode (see PDP11.MODE.KERNEL | SUPER | UNUSED | USER) - this.mapMMR3 = [4,2,0,1]; // map from mode to MMR3 I/D bit - this.mmuPDR = [ // memory management PDR registers by mode - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // KERNEL (8 KIPDR regs followed by 8 KDPDR regs) - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // SUPER (8 SIPDR regs followed by 8 SDPDR regs) - [f, f, f, f, f, f, f, f, f, f, f, f, f, f, f, f], // mode 2 (not used) - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] // USER (8 UIPDR regs followed by 8 UDPDR regs) - ]; - this.mmuPAR = [ // memory management PAR registers by mode + this.regsPAR = [ // memory management PAR registers by mode [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // KERNEL (8 KIPAR regs followed by 8 KDPAR regs) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // SUPER (8 SIPDR regs followed by 8 SDPDR regs) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // mode 2 (not used) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] // USER (8 UIPDR regs followed by 8 UDPDR regs) ]; + this.regsPDR = [ // memory management PDR registers by mode + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // KERNEL (8 KIPDR regs followed by 8 KDPDR regs) + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // SUPER (8 SIPDR regs followed by 8 SDPDR regs) + [f, f, f, f, f, f, f, f, f, f, f, f, f, f, f, f], // mode 2 (not used) + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] // USER (8 UIPDR regs followed by 8 UDPDR regs) + ]; this.regsUniMap = [ // 32 UNIBUS map registers 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; this.regsControl = [ // various control registers (177740-177756) we don't really care about 0, 0, 0, 0, 0, 0, 0, 0 ]; + + this.pswMode = 0; // current memory management mode (see PDP11.MODE.KERNEL | SUPER | UNUSED | USER) + this.pswTrap = -1; this.regMBR = 0; /* @@ -317,8 +317,6 @@ class CPUStatePDP11 extends CPUPDP11 { this.srcMode = this.srcReg = 0; this.dstMode = this.dstReg = this.dstAddr = 0; - this.pswTrap = -1; - this.initMMU(); } @@ -358,7 +356,7 @@ class CPUStatePDP11 extends CPUPDP11 { /* * This stores the PC in the lower 16 bits, and any auto-incs or auto-decs from the last opcode in the * upper 16 bits; the lower 16 bits are used to update MMR2, and the upper 16 bits are used to update MMR1. - * The upper bits are automatically zeroed at the start of every operation when PC is copied to opLast. + * The upper bits are automatically zeroed at the start of every operation when the PC is copied to opLast. */ this.opLast = 0; @@ -639,30 +637,33 @@ class CPUStatePDP11 extends CPUPDP11 { this.regsGen, this.regsAlt, this.regsAltStack, + this.regsPAR, + this.regsPDR, this.regsUniMap, this.regsControl, this.regErr, this.regMBR, this.regPIR, this.regSLR, - this.pswTrap, - this.pswMode, - this.opFlags, this.regMMR0, this.regMMR1, this.regMMR2, this.regMMR3, + this.mmuEnable, this.mmuLastMode, this.mmuLastPage, - this.mmuPDR, - this.mmuPAR, - this.mmuEnable, this.mmuMask, this.addrLast, - this.opLast + this.opFlags, + this.opLast, + this.pswTrap, + this.trapReason, + this.trapVector ]); state.set(1, [this.getPSW()]); - state.set(2, [this.nTotalCycles, this.getSpeed()]); + state.set(2, [this.nTotalCycles, this.getSpeed(), this.flags.autoStart]); + state.set(3, this.saveIRQs()); + state.set(4, this.saveTimers()); return state.data(); } @@ -675,45 +676,48 @@ class CPUStatePDP11 extends CPUPDP11 { */ restore(data) { - var a; /* - * ES6 ALERT: Gotta love these destructuring assignments, which make it easy to perform the inverse - * of what save() does when it collects a bunch of object properties into an array. + * ES6 ALERT: Gotta love these destructuring assignments, which make it easy to perform the + * inverse of what save() does when it collects a bunch of object properties into an array. */ [ this.regsGen, this.regsAlt, this.regsAltStack, + this.regsPAR, + this.regsPDR, this.regsUniMap, this.regsControl, this.regErr, this.regMBR, this.regPIR, this.regSLR, - this.pswTrap, - this.pswMode, - this.opFlags, this.regMMR0, this.regMMR1, this.regMMR2, this.regMMR3, + this.mmuEnable, this.mmuLastMode, this.mmuLastPage, - this.mmuPDR, - this.mmuPAR, - this.mmuEnable, this.mmuMask, this.addrLast, - this.opLast + this.opFlags, + this.opLast, + this.pswTrap, + this.trapReason, + this.trapVector ] = data[0]; - a = data[1]; + var a = data[1]; this.setPSW(a[0]); a = data[2]; this.nTotalCycles = a[0]; this.setSpeed(a[1]); + this.flags.autoStart = a[2]; + this.restoreIRQs(data[3]); + this.restoreTimers(data[4]); return true; } @@ -985,8 +989,7 @@ class CPUStatePDP11 extends CPUPDP11 { */ addIRQ(vector, priority, message) { - var irq = {vector: vector, priority: priority, message: message || 0, next: null}; - irq.name = PDP11.VECTORS[vector]; + var irq = {vector: vector, priority: priority, message: message || 0, name: PDP11.VECTORS[vector], next: null}; this.aIRQs.push(irq); return irq; } @@ -1087,6 +1090,22 @@ class CPUStatePDP11 extends CPUPDP11 { } } + /** + * findIRQ(vector) + * + * @this {CPUStatePDP11} + * @param {number} vector + * @return {IRQ|null} + */ + findIRQ(vector) + { + for (var i = 0; i < this.aIRQs.length; i++) { + var irq = this.aIRQs[i]; + if (irq.vector === vector) return irq; + } + return null; + } + /** * checkIRQs(priority) * @@ -1109,6 +1128,41 @@ class CPUStatePDP11 extends CPUPDP11 { this.irqNext = null; } + /** + * saveIRQs() + * + * @this {CPUStatePDP11} + * @return {Array.} + */ + saveIRQs() + { + var aIRQVectors = []; + var irq = this.irqNext; + while (irq) { + aIRQVectors.push(irq.vector); + irq = irq.next; + } + return aIRQVectors; + } + + /** + * restoreIRQs(aIRQVectors) + * + * @this {CPUStatePDP11} + * @param {Array.} aIRQVectors + */ + restoreIRQs(aIRQVectors) + { + for (var i = aIRQVectors.length - 1; i >= 0; i--) { + var irq = this.findIRQ(aIRQVectors[i]); + this.assert(irq != null); + if (irq) { + irq.next = this.irqNext; + this.irqNext = irq; + } + } + } + /** * checkInterrupts() * @@ -1615,8 +1669,8 @@ class CPUStatePDP11 extends CPUPDP11 { * These next properties (in conjunction with setting PDP11.OPFLAG.TRAP_LAST) are purely an aid for the Debugger; * see getTrapStatus(). */ - this.trapVector = vector; this.trapReason = reason; + this.trapVector = vector; if (reason == PDP11.REASON.PANIC) { this.stopCPU(); @@ -1757,9 +1811,9 @@ class CPUStatePDP11 extends CPUPDP11 { var page = addr >> 13; if (page > 7) mode |= 1; if (!(this.regMMR3 & this.mapMMR3[this.pswMode])) page &= 7; - var pdr = this.mmuPDR[this.pswMode][page]; + var pdr = this.regsPDR[this.pswMode][page]; var off = addr & 0x1fff; - var paf = (this.mmuPAR[this.pswMode][page] << 6); + var paf = (this.regsPAR[this.pswMode][page] << 6); addrPhysical = (paf + off) & this.mmuMask; if (addrPhysical >= BusPDP11.UNIBUS_22BIT) addrPhysical = this.mapUnibus(addrPhysical); a.push(addrPhysical); // a[0] @@ -1838,8 +1892,8 @@ class CPUStatePDP11 extends CPUPDP11 { page = addrVirtual >> 13; if (!(this.regMMR3 & this.mapMMR3[this.pswMode])) page &= 7; - pdr = this.mmuPDR[this.pswMode][page]; - addr = ((this.mmuPAR[this.pswMode][page] << 6) + (addrVirtual & 0x1fff)) & this.mmuMask; + pdr = this.regsPDR[this.pswMode][page]; + addr = ((this.regsPAR[this.pswMode][page] << 6) + (addrVirtual & 0x1fff)) & this.mmuMask; if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.mapUnibus(addr); @@ -1928,7 +1982,7 @@ class CPUStatePDP11 extends CPUPDP11 { /* * Aborts and traps: log FIRST trap and MOST RECENT abort */ - this.mmuPDR[this.pswMode][page] = pdr; + this.regsPDR[this.pswMode][page] = pdr; if (addr != ((BusPDP11.IOPAGE_22BIT | PDP11.UNIBUS.MMR0) & this.mmuMask) || this.pswMode) { this.mmuLastMode = this.pswMode; this.mmuLastPage = page; @@ -2843,9 +2897,11 @@ class CPUStatePDP11 extends CPUPDP11 { if (!mode) { this.regsGen[reg] = (data = data < 0? this.regsGen[-data-1] : data); + //noinspection JSUnresolvedFunction fnFlags.call(this, data); } else { var addr = this.getAddr(mode, reg, PDP11.ACCESS.WRITE_WORD); + //noinspection JSUnresolvedFunction fnFlags.call(this, (data = data < 0? this.regsGen[-data-1] : data)); this.setWord(addr, data); } @@ -2974,7 +3030,7 @@ class CPUStatePDP11 extends CPUPDP11 { } while (this.nStepCycles > 0); - return (this.flags.complete? this.nBurstCycles - this.nStepCycles : (this.flags.complete === undefined? 0 : -1)); + return (this.flags.complete? this.nBurstCycles - this.nStepCycles : (this.flags.complete === false? -1 : 0)); } /** diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index 63412c2a5..1787e2cc9 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -1270,8 +1270,8 @@ class DebuggerPDP11 extends Debugger { // this.println(data? "resuming" : "powering up"); - if (data && this.restore) { - if (!this.restore(data)) return false; + if (data) { + return this.restore(data); } } return true; @@ -1593,7 +1593,7 @@ class DebuggerPDP11 extends Debugger { checkMemoryRead(addr, nb) { if (this.checkBreakpoint(addr, nb || 1, this.aBreakRead)) { - this.stopCPU(true); + this.stopCPU(false); return true; } return false; @@ -1618,7 +1618,7 @@ class DebuggerPDP11 extends Debugger { checkMemoryWrite(addr, nb) { if (this.checkBreakpoint(addr, nb || 1, this.aBreakWrite)) { - this.stopCPU(true); + this.stopCPU(false); return true; } return false; diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index 55e6f0480..e9f0beea6 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -36,6 +36,7 @@ if (NODE) { var Str = require("../../shared/es6/strlib"); var Web = require("../../shared/es6/weblib"); var Component = require("../../shared/es6/component"); + var State = require("../../shared/es6/state"); var PDP11 = require("./defines"); var BusPDP11 = require("./bus"); var MemoryPDP11 = require("./memory"); @@ -62,7 +63,7 @@ class DevicePDP11 extends Component { super("Device", parmsDevice, DevicePDP11, MessagesPDP11.DEVICE); this.kw11 = { // KW11 registers - csr: 0, + lks: PDP11.KW11.LKS.MON, timer: -1 // initBus() will initialize this timer ID }; } @@ -111,18 +112,18 @@ class DevicePDP11 extends Component { { if (DEBUGGER) { var cpu = this.cpu; - this.dumpRegs("KIPDR", cpu.mmuPDR[0], 0, asArgs[0]); - this.dumpRegs("KDPDR", cpu.mmuPDR[0], 8, asArgs[0]); - this.dumpRegs("KIPAR", cpu.mmuPAR[0], 0, asArgs[0]); - this.dumpRegs("KDPAR", cpu.mmuPAR[0], 8, asArgs[0], true); - this.dumpRegs("SIPDR", cpu.mmuPDR[1], 0, asArgs[0]); - this.dumpRegs("SDPDR", cpu.mmuPDR[1], 8, asArgs[0]); - this.dumpRegs("SIPAR", cpu.mmuPAR[1], 0, asArgs[0]); - this.dumpRegs("SDPAR", cpu.mmuPAR[1], 8, asArgs[0], true); - this.dumpRegs("UIPDR", cpu.mmuPDR[3], 0, asArgs[0]); - this.dumpRegs("UDPDR", cpu.mmuPDR[3], 8, asArgs[0]); - this.dumpRegs("UIPAR", cpu.mmuPAR[3], 0, asArgs[0]); - this.dumpRegs("UDPAR", cpu.mmuPAR[3], 8, asArgs[0], true); + this.dumpRegs("KIPDR", cpu.regsPDR[0], 0, asArgs[0]); + this.dumpRegs("KDPDR", cpu.regsPDR[0], 8, asArgs[0]); + this.dumpRegs("KIPAR", cpu.regsPAR[0], 0, asArgs[0]); + this.dumpRegs("KDPAR", cpu.regsPAR[0], 8, asArgs[0], true); + this.dumpRegs("SIPDR", cpu.regsPDR[1], 0, asArgs[0]); + this.dumpRegs("SDPDR", cpu.regsPDR[1], 8, asArgs[0]); + this.dumpRegs("SIPAR", cpu.regsPAR[1], 0, asArgs[0]); + this.dumpRegs("SDPAR", cpu.regsPAR[1], 8, asArgs[0], true); + this.dumpRegs("UIPDR", cpu.regsPDR[3], 0, asArgs[0]); + this.dumpRegs("UDPDR", cpu.regsPDR[3], 8, asArgs[0]); + this.dumpRegs("UIPAR", cpu.regsPAR[3], 0, asArgs[0]); + this.dumpRegs("UDPAR", cpu.regsPAR[3], 8, asArgs[0], true); if (cpu.regMMR3 & PDP11.MMR3.UNIBUS_MAP) { this.dumpRegs("UNIMAP", cpu.regsUniMap, -1, asArgs[0]); } @@ -167,6 +168,39 @@ class DevicePDP11 extends Component { } } + /** + * powerUp(data, fRepower) + * + * @this {DevicePDP11} + * @param {Object|null} data + * @param {boolean} [fRepower] + * @return {boolean} true if successful, false if failure + */ + powerUp(data, fRepower) + { + if (!fRepower) { + if (!data) { + this.reset(); + } else { + if (!this.restore(data)) return false; + } + } + return true; + } + + /** + * powerDown(fSave, fShutdown) + * + * @this {DevicePDP11} + * @param {boolean} [fSave] + * @param {boolean} [fShutdown] + * @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure + */ + powerDown(fSave, fShutdown) + { + return fSave? this.save() : true; + } + /** * reset() * @@ -178,6 +212,45 @@ class DevicePDP11 extends Component { this.cpu.setTimer(this.kw11.timer, 1000/60, true); } + /** + * save() + * + * This implements save support for the DevicePDP11 component. + * + * @this {DevicePDP11} + * @return {Object} + */ + save() + { + var state = new State(this); + state.set(0, [ + this.kw11.lks + ]); + return state.data(); + } + + /** + * restore(data) + * + * This implements restore support for the DevicePDP11 component. + * + * @this {DevicePDP11} + * @param {Object} data + * @return {boolean} true if successful, false if failure + */ + restore(data) + { + /* + * ES6 ALERT: Gotta love these destructuring assignments, which make it easy to perform the + * inverse of what save() does when it collects a bunch of object properties into an array. + */ + [ + this.kw11.lks + ] = data[0]; + + return true; + } + /** * interruptKW11() * @@ -350,7 +423,7 @@ class DevicePDP11 extends Component { readSIPDR(addr) { var reg = (addr >> 1) & 7; - return this.cpu.mmuPDR[1][reg]; + return this.cpu.regsPDR[1][reg]; } /** @@ -363,7 +436,7 @@ class DevicePDP11 extends Component { writeSIPDR(data, addr) { var reg = (addr >> 1) & 7; - this.cpu.mmuPDR[1][reg] = data & 0xff0f; + this.cpu.regsPDR[1][reg] = data & 0xff0f; } /** @@ -376,7 +449,7 @@ class DevicePDP11 extends Component { readSDPDR(addr) { var reg = ((addr >> 1) & 7) + 8; - return this.cpu.mmuPDR[1][reg]; + return this.cpu.regsPDR[1][reg]; } /** @@ -389,7 +462,7 @@ class DevicePDP11 extends Component { writeSDPDR(data, addr) { var reg = ((addr >> 1) & 7) + 8; - this.cpu.mmuPDR[1][reg] = data & 0xff0f; + this.cpu.regsPDR[1][reg] = data & 0xff0f; } /** @@ -402,7 +475,7 @@ class DevicePDP11 extends Component { readSIPAR(addr) { var reg = (addr >> 1) & 7; - return this.cpu.mmuPAR[1][reg]; + return this.cpu.regsPAR[1][reg]; } /** @@ -415,8 +488,8 @@ class DevicePDP11 extends Component { writeSIPAR(data, addr) { var reg = (addr >> 1) & 7; - this.cpu.mmuPAR[1][reg] = data; - this.cpu.mmuPDR[1][reg] &= 0xff0f; + this.cpu.regsPAR[1][reg] = data; + this.cpu.regsPDR[1][reg] &= 0xff0f; } @@ -430,7 +503,7 @@ class DevicePDP11 extends Component { readSDPAR(addr) { var reg = ((addr >> 1) & 7) + 8; - return this.cpu.mmuPAR[1][reg]; + return this.cpu.regsPAR[1][reg]; } /** @@ -443,8 +516,8 @@ class DevicePDP11 extends Component { writeSDPAR(data, addr) { var reg = ((addr >> 1) & 7) + 8; - this.cpu.mmuPAR[1][reg] = data; - this.cpu.mmuPDR[1][reg] &= 0xff0f; + this.cpu.regsPAR[1][reg] = data; + this.cpu.regsPDR[1][reg] &= 0xff0f; } /** @@ -457,7 +530,7 @@ class DevicePDP11 extends Component { readKIPDR(addr) { var reg = (addr >> 1) & 7; - return this.cpu.mmuPDR[0][reg]; + return this.cpu.regsPDR[0][reg]; } /** @@ -470,7 +543,7 @@ class DevicePDP11 extends Component { writeKIPDR(data, addr) { var reg = (addr >> 1) & 7; - this.cpu.mmuPDR[0][reg] = data & 0xff0f; + this.cpu.regsPDR[0][reg] = data & 0xff0f; } /** @@ -483,7 +556,7 @@ class DevicePDP11 extends Component { readKDPDR(addr) { var reg = ((addr >> 1) & 7) + 8; - return this.cpu.mmuPDR[0][reg]; + return this.cpu.regsPDR[0][reg]; } /** @@ -496,7 +569,7 @@ class DevicePDP11 extends Component { writeKDPDR(data, addr) { var reg = ((addr >> 1) & 7) + 8; - this.cpu.mmuPDR[0][reg] = data & 0xff0f; + this.cpu.regsPDR[0][reg] = data & 0xff0f; } /** @@ -509,7 +582,7 @@ class DevicePDP11 extends Component { readKIPAR(addr) { var reg = (addr >> 1) & 7; - return this.cpu.mmuPAR[0][reg]; + return this.cpu.regsPAR[0][reg]; } /** @@ -522,8 +595,8 @@ class DevicePDP11 extends Component { writeKIPAR(data, addr) { var reg = (addr >> 1) & 7; - this.cpu.mmuPAR[0][reg] = data; - this.cpu.mmuPDR[0][reg] &= 0xff0f; + this.cpu.regsPAR[0][reg] = data; + this.cpu.regsPDR[0][reg] &= 0xff0f; } @@ -537,7 +610,7 @@ class DevicePDP11 extends Component { readKDPAR(addr) { var reg = ((addr >> 1) & 7) + 8; - return this.cpu.mmuPAR[0][reg]; + return this.cpu.regsPAR[0][reg]; } /** @@ -550,8 +623,8 @@ class DevicePDP11 extends Component { writeKDPAR(data, addr) { var reg = ((addr >> 1) & 7) + 8; - this.cpu.mmuPAR[0][reg] = data; - this.cpu.mmuPDR[0][reg] &= 0xff0f; + this.cpu.regsPAR[0][reg] = data; + this.cpu.regsPDR[0][reg] &= 0xff0f; } /** @@ -564,7 +637,7 @@ class DevicePDP11 extends Component { readUIPDR(addr) { var reg = (addr >> 1) & 7; - return this.cpu.mmuPDR[3][reg]; + return this.cpu.regsPDR[3][reg]; } /** @@ -577,7 +650,7 @@ class DevicePDP11 extends Component { writeUIPDR(data, addr) { var reg = (addr >> 1) & 7; - this.cpu.mmuPDR[3][reg] = data & 0xff0f; + this.cpu.regsPDR[3][reg] = data & 0xff0f; } /** @@ -590,7 +663,7 @@ class DevicePDP11 extends Component { readUDPDR(addr) { var reg = ((addr >> 1) & 7) + 8; - return this.cpu.mmuPDR[3][reg]; + return this.cpu.regsPDR[3][reg]; } /** @@ -603,7 +676,7 @@ class DevicePDP11 extends Component { writeUDPDR(data, addr) { var reg = ((addr >> 1) & 7) + 8; - this.cpu.mmuPDR[3][reg] = data & 0xff0f; + this.cpu.regsPDR[3][reg] = data & 0xff0f; } /** @@ -616,7 +689,7 @@ class DevicePDP11 extends Component { readUIPAR(addr) { var reg = (addr >> 1) & 7; - return this.cpu.mmuPAR[3][reg]; + return this.cpu.regsPAR[3][reg]; } /** @@ -629,8 +702,8 @@ class DevicePDP11 extends Component { writeUIPAR(data, addr) { var reg = (addr >> 1) & 7; - this.cpu.mmuPAR[3][reg] = data; - this.cpu.mmuPDR[3][reg] &= 0xff0f; + this.cpu.regsPAR[3][reg] = data; + this.cpu.regsPDR[3][reg] &= 0xff0f; } @@ -644,7 +717,7 @@ class DevicePDP11 extends Component { readUDPAR(addr) { var reg = ((addr >> 1) & 7) + 8; - return this.cpu.mmuPAR[3][reg]; + return this.cpu.regsPAR[3][reg]; } /** @@ -657,8 +730,8 @@ class DevicePDP11 extends Component { writeUDPAR(data, addr) { var reg = ((addr >> 1) & 7) + 8; - this.cpu.mmuPAR[3][reg] = data; - this.cpu.mmuPDR[3][reg] &= 0xff0f; + this.cpu.regsPAR[3][reg] = data; + this.cpu.regsPDR[3][reg] &= 0xff0f; } /** diff --git a/modules/pdp11/lib/pc11.js b/modules/pdp11/lib/pc11.js index a5b19c8d9..f144b9570 100644 --- a/modules/pdp11/lib/pc11.js +++ b/modules/pdp11/lib/pc11.js @@ -306,7 +306,7 @@ class PC11 extends Component { powerUp(data, fRepower) { if (!fRepower) { - if (!data || !this.restore) { + if (!data) { this.reset(); } else { if (!this.restore(data)) return false; diff --git a/modules/pdp11/lib/rk11.js b/modules/pdp11/lib/rk11.js index 46bcb9252..ccfd191d4 100644 --- a/modules/pdp11/lib/rk11.js +++ b/modules/pdp11/lib/rk11.js @@ -361,7 +361,7 @@ class RK11 extends Component { powerUp(data, fRepower) { if (!fRepower) { - if (!data || !this.restore) { + if (!data) { this.reset(); if (this.cmp.fReload) { /* @@ -453,6 +453,8 @@ class RK11 extends Component { /** * saveController() * + * TODO: Implement. + * * @this {RK11} * @return {Array} */ diff --git a/modules/pdp11/lib/rl11.js b/modules/pdp11/lib/rl11.js index 65fc5024f..d564f4733 100644 --- a/modules/pdp11/lib/rl11.js +++ b/modules/pdp11/lib/rl11.js @@ -392,7 +392,7 @@ class RL11 extends Component { powerUp(data, fRepower) { if (!fRepower) { - if (!data || !this.restore) { + if (!data) { this.reset(); if (this.cmp.fReload) { /* @@ -484,6 +484,8 @@ class RL11 extends Component { /** * saveController() * + * TODO: Implement. + * * @this {RL11} * @return {Array} */ diff --git a/modules/pdp11/lib/serial.js b/modules/pdp11/lib/serial.js index 77993f9f4..00ad402de 100644 --- a/modules/pdp11/lib/serial.js +++ b/modules/pdp11/lib/serial.js @@ -423,7 +423,7 @@ class SerialPortPDP11 extends Component { */ this.initConnection(this.fNullModem); - if (!data || !this.restore) { + if (!data) { this.reset(); } else { if (!this.restore(data)) return false; @@ -503,6 +503,8 @@ class SerialPortPDP11 extends Component { /** * saveRegisters() * + * TODO: Implement. + * * @this {SerialPortPDP11} * @return {Array} */ diff --git a/versions/pdpjs/1.32.2/pdp11-dbg.js b/versions/pdpjs/1.32.2/pdp11-dbg.js index 5b1ab9999..dd05343eb 100644 --- a/versions/pdpjs/1.32.2/pdp11-dbg.js +++ b/versions/pdpjs/1.32.2/pdp11-dbg.js @@ -33,342 +33,345 @@ http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2017 */ var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var ea=0;function da(a){return"jscomp_symbol_"+(a||"")+ea++} -function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ha(this)}});fa=function(){}}function ha(a){var b=0;return ia(function(){return b":62,"?":63,"@":64,Ic:65,qg:66,sg:67,Pg:68,E:69,Qg:70,Rg:71,Sg:72,Tg:73,Ug:74,Vg:75,Wg:76,Xg:77,Yg:78,Zg:79,$g:80,Q:81,ah:82,bh:83,dh:84,eh:85,fh:86,gh:87,hh:88,ih:89,Gd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,jh:97,kh:98,lh:99,d:100,e:101,nh:102,oh:103,ph:104,qh:105,th:106,k:107,uh:108,vh:109,n:110,wh:111,p:112,q:113,r:114,xh:115,t:116,zh:117,Ah:118,Bh:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,xd:127};function q(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Rc=b.comment;this.Fd=b;this.exports={};this.B=this.bindings={};a=this.id.indexOf(".");0>a?this.lb=this.id:(this.mb=this.id.substr(0,a),this.lb=this.id.substr(a+1));this.A={ready:!1,eb:!1,zc:!1,fa:!1,error:!1};this.dc=null;this.A.error=!1;this.ha=d||0;this.F=this.f=this.D=this.J=this.Pa=null;ta.push(this)}function ua(a,b,c){va[a]&&b&&(va[a][b]=c)} -function xa(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function ya(a){var b=!1;window&&(b=window.confirm(a));return b}function za(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b":62,"?":63,"@":64,Jc:65,qg:66,sg:67,Pg:68,E:69,Qg:70,Rg:71,Sg:72,Tg:73,Ug:74,Vg:75,Wg:76,Xg:77,Yg:78,Zg:79,$g:80,Q:81,ah:82,bh:83,dh:84,eh:85,fh:86,gh:87,hh:88,ih:89,Gd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,jh:97,kh:98,lh:99,d:100,e:101,mh:102,nh:103,oh:104,ph:105,sh:106,k:107,th:108,uh:109,n:110,vh:111,p:112,q:113,r:114,wh:115,t:116,yh:117,zh:118,Ah:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,xd:127};function q(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Sc=b.comment;this.Fd=b;this.exports={};this.B=this.bindings={};a=this.id.indexOf(".");0>a?this.mb=this.id:(this.nb=this.id.substr(0,a),this.mb=this.id.substr(a+1));this.A={ready:!1,fb:!1,Ac:!1,fa:!1,error:!1};this.hc=null;this.A.error=!1;this.ha=d||0;this.F=this.f=this.D=this.J=this.Pa=null;ua.push(this)}function va(a,b,c){xa[a]&&b&&(xa[a][b]=c)} +function ya(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function za(a){var b=!1;window&&(b=window.confirm(a));return b}function Aa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=1,f--;return d}function H(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d} -function Na(a){var b=2,c="";b?10=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function Oa(a){return I(a,4,!0)} -function Pa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Wa[a]})}function Xa(a,b){return(a+" ").slice(0,b)} -function Ya(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Wa={"&":"&","<":"<",">":">",'"':""","'":"'"},Za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; -function $a(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function bb(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, +d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function Na(a,b,c){var d="";b?32>=1,f--;return d}function H(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d} +function Oa(a){var b=2,c="";b?10=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function Pa(a){return I(a,4,!0)} +function Qa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Xa[a]})}function Ya(a,b){return(a+" ").slice(0,b)} +function Za(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Xa={"&":"&","<":"<",">":">",'"':""","'":"'"},$a={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function ab(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function cb(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function cb(a,b){var c,d={ca:null,ea:null,wa:null,va:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.wa=g.load;d.va=g.exec;if(e=g.bytes)d.ca=e;else if(e=g.words)for(d.ca=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ca=Array(4*e.length),f=c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Aa=g.load;d.za=g.exec;if(e=g.bytes)d.ca=e;else if(e=g.words)for(d.ca=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ca=Array(4*e.length),f=c=0;c>8&255,d.ca[f++]=e[c]>>16&255,d.ca[f++]=e[c]>>24&255;else d.ca=g;d.ea=g.symbols;d.ca.length?1==d.ca.length&&(v(d.ca[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.b["S"+a]=[0,0,!1,!1,this.Zd,a];this.F=this.f=this.D=this.J=null;A(this)}p(Sb,q);h=Sb.prototype;h.reset=function(){this.stop()}; -h.pa=function(a,b,c,d){if(this.J&&this.J.pa(a,b,c,d)||this.f&&this.f.pa(a,b,c,d)||this.F&&this.F.pa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.B[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.B[b]=c,this.g[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.B[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, -b){return function(){Ub(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Vb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Ub(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Vb(a,b)}}(this,b),!0):q.prototype.pa.call(this,a,b,c,d)}};h.ta=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;Wb(b,this,Xb);Yb(b,this.reset.bind(this));Zb(this);$b(this)};h.za=function(a,b){b||(this.I&&ac(),this.reset());return!0};h.ya=function(){return!0}; -function bc(a,b,c){if(a=a.B[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Zb(a,b){for(var c in a.g)bc(a,c,null!=b?b:a.g[c])}function cc(a,b,c){if(a=a.B[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function $b(a){for(var b in a.b)cc(a,b,a.b[b][1])}function dc(a,b,c,d){a.B[b]&&(void 0===c&&(Da(a,"Value for "+b+" is invalid"),a.f.Z()),c=8==(a.F&&a.F.xa||8)?H(c,d):I(c,d),a.B[b].textContent!=c&&(a.B[b].textContent=c))} -function Ub(a,b){var c=a.b[b];cc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=ec&&(a.C=b==fc,a.G=b==gc)}function Vb(a,b){var c=a.b[b];c[2]&&c[3]&&(cc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Xd=function(a){a||this.f.A.U||(a=this.f,a.D.reset(),hc(a),this.b[ic]&&this.b[ic][1]&&jc(this.f))};h.Yd=function(){};h.Td=function(a){a||this.f.Z()}; -h.Rd=function(a){if(!a&&!this.f.A.U)if(this.b[ic]&&this.b[ic][1])jc(this.f);else{if((a=this.F)&&!Ka(a,!0))La(a,!0),kc(a,0,null),La(a,!1);else try{var b=this.f.bc(1);0=a.f.ba?8:16,c=65472<=a.ua&&a.ua<65472+b,b=c?1:2,c=c?15:a.D.I;a.b[ec]&&a.b[ec][1]||(b=-b);Fc(a,a.ua&~c|a.ua+b&c)} -function Fc(a,b){a.ua=b&a.D.I;b=a.ua;for(var c=0;22>c;c++)Hc(a,"A"+c,b&1<c;c++)Hc(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.H=this.M/this.j|0;this.T=this.H-1;this.Ma=[];this.ja=0;this.G=!1;this.N=[];this.Hd=[Nc,Oc,Pc,Qc];this.b=this.v=[];this.C=this.L=this.w=this.P=this.R=0;a=new L(this);Rc(a,this.F);this.b=Array(this.H);this.v=Array(this.H);for(b=0;b>>this.g;this.L=0;this.w=this.I;A(this)}p(Lc,q);function Uc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.v[a.R]=a.b[a.P])}}h=Lc.prototype;h.reset=function(){for(var a=0;aa;a++)this.b["S"+a]=[0,0,!1,!1,this.Zd,a];this.F=this.f=this.D=this.J=null;A(this)}p(Tb,q);h=Tb.prototype;h.reset=function(){this.stop()}; +h.qa=function(a,b,c,d){if(this.J&&this.J.qa(a,b,c,d)||this.f&&this.f.qa(a,b,c,d)||this.F&&this.F.qa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.B[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.B[b]=c,this.g[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.B[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, +b){return function(){Vb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Wb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Vb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Wb(a,b)}}(this,b),!0):q.prototype.qa.call(this,a,b,c,d)}};h.ua=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;Xb(b,this,Yb);Zb(b,this.reset.bind(this));$b(this);ac(this)};h.wa=function(a,b){b||(this.I&&bc(),this.reset());return!0};h.va=function(){return!0}; +function cc(a,b,c){if(a=a.B[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function $b(a,b){for(var c in a.g)cc(a,c,null!=b?b:a.g[c])}function dc(a,b,c){if(a=a.B[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function ac(a){for(var b in a.b)dc(a,b,a.b[b][1])}function ec(a,b,c,d){a.B[b]&&(void 0===c&&(Ea(a,"Value for "+b+" is invalid"),a.f.Z()),c=8==(a.F&&a.F.Ba||8)?H(c,d):I(c,d),a.B[b].textContent!=c&&(a.B[b].textContent=c))} +function Vb(a,b){var c=a.b[b];dc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=fc&&(a.C=b==gc,a.G=b==hc)}function Wb(a,b){var c=a.b[b];c[2]&&c[3]&&(dc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Xd=function(a){a||this.f.A.U||(a=this.f,a.D.reset(),ic(a),this.b[jc]&&this.b[jc][1]&&kc(this.f))};h.Yd=function(){};h.Td=function(a){a||this.f.Z()}; +h.Rd=function(a){if(!a&&!this.f.A.U)if(this.b[jc]&&this.b[jc][1])kc(this.f);else{if((a=this.F)&&!La(a,!0))Ma(a,!0),lc(a,0,null),Ma(a,!1);else try{var b=this.f.ec(1);0=a.f.ia?8:16,c=65472<=a.xa&&a.xa<65472+b,b=c?1:2,c=c?15:a.D.I;a.b[fc]&&a.b[fc][1]||(b=-b);Gc(a,a.xa&~c|a.xa+b&c)} +function Gc(a,b){a.xa=b&a.D.I;b=a.xa;for(var c=0;22>c;c++)Ic(a,"A"+c,b&1<c;c++)Ic(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.H=this.M/this.j|0;this.T=this.H-1;this.Ma=[];this.la=0;this.G=!1;this.O=[];this.Hd=[Oc,Pc,Qc,Rc];this.b=this.v=[];this.C=this.L=this.w=this.P=this.R=0;a=new L(this);Sc(a,this.F);this.b=Array(this.H);this.v=Array(this.H);for(b=0;b>>this.g;this.L=0;this.w=this.I;A(this)}p(Mc,q);function Vc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.v[a.R]=a.b[a.P])}}h=Mc.prototype;h.reset=function(){for(var a=0;a>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.K)return l.Jb+=l.K-f,l.K=f,!0;if(f>=l.K+l.Jb){n=l.size-(f-m);n>g&&(n=g);l.Jb=f-l.K+n;f=m+a.j;g-=n;k++;continue}}return Wc(Xc,f,g)}f=new L(a,f,n,a.j,d,e);Rc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Yc[d]+" at "+H(b)),!0):Wc(Zc,b,c)}h.Jc=function(a){return this.v[(a&this.w)>>>this.g].ub(a&this.i,a)}; -h.ac=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Ob||b!=this.i?this.v[c].ka(b,a):this.v[c++].ub(b,a)|this.v[c&this.T].ub(0,a+1)<<8};h.Kc=function(a,b){this.v[(a&this.w)>>>this.g].wb(a&this.i,b,a)};h.Nb=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Ob||c!=this.i?this.v[d].xb(c,b,a):(this.v[d++].wb(c,b&255,a),this.v[d&this.T].wb(0,b>>8&255,a+1))};function $c(a,b){return a.b[(b&a.I)>>>a.g]} -function Dc(a,b){var c;a.G=!1;a.ja++;var d=b&a.i,e=$c(a,b);Ob||d!=a.i?c=e.C(d,b):c=e.j(d,b)|$c(a,b+1).j(0,b+1)<<8;a.ja--;return c}function ad(a,b,c){a.G=!1;a.ja++;$c(a,b).D(b&a.i,c&255,b);a.ja--}function qc(a,b,c){a.G=!1;a.ja++;var d=b&a.i,e=$c(a,b);Ob||d!=a.i?e.G(d,c&65535,b):(e.D(d,c&255,b),$c(a,b+1).D(0,c>>8&255,b+1));a.ja--} -function Vc(a){for(var b=0,c=[],d=0;da.f.ba)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Ma[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&B(this.f,16|e[5])&&C(this.f,e[4]+".readByte("+O(this.f,b)+"): "+O(this.f,c),!0,!d.ja),c;d.La(b,16,3);c=255;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to byte @"+O(this.f,b)+": "+O(this.f,c),!0,!d.ja);return c} -function Oc(a,b,c){var d=!1,e=this.controller,f=e.Ma[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ma[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&B(this.f,16|f[5])&&C(this.f,f[4]+".writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.ja):(e.La(c,16,5),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to byte @"+O(this.f,c)+": "+O(this.f, -b),!0,!e.ja))}function Pc(a,b){var c=-1,d=this.controller;a=d.Ma[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".readWord("+O(this.f,b)+"): "+O(this.f,c),!0,!d.ja),c;d.La(b,16,2);c=65535;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to word @"+O(this.f,b)+": "+O(this.f,c),!0,!d.ja);return c} -function Qc(a,b,c){var d=!1,e=this.controller;a=e.Ma[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".writeWord("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.ja):(e.La(c,16,4),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to word @"+O(this.f,c)+": "+O(this.f,b),!0,!e.ja))}function P(a){q.call(this,"Device",a,0,256);this.b={mh:0,Gc:-1}}p(P,q);h=P.prototype; -h.ta=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.F=d;var e=this;this.b.Gc=gd(c,function(){e.b.Gb|=128;e.b.Gb&64&&hd(e.f,e.b.gb);e.J&&J(e.J,1);id(e.f,e.b.Gc,1E3/60)});this.b.gb=jd(c,64,6,524288);Wb(b,this,kd);Yb(b,this.reset.bind(this));d&&ld(d,64,function(a){var b=e.f;md(e,"KIPDR",b.C[0],0,a[0]);md(e,"KDPDR",b.C[0],8,a[0]);md(e,"KIPAR",b.M[0],0,a[0]);md(e,"KDPAR",b.M[0],8,a[0],!0);md(e,"SIPDR",b.C[1],0,a[0]);md(e,"SDPDR",b.C[1],8,a[0]);md(e,"SIPAR",b.M[1],0,a[0]);md(e,"SDPAR",b.M[1],8,a[0], -!0);md(e,"UIPDR",b.C[3],0,a[0]);md(e,"UDPDR",b.C[3],8,a[0]);md(e,"UIPAR",b.M[3],0,a[0]);md(e,"UDPAR",b.M[3],8,a[0],!0);b.T&32&&md(e,"UNIMAP",b.Ea,-1,a[0])});A(this)};function md(a,b,c,d,e,f){a=a.F;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Ea[a>>1];return a&1?b>>16:b&65535};h.hg=function(a,b){b=b>>1&63;var c=b>>1;this.f.Ea[c]=b&1?this.f.Ea[c]&65535|(a&63)<<16:this.f.Ea[c]&-65536|a&65534}; -h.Qe=function(a){return this.f.C[1][a>>1&7]};h.ag=function(a,b){this.f.C[1][b>>1&7]=a&65295};h.Oe=function(a){return this.f.C[1][(a>>1&7)+8]};h.Zf=function(a,b){this.f.C[1][(b>>1&7)+8]=a&65295};h.Pe=function(a){return this.f.M[1][a>>1&7]};h.$f=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.C[1][b]&=65295};h.Ne=function(a){return this.f.M[1][(a>>1&7)+8]};h.Yf=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.C[1][b]&=65295};h.je=function(a){return this.f.C[0][a>>1&7]}; -h.wf=function(a,b){this.f.C[0][b>>1&7]=a&65295};h.he=function(a){return this.f.C[0][(a>>1&7)+8]};h.uf=function(a,b){this.f.C[0][(b>>1&7)+8]=a&65295};h.ie=function(a){return this.f.M[0][a>>1&7]};h.vf=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.C[0][b]&=65295};h.ge=function(a){return this.f.M[0][(a>>1&7)+8]};h.tf=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.C[0][b]&=65295};h.We=function(a){return this.f.C[3][a>>1&7]};h.gg=function(a,b){this.f.C[3][b>>1&7]=a&65295}; -h.Ue=function(a){return this.f.C[3][(a>>1&7)+8]};h.eg=function(a,b){this.f.C[3][(b>>1&7)+8]=a&65295};h.Ve=function(a){return this.f.M[3][a>>1&7]};h.fg=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.C[3][b]&=65295};h.Te=function(a){return this.f.M[3][(a>>1&7)+8]};h.dg=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.C[3][b]&=65295};h.Hb=function(a){a&=7;return this.f.w&2048?this.f.na[a]:this.f.g[a]};h.Lb=function(a,b){b&=7;this.f.w&2048?this.f.na[b]=a:this.f.g[b]=a}; -h.ue=function(){return this.f.w&49152?this.f.V[0]:this.f.g[6]};h.Ff=function(a){this.f.w&49152?this.f.V[0]=a:this.f.g[6]=a};h.xe=function(){return this.f.g[7]};h.If=function(a){this.f.g[7]=a};h.Ib=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.na[a]};h.Mb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.na[b]=a};h.ve=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.V[1]};h.Gf=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.V[1]=a}; -h.we=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.V[3]};h.Hf=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.V[3]=a};h.fe=function(a){return this.f.Zb[a-65504>>1]};h.sf=function(a,b){this.f.Zb[b-65504>>1]=a};h.nd=function(a){return 65520==a?(bd(this.D)>>6)-1:0};h.sd=function(){};h.Se=function(){return 1};h.cg=function(){};h.ee=function(){return this.f.R};h.rf=function(){this.f.R=0};h.le=function(){return this.f.Yb};h.yf=function(a,b){b&1||(a&=255);this.f.Yb=a}; -h.qe=function(a,b){return b?0:this.f.Va};h.Bf=function(a){td(this.f,a)};h.Re=function(a,b){return b?0:this.f.sa&65280};h.bg=function(a){this.f.sa=a|255};h.te=function(){return ud(this.f)};h.Ef=function(a){vd(this.f,a)};h.rd=function(a,b){B(this)&&C(this,"writeIgnored("+H(b)+"): "+H(a),!0,!0)}; -var Q={},kd=(Q[61568]=[null,null,P.prototype.Xe,P.prototype.hg,"UNIMAP",64,1170],Q[62592]=[null,null,P.prototype.Qe,P.prototype.ag,"SIPDR",8,1145,64],Q[62608]=[null,null,P.prototype.Oe,P.prototype.Zf,"SDPDR",8,1145,64],Q[62624]=[null,null,P.prototype.Pe,P.prototype.$f,"SIPAR",8,1145,64],Q[62640]=[null,null,P.prototype.Ne,P.prototype.Yf,"SDPAR",8,1145,64],Q[62656]=[null,null,P.prototype.je,P.prototype.wf,"KIPDR",8,1140,64],Q[62672]=[null,null,P.prototype.he,P.prototype.uf,"KDPDR",8,1145,64],Q[62688]= +function Tc(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.K)return l.Kb+=l.K-f,l.K=f,!0;if(f>=l.K+l.Kb){n=l.size-(f-m);n>g&&(n=g);l.Kb=f-l.K+n;f=m+a.j;g-=n;k++;continue}}return Xc(Yc,f,g)}f=new L(a,f,n,a.j,d,e);Sc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Zc[d]+" at "+H(b)),!0):Xc($c,b,c)}h.Kc=function(a){return this.v[(a&this.w)>>>this.g].vb(a&this.i,a)}; +h.dc=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Pb||b!=this.i?this.v[c].ma(b,a):this.v[c++].vb(b,a)|this.v[c&this.T].vb(0,a+1)<<8};h.Lc=function(a,b){this.v[(a&this.w)>>>this.g].yb(a&this.i,b,a)};h.Ob=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Pb||c!=this.i?this.v[d].zb(c,b,a):(this.v[d++].yb(c,b&255,a),this.v[d&this.T].yb(0,b>>8&255,a+1))};function ad(a,b){return a.b[(b&a.I)>>>a.g]} +function Ec(a,b){var c;a.G=!1;a.la++;var d=b&a.i,e=ad(a,b);Pb||d!=a.i?c=e.C(d,b):c=e.j(d,b)|ad(a,b+1).j(0,b+1)<<8;a.la--;return c}function bd(a,b,c){a.G=!1;a.la++;ad(a,b).D(b&a.i,c&255,b);a.la--}function rc(a,b,c){a.G=!1;a.la++;var d=b&a.i,e=ad(a,b);Pb||d!=a.i?e.G(d,c&65535,b):(e.D(d,c&255,b),ad(a,b+1).D(0,c>>8&255,b+1));a.la--} +function Wc(a){for(var b=0,c=[],d=0;da.f.ia)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Ma[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&B(this.f,16|e[5])&&C(this.f,e[4]+".readByte("+O(this.f,b)+"): "+O(this.f,c),!0,!d.la),c;d.La(b,16,3);c=255;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to byte @"+O(this.f,b)+": "+O(this.f,c),!0,!d.la);return c} +function Pc(a,b,c){var d=!1,e=this.controller,f=e.Ma[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ma[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&B(this.f,16|f[5])&&C(this.f,f[4]+".writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.la):(e.La(c,16,5),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to byte @"+O(this.f,c)+": "+O(this.f, +b),!0,!e.la))}function Qc(a,b){var c=-1,d=this.controller;a=d.Ma[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".readWord("+O(this.f,b)+"): "+O(this.f,c),!0,!d.la),c;d.La(b,16,2);c=65535;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to word @"+O(this.f,b)+": "+O(this.f,c),!0,!d.la);return c} +function Rc(a,b,c){var d=!1,e=this.controller;a=e.Ma[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".writeWord("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.la):(e.La(c,16,4),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to word @"+O(this.f,c)+": "+O(this.f,b),!0,!e.la))}function P(a){q.call(this,"Device",a,0,256);this.b={Ya:128,Hc:-1}}p(P,q);h=P.prototype; +h.ua=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.F=d;var e=this;this.b.Hc=hd(c,function(){e.b.Ya|=128;e.b.Ya&64&&id(e.f,e.b.hb);e.J&&J(e.J,1);jd(e.f,e.b.Hc,1E3/60)});this.b.hb=kd(c,64,6,524288);Xb(b,this,ld);Zb(b,this.reset.bind(this));d&&md(d,64,function(a){var b=e.f;nd(e,"KIPDR",b.C[0],0,a[0]);nd(e,"KDPDR",b.C[0],8,a[0]);nd(e,"KIPAR",b.M[0],0,a[0]);nd(e,"KDPAR",b.M[0],8,a[0],!0);nd(e,"SIPDR",b.C[1],0,a[0]);nd(e,"SDPDR",b.C[1],8,a[0]);nd(e,"SIPAR",b.M[1],0,a[0]);nd(e,"SDPAR",b.M[1],8,a[0], +!0);nd(e,"UIPDR",b.C[3],0,a[0]);nd(e,"UDPDR",b.C[3],8,a[0]);nd(e,"UIPAR",b.M[3],0,a[0]);nd(e,"UDPAR",b.M[3],8,a[0],!0);b.T&32&&nd(e,"UNIMAP",b.Ga,-1,a[0])});A(this)};function nd(a,b,c,d,e,f){a=a.F;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Ga[a>>1];return a&1?b>>16:b&65535};h.hg=function(a,b){b=b>>1&63;var c=b>>1;this.f.Ga[c]=b&1?this.f.Ga[c]&65535|(a&63)<<16:this.f.Ga[c]&-65536|a&65534};h.Qe=function(a){return this.f.C[1][a>>1&7]};h.ag=function(a,b){this.f.C[1][b>>1&7]=a&65295};h.Oe=function(a){return this.f.C[1][(a>>1&7)+8]};h.Zf=function(a,b){this.f.C[1][(b>>1&7)+8]=a&65295};h.Pe=function(a){return this.f.M[1][a>>1&7]}; +h.$f=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.C[1][b]&=65295};h.Ne=function(a){return this.f.M[1][(a>>1&7)+8]};h.Yf=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.C[1][b]&=65295};h.je=function(a){return this.f.C[0][a>>1&7]};h.wf=function(a,b){this.f.C[0][b>>1&7]=a&65295};h.he=function(a){return this.f.C[0][(a>>1&7)+8]};h.uf=function(a,b){this.f.C[0][(b>>1&7)+8]=a&65295};h.ie=function(a){return this.f.M[0][a>>1&7]};h.vf=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.C[0][b]&=65295}; +h.ge=function(a){return this.f.M[0][(a>>1&7)+8]};h.tf=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.C[0][b]&=65295};h.We=function(a){return this.f.C[3][a>>1&7]};h.gg=function(a,b){this.f.C[3][b>>1&7]=a&65295};h.Ue=function(a){return this.f.C[3][(a>>1&7)+8]};h.eg=function(a,b){this.f.C[3][(b>>1&7)+8]=a&65295};h.Ve=function(a){return this.f.M[3][a>>1&7]};h.fg=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.C[3][b]&=65295};h.Te=function(a){return this.f.M[3][(a>>1&7)+8]}; +h.dg=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.C[3][b]&=65295};h.Ib=function(a){a&=7;return this.f.w&2048?this.f.oa[a]:this.f.g[a]};h.Mb=function(a,b){b&=7;this.f.w&2048?this.f.oa[b]=a:this.f.g[b]=a};h.ue=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.Ff=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.xe=function(){return this.f.g[7]};h.If=function(a){this.f.g[7]=a};h.Jb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.oa[a]}; +h.Nb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.oa[b]=a};h.ve=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Gf=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.we=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Hf=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.fe=function(a){return this.f.ac[a-65504>>1]};h.sf=function(a,b){this.f.ac[b-65504>>1]=a};h.nd=function(a){return 65520==a?(cd(this.D)>>6)-1:0}; +h.sd=function(){};h.Se=function(){return 1};h.cg=function(){};h.ee=function(){return this.f.R};h.rf=function(){this.f.R=0};h.le=function(){return this.f.$b};h.yf=function(a,b){b&1||(a&=255);this.f.$b=a};h.qe=function(a,b){return b?0:this.f.Va};h.Bf=function(a){ud(this.f,a)};h.Re=function(a,b){return b?0:this.f.ya&65280};h.bg=function(a){this.f.ya=a|255};h.te=function(){return vd(this.f)};h.Ef=function(a){Ed(this.f,a)};h.rd=function(a,b){B(this)&&C(this,"writeIgnored("+H(b)+"): "+H(a),!0,!0)}; +var Q={},ld=(Q[61568]=[null,null,P.prototype.Xe,P.prototype.hg,"UNIMAP",64,1170],Q[62592]=[null,null,P.prototype.Qe,P.prototype.ag,"SIPDR",8,1145,64],Q[62608]=[null,null,P.prototype.Oe,P.prototype.Zf,"SDPDR",8,1145,64],Q[62624]=[null,null,P.prototype.Pe,P.prototype.$f,"SIPAR",8,1145,64],Q[62640]=[null,null,P.prototype.Ne,P.prototype.Yf,"SDPAR",8,1145,64],Q[62656]=[null,null,P.prototype.je,P.prototype.wf,"KIPDR",8,1140,64],Q[62672]=[null,null,P.prototype.he,P.prototype.uf,"KDPDR",8,1145,64],Q[62688]= [null,null,P.prototype.ie,P.prototype.vf,"KIPAR",8,1140,64],Q[62704]=[null,null,P.prototype.ge,P.prototype.tf,"KDPAR",8,1145,64],Q[62798]=[null,null,P.prototype.pe,P.prototype.Af,"MMR3",1,1145,64],Q[65382]=[null,null,P.prototype.ke,P.prototype.xf,"LKS"],Q[65402]=[null,null,P.prototype.me,P.prototype.zf,"MMR0",1,1140,64],Q[65404]=[null,null,P.prototype.ne,P.prototype.rd,"MMR1",1,1145,64],Q[65406]=[null,null,P.prototype.oe,P.prototype.rd,"MMR2",1,1140,64],Q[65408]=[null,null,P.prototype.We,P.prototype.gg, -"UIPDR",8,1140,64],Q[65424]=[null,null,P.prototype.Ue,P.prototype.eg,"UDPDR",8,1145,64],Q[65440]=[null,null,P.prototype.Ve,P.prototype.fg,"UIPAR",8,1140,64],Q[65456]=[null,null,P.prototype.Te,P.prototype.dg,"UDPAR",8,1145,64],Q[65472]=[null,null,P.prototype.Hb,P.prototype.Lb,"R0SET0"],Q[65473]=[null,null,P.prototype.Hb,P.prototype.Lb,"R1SET0"],Q[65474]=[null,null,P.prototype.Hb,P.prototype.Lb,"R2SET0"],Q[65475]=[null,null,P.prototype.Hb,P.prototype.Lb,"R3SET0"],Q[65476]=[null,null,P.prototype.Hb, -P.prototype.Lb,"R4SET0"],Q[65477]=[null,null,P.prototype.Hb,P.prototype.Lb,"R5SET0"],Q[65478]=[null,null,P.prototype.ue,P.prototype.Ff,"R6KERNEL"],Q[65479]=[null,null,P.prototype.xe,P.prototype.If,"R7KERNEL"],Q[65480]=[null,null,P.prototype.Ib,P.prototype.Mb,"R0SET1",1,1145],Q[65481]=[null,null,P.prototype.Ib,P.prototype.Mb,"R1SET1",1,1145],Q[65482]=[null,null,P.prototype.Ib,P.prototype.Mb,"R2SET1",1,1145],Q[65483]=[null,null,P.prototype.Ib,P.prototype.Mb,"R3SET1",1,1145],Q[65484]=[null,null,P.prototype.Ib, -P.prototype.Mb,"R4SET1",1,1145],Q[65485]=[null,null,P.prototype.Ib,P.prototype.Mb,"R5SET1",1,1145],Q[65486]=[null,null,P.prototype.ve,P.prototype.Gf,"R6SUPER",1,1145],Q[65487]=[null,null,P.prototype.we,P.prototype.Hf,"R6USER",1,1145],Q[65504]=[null,null,P.prototype.fe,P.prototype.sf,"CTRL",8,1170],Q[65520]=[null,null,P.prototype.nd,P.prototype.sd,"LSIZE",1,1170],Q[65522]=[null,null,P.prototype.nd,P.prototype.sd,"HSIZE",1,1170],Q[65524]=[null,null,P.prototype.Se,P.prototype.cg,"SYSID",1,1170],Q[65526]= +"UIPDR",8,1140,64],Q[65424]=[null,null,P.prototype.Ue,P.prototype.eg,"UDPDR",8,1145,64],Q[65440]=[null,null,P.prototype.Ve,P.prototype.fg,"UIPAR",8,1140,64],Q[65456]=[null,null,P.prototype.Te,P.prototype.dg,"UDPAR",8,1145,64],Q[65472]=[null,null,P.prototype.Ib,P.prototype.Mb,"R0SET0"],Q[65473]=[null,null,P.prototype.Ib,P.prototype.Mb,"R1SET0"],Q[65474]=[null,null,P.prototype.Ib,P.prototype.Mb,"R2SET0"],Q[65475]=[null,null,P.prototype.Ib,P.prototype.Mb,"R3SET0"],Q[65476]=[null,null,P.prototype.Ib, +P.prototype.Mb,"R4SET0"],Q[65477]=[null,null,P.prototype.Ib,P.prototype.Mb,"R5SET0"],Q[65478]=[null,null,P.prototype.ue,P.prototype.Ff,"R6KERNEL"],Q[65479]=[null,null,P.prototype.xe,P.prototype.If,"R7KERNEL"],Q[65480]=[null,null,P.prototype.Jb,P.prototype.Nb,"R0SET1",1,1145],Q[65481]=[null,null,P.prototype.Jb,P.prototype.Nb,"R1SET1",1,1145],Q[65482]=[null,null,P.prototype.Jb,P.prototype.Nb,"R2SET1",1,1145],Q[65483]=[null,null,P.prototype.Jb,P.prototype.Nb,"R3SET1",1,1145],Q[65484]=[null,null,P.prototype.Jb, +P.prototype.Nb,"R4SET1",1,1145],Q[65485]=[null,null,P.prototype.Jb,P.prototype.Nb,"R5SET1",1,1145],Q[65486]=[null,null,P.prototype.ve,P.prototype.Gf,"R6SUPER",1,1145],Q[65487]=[null,null,P.prototype.we,P.prototype.Hf,"R6USER",1,1145],Q[65504]=[null,null,P.prototype.fe,P.prototype.sf,"CTRL",8,1170],Q[65520]=[null,null,P.prototype.nd,P.prototype.sd,"LSIZE",1,1170],Q[65522]=[null,null,P.prototype.nd,P.prototype.sd,"HSIZE",1,1170],Q[65524]=[null,null,P.prototype.Se,P.prototype.cg,"SYSID",1,1170],Q[65526]= [null,null,P.prototype.ee,P.prototype.rf,"ERR",1,1170],Q[65528]=[null,null,P.prototype.le,P.prototype.yf,"MBR",1,1170],Q[65530]=[null,null,P.prototype.qe,P.prototype.Bf,"PIR"],Q[65532]=[null,null,P.prototype.Re,P.prototype.bg,"SLR"],Q[65534]=[null,null,P.prototype.te,P.prototype.Ef,"PSW"],Q); -vb(function(){for(var a=y(document,x,"device"),b=0;b>1),this.b=new Int32Array(this.v,0,this.size>>2),Jd(this,Kd?Ld:Md);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.ce=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.cf=function(a,b){Nb&&a&1&&this.B.La(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8}; -h.pf=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Wa=!0};h.ae=function(a,b){this.f&&null!=this.K&&Td(this.f,this.K+a);return this.j(a,b)};h.Ze=function(a,b){this.f&&null!=this.K&&Td(this.f,this.K+a,2);return this.C(a,b)}; -h.mf=function(a,b,c){this.f&&null!=this.K&&Ud(this.f,this.K+a);this.J?this.Kb(0,b,c):this.D(a,b,c)};h.jg=function(a,b,c){this.f&&null!=this.K&&Ud(this.f,this.K+a,2);this.J?this.Kb(0,b,c):this.G(a,b,c)};h.$d=function(a){return this.g[a]};h.be=function(a,b){a=this.g[a];this.f&&B(this.f,32)&&C(this.f,"Memory.readByte("+O(this.f,b)+"): "+O(this.f,a),!0);return a};h.Ye=function(a,b){Nb&&a&1&&this.B.La(b,64,2);return this.w.getUint16(a,!0)}; -h.bf=function(a,b){Nb&&a&1&&this.B.La(b,64,2);a=!Ob&&a&1?this.g[a]|this.g[a+1]<<8:this.H[a>>1];this.f&&B(this.f,32)&&C(this.f,"Memory.readWord("+O(this.f,b)+"): "+O(this.f,a),!0);return a};h.lf=function(a,b){this.g[a]=b;this.Wa=!0};h.nf=function(a,b,c){this.g[a]=b;this.Wa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0)};h.ig=function(a,b,c){Nb&&a&1&&this.B.La(c,64,4);this.w.setUint16(a,b,!0);this.Wa=!0}; -h.kg=function(a,b,c){Nb&&a&1&&this.B.La(c,64,4);!Ob&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.H[a>>1]=b;this.Wa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeWord("+O(this.f,c)+","+O(this.f,b)+")",!0)};var Hd=0,cd=1,Id=2,Tc=4,Yc=["NONE","RAM","ROM","VID","H/W"],Gd=0,Od=[],Nd=[L.prototype.ce,L.prototype.pf,L.prototype.cf,L.prototype.lg],Rd=[L.prototype.ae,L.prototype.mf,L.prototype.Ze,L.prototype.jg]; -if(Db)var Md=[L.prototype.$d,L.prototype.lf,L.prototype.Ye,L.prototype.ig],Ld=[L.prototype.be,L.prototype.nf,L.prototype.bf,L.prototype.kg];var Vd;if(Db){var Wd=new ArrayBuffer(2);(new DataView(Wd)).setUint16(0,256,!0);Vd=256===(new Uint16Array(Wd))[0]}else Vd=!1;var Kd=Vd; -function Xd(a,b){q.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.oc=0;this.lc=b;this.bb=c;this.vc=Math.round(this.lc/1E4)/100;this.ob=this.vc*this.bb;this.wc=this.Vb=this.rb=this.mc=0;this.A.U=!1;this.A.hc=!1;this.A.Ia=a.autoStart;"string"==typeof this.A.Ia&&(this.A.Ia="true"==this.A.Ia);this.A.zb=!1;this.Sb=this.Bb=0;this.Tb=+a.csStart;this.Ab=+a.csInterval;this.Cb=+a.csStop;this.Fa=[];this.Tc=this.gf.bind(this);this.cb=this.Ta=this.ab=this.b=this.ga=this.Sa=this.Rb=this.$a=this.Db= -this.xc=this.nb=0;this.ra=null;A(this)}p(Xd,q);h=Xd.prototype;h.ta=function(a,b,c,d){this.J=a;this.D=b;this.F=d;this.ra=a.i;for(a=0;a=a.Bb&&(a.Bb+=a.Ab,c=!0);0<=a.Cb&&a.Cb<=ee(a)&&(a.Ab=a.Cb=-1,ae(a),a.Z(),c=!0);c&&a.u(ee(a)+" cycles: checksum="+I(a.Sb))}} -h.pa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.B[b]=c,!0;case "run":return this.B[b]=c,c.onclick=function(){var a;if(a=d.J)if(a=d.J,a.A.fa)a=!0;else{var b=null,c,k=za(a.id);for(c=0;ca.nb/a.ob?b=1:d=!0;a.bb=b;b=a.vc*a.bb;if(a.ob!=b){a.ob=b;b=a.ob.toFixed(2)+"Mhz";var e=a.B.setSpeed;e&&(e.textContent=b);a.u("target speed: "+b)}c&&a.J&&ie(a.J)}mc(a,a.Ta);a.Ta=0;a.Sa=xa();a.$a=0;ge(a);return d}function gd(a,b){var c=a.Fa.length;a.Fa.push([-1,b]);return c}function id(a,b,c,d){0<=b&&ba.Fa[b][0])&&(c=a.lc*a.bb/1E3*c|0,a.A.U&&(c+=je(a)),a.Fa[b][0]=c)} -function ke(a,b){for(var c=a.Fa.length-1;0<=c;c--){var d=a.Fa[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function lc(a,b){for(var c=a.Fa.length-1;0<=c;c--){var d=a.Fa[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function je(a,b){var c=a.ab-=a.b;a.b=a.ga=0;b&&(a.ab=0);return c} -h.gf=function(){if(this.A.U){this.mc>=this.lc&&ge(this,!0);this.Db=0;this.Rb=xa();if(this.$a){var a=this.Rb-this.$a;a>this.wc&&(this.Sa+=a,this.Sa>this.Rb&&(this.Sa=this.Rb))}try{do{var b=ke(this,this.A.zb?1:this.Vb);try{this.bc(b)}catch(e){if("number"!=typeof e)throw e;}b=je(this,!0);this.Db+=b;this.Ta+=b;nc(this,b);lc(this,b);this.rb-=b;if(0>=this.rb){this.rb+=this.Vb;++this.xc>=le&&(this.J&&J(this.J,void 0),this.xc=0);break}}while(this.A.U)}catch(e){this.Z();this.J&&this.J.stop(xa(),ee(this)); -Da(this,e.stack||e.message);return}if(this.A.U){a=setTimeout;b=this.Tc;this.$a=xa();var c=this.wc;this.Db&&(c=Math.round(c*this.Db/this.Vb));var c=c-(this.$a-this.Rb),d=this.$a-this.Sa;d&&(this.nb=Math.round(this.Ta/(10*d))/100,864E5<=d&&(this.cb=0,fe(this)));if(0>c||this.nbc&&(this.Sa-=c),c=0;this.mc+=this.Db;this.$a+=c;a(b,c)}}}; -function jc(a,b){if(!Ea(a))if(a.A.U)a.u(a.toString()+" busy");else{fe(a);a.A.U=!0;a.A.hc=!0;var c=a.B.run;c&&(c.textContent="Halt");a.J&&(b&&ie(a.J,!0),a.J.start(a.Sa,ee(a)));a.F||a.status("Started");setTimeout(a.Tc,0)}}h.bc=function(){return 0};h.Z=function(a){var b=!1;if(this.A.U){je(this);mc(this,this.Ta);this.Ta=0;this.A.U=!1;if(b=this.B.run)b.textContent="Run";this.J&&this.J.stop(xa(),ee(this));b=!0;this.F||this.status("Stopped")}this.A.complete=a;return b};var he=30,le=15,Yd=["power","reset"]; -function me(a){var b=+a.model||1170;Xd.call(this,a,6666667);this.ba=b;this.Qc=+a.addrReset||0;this.w=this.G=this.H=this.L=this.I=0;this.g=this.na=this.V=[];this.N=0;this.uc=[];this.C=this.M=this.Ea=this.Zb=[];this.nc=this.Za=this.P=this.Pc=this.Ha=this.jb=this.pb=this.Da=this.R=this.Va=this.sa=this.S=this.Eb=this.Fb=this.T=this.Ua=this.v=this.j=this.jc=this.W=this.Y=this.i=this.Yb=0;this.Sc=255;1120>=this.ba?(this.Oc=ne.bind(this),this.yb=this.Ld,this.nc=8,this.Sc=-1,this.Xc=255,this.Uc=0):(this.Oc= -oe.bind(this),this.yb=this.Md,this.Xc=~(1792|(1140>=this.ba?2048:0))&65535,this.Uc=1140e.$b&&(e.$b=c,c+=4)}return Xd.prototype.za.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.ba);this.A.U&&this.Z();this.G=65536;this.H=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Qc,-1,-2,-3,-4,-5,-6,-7,-8];this.na=[0,0,0,0,0,0];this.V=[0,0,0,0];this.N=0;this.uc=[4,2,0,1];this.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], -[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ea=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Zb=[0,0,0,0,0,0,0,0];this.v=this.j=this.jc=this.W=this.Y=this.i=this.Yb=0;this.Ua=-1;hc(this);$d(this);this.A.error=!1;Xd.prototype.reset.call(this)};function hc(a){a.S=0;a.Eb=0;a.Fb=0;a.T=0;a.R=0;a.Va=0;a.sa=255;a.Ha=0;a.jb=0;a.pb=0;a.Da=262143;a.Za=a.g[7];a.P=0;a.la=null;a.D&&(pe(a),a.Pc=bd(a.D))} -function pe(a){a.Ob=a.pc;a.Pb=a.qc;a.ic=a.rc;a.Qb=a.sc;a.Wb&&(a.Ob=a.fd,a.Pb=a.ld);a.Xb&&(a.ic=a.pd,a.Qb=a.qd);a.Ha?(a.Ga=65536,a.kb=a.T&16?4186112:253952,a.Ca=a.kd,a.ka=a.Wb?a.af:a.Ec,a.xb=a.Xb?a.ng:a.Hc,Uc(a.D,a.T&16?22:18)):(a.Ga=0,a.kb=57344,a.Ca=a.Od,a.ka=a.Wb?a.$e:a.od,a.xb=a.Xb?a.mg:a.td,Uc(a.D,16))}function od(a){var b=a.S;b&57344||(b=b&-3199|a.jb<<5|a.pb<<1);return b} -function pd(a,b){b&=-3073;if(a.S!=b){b&57344&&!(a.S&57344)&&(a.Eb=a.P>>16&65535,a.Fb=a.P&65535);a.S=b;a.jb=(b&96)>>5;a.pb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ha!=c&&(a.Ha=c,pe(a))}}function qd(a){a.S&57344||(a.Eb=a.P>>16&65535);a=a.Eb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function rd(a){a.S&57344||(a.Fb=a.P&65535);return a.Fb}function sd(a,b){1170>a.ba&&(b&=-49);a.T!=b&&(a.T=b,a.Da=b&16?4194303:262143,pe(a))} -function qe(a,b,c){a.Qc=b;a.D.reset();hc(a);re(a,b);vd(a,0);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.U||jc(a)}else a.F?a.Z()||be(a.F):!1===c&&a.Z();!a.A.U&&a.ra&&a.ra.stop()}h.gd=function(){return 0};h.save=function(){var a=new M(this);a.set(0,[this.g,this.na,this.V,this.Ea,this.Zb,this.R,this.Yb,this.Va,this.sa,this.Ua,this.N,this.i,this.S,this.Eb,this.Fb,this.T,this.jb,this.pb,this.C,this.M,this.Ha,this.Da,this.Za,this.P]);a.set(1,[ud(this)]);a.set(2,[this.cb,this.bb]);return a.data()}; -h.restore=function(a){var b;b=a[0];fa();ca();fa();var c=b[Symbol.iterator];b=c?c.call(b):ha(b);this.g=b.next().value;this.na=b.next().value;this.V=b.next().value;this.Ea=b.next().value;this.Zb=b.next().value;this.R=b.next().value;this.Yb=b.next().value;this.Va=b.next().value;this.sa=b.next().value;this.Ua=b.next().value;this.N=b.next().value;this.i=b.next().value;this.S=b.next().value;this.Eb=b.next().value;this.Fb=b.next().value;this.T=b.next().value;this.jb=b.next().value;this.pb=b.next().value; -this.C=b.next().value;this.M=b.next().value;this.Ha=b.next().value;this.Da=b.next().value;this.Za=b.next().value;this.P=b.next().value;b=a[1];vd(this,b[0]);b=a[2];this.cb=b[0];fe(this,b[1]);return!0};function se(a){return a.G&65536?1:0}function te(a){return a.H&32768?2:0}function ue(a){return a.L&65535?0:4}function ve(a){return a.I&32768?8:0}function we(a,b){var c=a.g[7];a.g[7]=c+b&65535;return c}function S(a,b,c){c&&(re(a,a.g[7]+(b<<24>>23)),a.b-=2);a.b-=3}function re(a,b){a.g[7]=b&65535} -function jd(a,b,c,d){c={$b:b,hb:c,message:d||0,next:null};c.name=Qb[b];a.tc.push(c);return c}function xe(a,b){var c=a.la;if(c==b)a.la=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.la&&(a.i|=1)}function hd(a,b){if(b){if(b!=a.la){var c=a.la;if(!c||c.hb<=b.hb)b.next=c,a.la=b;else{do{var d=c.next;if(!d||d.hb<=b.hb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&B(a,b.message|8)&&C(a,"setIRQ(vector="+H(b.$b)+",priority="+b.hb+")",!0,!0)}} -function nd(a,b){b&&(xe(a,b),b.message&&B(a,b.message|8)&&C(a,"clearIRQ(vector="+H(b.$b)+",priority="+b.hb+")",!0,!0))}function ye(a){return a.i&64?(a.qa(168,64,-6),!0):a.i&32?(a.qa(4,32,-5),!0):a.i&16?(a.qa(12,16,-7),!0):!1}function ud(a){return a.w=a.w&63728|ve(a)|ue(a)|te(a)|se(a)} -function vd(a,b){b&=a.Xc;a.I=b<<12;a.L=~b&4;a.H=b<<14;a.G=b<<16;if((b^a.w)&a.Uc)for(var c=a.na.length;0<=--c;){var d=a.g[c];a.g[c]=a.na[c];a.na[c]=d}a.N=b>>14&3;c=a.w>>14&3;a.N!=c&&(a.V[c]=a.g[6],a.g[6]=a.V[a.N]);a.w=b;a.i&=-3;a.i|=a.la?2:1}function td(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.Va=b}h.Ba=function(a){this.I=this.L=a;this.H=0};h.ib=function(a,b){this.I=this.L=this.G=a;this.H=b||0};function ze(a,b){a.I=a.L=a.G=b;a.H=a.I^a.G>>1} -function Ae(a,b,c,d){a.I=a.L=a.G=b;a.H=(c^d)&(d^b)}h.qa=function(a,b,c){if(!this.ma){0>this.Ua?this.Ua=ud(this):this.N||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.R|=4,this.g[6]=a=4);if(-1!=c){this.P=a|4143316992;this.N=0;var d=this.ka(a|this.Ga),e=this.ka(a+2&65535|this.Ga);vd(this,e&-12289|this.Ua>>2&12288);Be(this,this.Ua);Be(this,this.g[7]);re(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Ua=-1;this.Zc=a;this.Yc=c;-1==c&&this.Z();if(-4<=c)throw a;}}; -function Ce(a){var b=De(a),c=De(a);a.w&49152&&(c=c&-225|a.w&63712);re(a,b);vd(a,c);a.i&=-17}function Ee(a,b){var c=b>>13&31;31>c&&(b=a.T&32?a.Ea[c]+(b&8191)&4194303:b&-3932161);return b} -function Fe(a,b,c){var d=[];if(c){c=Ee(a,b);var e=b>>13&31;d.push(c);d.push(e);a.T&32&&(d.push(a.Ea[e]),d.push(b&8191))}else if(a.Ha){var e=a.N<<1,f=b>>13;7>13;a.T&a.uc[a.N]||(d&=7);e=a.C[a.N][d];f=(a.M[a.N][d]<<6)+(b&8191)&a.Da;3932160<=f&&(f=Ee(a,f));if(a.ma)return f;f>=a.Pc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.C[a.N][d]=e;if(f!=(4194170&a.Da)||a.N)a.jb=a.N,a.pb=d;g&&(g&57344&&(0<=a.Ua&&(g|=128),a.S&57344||(g|=a.S&4096|a.jb<<5|a.pb<<1,pd(a,a.S&-61695|g&61694)),a.qa(168,64,-2)),a.S&61440||!(f<(4191360&a.Da)||f>(4194239&a.Da))||(a.S|=4096,a.S&512&&(a.i|=64)));return f}function De(a){var b=a.ka(a.g[6]|a.Ga);a.g[6]=a.g[6]+2&65535;return b}function Be(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.P=a.P&65535|(a.P&-65536)<<8|16121856;a.i&256||a.yb(4,-2,c);a.xb(c,b)} -function Ge(a,b,c,d){var e,f,g=d&8?0:a.Ga;switch(b){case 0:return a.qa(4,0,-3),0;case 1:return 6==c&&a.yb(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.yb(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.ka(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.yb(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.ka(e)|g;a.b-=8;break;case 6:return e=a.ka(we(a,2)),e=e+a.g[c]&65535,6==c&&a.yb(d, -0,e),a.b-=6,e|g;case 7:return e=a.ka(we(a,2)),e=e+a.g[c]&65535,e=a.ka(e|a.Ga),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.P=a.P&65535|(a.P&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ld=function(a,b,c){!this.N&&0>=b&&c<=this.sa&&(this.i|=32)};h.Md=function(a,b,c){this.N||(65534<=c&&(c|=-65536),a&4&&c<=this.sa&&(c<=this.sa-32?this.qa(4,0,-4):(this.R|=8,this.i|=32)))};h.fd=function(a){this.F&&Td(this.F,a,1);return this.pc(a)};h.ld=function(a){this.F&&Td(this.F,a,2);return this.qc(a)}; -h.pd=function(a,b){this.F&&Ud(this.F,a,1);this.rc(a,b)};h.qd=function(a,b){this.F&&Ud(this.F,a,2);this.sc(a,b)};function Ec(a,b){a.ma++;b=a.D.ac(rc(a,b,2));a.ma--;return b}function He(a,b){(b?--a.Xb:--a.Wb)||pe(a)}h.Od=function(a,b,c){return Ge(this,a,b,c)};h.kd=function(a,b,c){return rc(this,Ge(this,a,b,c),c)};h.od=function(a){return this.D.ac(this.Za=a)};h.$e=function(a){this.F&&Td(this.F,a,2);return this.od(a)};h.Ec=function(a){return this.D.ac(this.Za=rc(this,a,2))}; -h.af=function(a){this.F&&Td(this.F,a,2);return this.Ec(a)};h.td=function(a,b){this.D.Nb(this.Za=a,b)};h.mg=function(a,b){this.F&&Ud(this.F,a,2);this.td(a,b)};h.Hc=function(a,b){this.D.Nb(this.Za=rc(this,a,4),b)};h.ng=function(a,b){this.F&&Ud(this.F,a,2);this.Hc(a,b)};function Ie(a,b,c){var d=a.j=b&7;(b=a.v=(b&56)>>3)?(d=Ge(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.N=a.w>>12&3,c=a.ka(d|c&a.Ga),a.N=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.V[a.w>>12&3];return c} -function Je(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=Ge(a,b,e,4),c&65536||(e&=65535),a.N=a.w>>12&3,e=rc(a,e|c&65536,4),a.N=a.w>>14&3,a.Qb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.V[a.w>>12&3]=d}function Ke(a,b){b>>=6;var c=a.Y=b&7;return(b=a.W=(b&56)>>3)?a.Ob(a.Ca(b,c,3)):a.g[c+a.nc]&a.Sc}function Le(a,b){var c;b>>=6;var d=a.Y=b&7;(b=a.W=(b&56)>>3)?c=a.Pb(a.Ca(b,d,2)):c=a.g[d+a.nc];return c}function Me(a,b){var c=a.j=b&7;b=a.v=(b&56)>>3;return Ge(a,b,c,8)} -function hf(a,b){var c=a.j=b&7;return(b=a.v=(b&56)>>3)?a.Ob(a.Ca(b,c,3)):a.g[c]&255}function jf(a,b){var c,d=a.j=b&7;(b=a.v=(b&56)>>3)?c=a.Pb(a.Ca(b,d,2)):c=a.g[d];return c}function kf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.jc=a.Ca(b,e,7),c=0>c?a.g[-c-1]&255:c,a.ic(e,d.call(a,c,a.Ob(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} -function T(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ca(b,e,6),a.Qb(e,d.call(a,0>c?a.g[-c-1]:c,a.Pb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function lf(a,b,c,d,e){var f=a.j=b&7;(b=a.v=(b&56)>>3)?(d=a.Ca(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.ic(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} -function mf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ca(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Qb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} -h.bc=function(a){this.A.complete=!0;var b=this.F?nf(this.F)?1:this.A.hc?-1:0:0,c=a?this.A.hc?0:1:-1;this.A.hc=!1;this.ab=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(of(this.F,this.g[7],c)){this.Z();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.Va&224)>>5,f=this.la&&this.la.hb>e?this.la:null;f&&(d=f.$b,e=f.hb);e>(this.w&224)>>5?(this.i&8&&(we(this,2),this.i&=-9),this.qa(d,0,-10),e=!0):e=!1;e&&(f&&xe(this,f),a=!0);this.la||this.Va||(this.i&=-3)}else this.i& -1&&this.i++;if(a){if(this.i&4&&of(this.F,this.g[7],c)){this.Z();break}if(0>c)break}if(this.i&112&&ye(this)){if(this.i&4&&of(this.F,this.g[7],c)){this.Z();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.ka(a);this.g[7]=a+2&65535;this.Oc(f)}while(0>1|b<<16;ze(this,a);return a&65535}function uf(a,b){a=b&128|b>>1|b<<8;ze(this,a<<8);return a&255}function vf(a,b){a=b&~a;this.Ba(a);return a}function wf(a,b){a=b&~a;this.Ba(a<<8);return a} -function xf(a,b){a|=b;this.Ba(a);return a}function yf(a,b){a|=b;this.Ba(a<<8);return a}function zf(a,b){a=~b|65536;this.ib(a);return a&65535}function Af(a,b){a=~b|256;this.ib(a<<8);return a&255}function Bf(a,b){this.I=this.L=a=b-a;this.H=b&(b^a);return a&65535}function Cf(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.H=b&(b^c);return a&255}function Df(a,b){this.I=this.L=a=b+a;this.H=a&(b^a);return a&65535}function Ef(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.H=c&(b<<8^c);return a&255} -function Ff(a,b){a=-b;this.ib(a,a&b&32768);return a&65535}function Gf(a,b){a=-b;this.ib(a<<8,(a&b&128)<<8);return a&255}function Hf(a,b){a=b<<1|this.G>>16&1;ze(this,a);return a&65535}function If(a,b){a=b<<1|this.G>>16&1;ze(this,a<<8);return a&255}function Jf(a,b){a=(this.G&65536|b)>>1|b<<16;ze(this,a);return a&65535}function Kf(a,b){a=((this.G&65536)>>8|b)>>1|b<<8;ze(this,a<<8);return a&255}function Lf(a,b){var c=b-a;Ae(this,c,a,b);return c&65535} -function Mf(a,b){var c=b-a;Ae(this,c<<8,a<<8,b<<8);return c&255}function Nf(a,b){this.I=this.L=b&65280;this.H=this.G=0;return(b<<8|b>>8)&65535}function Of(a,b){a^=b;this.Ba(a);return a&65535}function Pf(a){T(this,a,Le(this,a),pf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.W?5:3)+(7==this.j?2:0)} -function Qf(a){var b=jf(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.G=this.H=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.H=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.v?6:7)+b} -function Rf(a){var b=jf(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.G=this.H=0;b&=63;if(b&32){b=64-b;32>b-1;this.G=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.v?6:7)+b}function Sf(a){S(this,a,!se(this))}function Tf(a){S(this,a,se(this))} -function Uf(a){T(this,a,Le(this,a),vf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.W?5:3)+(7==this.j?2:0)}function Vf(a){kf(this,a,Ke(this,a),wf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.W?5:3)+(7==this.j?2:0)}function Wf(a){T(this,a,Le(this,a),xf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.W?5:3)+(7==this.j?2:0)}function Xf(a){kf(this,a,Ke(this,a),yf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.W?5:3)+(7==this.j?2:0)} -function Yf(a){var b=Le(this,a);a=jf(this,a);this.Ba((0>b?this.g[-b-1]:b)&a);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.W?4:3)+(7==this.j?2:0)}function Zf(a){var b=Ke(this,a);a=hf(this,a);this.Ba(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.W?4:3)+(7==this.j?2:0)}function $f(a){S(this,a,ue(this))}function ag(a){S(this,a,!ve(this)==!te(this))}function bg(a){S(this,a,!ue(this)&&!ve(this)==!te(this))}function cg(a){S(this,a,!se(this)&&!ue(this))} -function dg(a){S(this,a,ue(this)||!ve(this)!=!te(this))}function eg(a){S(this,a,se(this)||ue(this))}function fg(a){S(this,a,!ve(this)!=!te(this))}function gg(a){S(this,a,ve(this))}function hg(a){S(this,a,!ue(this))}function ig(a){S(this,a,!ve(this))}function jg(){this.qa(12,0,-9)}function kg(a){S(this,a,!0)}function lg(a){S(this,a,!te(this))}function mg(a){S(this,a,te(this))}function ng(a){a&1&&(this.G=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} -function og(a){var b=Le(this,a);a=jf(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Ae(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.W?4:3)+(7==this.j?2:0)}function pg(a){var b=Ke(this,a);a=hf(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Ae(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.W?4:3)+(7==this.j?2:0)} -function qg(a){var b=jf(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.G=this.H=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.H=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.H=32768,this.G=65536,this.b-=7}function rg(){this.qa(24,0,-9);this.b-=20} -function sg(){this.w&49152?(this.R|=128,this.qa(4,0,-8)):(this.ra&&1120==this.ba&&this.ra.setData(this.g[0],!0),this.F?tg(this.F):this.Z());this.b-=7}function ug(){this.qa(16,0,-9);this.b-=20}var vg=[0,7,7,10,7,11,9,13];function wg(a){this.ga=this.b;re(this,Me(this,a));this.b=this.ga-vg[this.v]}var xg=[0,14,14,17,14,18,16,20];function yg(a){this.ga=this.b;var b=Me(this,a);a=a>>6&7;Be(this,this.g[a]);this.g[a]=this.g[7];re(this,b);this.b=this.ga-xg[this.v]} -var zg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ag(a){var b=Le(this,a);this.ga=this.b;mf(this,a,b,this.Ba);this.b=this.ga-zg[(this.W?8:0)+this.v]+(7!=this.j||this.v?0:2)}function Bg(a){var b=Ke(this,a);lf(this,a,b,65535,this.Ba);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.W?5:3)+(7==this.j?2:0)}var Cg=[7,13,13,17,14,18,17,21]; -function Dg(a){var b=jf(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.H=0;this.G=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)re(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Kg(a){T(this,a,Le(this,a),Lf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.W?5:3)+(7==this.j?2:0)}function Lg(a){T(this,a,0,Nf);this.b-=this.v?9:3+(7==this.j?2:0)}function Mg(){this.qa(28,0,-9)} -function Ng(){this.ra&&(this.ra.Fc(this.g[7],!0),this.ra.setData(this.g[0],!0));this.i|=8;we(this,-2);this.b-=3}function Og(a){T(this,a,this.g[(a>>6&7)+this.nc],Of);this.b-=this.v?9:3+(7==this.j?2:0)}function U(a){var b;if(b=this.F)b=this.F,B(b,1)?(C(b,"undefined opcode "+O(b,a),!0,!0),b=tg(b)):b=!1;b||this.qa(8,0,-9)}function ne(a){Pg[a>>12].call(this,a)}function Qg(a){Rg[a>>6&3].call(this,a)}function Sg(a){Tg[a>>6&3].call(this,a)}function Ug(a){Vg[a>>6&3].call(this,a)} -function Wg(a){Xg[a&15].call(this,a)}function Yg(a){Zg[a&15].call(this,a)}function $g(a){ah[a>>6&3].call(this,a)}function bh(a){ch[a>>6&3].call(this,a)}function dh(a){eh[a>>6&3].call(this,a)} -var Pg=[function(a){fh[a>>8&15].call(this,a)},Ag,og,Yf,Uf,Wf,Pf,U,function(a){gh[a>>8&15].call(this,a)},Bg,pg,Zf,Vf,Xf,Kg,U],fh=[function(a){hh[a>>4&15].call(this,a)},kg,hg,$f,ag,fg,bg,dg,yg,yg,Qg,Sg,Ug,U,U,U],Rg=[function(a){mf(this,a,0,this.ib);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,zf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,1,Df);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,1,Bf);this.b-=this.v?9:3+(7==this.j?2:0)}],Tg=[function(a){T(this,a,0,Ff); -this.b-=this.v?11:6},function(a){T(this,a,se(this)?1:0,pf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,se(this)?1:0,Lf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=jf(this,a);this.ib(a);this.b-=this.v?4:3+(7==this.j?2:0)}],Vg=[function(a){T(this,a,0,Jf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,Hf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,tf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,rf);this.b-=this.v?9:3+(7==this.j?2:0)}],hh= -[function(a){ih[a&15].call(this,a)},U,U,U,wg,wg,wg,wg,Gg,U,Wg,Yg,Lg,Lg,Lg,Lg],ih=[sg,Ng,Hg,jg,ug,Fg,U,U,U,U,U,U,U,U,U,U],Xg=[Eg,function(){this.G=0;this.b-=5},function(){this.H=0;this.b-=5},ng,function(){this.L=1;this.b-=5},ng,ng,ng,function(){this.I=0;this.b-=5},ng,ng,ng,ng,ng,ng,ng],Zg=[Eg,function(){this.G=65536;this.b-=5},function(){this.H=32768;this.b-=5},Ig,function(){this.L=0;this.b-=5},Ig,Ig,Ig,function(){this.I=32768;this.b-=5},Ig,Ig,Ig,Ig,Ig,Ig,Ig],gh=[ig,gg,cg,eg,lg,mg,Sf,Tf,rg,Mg,$g,bh, -dh,U,U,U],ah=[function(a){lf(this,a,0,255,this.ib);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){kf(this,a,0,Af);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){kf(this,a,1,Ef);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){kf(this,a,1,Cf);this.b-=this.v?9:3+(7==this.j?2:0)}],ch=[function(a){kf(this,a,0,Gf);this.b-=this.v?11:6},function(a){kf(this,a,se(this)?1:0,qf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){kf(this,a,se(this)?1:0,Mf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=hf(this, -a);this.ib(a<<8);this.b-=this.v?4:3+(7==this.j?2:0)}],eh=[function(a){kf(this,a,0,Kf);this.b-=this.v?9+(this.jc&1):3+(7==this.j?2:0)},function(a){kf(this,a,0,If);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){kf(this,a,0,uf);this.b-=this.v?9+(this.jc&1):3+(7==this.j?2:0)},function(a){kf(this,a,0,sf);this.b-=this.v?9:3+(7==this.j?2:0)}];function oe(a){jh[a>>12].call(this,a)} -var jh=[function(a){kh[a>>8&15].call(this,a)},Ag,og,Yf,Uf,Wf,Pf,function(a){lh[a>>8&15].call(this,a)},function(a){mh[a>>8&15].call(this,a)},Bg,pg,Zf,Vf,Xf,Kg,U],kh=[function(a){nh[a>>4&15].call(this,a)},kg,hg,$f,ag,fg,bg,dg,yg,yg,Qg,Sg,Ug,function(a){oh[a>>6&3].call(this,a)},U,U],oh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.ka(a|this.Ga);re(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Ie(this,a,0);this.Ba(a);Be(this,a);this.b-=11},function(a){var b=De(this); -this.ga=this.b;this.Ba(b);Je(this,a,0,b);this.b=this.ga-Cg[this.v]},function(a){mf(this,a,ve(this)?65535:0,this.Ba);this.b-=this.v?9:3+(7==this.j?2:0)}],nh=[function(a){ph[a&15].call(this,a)},U,U,U,wg,wg,wg,wg,Gg,function(a){!(a&8)||1145>this.ba?U.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},Wg,Yg,Lg,Lg,Lg,Lg],ph=[sg,Ng,function(){Ce(this);this.i|=this.w&16;this.b-=13},jg,ug,Fg,Hg,function(a){U.call(this,a)},U,U,U,U,U,U,U,U],lh=[Dg,Dg,qg,qg,Qf,Qf,Rf,Rf, -Og,Og,U,U,U,U,Jg,Jg],mh=[ig,gg,cg,eg,lg,mg,Sf,Tf,rg,Mg,$g,bh,dh,function(a){1145>this.ba?U.call(this,a):qh[a>>6&3].call(this,a)},U,U],qh=[function(a){U.call(this,a)},function(a){a=Ie(this,a,65536);this.Ba(a);Be(this,a);this.b-=11},function(a){var b=De(this);this.ga=this.b;this.Ba(b);Je(this,a,65536,b);this.b=this.ga-Cg[this.v]},function(a){U.call(this,a)}]; -function rh(a){q.call(this,"ROM",a,0,128);this.ea=this.g=null;this.v=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.C=Pa(this.j);if(this.j){a=this.j;var b=Qa(this.C);"json"!=b&&"hex"!=b&&(a=db()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;bb(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(ua(c.mb,a,b),(a=cb(a,b))?(c.g=a.ca,c.ea=a.ea):c.j=null);sh(c)})}}p(rh,q); -h=rh.prototype;h.ta=function(a,b,c,d){this.D=b;this.f=c;this.F=d;sh(this)};h.za=function(){this.ea&&(this.F&&th(this.F,this.id,this.v,this.b,this.ea),delete this.ea);return!0};h.ya=function(){return!0}; -function sh(a){if(!Ja(a)){if(a.j){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Da(a,"ROM size ("+I(a.g.length,8,!0)+") does not match specified size ("+I(a.b,8,!0)+")");else{var b;a:{b=a.v;if(57344<=b&&b<57344+Mc){var c={},c=(c[b]=[rh.prototype.Me,rh.prototype.Xf,null,null,null,a.b>>1],c);if(Wb(a.D,a,c)){a.status("Added "+a.b+"-byte ROM at "+H(b));b=a.w=!0;break a}}else if(Sc(a.D,b,a.b,Id)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){C(a,"invalid block at offset "+Oa(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,E=r-=6;0=b.length){C(a,"insufficient data for block at offset "+Oa(n),4096); -break}m+=b[l++]&255;if(m&255){C(a,"invalid checksum ("+I(m,2,!0)+") for block at offset "+Oa(n),4096);break}if(E)for(C(a,"loading "+Oa(E)+" bytes at "+Oa(u)+"-"+Oa(u+E),4096);E--;)ad(a.D,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&C(a,"starting address: "+Oa(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=sa.Ic&&c<=sa.Gd&&(b=c-(sa.Ic-sa.ud));b&&(a.preventDefault&&a.preventDefault(),d.ec(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==sa.wd&&(b=sa.vd);d.ec(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); -a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ec(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.ta=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;var e=this;this.R=jd(this.f,this.M?-1:48,4,262144);this.S=gd(this.f,function(){var a;a=-1;e.v.length&&(a=e.v.shift()&255,C(e,"receiveByte("+I(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),id(e.f,e.S,1E3/Math.round(e.T/10)));0<=a&&(e.G=a,e.b&128?e.G|=49152:e.b|=128,e.b&64&&hd(c,e.R))});this.N=jd(this.f,this.M?-1:52,4,262144);this.Y=gd(this.f,function(){e.g|=128;e.g&64&&hd(c,e.N)});Wb(b,this,Ah,this.M?64832+8*(this.M-1)-65392:0);Yb(b,this.reset.bind(this)); -A(this)};h.md=function(a){if(!this.i){var b=Zd(this.J,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ya(c[0]);if(d!=this.lb)return;c=Ya(c[1]);if(this.i=Aa(c)){var e=this.i.exports;if(e){var f=e.connect;f&&f.call(this.i,this.I);if(this.H=e.receiveData){this.I=a;this.P=e.receiveStatus;this.status("Connected "+this.mb+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -h.za=function(a,b){if(!b)if(this.md(this.I),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ya=function(a){return a?this.save():!0};h.reset=function(){Bh(this)};h.save=function(){var a=new M(this);a.set(0,[]);return a.data()};h.restore=function(){return Bh(this)};function Bh(a){a.G=0;a.b=8192;a.g=128;a.v=[];return!0} -h.ec=function(a){if("number"==typeof a)this.v.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.C%a,this.W&&(b=Xa("",c)));this.V&&!this.C&&c&&(b=String.fromCharCode(this.V)+b);this.j.value+=b;this.j.scrollTop=this.j.scrollHeight;this.C+=c}}else if(null!=this.w){if(10== -a||1024<=this.w.length)this.u(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}id(this.f,this.Y,1E3/Math.round(this.ba/10));this.g&=-129};var zh="buffer",Ch={},Ah=(Ch[65392]=[null,null,yh.prototype.ze,yh.prototype.Kf,"RCSR"],Ch[65394]=[null,null,yh.prototype.ye,yh.prototype.Jf,"RBUF"],Ch[65396]=[null,null,yh.prototype.ef,yh.prototype.pg,"XCSR"],Ch[65398]=[null,null,yh.prototype.df,yh.prototype.og,"XBUF"],Ch); -vb(function(){for(var a=y(document,x,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.B[b]=c,!0;case "readTape":e=Gh;case "loadTape":return e||(e=Hh),this.B[b]=c,c.onclick= -function(){var a=d.B.listTapes;a&&Ih(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.N){c.parentNode.removeChild(c);break}this.B[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ih(d,Pa(b,!0),b,Hh,a)}return!1};return!0;case Jh:return this.B[b]=c,!0}return!1}; -h.ta=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;this.I=Kh(a);var e=this;if(a=Dh(this,Zd(this.J,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.H=jd(this.f,56,4,4096);this.R=gd(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Cc.indexOf("/api/v1/dump")&&(e=Qa(c),f="json"==e||"gz"==e?encodeURI(c):db()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!bb(f,null,!0,function(e,f,g){var k=0>g&&!!a.J&&!a.J.A.fa;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ua(a.mb,e,f),(e=cb(e,f))&&Vh(a,b,c,d,e.ca,e.wa, -e.va));a.A.eb=!1;a.g&&(a.g--,a.g||A(a));Sh(a)})}function Nh(a,b,c,d){if((a=a.B.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.X);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Qa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ra(c,"/")&&(d="dir"),f=db()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.cc?"":e)+"&format=json"));return!!bb(f, -null,!0,function(b,c,d){ci(a,b,c,d)})} -function ci(a,b,c,d){var e=null,f=0>d&&!!a.J&&!a.J.A.fa;a.j=!1;if(d)a.controller.O('Unable to load disk "'+a.Na+'" (error '+d+": "+b+")",f);else{ua(a.controller.mb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.X=k.length;a.da=k[0].length;a.aa=k[0][0].length;var l=k[0][0][0];a.oa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;E>2,e=Array(d),f=0;f>1),this.b=new Int32Array(this.v,0,this.size>>2),Kd(this,Ld?Md:Nd);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.ce=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.cf=function(a,b){Ob&&a&1&&this.B.La(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8}; +h.pf=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Wa=!0};h.ae=function(a,b){this.f&&null!=this.K&&Ud(this.f,this.K+a);return this.j(a,b)};h.Ze=function(a,b){this.f&&null!=this.K&&Ud(this.f,this.K+a,2);return this.C(a,b)}; +h.mf=function(a,b,c){this.f&&null!=this.K&&Vd(this.f,this.K+a);this.J?this.Lb(0,b,c):this.D(a,b,c)};h.jg=function(a,b,c){this.f&&null!=this.K&&Vd(this.f,this.K+a,2);this.J?this.Lb(0,b,c):this.G(a,b,c)};h.$d=function(a){return this.g[a]};h.be=function(a,b){a=this.g[a];this.f&&B(this.f,32)&&C(this.f,"Memory.readByte("+O(this.f,b)+"): "+O(this.f,a),!0);return a};h.Ye=function(a,b){Ob&&a&1&&this.B.La(b,64,2);return this.w.getUint16(a,!0)}; +h.bf=function(a,b){Ob&&a&1&&this.B.La(b,64,2);a=!Pb&&a&1?this.g[a]|this.g[a+1]<<8:this.H[a>>1];this.f&&B(this.f,32)&&C(this.f,"Memory.readWord("+O(this.f,b)+"): "+O(this.f,a),!0);return a};h.lf=function(a,b){this.g[a]=b;this.Wa=!0};h.nf=function(a,b,c){this.g[a]=b;this.Wa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0)};h.ig=function(a,b,c){Ob&&a&1&&this.B.La(c,64,4);this.w.setUint16(a,b,!0);this.Wa=!0}; +h.kg=function(a,b,c){Ob&&a&1&&this.B.La(c,64,4);!Pb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.H[a>>1]=b;this.Wa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeWord("+O(this.f,c)+","+O(this.f,b)+")",!0)};var Id=0,dd=1,Jd=2,Uc=4,Zc=["NONE","RAM","ROM","VID","H/W"],Hd=0,Pd=[],Od=[L.prototype.ce,L.prototype.pf,L.prototype.cf,L.prototype.lg],Sd=[L.prototype.ae,L.prototype.mf,L.prototype.Ze,L.prototype.jg]; +if(Eb)var Nd=[L.prototype.$d,L.prototype.lf,L.prototype.Ye,L.prototype.ig],Md=[L.prototype.be,L.prototype.nf,L.prototype.bf,L.prototype.kg];var Wd;if(Eb){var Xd=new ArrayBuffer(2);(new DataView(Xd)).setUint16(0,256,!0);Wd=256===(new Uint16Array(Xd))[0]}else Wd=!1;var Ld=Wd; +function Yd(a,b){q.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.rc=0;this.pc=b;this.cb=c;this.wc=Math.round(this.pc/1E4)/100;this.pb=this.wc*this.cb;this.xc=this.Xb=this.sb=this.qc=0;this.A.U=this.A.lc=!1;this.A.ta=a.autoStart;"string"==typeof this.A.ta&&(this.A.ta="true"==this.A.ta);this.A.Bb=!1;this.Ub=this.Db=0;this.Wb=+a.csStart;this.Cb=+a.csInterval;this.Eb=+a.csStop;this.ga=[];this.Xc=this.gf.bind(this);this.eb=this.Ta=this.bb=this.b=this.ja=this.Sa=this.Tb=this.ab=this.Fb= +this.yc=this.ob=0;this.sa=null;A(this)}p(Yd,q);h=Yd.prototype;h.ua=function(a,b,c,d){this.J=a;this.D=b;this.F=d;this.sa=a.i;for(a=0;a=a.Db&&(a.Db+=a.Cb,c=!0);0<=a.Eb&&a.Eb<=fe(a)&&(a.Cb=a.Eb=-1,be(a),a.Z(),c=!0);c&&a.u(fe(a)+" cycles: checksum="+I(a.Ub))}} +h.qa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.B[b]=c,!0;case "run":return this.B[b]=c,c.onclick=function(){var a;if(a=d.J)if(a=d.J,a.A.fa)a=!0;else{var b=null,c,k=Aa(a.id);for(c=0;ca.ob/a.pb?b=1:d=!0;a.cb=b;b=a.wc*a.cb;if(a.pb!=b){a.pb=b;b=a.pb.toFixed(2)+"Mhz";var e=a.B.setSpeed;e&&(e.textContent=b);a.u("target speed: "+b)}c&&a.J&&je(a.J)}nc(a,a.Ta);a.Ta=0;a.Sa=ya();a.ab=0;he(a);return d}function hd(a,b){var c=a.ga.length;a.ga.push([-1,b]);return c}function jd(a,b,c,d){0<=b&&ba.ga[b][0])&&(c=a.pc*a.cb/1E3*c|0,a.A.U&&(c+=ke(a)),a.ga[b][0]=c)} +function le(a,b){for(var c=a.ga.length-1;0<=c;c--){var d=a.ga[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function me(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ke(a,b){var c=a.bb-=a.b;a.b=a.ja=0;b&&(a.bb=0);return c} +h.gf=function(){if(this.A.U){this.qc>=this.pc&&he(this,!0);this.Fb=0;this.Tb=ya();if(this.ab){var a=this.Tb-this.ab;a>this.xc&&(this.Sa+=a,this.Sa>this.Tb&&(this.Sa=this.Tb))}try{do{var b=le(this,this.A.Bb?1:this.Xb);try{this.ec(b)}catch(e){if("number"!=typeof e)throw e;}b=ke(this,!0);this.Fb+=b;this.Ta+=b;oc(this,b);mc(this,b);this.sb-=b;if(0>=this.sb){this.sb+=this.Xb;++this.yc>=ne&&(this.J&&J(this.J,void 0),this.yc=0);break}}while(this.A.U)}catch(e){this.Z();this.J&&this.J.stop(ya(),fe(this)); +Ea(this,e.stack||e.message);return}if(this.A.U){a=setTimeout;b=this.Xc;this.ab=ya();var c=this.xc;this.Fb&&(c=Math.round(c*this.Fb/this.Xb));var c=c-(this.ab-this.Tb),d=this.ab-this.Sa;d&&(this.ob=Math.round(this.Ta/(10*d))/100,864E5<=d&&(this.eb=0,ge(this)));if(0>c||this.obc&&(this.Sa-=c),c=0;this.qc+=this.Fb;this.ab+=c;a(b,c)}}}; +function kc(a,b){if(!Ja(a))if(a.A.U)a.u(a.toString()+" busy");else{ge(a);a.A.U=!0;a.A.lc=!0;var c=a.B.run;c&&(c.textContent="Halt");a.J&&(b&&je(a.J,!0),a.J.start(a.Sa,fe(a)));a.F||a.status("Started");setTimeout(a.Xc,0)}}h.ec=function(){return 0};h.Z=function(a){var b=!1;if(this.A.U){ke(this);nc(this,this.Ta);this.Ta=0;this.A.U=!1;if(b=this.B.run)b.textContent="Run";this.J&&this.J.stop(ya(),fe(this));b=!0;this.F||this.status("Stopped")}this.A.complete=a;return b};var ie=30,ne=15,Zd=["power","reset"]; +function oe(a){var b=+a.model||1170;Yd.call(this,a,6666667);this.ia=b;this.Rc=+a.addrReset||0;this.Ua=this.w=this.O=this.G=this.H=this.L=this.I=0;this.g=this.oa=this.W=[];this.M=this.C=this.Ga=this.ac=[];this.$a=this.P=this.Qc=this.Ia=this.kb=this.qb=this.Fa=this.R=this.$b=this.Va=this.ya=this.S=this.Gb=this.Hb=this.T=this.i=0;this.Tc=[4,2,0,1];this.bc=0;this.Uc=255;1120>=this.ia?(this.Pc=pe.bind(this),this.Ab=this.Ld,this.bc=8,this.Uc=-1,this.Zc=255,this.Yc=0):(this.Pc=qe.bind(this),this.Ab=this.Md, +this.Zc=~(1792|(1140>=this.ia?2048:0))&65535,this.Yc=1140e.xb&&(e.xb=c,c+=4)}return Yd.prototype.wa.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.ia);this.A.U&&this.Z();this.G=65536;this.H=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Rc,-1,-2,-3,-4,-5,-6,-7,-8];this.oa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, +65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ga=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ac=[0,0,0,0,0,0,0,0];this.O=0;this.Ua=-1;this.v=this.j=this.oc=this.X=this.aa=this.i=this.$b=0;ic(this);ae(this);this.A.error=!1;Yd.prototype.reset.call(this)};function ic(a){a.S=0;a.Gb=0;a.Hb=0;a.T=0;a.R=0;a.Va=0;a.ya=255;a.Ia=0;a.kb=0;a.qb=0;a.Fa=262143;a.$a=a.g[7];a.P=0;a.V=null;a.D&&(re(a),a.Qc=cd(a.D))} +function re(a){a.Pb=a.sc;a.Qb=a.tc;a.mc=a.uc;a.Rb=a.vc;a.Yb&&(a.Pb=a.fd,a.Qb=a.ld);a.Zb&&(a.mc=a.pd,a.Rb=a.qd);a.Ia?(a.Ha=65536,a.lb=a.T&16?4186112:253952,a.Ea=a.kd,a.ma=a.Yb?a.af:a.Fc,a.zb=a.Zb?a.ng:a.Ic,Vc(a.D,a.T&16?22:18)):(a.Ha=0,a.lb=57344,a.Ea=a.Od,a.ma=a.Yb?a.$e:a.od,a.zb=a.Zb?a.mg:a.td,Vc(a.D,16))}function pd(a){var b=a.S;b&57344||(b=b&-3199|a.kb<<5|a.qb<<1);return b} +function qd(a,b){b&=-3073;if(a.S!=b){b&57344&&!(a.S&57344)&&(a.Gb=a.P>>16&65535,a.Hb=a.P&65535);a.S=b;a.kb=(b&96)>>5;a.qb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ia!=c&&(a.Ia=c,re(a))}}function rd(a){a.S&57344||(a.Gb=a.P>>16&65535);a=a.Gb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function sd(a){a.S&57344||(a.Hb=a.P&65535);return a.Hb}function td(a,b){1170>a.ia&&(b&=-49);a.T!=b&&(a.T=b,a.Fa=b&16?4194303:262143,re(a))} +function se(a,b,c){a.Rc=b;a.D.reset();ic(a);te(a,b);Ed(a,0);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.U||kc(a)}else a.F?a.Z()||ce(a.F):!1===c&&a.Z();!a.A.U&&a.sa&&a.sa.stop()}h.gd=function(){return 0}; +h.save=function(){var a=new M(this);a.set(0,[this.g,this.oa,this.W,this.M,this.C,this.Ga,this.ac,this.R,this.$b,this.Va,this.ya,this.S,this.Gb,this.Hb,this.T,this.Ia,this.kb,this.qb,this.Fa,this.$a,this.i,this.P,this.Ua,this.cc,this.fc]);a.set(1,[vd(this)]);a.set(2,[this.eb,this.cb,this.A.ta]);a.set(3,ue(this));a.set(4,me(this));return a.data()}; +h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.oa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.C=b.next().value;this.Ga=b.next().value;this.ac=b.next().value;this.R=b.next().value;this.$b=b.next().value;this.Va=b.next().value;this.ya=b.next().value;this.S=b.next().value;this.Gb=b.next().value;this.Hb=b.next().value;this.T=b.next().value;this.Ia=b.next().value;this.kb=b.next().value;this.qb=b.next().value;this.Fa=b.next().value;this.$a=b.next().value;this.i=b.next().value; +this.P=b.next().value;this.Ua=b.next().value;this.cc=b.next().value;this.fc=b.next().value;b=a[1];Ed(this,b[0]);b=a[2];this.eb=b[0];ge(this,b[1]);this.A.ta=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function te(a,b){a.g[7]=b&65535}function kd(a,b,c,d){b={xb:b,ib:c,message:d||0,name:Rb[b],next:null};a.Sb.push(b);return b}function Ae(a,b){var c=a.V;if(c==b)a.V=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.V&&(a.i|=1)} +function id(a,b){if(b){if(b!=a.V){var c=a.V;if(!c||c.ib<=b.ib)b.next=c,a.V=b;else{do{var d=c.next;if(!d||d.ib<=b.ib){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&B(a,b.message|8)&&C(a,"setIRQ(vector="+H(b.xb)+",priority="+b.ib+")",!0,!0)}}function od(a,b){b&&(Ae(a,b),b.message&&B(a,b.message|8)&&C(a,"clearIRQ(vector="+H(b.xb)+",priority="+b.ib+")",!0,!0))}function ue(a){var b=[];for(a=a.V;a;)b.push(a.xb),a=a.next;return b} +function Be(a){return a.i&64?(a.ra(168,64,-6),!0):a.i&32?(a.ra(4,32,-5),!0):a.i&16?(a.ra(12,16,-7),!0):!1}function vd(a){return a.w=a.w&63728|ye(a)|xe(a)|we(a)|ve(a)}function Ed(a,b){b&=a.Zc;a.I=b<<12;a.L=~b&4;a.H=b<<14;a.G=b<<16;if((b^a.w)&a.Yc)for(var c=a.oa.length;0<=--c;){var d=a.g[c];a.g[c]=a.oa[c];a.oa[c]=d}a.O=b>>14&3;c=a.w>>14&3;a.O!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.O]);a.w=b;a.i&=-3;a.i|=a.V?2:1}function ud(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.Va=b} +h.Da=function(a){this.I=this.L=a;this.H=0};h.jb=function(a,b){this.I=this.L=this.G=a;this.H=b||0};function Ce(a,b){a.I=a.L=a.G=b;a.H=a.I^a.G>>1}function De(a,b,c,d){a.I=a.L=a.G=b;a.H=(c^d)&(d^b)} +h.ra=function(a,b,c){if(!this.na){0>this.Ua?this.Ua=vd(this):this.O||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.R|=4,this.g[6]=a=4);if(-1!=c){this.P=a|4143316992;this.O=0;var d=this.ma(a|this.Ha),e=this.ma(a+2&65535|this.Ha);Ed(this,e&-12289|this.Ua>>2&12288);Ee(this,this.Ua);Ee(this,this.g[7]);te(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Ua=-1;this.cc=c;this.fc=a;-1==c&&this.Z();if(-4<=c)throw a;}}; +function Fe(a){var b=Ge(a),c=Ge(a);a.w&49152&&(c=c&-225|a.w&63712);te(a,b);Ed(a,c);a.i&=-17}function He(a,b){var c=b>>13&31;31>c&&(b=a.T&32?a.Ga[c]+(b&8191)&4194303:b&-3932161);return b} +function Ie(a,b,c){var d=[];if(c){c=He(a,b);var e=b>>13&31;d.push(c);d.push(e);a.T&32&&(d.push(a.Ga[e]),d.push(b&8191))}else if(a.Ia){var e=a.O<<1,f=b>>13;7>13;a.T&a.Tc[a.O]||(d&=7);e=a.C[a.O][d];f=(a.M[a.O][d]<<6)+(b&8191)&a.Fa;3932160<=f&&(f=He(a,f));if(a.na)return f;f>=a.Qc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.C[a.O][d]=e;if(f!=(4194170&a.Fa)||a.O)a.kb=a.O,a.qb=d;g&&(g&57344&&(0<=a.Ua&&(g|=128),a.S&57344||(g|=a.S&4096|a.kb<<5|a.qb<<1,qd(a,a.S&-61695|g&61694)),a.ra(168,64,-2)),a.S&61440||!(f<(4191360&a.Fa)||f>(4194239&a.Fa))||(a.S|=4096,a.S&512&&(a.i|=64)));return f}function Ge(a){var b=a.ma(a.g[6]|a.Ha);a.g[6]=a.g[6]+2&65535;return b}function Ee(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.P=a.P&65535|(a.P&-65536)<<8|16121856;a.i&256||a.Ab(4,-2,c);a.zb(c,b)} +function Je(a,b,c,d){var e,f,g=d&8?0:a.Ha;switch(b){case 0:return a.ra(4,0,-3),0;case 1:return 6==c&&a.Ab(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Ab(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.ma(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Ab(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.ma(e)|g;a.b-=8;break;case 6:return e=a.ma(ze(a,2)),e=e+a.g[c]&65535,6==c&&a.Ab(d, +0,e),a.b-=6,e|g;case 7:return e=a.ma(ze(a,2)),e=e+a.g[c]&65535,e=a.ma(e|a.Ha),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.P=a.P&65535|(a.P&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ld=function(a,b,c){!this.O&&0>=b&&c<=this.ya&&(this.i|=32)};h.Md=function(a,b,c){this.O||(65534<=c&&(c|=-65536),a&4&&c<=this.ya&&(c<=this.ya-32?this.ra(4,0,-4):(this.R|=8,this.i|=32)))};h.fd=function(a){this.F&&Ud(this.F,a,1);return this.sc(a)};h.ld=function(a){this.F&&Ud(this.F,a,2);return this.tc(a)}; +h.pd=function(a,b){this.F&&Vd(this.F,a,1);this.uc(a,b)};h.qd=function(a,b){this.F&&Vd(this.F,a,2);this.vc(a,b)};function Fc(a,b){a.na++;b=a.D.dc(Dc(a,b,2));a.na--;return b}function Ke(a,b){(b?--a.Zb:--a.Yb)||re(a)}h.Od=function(a,b,c){return Je(this,a,b,c)};h.kd=function(a,b,c){return Dc(this,Je(this,a,b,c),c)};h.od=function(a){return this.D.dc(this.$a=a)};h.$e=function(a){this.F&&Ud(this.F,a,2);return this.od(a)};h.Fc=function(a){return this.D.dc(this.$a=Dc(this,a,2))}; +h.af=function(a){this.F&&Ud(this.F,a,2);return this.Fc(a)};h.td=function(a,b){this.D.Ob(this.$a=a,b)};h.mg=function(a,b){this.F&&Vd(this.F,a,2);this.td(a,b)};h.Ic=function(a,b){this.D.Ob(this.$a=Dc(this,a,4),b)};h.ng=function(a,b){this.F&&Vd(this.F,a,2);this.Ic(a,b)};function Le(a,b,c){var d=a.j=b&7;(b=a.v=(b&56)>>3)?(d=Je(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.O=a.w>>12&3,c=a.ma(d|c&a.Ha),a.O=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} +function Me(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=Je(a,b,e,4),c&65536||(e&=65535),a.O=a.w>>12&3,e=Dc(a,e|c&65536,4),a.O=a.w>>14&3,a.Rb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function hf(a,b){b>>=6;var c=a.aa=b&7;return(b=a.X=(b&56)>>3)?a.Pb(a.Ea(b,c,3)):a.g[c+a.bc]&a.Uc}function jf(a,b){var c;b>>=6;var d=a.aa=b&7;(b=a.X=(b&56)>>3)?c=a.Qb(a.Ea(b,d,2)):c=a.g[d+a.bc];return c}function kf(a,b){var c=a.j=b&7;b=a.v=(b&56)>>3;return Je(a,b,c,8)} +function lf(a,b){var c=a.j=b&7;return(b=a.v=(b&56)>>3)?a.Pb(a.Ea(b,c,3)):a.g[c]&255}function mf(a,b){var c,d=a.j=b&7;(b=a.v=(b&56)>>3)?c=a.Qb(a.Ea(b,d,2)):c=a.g[d];return c}function nf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.oc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.mc(e,d.call(a,c,a.Pb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} +function T(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,6),a.Rb(e,d.call(a,0>c?a.g[-c-1]:c,a.Qb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function of(a,b,c,d,e){var f=a.j=b&7;(b=a.v=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.mc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} +function pf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Rb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} +h.ec=function(a){this.A.complete=!0;var b=this.F?qf(this.F)?1:this.A.lc?-1:0:0,c=a?this.A.lc?0:1:-1;this.A.lc=!1;this.bb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(rf(this.F,this.g[7],c)){this.Z();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.Va&224)>>5,f=this.V&&this.V.ib>e?this.V:null;f&&(d=f.xb,e=f.ib);e>(this.w&224)>>5?(this.i&8&&(ze(this,2),this.i&=-9),this.ra(d,0,-10),e=!0):e=!1;e&&(f&&Ae(this,f),a=!0);this.V||this.Va||(this.i&=-3)}else this.i& +1&&this.i++;if(a){if(this.i&4&&rf(this.F,this.g[7],c)){this.Z();break}if(0>c)break}if(this.i&112&&Be(this)){if(this.i&4&&rf(this.F,this.g[7],c)){this.Z();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.ma(a);this.g[7]=a+2&65535;this.Pc(f)}while(0>1|b<<16;Ce(this,a);return a&65535}function xf(a,b){a=b&128|b>>1|b<<8;Ce(this,a<<8);return a&255}function yf(a,b){a=b&~a;this.Da(a);return a}function zf(a,b){a=b&~a;this.Da(a<<8);return a} +function Af(a,b){a|=b;this.Da(a);return a}function Bf(a,b){a|=b;this.Da(a<<8);return a}function Cf(a,b){a=~b|65536;this.jb(a);return a&65535}function Df(a,b){a=~b|256;this.jb(a<<8);return a&255}function Ef(a,b){this.I=this.L=a=b-a;this.H=b&(b^a);return a&65535}function Ff(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.H=b&(b^c);return a&255}function Gf(a,b){this.I=this.L=a=b+a;this.H=a&(b^a);return a&65535}function Hf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.H=c&(b<<8^c);return a&255} +function If(a,b){a=-b;this.jb(a,a&b&32768);return a&65535}function Jf(a,b){a=-b;this.jb(a<<8,(a&b&128)<<8);return a&255}function Kf(a,b){a=b<<1|this.G>>16&1;Ce(this,a);return a&65535}function Lf(a,b){a=b<<1|this.G>>16&1;Ce(this,a<<8);return a&255}function Mf(a,b){a=(this.G&65536|b)>>1|b<<16;Ce(this,a);return a&65535}function Nf(a,b){a=((this.G&65536)>>8|b)>>1|b<<8;Ce(this,a<<8);return a&255}function Of(a,b){var c=b-a;De(this,c,a,b);return c&65535} +function Pf(a,b){var c=b-a;De(this,c<<8,a<<8,b<<8);return c&255}function Qf(a,b){this.I=this.L=b&65280;this.H=this.G=0;return(b<<8|b>>8)&65535}function Rf(a,b){a^=b;this.Da(a);return a&65535}function Sf(a){T(this,a,jf(this,a),sf);this.b-=this.v?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function Tf(a){var b=mf(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.G=this.H=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.H=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.v?6:7)+b} +function Uf(a){var b=mf(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.G=this.H=0;b&=63;if(b&32){b=64-b;32>b-1;this.G=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.v?6:7)+b}function Vf(a){S(this,a,!ve(this))}function Wf(a){S(this,a,ve(this))} +function Xf(a){T(this,a,jf(this,a),yf);this.b-=this.v?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Yf(a){nf(this,a,hf(this,a),zf);this.b-=this.v?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Zf(a){T(this,a,jf(this,a),Af);this.b-=this.v?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function $f(a){nf(this,a,hf(this,a),Bf);this.b-=this.v?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function ag(a){var b=jf(this,a);a=mf(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.v?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function bg(a){var b=hf(this,a);a=lf(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.v?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function cg(a){S(this,a,xe(this))}function dg(a){S(this,a,!ye(this)==!we(this))}function eg(a){S(this,a,!xe(this)&&!ye(this)==!we(this))}function fg(a){S(this,a,!ve(this)&&!xe(this))} +function gg(a){S(this,a,xe(this)||!ye(this)!=!we(this))}function hg(a){S(this,a,ve(this)||xe(this))}function ig(a){S(this,a,!ye(this)!=!we(this))}function jg(a){S(this,a,ye(this))}function kg(a){S(this,a,!xe(this))}function lg(a){S(this,a,!ye(this))}function mg(){this.ra(12,0,-9)}function ng(a){S(this,a,!0)}function og(a){S(this,a,!we(this))}function pg(a){S(this,a,we(this))}function qg(a){a&1&&(this.G=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} +function rg(a){var b=jf(this,a);a=mf(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;De(this,c,a,b);this.b-=this.v?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function sg(a){var b=hf(this,a);a=lf(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);De(this,c,a,b);this.b-=this.v?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} +function tg(a){var b=mf(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.G=this.H=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.H=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.H=32768,this.G=65536,this.b-=7}function ug(){this.ra(24,0,-9);this.b-=20} +function vg(){this.w&49152?(this.R|=128,this.ra(4,0,-8)):(this.sa&&1120==this.ia&&this.sa.setData(this.g[0],!0),this.F?wg(this.F):this.Z());this.b-=7}function xg(){this.ra(16,0,-9);this.b-=20}var yg=[0,7,7,10,7,11,9,13];function zg(a){this.ja=this.b;te(this,kf(this,a));this.b=this.ja-yg[this.v]}var Ag=[0,14,14,17,14,18,16,20];function Bg(a){this.ja=this.b;var b=kf(this,a);a=a>>6&7;Ee(this,this.g[a]);this.g[a]=this.g[7];te(this,b);this.b=this.ja-Ag[this.v]} +var Cg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Dg(a){var b=jf(this,a);this.ja=this.b;pf(this,a,b,this.Da);this.b=this.ja-Cg[(this.X?8:0)+this.v]+(7!=this.j||this.v?0:2)}function Eg(a){var b=hf(this,a);of(this,a,b,65535,this.Da);this.b-=this.v?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Fg=[7,13,13,17,14,18,17,21]; +function Gg(a){var b=mf(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.H=0;this.G=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)te(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Ng(a){T(this,a,jf(this,a),Of);this.b-=this.v?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Og(a){T(this,a,0,Qf);this.b-=this.v?9:3+(7==this.j?2:0)}function Pg(){this.ra(28,0,-9)} +function Qg(){this.sa&&(this.sa.Gc(this.g[7],!0),this.sa.setData(this.g[0],!0));this.i|=8;ze(this,-2);this.b-=3}function Rg(a){T(this,a,this.g[(a>>6&7)+this.bc],Rf);this.b-=this.v?9:3+(7==this.j?2:0)}function U(a){var b;if(b=this.F)b=this.F,B(b,1)?(C(b,"undefined opcode "+O(b,a),!0,!0),b=wg(b)):b=!1;b||this.ra(8,0,-9)}function pe(a){Sg[a>>12].call(this,a)}function Tg(a){Ug[a>>6&3].call(this,a)}function Vg(a){Wg[a>>6&3].call(this,a)}function Xg(a){Yg[a>>6&3].call(this,a)} +function Zg(a){$g[a&15].call(this,a)}function ah(a){bh[a&15].call(this,a)}function ch(a){dh[a>>6&3].call(this,a)}function eh(a){fh[a>>6&3].call(this,a)}function gh(a){hh[a>>6&3].call(this,a)} +var Sg=[function(a){ih[a>>8&15].call(this,a)},Dg,rg,ag,Xf,Zf,Sf,U,function(a){jh[a>>8&15].call(this,a)},Eg,sg,bg,Yf,$f,Ng,U],ih=[function(a){kh[a>>4&15].call(this,a)},ng,kg,cg,dg,ig,eg,gg,Bg,Bg,Tg,Vg,Xg,U,U,U],Ug=[function(a){pf(this,a,0,this.jb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,Cf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,1,Gf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,1,Ef);this.b-=this.v?9:3+(7==this.j?2:0)}],Wg=[function(a){T(this,a,0,If); +this.b-=this.v?11:6},function(a){T(this,a,ve(this)?1:0,sf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,ve(this)?1:0,Of);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=mf(this,a);this.jb(a);this.b-=this.v?4:3+(7==this.j?2:0)}],Yg=[function(a){T(this,a,0,Mf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,Kf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,wf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,uf);this.b-=this.v?9:3+(7==this.j?2:0)}],kh= +[function(a){lh[a&15].call(this,a)},U,U,U,zg,zg,zg,zg,Jg,U,Zg,ah,Og,Og,Og,Og],lh=[vg,Qg,Kg,mg,xg,Ig,U,U,U,U,U,U,U,U,U,U],$g=[Hg,function(){this.G=0;this.b-=5},function(){this.H=0;this.b-=5},qg,function(){this.L=1;this.b-=5},qg,qg,qg,function(){this.I=0;this.b-=5},qg,qg,qg,qg,qg,qg,qg],bh=[Hg,function(){this.G=65536;this.b-=5},function(){this.H=32768;this.b-=5},Lg,function(){this.L=0;this.b-=5},Lg,Lg,Lg,function(){this.I=32768;this.b-=5},Lg,Lg,Lg,Lg,Lg,Lg,Lg],jh=[lg,jg,fg,hg,og,pg,Vf,Wf,ug,Pg,ch,eh, +gh,U,U,U],dh=[function(a){of(this,a,0,255,this.jb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){nf(this,a,0,Df);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){nf(this,a,1,Hf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){nf(this,a,1,Ff);this.b-=this.v?9:3+(7==this.j?2:0)}],fh=[function(a){nf(this,a,0,Jf);this.b-=this.v?11:6},function(a){nf(this,a,ve(this)?1:0,tf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){nf(this,a,ve(this)?1:0,Pf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=lf(this, +a);this.jb(a<<8);this.b-=this.v?4:3+(7==this.j?2:0)}],hh=[function(a){nf(this,a,0,Nf);this.b-=this.v?9+(this.oc&1):3+(7==this.j?2:0)},function(a){nf(this,a,0,Lf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){nf(this,a,0,xf);this.b-=this.v?9+(this.oc&1):3+(7==this.j?2:0)},function(a){nf(this,a,0,vf);this.b-=this.v?9:3+(7==this.j?2:0)}];function qe(a){mh[a>>12].call(this,a)} +var mh=[function(a){nh[a>>8&15].call(this,a)},Dg,rg,ag,Xf,Zf,Sf,function(a){oh[a>>8&15].call(this,a)},function(a){ph[a>>8&15].call(this,a)},Eg,sg,bg,Yf,$f,Ng,U],nh=[function(a){qh[a>>4&15].call(this,a)},ng,kg,cg,dg,ig,eg,gg,Bg,Bg,Tg,Vg,Xg,function(a){rh[a>>6&3].call(this,a)},U,U],rh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.ma(a|this.Ha);te(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Le(this,a,0);this.Da(a);Ee(this,a);this.b-=11},function(a){var b=Ge(this); +this.ja=this.b;this.Da(b);Me(this,a,0,b);this.b=this.ja-Fg[this.v]},function(a){pf(this,a,ye(this)?65535:0,this.Da);this.b-=this.v?9:3+(7==this.j?2:0)}],qh=[function(a){sh[a&15].call(this,a)},U,U,U,zg,zg,zg,zg,Jg,function(a){!(a&8)||1145>this.ia?U.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},Zg,ah,Og,Og,Og,Og],sh=[vg,Qg,function(){Fe(this);this.i|=this.w&16;this.b-=13},mg,xg,Ig,Kg,function(a){U.call(this,a)},U,U,U,U,U,U,U,U],oh=[Gg,Gg,tg,tg,Tf,Tf,Uf,Uf, +Rg,Rg,U,U,U,U,Mg,Mg],ph=[lg,jg,fg,hg,og,pg,Vf,Wf,ug,Pg,ch,eh,gh,function(a){1145>this.ia?U.call(this,a):th[a>>6&3].call(this,a)},U,U],th=[function(a){U.call(this,a)},function(a){a=Le(this,a,65536);this.Da(a);Ee(this,a);this.b-=11},function(a){var b=Ge(this);this.ja=this.b;this.Da(b);Me(this,a,65536,b);this.b=this.ja-Fg[this.v]},function(a){U.call(this,a)}]; +function uh(a){q.call(this,"ROM",a,0,128);this.ea=this.g=null;this.v=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.C=Qa(this.j);if(this.j){a=this.j;var b=Ra(this.C);"json"!=b&&"hex"!=b&&(a=eb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;cb(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(va(c.nb,a,b),(a=db(a,b))?(c.g=a.ca,c.ea=a.ea):c.j=null);vh(c)})}}p(uh,q); +h=uh.prototype;h.ua=function(a,b,c,d){this.D=b;this.f=c;this.F=d;vh(this)};h.wa=function(){this.ea&&(this.F&&wh(this.F,this.id,this.v,this.b,this.ea),delete this.ea);return!0};h.va=function(){return!0}; +function vh(a){if(!Ka(a)){if(a.j){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Ea(a,"ROM size ("+I(a.g.length,8,!0)+") does not match specified size ("+I(a.b,8,!0)+")");else{var b;a:{b=a.v;if(57344<=b&&b<57344+Nc){var c={},c=(c[b]=[uh.prototype.Me,uh.prototype.Xf,null,null,null,a.b>>1],c);if(Xb(a.D,a,c)){a.status("Added "+a.b+"-byte ROM at "+H(b));b=a.w=!0;break a}}else if(Tc(a.D,b,a.b,Jd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){C(a,"invalid block at offset "+Pa(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,E=r-=6;0=b.length){C(a,"insufficient data for block at offset "+Pa(n),4096); +break}m+=b[l++]&255;if(m&255){C(a,"invalid checksum ("+I(m,2,!0)+") for block at offset "+Pa(n),4096);break}if(E)for(C(a,"loading "+Pa(E)+" bytes at "+Pa(u)+"-"+Pa(u+E),4096);E--;)bd(a.D,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&C(a,"starting address: "+Pa(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=ta.Jc&&c<=ta.Gd&&(b=c-(ta.Jc-ta.ud));b&&(a.preventDefault&&a.preventDefault(),d.ic(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ta.wd&&(b=ta.vd);d.ic(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ic(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +h.ua=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;var e=this;this.R=kd(this.f,this.M?-1:48,4,262144);this.S=hd(this.f,function(){var a;a=-1;e.v.length&&(a=e.v.shift()&255,C(e,"receiveByte("+I(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),jd(e.f,e.S,1E3/Math.round(e.T/10)));0<=a&&(e.G=a,e.b&128?e.G|=49152:e.b|=128,e.b&64&&id(c,e.R))});this.O=kd(this.f,this.M?-1:52,4,262144);this.X=hd(this.f,function(){e.g|=128;e.g&64&&id(c,e.O)});Xb(b,this,Dh,this.M?64832+8*(this.M-1)-65392:0);Zb(b,this.reset.bind(this)); +A(this)};h.md=function(a){if(!this.i){var b=$d(this.J,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Za(c[0]);if(d!=this.mb)return;c=Za(c[1]);if(this.i=Ba(c)){var e=this.i.exports;if(e){var f=e.connect;f&&f.call(this.i,this.I);if(this.H=e.receiveData){this.I=a;this.P=e.receiveStatus;this.status("Connected "+this.nb+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +h.wa=function(a,b){if(!b)if(this.md(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.va=function(a){return a?this.save():!0};h.reset=function(){Eh(this)};h.save=function(){var a=new M(this);a.set(0,[]);return a.data()};h.restore=function(){return Eh(this)};function Eh(a){a.G=0;a.b=8192;a.g=128;a.v=[];return!0} +h.ic=function(a){if("number"==typeof a)this.v.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.C%a,this.W&&(b=Ya("",c)));this.V&&!this.C&&c&&(b=String.fromCharCode(this.V)+b);this.j.value+=b;this.j.scrollTop=this.j.scrollHeight;this.C+=c}}else if(null!=this.w){if(10== +a||1024<=this.w.length)this.u(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}jd(this.f,this.X,1E3/Math.round(this.aa/10));this.g&=-129};var Ch="buffer",Fh={},Dh=(Fh[65392]=[null,null,Bh.prototype.ze,Bh.prototype.Kf,"RCSR"],Fh[65394]=[null,null,Bh.prototype.ye,Bh.prototype.Jf,"RBUF"],Fh[65396]=[null,null,Bh.prototype.ef,Bh.prototype.pg,"XCSR"],Fh[65398]=[null,null,Bh.prototype.df,Bh.prototype.og,"XBUF"],Fh); +wb(function(){for(var a=y(document,x,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.B[b]=c,!0;case "readTape":e=Jh;case "loadTape":return e||(e=Kh),this.B[b]=c,c.onclick= +function(){var a=d.B.listTapes;a&&Lh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.B[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Lh(d,Qa(b,!0),b,Kh,a)}return!1};return!0;case Mh:return this.B[b]=c,!0}return!1}; +h.ua=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;this.I=Nh(a);var e=this;if(a=Gh(this,$d(this.J,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.H=kd(this.f,56,4,4096);this.R=hd(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Cc.indexOf("/api/v1/dump")&&(e=Ra(c),f="json"==e||"gz"==e?encodeURI(c):eb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!cb(f,null,!0,function(e,f,g){var k=0>g&&!!a.J&&!a.J.A.fa;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(va(a.nb,e,f),(e=db(e,f))&&Yh(a,b,c,d,e.ca,e.Aa, +e.za));a.A.fb=!1;a.g&&(a.g--,a.g||A(a));Vh(a)})}function Qh(a,b,c,d){if((a=a.B.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.Y);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ra(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Sa(c,"/")&&(d="dir"),f=eb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.gc?"":e)+"&format=json"));return!!cb(f, +null,!0,function(b,c,d){fi(a,b,c,d)})} +function fi(a,b,c,d){var e=null,f=0>d&&!!a.J&&!a.J.A.fa;a.j=!1;if(d)a.controller.N('Unable to load disk "'+a.Na+'" (error '+d+": "+b+")",f);else{va(a.controller.nb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)v(k[0]);else{a.Y=k.length;a.da=k[0].length;a.ba=k[0][0].length;var l=k[0][0][0];a.pa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;E>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ja?f=a.Ra+a.Ja&&(a.Ja+=f-(a.Ra+a.Ja)+1):(a.Ra=f,a.Ja=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Na+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=ei(this,a++);)hi(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function hi(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var Zh=0;function R(a){q.call(this,"RK11",a,0,65536);this.G=ii(this,a.autoMount);this.C=0;this.i=Array(8);this.H=!ob("Mobi")&&window&&"FileReader"in window;this.gb=null;this.L=this.g=this.b=this.w=this.v=this.j=this.I=0}p(R,q); -function ii(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=R.prototype; -h.pa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.B[b]=c,c.onchange=function(){var a=d.B.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.B[b]=c,c.onchange=function(){var a=G(c.value,10);null!=a&&ji(d, -a)},!0;case "loadDisk":return this.B[b]=c,c.onclick=function(){var a=d.B.listDisks;a&&a.options&&Di(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.B[b]=c,c.onclick=function(){var a,b=d.B.listDrives,b=b&&G(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.O("Unable to boot the selected drive"):a.ia?(qe(d.f,0,!0),(a=d.Vc(a,0,0,0,512,0,2))&&d.O("Unable to read the boot sector ("+a+")")):d.O("Load a disk into the drive first")},!0;case "saveDisk":if(!this.H){c.parentNode.removeChild(c); -break}this.B[b]=c;c.onclick=function(){var a=d.B.listDrives;a&&a.options&&d.i&&((a=d.i[G(a.value,10)||0])?(a=a.ia)?(a=rb(gi(a),a.gc.replace(".json",".img")),v(a)):d.O("No disk loaded in drive."):d.O("No disk drive selected."))};return!0;case "mountDisk":if(this.H)return this.B[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Di(d,Pa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ta=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;if(a=ii(this,Zd(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.G[e]=a[e]);Fi(this);this.gb=jd(this.f,144,5,65536);Wb(b,this,Gi);Yb(b,this.reset.bind(this));Hi(this,"None",Ii,!0);this.H&&Hi(this,"Local Disk",Ji);Hi(this,"Remote Disk",Ki);Li(this)||A(this)}; -h.za=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.J.C){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";ji(this,0)}}return!0};h.ya=function(a){return a?this.save():!0};h.reset=function(){Fi(this)};h.save=function(){return(new M(this)).data()}; -h.restore=function(a){return Fi(this,a[0])};function Li(a,b){b||(a.C=0);for(var c in a.G){var d=a.G[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.B.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.i.length)a.O("Unable to load the selected drive");else if(c)if(c==Ji)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Ki){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Pa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ni(a,e,b,c,!1,d)}else Mi(a,e)} -function Ni(a,b,c,d,e,f){var g=-1,k=a.i[b];k.Aa.toLowerCase()!=d.toLowerCase()&&(g++,Mi(a,b,!0),k.tb?a.O("RK11 busy"):(k.tb=!0,e&&(k.sb=!0,a.C++,B(a)&&C(a,"auto-loading disk: "+c)),k.Xa=!!f,bi(new Yh(a,k,"preload"),c,d,f,a.Ad)&&g++));return g} -h.Ad=function(a,b,c,d,e){a.tb=!1;b&&(b.X>a.X||b.da>a.da)&&(this.O('Disk "'+c+'" too large for drive '+("RK"+a.fb)),b=null);b?(a.ia=b,a.Na=c,a.Aa=d,this.O('Loaded disk "'+c+'" in drive '+("RK"+a.fb),a.sb||e),this.J&&ie(this.J)):a.Xa=!1;a.sb&&(a.sb=!1,--this.C||A(this));ji(this,a.fb)}; -function Hi(a,b,c,d){if((a=a.B.listDisks)&&a.options){for(var e=0;e=a.X){m=64;break}n=a.seek(b,c,d+1);if(!n){m=4096;break}r=0;++d>=a.aa&&(d=0,++c>=a.da&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=32;break}if(!k&&(qc(this.D,Ee(this.f,f),u|t<<8),fd(this.D))){m=1024;break}r>=a.oa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Bd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ia;var n=null,r;a||(m=128,e=0);for(;e;){var u=Dc(this.D,Ee(this.f,f));if(fd(this.D)){m=1024;break}if(!n){if(b>=a.X){m=64;break}n=a.seek(b,c,d+1,!0);if(!n){m=4096;break}r=0;++d>=a.aa&&(d=0,++c>=a.da&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=32;break}if(u!=(t|E<<8)){m=1;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=32;break}r>=a.oa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.zd=function(a,b,c,d,e,f){this.v=f&65535;this.b=this.b&-49|f>>12&48;this.w=65536-e&65535;this.j=this.j&-16|d&15;this.g|=a;Oi(this);return!0};function Oi(a){a.b&=-32769;a.g&&(a.g|=32768,a.b|=32768,a.g&32736&&(a.b|=16384),B(a)&&C(a,a.type+": ERROR: "+H(a.g)))}h.Ee=function(){return this.L};h.Pf=function(){};h.Fe=function(){return this.g};h.Qf=function(){};h.Be=function(){return this.b&61438}; +function hi(a,b){var c=a.da*a.ba,d=b/c|0;return dg)break;e|=g<=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.N("Unable to restore disk '"+this.Na+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=hi(this,a++);)ki(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function ki(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var bi=0;function R(a){q.call(this,"RK11",a,0,65536);this.G=Ei(this,a.autoMount);this.C=0;this.i=Array(8);this.H=!pb("Mobi")&&window&&"FileReader"in window;this.hb=null;this.L=this.g=this.b=this.w=this.v=this.j=this.I=0}p(R,q); +function Ei(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=R.prototype; +h.qa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.B[b]=c,c.onchange=function(){var a=d.B.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.B[b]=c,c.onchange=function(){var a=G(c.value,10);null!=a&&Gi(d, +a)},!0;case "loadDisk":return this.B[b]=c,c.onclick=function(){var a=d.B.listDisks;a&&a.options&&Hi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.B[b]=c,c.onclick=function(){var a,b=d.B.listDrives,b=b&&G(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.N("Unable to boot the selected drive"):a.ka?(se(d.f,0,!0),(a=d.Vc(a,0,0,0,512,0,2))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.H){c.parentNode.removeChild(c); +break}this.B[b]=c;c.onclick=function(){var a=d.B.listDrives;a&&a.options&&d.i&&((a=d.i[G(a.value,10)||0])?(a=a.ka)?(a=sb(ji(a),a.kc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.H)return this.B[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Hi(d,Qa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ua=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;if(a=Ei(this,$d(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.G[e]=a[e]);Ii(this);this.hb=kd(this.f,144,5,65536);Xb(b,this,Ji);Zb(b,this.reset.bind(this));Ki(this,"None",Li,!0);this.H&&Ki(this,"Local Disk",Mi);Ki(this,"Remote Disk",Ni);Oi(this)||A(this)}; +h.wa=function(a,b){if(!b){if(!a){if(this.reset(),this.J.C){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Gi(this,0)}}return!0};h.va=function(a){return a?this.save():!0};h.reset=function(){Ii(this)};h.save=function(){return(new M(this)).data()}; +h.restore=function(a){return Ii(this,a[0])};function Oi(a,b){b||(a.C=0);for(var c in a.G){var d=a.G[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.B.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.i.length)a.N("Unable to load the selected drive");else if(c)if(c==Mi)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Ni){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Qa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Qi(a,e,b,c,!1,d)}else Pi(a,e)} +function Qi(a,b,c,d,e,f){var g=-1,k=a.i[b];k.Ca.toLowerCase()!=d.toLowerCase()&&(g++,Pi(a,b,!0),k.ub?a.N("RK11 busy"):(k.ub=!0,e&&(k.tb=!0,a.C++,B(a)&&C(a,"auto-loading disk: "+c)),k.Xa=!!f,ei(new ai(a,k,"preload"),c,d,f,a.Ad)&&g++));return g} +h.Ad=function(a,b,c,d,e){a.ub=!1;b&&(b.Y>a.Y||b.da>a.da)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.gb)),b=null);b?(a.ka=b,a.Na=c,a.Ca=d,this.N('Loaded disk "'+c+'" in drive '+("RK"+a.gb),a.tb||e),this.J&&je(this.J)):a.Xa=!1;a.tb&&(a.tb=!1,--this.C||A(this));Gi(this,a.gb)}; +function Ki(a,b,c,d){if((a=a.B.listDisks)&&a.options){for(var e=0;e=a.Y){m=64;break}n=a.seek(b,c,d+1);if(!n){m=4096;break}r=0;++d>=a.ba&&(d=0,++c>=a.da&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=32;break}if(!k&&(rc(this.D,He(this.f,f),u|t<<8),gd(this.D))){m=1024;break}r>=a.pa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Bd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ka;var n=null,r;a||(m=128,e=0);for(;e;){var u=Ec(this.D,He(this.f,f));if(gd(this.D)){m=1024;break}if(!n){if(b>=a.Y){m=64;break}n=a.seek(b,c,d+1,!0);if(!n){m=4096;break}r=0;++d>=a.ba&&(d=0,++c>=a.da&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=32;break}if(u!=(t|E<<8)){m=1;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=32;break}r>=a.pa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.zd=function(a,b,c,d,e,f){this.v=f&65535;this.b=this.b&-49|f>>12&48;this.w=65536-e&65535;this.j=this.j&-16|d&15;this.g|=a;Ri(this);return!0};function Ri(a){a.b&=-32769;a.g&&(a.g|=32768,a.b|=32768,a.g&32736&&(a.b|=16384),B(a)&&C(a,a.type+": ERROR: "+H(a.g)))}h.Ee=function(){return this.L};h.Pf=function(){};h.Fe=function(){return this.g};h.Qf=function(){};h.Be=function(){return this.b&61438}; h.Mf=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){a=!0;var b,c,d="",e=(this.j&57344)>>13,f=this.i[e],g,k,l,m,n,r;this.b&=-8321;this.g&=-4;switch(c=this.b&14){case 0:B(this)&&C(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=128;break;case 10:d="RCHK";case 4:d||(d="READ"),b=this.Vc;case 6:d||(d="WCHK");case 2:d||(d="WRITE");b||(b=this.Bd);g=(this.j&8160)>>5;k=(this.j&16)>>4;l=this.j&15;m=65536-this.w&65535;n=(this.b&48)<<12|this.v;r=this.b&2048?0:2;B(this)&&C(this,this.type+": "+ -d+"("+g+":"+k+":"+l+") "+H(n)+"--"+H(n+(m<<1)),!0,!0);if(g>=f.X){this.g|=64;break}if(l>=f.aa){this.g|=32;break}a=b.call(this,f,g,k,l,m,n,r,6<=c,this.zd.bind(this));break;case 8:g=(this.j&8160)>>5;B(this)&&C(this,this.type+": SEEK("+g+")",!0);g'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.B[b]=c,c.onchange=function(){var a=G(c.value,10);null!=a&&Ri(d, -a)},!0;case "loadDisk":return this.B[b]=c,c.onclick=function(){var a=d.B.listDisks;a&&a.options&&Si(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.B[b]=c,c.onclick=function(){var a,b=d.B.listDrives,b=b&&G(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.O("Unable to boot the selected drive"):a.ia?(qe(d.f,0,!0),(a=d.Wc(a,0,0,0,512,0))&&d.O("Unable to read the boot sector ("+a+")")):d.O("Load a disk into the drive first")},!0;case "saveDisk":if(!this.I){c.parentNode.removeChild(c); -break}this.B[b]=c;c.onclick=function(){var a=d.B.listDrives;a&&a.options&&d.g&&((a=d.g[G(a.value,10)||0])?(a=a.ia)?(a=rb(gi(a),a.gc.replace(".json",".img")),v(a)):d.O("No disk loaded in drive."):d.O("No disk drive selected."))};return!0;case "mountDisk":if(this.I)return this.B[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Si(d,Pa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ta=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;if(a=Qi(this,Zd(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.H[e]=a[e]);Ti(this);this.gb=jd(this.f,112,5,131072);Wb(b,this,Ui);Yb(b,this.reset.bind(this));Vi(this,"None",Wi,!0);this.I&&Vi(this,"Local Disk",Xi);Vi(this,"Remote Disk",Yi);Zi(this)||A(this)}; -h.za=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.J.C){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Ri(this,0)}}return!0};h.ya=function(a){return a?this.save():!0};h.reset=function(){Ti(this)};h.save=function(){return(new M(this)).data()}; -h.restore=function(a){return Ti(this,a[0])};function Zi(a,b){b||(a.G=0);for(var c in a.H){var d=a.H[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.B.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.O("Unable to load the selected drive");else if(c)if(c==Xi)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Yi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Pa(c);a.status("Attempting to load "+c+' as "'+b+'"')}aj(a,e,b,c,!1,d)}else $i(a,e)} -function aj(a,b,c,d,e,f){var g=-1,k=a.g[b];k.Aa.toLowerCase()!=d.toLowerCase()&&(g++,$i(a,b,!0),k.tb?a.O("RL11 busy"):(k.tb=!0,e&&(k.sb=!0,a.G++,B(a)&&C(a,"auto-loading disk: "+c)),k.Xa=!!f,bi(new Yh(a,k,"preload"),c,d,f,a.Dd)&&g++));return g} -h.Dd=function(a,b,c,d,e){a.tb=!1;b&&(b.X>a.X||b.da>a.da)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.fb)),b=null);b?(a.ia=b,a.Na=c,a.Aa=d,this.O('Loaded disk "'+c+'" in drive '+("RL"+a.fb),a.sb||e),this.J&&ie(this.J)):a.Xa=!1;a.sb&&(a.sb=!1,--this.G||A(this));Ri(this,a.fb)}; -function Vi(a,b,c,d){if((a=a.B.listDisks)&&a.options){for(var e=0;e(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}qc(this.D,Ee(this.f,f),n|r<<8);if(fd(this.D)){k=8192;break}f+=2;e--;if(m>=a.oa&&(l=null,++d>=a.aa&&(d=0,++c>=a.da&&(c=0,++b>=a.X)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Ed=function(a,b,c,d,e,f,g){var k=0;a=a.ia;var l=null,m;a||(k=5120,e=0);for(;e;){var n=Dc(this.D,Ee(this.f,f));if(fd(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.oa&&(l=null,++d>=a.aa&&(d=0,++c>=a.da&&(c=0,++b>=a.X)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +d+"("+g+":"+k+":"+l+") "+H(n)+"--"+H(n+(m<<1)),!0,!0);if(g>=f.Y){this.g|=64;break}if(l>=f.ba){this.g|=32;break}a=b.call(this,f,g,k,l,m,n,r,6<=c,this.zd.bind(this));break;case 8:g=(this.j&8160)>>5;B(this)&&C(this,this.type+": SEEK("+g+")",!0);g'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.B[b]=c,c.onchange=function(){var a=G(c.value,10);null!=a&&Ui(d, +a)},!0;case "loadDisk":return this.B[b]=c,c.onclick=function(){var a=d.B.listDisks;a&&a.options&&Vi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.B[b]=c,c.onclick=function(){var a,b=d.B.listDrives,b=b&&G(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.N("Unable to boot the selected drive"):a.ka?(se(d.f,0,!0),(a=d.Wc(a,0,0,0,512,0))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.I){c.parentNode.removeChild(c); +break}this.B[b]=c;c.onclick=function(){var a=d.B.listDrives;a&&a.options&&d.g&&((a=d.g[G(a.value,10)||0])?(a=a.ka)?(a=sb(ji(a),a.kc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.I)return this.B[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Vi(d,Qa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ua=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;if(a=Ti(this,$d(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.H[e]=a[e]);Wi(this);this.hb=kd(this.f,112,5,131072);Xb(b,this,Xi);Zb(b,this.reset.bind(this));Yi(this,"None",Zi,!0);this.I&&Yi(this,"Local Disk",$i);Yi(this,"Remote Disk",aj);bj(this)||A(this)}; +h.wa=function(a,b){if(!b){if(!a){if(this.reset(),this.J.C){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Ui(this,0)}}return!0};h.va=function(a){return a?this.save():!0};h.reset=function(){Wi(this)};h.save=function(){return(new M(this)).data()}; +h.restore=function(a){return Wi(this,a[0])};function bj(a,b){b||(a.G=0);for(var c in a.H){var d=a.H[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.B.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if(c==$i)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==aj){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Qa(c);a.status("Attempting to load "+c+' as "'+b+'"')}dj(a,e,b,c,!1,d)}else cj(a,e)} +function dj(a,b,c,d,e,f){var g=-1,k=a.g[b];k.Ca.toLowerCase()!=d.toLowerCase()&&(g++,cj(a,b,!0),k.ub?a.N("RL11 busy"):(k.ub=!0,e&&(k.tb=!0,a.G++,B(a)&&C(a,"auto-loading disk: "+c)),k.Xa=!!f,ei(new ai(a,k,"preload"),c,d,f,a.Dd)&&g++));return g} +h.Dd=function(a,b,c,d,e){a.ub=!1;b&&(b.Y>a.Y||b.da>a.da)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.gb)),b=null);b?(a.ka=b,a.Na=c,a.Ca=d,this.N('Loaded disk "'+c+'" in drive '+("RL"+a.gb),a.tb||e),this.J&&je(this.J)):a.Xa=!1;a.tb&&(a.tb=!1,--this.G||A(this));Ui(this,a.gb)}; +function Yi(a,b,c,d){if((a=a.B.listDisks)&&a.options){for(var e=0;e(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}rc(this.D,He(this.f,f),n|r<<8);if(gd(this.D)){k=8192;break}f+=2;e--;if(m>=a.pa&&(l=null,++d>=a.ba&&(d=0,++c>=a.da&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +h.Ed=function(a,b,c,d,e,f,g){var k=0;a=a.ka;var l=null,m;a||(k=5120,e=0);for(;e;){var n=Ec(this.D,He(this.f,f));if(gd(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.pa&&(l=null,++d>=a.ba&&(d=0,++c>=a.da&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; h.Cd=function(a,b,c,d,e,f){this.C=f&65535;this.b=this.b&-49|f>>12&48;this.v=f>>16&63;this.j=this.i=b<<7|(c?64:0)|d&63;this.w=65536-e&65535;a&&(this.b=this.b|a|32768);return!0};h.Je=function(){return this.b&65535}; -h.Uf=function(a){this.b=this.b&-1023|a&1022;this.v=this.v&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c="",d=this.g[(this.b&768)>>8],e=d.ia,f,g,k;this.b&=-2;switch(this.b&14){case 4:this.w&8&&(this.b&=63);this.w=d.status|this.j&64|(e&&512==e.X?128:0);break;case 6:1==(this.i&3)&&(b=this.i&65408,c=(this.i&16)<<2,this.j=this.i&4?this.j+b:this.j-b,this.i=this.j=this.j&65408|c);break;case 8:this.w=this.j;break;case 12:c="READ",b=this.Wc;case 10:c||(c="WRITE"),b||(b=this.Ed),f=this.i>>7,g=this.i&64?1:0,k= -this.i&63,!e||f>=e.X||k>=e.aa?this.b|=37888:(a=65536-this.w&65535,e=(this.v&63)<<16|this.C,B(this)&&C(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+H(e)+"--"+H(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.Cd.bind(this)))}a&&(this.b|=129,this.b&64&&hd(this.f,this.gb))}};h.He=function(){return this.C};h.Sf=function(a){this.C=a&65534};h.Ke=function(){return this.i};h.Vf=function(a){this.i=a};h.Le=function(){return this.w};h.Wf=function(a){this.w=a};h.Ie=function(){return this.v}; -h.Tf=function(a){this.v=a&63;this.b=this.b&-49|(this.v&3)<<4};var Wi="",Xi="?",Yi="??",bj={},Ui=(bj[63744]=[null,null,Fd.prototype.Je,Fd.prototype.Uf,"RLCS"],bj[63746]=[null,null,Fd.prototype.He,Fd.prototype.Sf,"RLBA"],bj[63748]=[null,null,Fd.prototype.Ke,Fd.prototype.Vf,"RLDA"],bj[63750]=[null,null,Fd.prototype.Le,Fd.prototype.Wf,"RLMP"],bj[63752]=[null,null,Fd.prototype.Ie,Fd.prototype.Tf,"RLBE"],bj); -function cj(a){q.call(this,"Debugger",a);this.xa=+a.base||16;this.ga=!1;this.w=0;this.P=!1;this.v=-1;this.j=[];this.T={}}p(cj,q);cj.prototype.hd=function(){return-1};cj.prototype.jd=function(){}; -function dj(a,b,c,d){if(c)if(b){0>a.v&&a.j.length&&(a.v=0);if(0>a.v||b!=a.j[a.v])a.j.splice(0,0,b),a.v=0;a.v--}else a.P?b="end":b=a.j[a.v+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(Ya(b.substring(c,f))),c=f+1}}return a} -function ej(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +h.Uf=function(a){this.b=this.b&-1023|a&1022;this.v=this.v&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c="",d=this.g[(this.b&768)>>8],e=d.ka,f,g,k;this.b&=-2;switch(this.b&14){case 4:this.w&8&&(this.b&=63);this.w=d.status|this.j&64|(e&&512==e.Y?128:0);break;case 6:1==(this.i&3)&&(b=this.i&65408,c=(this.i&16)<<2,this.j=this.i&4?this.j+b:this.j-b,this.i=this.j=this.j&65408|c);break;case 8:this.w=this.j;break;case 12:c="READ",b=this.Wc;case 10:c||(c="WRITE"),b||(b=this.Ed),f=this.i>>7,g=this.i&64?1:0,k= +this.i&63,!e||f>=e.Y||k>=e.ba?this.b|=37888:(a=65536-this.w&65535,e=(this.v&63)<<16|this.C,B(this)&&C(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+H(e)+"--"+H(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.Cd.bind(this)))}a&&(this.b|=129,this.b&64&&id(this.f,this.hb))}};h.He=function(){return this.C};h.Sf=function(a){this.C=a&65534};h.Ke=function(){return this.i};h.Vf=function(a){this.i=a};h.Le=function(){return this.w};h.Wf=function(a){this.w=a};h.Ie=function(){return this.v}; +h.Tf=function(a){this.v=a&63;this.b=this.b&-49|(this.v&3)<<4};var Zi="",$i="?",aj="??",ej={},Xi=(ej[63744]=[null,null,Gd.prototype.Je,Gd.prototype.Uf,"RLCS"],ej[63746]=[null,null,Gd.prototype.He,Gd.prototype.Sf,"RLBA"],ej[63748]=[null,null,Gd.prototype.Ke,Gd.prototype.Vf,"RLDA"],ej[63750]=[null,null,Gd.prototype.Le,Gd.prototype.Wf,"RLMP"],ej[63752]=[null,null,Gd.prototype.Ie,Gd.prototype.Tf,"RLBE"],ej); +function fj(a){q.call(this,"Debugger",a);this.Ba=+a.base||16;this.ga=!1;this.w=0;this.P=!1;this.v=-1;this.j=[];this.T={}}p(fj,q);fj.prototype.hd=function(){return-1};fj.prototype.jd=function(){}; +function gj(a,b,c,d){if(c)if(b){0>a.v&&a.j.length&&(a.v=0);if(0>a.v||b!=a.j[a.v])a.j.splice(0,0,b),a.v=0;a.v--}else a.P?b="end":b=a.j[a.v+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(Za(b.substring(c,f))),c=f+1}}return a} +function hj(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function fj(a,b,c){var d;if(b){b=gj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=I(c,0,!0)+" "+c+". "+H(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.u((null!=b?b+": ":"")+d);return e} -function kj(a,b){if(b)return jj(a,b,a.T[b]);var c=0;for(b in a.T)jj(a,b,a.T[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function lj(a){cj.call(this,a);this.Da=!1;this.ga=!0;this.H=V();this.Ca=V();this.N=V();this.C=[];this.g=this.L=this.G=[];mj(this);this.R=this.ba=0;this.i=[];this.na=void 0;nj(this);this.F=this;this.la={};this.ha=this.cd=0;this.S=null;this.M=[];oj(this,a.messages);this.sa=a.commands;this.Ga=pj;this.W=[];this.I=0;this.Ha=this.ra=null;this.w=this.Fa=this.Ea=this.Y=this.ma=0;this.b=this.V=null;var b=this;window?void 0===window[x]&&(window[x]=function(a){return de(b,a)}):void 0===global[x]&&(global[x]= -function(a){return de(b,a)})}p(lj,cj);function qj(a){a=a&&a.K;null==a&&(a=-1);return a}function V(a,b,c){return{K:void 0===a?null:a,Ka:void 0===b?!1:b,Qa:!1,xa:c}}h=lj.prototype;h.Fc=function(a,b){a.K=b;a.Qa=!1;a.xa=void 0;return a};function rj(a){return[a.K,a.Ka,a.xa,a.Qa,a.fc]}function sj(a,b){var c=V(b[0],b[1],b[2]);c.Qa=b[3];b[4]&&(c.$c=dj(a,c.fc=b[4]));return c} -h.ta=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.b=a.i;(a=Zd(a,"messages"))&&oj(this,a);1140>this.f.ba&&(this.W=this.W.concat(tj));1145>this.f.ba&&(this.W=this.W.concat(uj));ld(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=qj(vj(d,c));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.u("blockid physical blockaddr used size type");d.u("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.u("..."): -(c=n.type,m=Yc[c],n&&d.u(I(n.id,8)+" %"+I(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -h.jd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.na[a-8];else if(20>a)b=this.f.V[a-16];else{var c=this.f,d=this.b;switch(a){case Bj:b=ud(this.f);break;case Cj:b=c.Va;break;case Dj:b=c.R;break;case Ej:b=c.sa&65280;break;case Fj:b=od(c);break;case Gj:b=qd(c);break;case Hj:b=rd(c);break;case Ij:b=c.T;break;case Jj:d&&(b=d.ua);break;case Kj:d&&(b=d.vb);break;case Lj:d&&Ic(d)&&(b=d.Ya)}}return b}; -h.message=function(a,b){b&&(a+=" @"+yj(this,V(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.ha&1073741824)this.M.push(a);else{var c;if(this.ha&-2147483648&&this.f&&(c=this.f.A.U)||Ka(this,!0))this.Z(),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,je(a),a.rb=0,a.J&&J(a.J,void 0))}}; -function nj(a){var b;if(!nf(a))a.i&&a.i.length&&a.u("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Mj);for(b=0;b>8;a.u("trapped to "+O(a,c&255,1)+" ("+(0>d?Pb[-d]:O(a,d))+")")}a.H=V(a.f.g[7]);b&&1!=a.I?Qj(a):Rj(a)}}function Oj(a,b){var c;(c=!a.f||!Ja(a.f))||(c=a.f,c.A.fa?c=!0:(c.u(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.U?(b||a.u("cpu busy or unavailable, command ignored"),!1):!Ea(a.f)}h.za=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; -h.ya=function(a,b){b&&this.u(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){nj(this);this.Y=0;this.S=null;this.w=0;this.H=V(this.f.g[7]);this.A.U=!1;Sj(this);a||be(this)};h.save=function(){var a=new M(this);a.set(0,rj(this.H));a.set(1,rj(this.N));a.set(2,[this.j,this.P,this.ha]);a.set(3,this.C);return a.data()}; -h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=sj(this,a[b++]),this.N=sj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.ha|=a[b][2]);a[3]&&(this.C=a[3]);return!0};h.start=function(a,b){this.I||this.u("running");this.A.U=!0;this.Ea=a;this.Fa=b}; -h.stop=function(a,b){if(this.A.U){this.A.U=!1;this.w=b-this.Fa;if(!this.I){b="stopped";if(this.w){a-=this.Ea;var c=0d&&(d=Ec(a.f,b)),65535!=(d&65535)&&(a.Fc(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function tg(a){var b=a.f;if(b.A.U)throw re(b,a.f.P&65535),a.Z(),-1;return!1}function Td(a,b,c){Tj(a,b,c||1,a.L)&&a.Z(!0)}function Ud(a,b,c){Tj(a,b,c||1,a.G)&&a.Z(!0)} -function mj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):He(a.f,!1);a.L=["br"];if(a.G)for(b=1;b>>c.g],!0)):He(a.f,!0);a.G=["bw"];a.ma=0} -h.qb=function(a,b,c){var d=!0;c||Uj(this,a,b,!1,!0);if(a!=this.g){var e=qj(b);if(-1===e)this.u("invalid address: "+yj(this,b)),d=!1;else{var f=a==this.G;65535>>g.g].qb(e&g.i,f)}else e=this.f,(f?e.Xb++:e.Wb++)||pe(e)}}d&&(a.push(b),c?b.Qa=!0:(Vj(this,a,a.length-1,"set"),nj(this)));return d}; -function Uj(a,b,c,d,e){var f=!1;c=qj(c);for(var g=1;g>>d.g],b)):He(a.f,b));k.Qa||nj(a);break}}return f}function Wj(a,b){for(var c=1;c>23)&65535,z=O(t,u);else if(D==ck)u=u.K-((f&63)<<1)&65535,z=O(t,u);else if(D==dk)z=O(t,f&7,1);else if(D==ek)z=O(t,f&63,1);else if(D==fk)z=O(t,f&255,1);else if(D=f&E,E&gk&&(D>>=6,E>>=6),E&Y){var E=null,F=D& -hk;switch(D&ik){case 0:z=Aj(F);break;case 8:z="@"+Aj(F);E=jk(t,t.f.g[F]);break;case 16:7>F?z="("+Aj(F)+")+":(D=t.Oa(u,2),z="#"+O(t,D,0,!0));break;case 24:7>F?z="@("+Aj(F)+")+":(D=t.Oa(u,2),z="@#"+O(t,D,0,!0),E=jk(t,D));break;case 32:z="-("+Aj(F)+")";break;case 40:z="@-("+Aj(F)+")";break;case 48:D=t.Oa(u,2);z=O(t,D,0,!0)+"("+Aj(F)+")";7==F&&(z=O(t,D=D+u.K&65535),E=jk(t,D));break;case 56:D=t.Oa(u,2),z="@"+O(t,D)+"("+Aj(F)+")",7==F&&(z="@"+O(t,D=D+u.K&65535),E=jk(t,Ec(t.f,D)))}E&&(z=[z,E])}t=z;if(!t|| -!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.kb&&b=c.C&&(b=c.Ma[b&ed])&&(a=b[4]);return a}function kk(a,b){switch(b){case "N":a=ve(a.f);break;case "Z":a=ue(a.f);break;case "V":a=te(a.f);break;case "C":a=se(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} -function Z(a,b){var c="",d=a.f;if(8>b)c=Aj(b),c+="="+O(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+O(a,d.na[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+O(a,d.V[b-16]);else switch(b){case Bj:c="PS="+O(a,ud(d));break;case Cj:c="PI="+O(a,d.Va);break;case Dj:c="ER="+O(a,d.R);break;case Ej:c="SL="+O(a,d.sa&65280);break;case Fj:c="M0="+O(a,od(d));break;case Gj:c="M1="+O(a,qd(d));break;case Hj:c="M2="+O(a,rd(d));break;case Ij:c="M3="+O(a,d.T);break;case Jj:a.b&&(c="AR="+O(a,a.b.ua,3));break;case Kj:a.b&&(c="DR="+ -O(a,a.b.vb));break;case Lj:a.b&&Ic(a.b)&&(c="SR="+O(a,a.b.Ya,3))}c&&(c+=" ");return c}function lk(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Bj)+Z(a,Cj)+Z(a,Ej);d+=kk(a,"T")+kk(a,"N")+kk(a,"Z")+kk(a,"V")+kk(a,"C");b&&(b=d,c=""+(Z(a,Fj)+Z(a,Gj)),c+=Z(a,Hj)+Z(a,Ij)+Z(a,Dj),c=c+"\n"+(Z(a,Lj)+Z(a,Jj)+Z(a,Kj)),d=b+("\n"+c));return d}h.dd=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=$a(n,l,a.dd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.C.push({yh:b,K:c,Qd:d,ea:e,ad:f})}function mk(a,b,c){var d=[],e=qj(b)>>>0;for(b=0;b>>0,k=f.Qd;if(e>=g&&eb)){e.g[b]= -g&65535;break}a.u("unknown register: "+f);return}J(a.J);a.u("updated registers:")}}a.u(lk(a,d));c&&(a.H=V(e.g[7]),Rj(a,yj(a,a.H)))}}function qk(a,b){b=Ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.u(m)}k[3]&&(g=k[3],f=null);f=Yj(a,b,g,f);a.u(f);a.H=b;e-=b.K-l;c++}}} -function Xj(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(Pj+b):(a.P&&(a.u("ended assemble at "+yj(a,a.N)),a.H=a.N,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(Ja(a)&&0n||"z"Ga.length&&(a.u("note: only "+Ga.length+" available"),qa=Ga.length);wa-=qa;0>wa&&(null==Ga[Ga.length-1].K?(qa=wa+qa,wa=0):wa+=Ga.length);var Qe=[];"call"==oi&&(sc=1E5,Qe=["CALL"]);for(void 0!==ni&&a.u(qa+" instructions earlier:");0=Ga.length&&(wa=0);a.na=qa;qi++;sc--}}qi||(a.u("no "+pi+"history available"),a.na=void 0)}else{var ga=vj(a,Fa);if(ga)if("da"==Ta){var Re=ga.Ka||65535K.length?(2ib&&(ib=0);65536Ve?String.fromCharCode(Ve):"."),yd=yd>>8}kb&&(kb+="\n");kb=Se?kb+(lb+","):kb+(Fa+": "+lb+(xd?"":" "+Ue))}kb&&a.u(kb);a.Ca=ga;a.xa=Uk}}}}break;case "e":if("else"==g[0])break;var Lb,We,Xe,Ye,Ze=g[0],$e=g[1];"eb"==Ze? -(Lb=1,We=255,Xe=a.Mc,Ye=a.Nc):"e"==Ze||"ew"==Ze?(Lb=2,We=65535,Xe=a.Oa,Ye=a.yd):$e=null;if(null==$e)a.u("edit memory commands:"),a.u("\teb [a] [...] edit bytes at address a"),a.u("\tew [a] [...] edit words at address a");else{var zd=vj(a,$e);if(zd)for(var Ad=2;Adcf;){for(var mb=null,Yk=256;65536>yc.K>>>0;){df.K=a.Oa(yc,2);if(null==yc.K||!Yk--)break;if(!(df.K&1)){for(var Zk=a,Bd=df,vi=null,zc=Bd.K,wi=zc,ef=1;6>=ef&&zc;ef++){if(2> ";vb(function(){for(var a=y(document,x,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.u("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;byk){if(zk(d,this.I)){this.v=new M(this,"1.32.2",Ik);zk(this.v)&&(Jk(this,d),a=Kk,Lk(this.v));this.v.set(Fk,ab());Mk(this.v);var e=this.b&&!this.G;if(a==Gk||ya("Click OK to restore the previous "+Eb+" machine state, or CANCEL to reset the machine.")){if(c=Ek(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?zk(d,g):("error"==f&&"no machine state"!= -g?(this.O("Error: "+g),"unable to verify user"==g&&(nb(Nk,""),this.g=null)):this.u(f+": "+g),Lk(d),zk(d)?(c=Ek(d),e=!0):c=!1))}e&&Ck(this,c?d:null)}else a==Kk&&d.clear()}else Ck(this);delete this.I;delete this.w}e=za(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.A.fa=!0;var d=this.B.power;d&&(d.textContent="Shutdown");this.f&&(Ok(this,this.f,b,c,a),J(this),this.f.Ia());this.N&&(Jk(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0}; -function Jk(a,b){if(ya("There may be a problem with your "+Eb+" machine.\n\nTo help us diagnose it, click OK to send this "+Eb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Eb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;bb("http://www.pcjs.org/api/v1/report",d,!0)}} -function sk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new M(a,"1.32.2"),g=new M(a,"1.32.2",Dk),k=ab();g.set(Fk,k);f.set(Fk,k);f.set(Pk,"1.32.2");f.set(Qk,window?window.location.href:null);f.set(Tk,window?window.navigator.userAgent:"");a.f&&a.f.ya&&(c&&a.f.Z(),d=a.f.ya(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.fa=!1,!1===d&&(e=null)));for(var k=za(a.id),l=0;l=d||30<=(c.oc+=d))&&(e.textContent=c.A.U?c.nb.toFixed(2)+"Mhz":"Stopped",c.oc=0)}if(a.i&&(a=a.i,b=b||0,a.v)){c=a.f.A.U;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;ef.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");bb(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);jl(a,b,c)}})}else c(a,null)} -function kl(a,b,c,d){function e(a){if(void 0===k){var b=g&&y(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Sa(a))}function f(a){e("Error: "+a);l&&(--gl||zb(!0));l=!1}var g,k,l=!0;gl++;va[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?hl(c,null,null,!1,e,function(d,l){l?(ua(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--gl||zb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--gl||zb(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?hl(b,a,d,!0,e,m):il(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){zb(!1);return kl(a,b,c,d)};window.findMachineComponent=function(a,b){return Ba(b,a+".machine")};window.enableEvents=zb;window.sendEvent=Bb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11-dbg.map +function ij(a,b,c){var d;if(b){b=jj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=I(c,0,!0)+" "+c+". "+H(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.u((null!=b?b+": ":"")+d);return e} +function nj(a,b){if(b)return mj(a,b,a.T[b]);var c=0;for(b in a.T)mj(a,b,a.T[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; +function oj(a){fj.call(this,a);this.Ea=!1;this.ga=!0;this.H=V();this.ya=V();this.O=V();this.C=[];this.g=this.L=this.G=[];pj(this);this.R=this.aa=0;this.i=[];this.na=void 0;qj(this);this.F=this;this.ia={};this.ha=this.cd=0;this.S=null;this.M=[];rj(this,a.messages);this.sa=a.commands;this.Ha=sj;this.W=[];this.I=0;this.Ia=this.oa=null;this.w=this.Ga=this.Fa=this.X=this.ja=0;this.b=this.V=null;var b=this;window?void 0===window[x]&&(window[x]=function(a){return ee(b,a)}):void 0===global[x]&&(global[x]= +function(a){return ee(b,a)})}p(oj,fj);function tj(a){a=a&&a.K;null==a&&(a=-1);return a}function V(a,b,c){return{K:void 0===a?null:a,Ka:void 0===b?!1:b,Qa:!1,Ba:c}}h=oj.prototype;h.Gc=function(a,b){a.K=b;a.Qa=!1;a.Ba=void 0;return a};function uj(a){return[a.K,a.Ka,a.Ba,a.Qa,a.jc]}function vj(a,b){var c=V(b[0],b[1],b[2]);c.Qa=b[3];b[4]&&(c.$c=gj(a,c.jc=b[4]));return c} +h.ua=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.b=a.i;(a=$d(a,"messages"))&&rj(this,a);1140>this.f.ia&&(this.W=this.W.concat(wj));1145>this.f.ia&&(this.W=this.W.concat(xj));md(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=tj(yj(d,c));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.u("blockid physical blockaddr used size type");d.u("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.u("..."): +(c=n.type,m=Zc[c],n&&d.u(I(n.id,8)+" %"+I(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} +h.jd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.oa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Ej:b=vd(this.f);break;case Fj:b=c.Va;break;case Gj:b=c.R;break;case Hj:b=c.ya&65280;break;case Ij:b=pd(c);break;case Jj:b=rd(c);break;case Kj:b=sd(c);break;case Lj:b=c.T;break;case Mj:d&&(b=d.xa);break;case Nj:d&&(b=d.wb);break;case Oj:d&&Jc(d)&&(b=d.Za)}}return b}; +h.message=function(a,b){b&&(a+=" @"+Bj(this,V(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.ha&1073741824)this.M.push(a);else{var c;if(this.ha&-2147483648&&this.f&&(c=this.f.A.U)||La(this,!0))this.Z(),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,ke(a),a.sb=0,a.J&&J(a.J,void 0))}}; +function qj(a){var b;if(!qf(a))a.i&&a.i.length&&a.u("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Pj);for(b=0;b>8;a.u("trapped to "+O(a,c&255,1)+" ("+(0>d?Qb[-d]:O(a,d))+")")}a.H=V(a.f.g[7]);b&&1!=a.I?Tj(a):Uj(a)}}function Rj(a,b){var c;(c=!a.f||!Ka(a.f))||(c=a.f,c.A.fa?c=!0:(c.u(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.U?(b||a.u("cpu busy or unavailable, command ignored"),!1):!Ja(a.f)}h.wa=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; +h.va=function(a,b){b&&this.u(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){qj(this);this.X=0;this.S=null;this.w=0;this.H=V(this.f.g[7]);this.A.U=!1;Vj(this);a||ce(this)};h.save=function(){var a=new M(this);a.set(0,uj(this.H));a.set(1,uj(this.O));a.set(2,[this.j,this.P,this.ha]);a.set(3,this.C);return a.data()}; +h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=vj(this,a[b++]),this.O=vj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.ha|=a[b][2]);a[3]&&(this.C=a[3]);return!0};h.start=function(a,b){this.I||this.u("running");this.A.U=!0;this.Fa=a;this.Ga=b}; +h.stop=function(a,b){if(this.A.U){this.A.U=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Fc(a.f,b)),65535!=(d&65535)&&(a.Gc(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function wg(a){var b=a.f;if(b.A.U)throw te(b,a.f.P&65535),a.Z(),-1;return!1}function Ud(a,b,c){Wj(a,b,c||1,a.L)&&a.Z(!1)}function Vd(a,b,c){Wj(a,b,c||1,a.G)&&a.Z(!1)} +function pj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Ke(a.f,!1);a.L=["br"];if(a.G)for(b=1;b>>c.g],!0)):Ke(a.f,!0);a.G=["bw"];a.ja=0} +h.rb=function(a,b,c){var d=!0;c||Xj(this,a,b,!1,!0);if(a!=this.g){var e=tj(b);if(-1===e)this.u("invalid address: "+Bj(this,b)),d=!1;else{var f=a==this.G;65535>>g.g].rb(e&g.i,f)}else e=this.f,(f?e.Zb++:e.Yb++)||re(e)}}d&&(a.push(b),c?b.Qa=!0:(Yj(this,a,a.length-1,"set"),qj(this)));return d}; +function Xj(a,b,c,d,e){var f=!1;c=tj(c);for(var g=1;g>>d.g],b)):Ke(a.f,b));k.Qa||qj(a);break}}return f}function Zj(a,b){for(var c=1;c>23)&65535,z=O(t,u);else if(D==fk)u=u.K-((f&63)<<1)&65535,z=O(t,u);else if(D==gk)z=O(t,f&7,1);else if(D==hk)z=O(t,f&63,1);else if(D==ik)z=O(t,f&255,1);else if(D=f&E,E&jk&&(D>>=6,E>>=6),E&Y){var E=null,F=D& +kk;switch(D&lk){case 0:z=Dj(F);break;case 8:z="@"+Dj(F);E=mk(t,t.f.g[F]);break;case 16:7>F?z="("+Dj(F)+")+":(D=t.Oa(u,2),z="#"+O(t,D,0,!0));break;case 24:7>F?z="@("+Dj(F)+")+":(D=t.Oa(u,2),z="@#"+O(t,D,0,!0),E=mk(t,D));break;case 32:z="-("+Dj(F)+")";break;case 40:z="@-("+Dj(F)+")";break;case 48:D=t.Oa(u,2);z=O(t,D,0,!0)+"("+Dj(F)+")";7==F&&(z=O(t,D=D+u.K&65535),E=mk(t,D));break;case 56:D=t.Oa(u,2),z="@"+O(t,D)+"("+Dj(F)+")",7==F&&(z="@"+O(t,D=D+u.K&65535),E=mk(t,Fc(t.f,D)))}E&&(z=[z,E])}t=z;if(!t|| +!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.lb&&b=c.C&&(b=c.Ma[b&fd])&&(a=b[4]);return a}function nk(a,b){switch(b){case "N":a=ye(a.f);break;case "Z":a=xe(a.f);break;case "V":a=we(a.f);break;case "C":a=ve(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} +function Z(a,b){var c="",d=a.f;if(8>b)c=Dj(b),c+="="+O(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+O(a,d.oa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+O(a,d.W[b-16]);else switch(b){case Ej:c="PS="+O(a,vd(d));break;case Fj:c="PI="+O(a,d.Va);break;case Gj:c="ER="+O(a,d.R);break;case Hj:c="SL="+O(a,d.ya&65280);break;case Ij:c="M0="+O(a,pd(d));break;case Jj:c="M1="+O(a,rd(d));break;case Kj:c="M2="+O(a,sd(d));break;case Lj:c="M3="+O(a,d.T);break;case Mj:a.b&&(c="AR="+O(a,a.b.xa,3));break;case Nj:a.b&&(c="DR="+ +O(a,a.b.wb));break;case Oj:a.b&&Jc(a.b)&&(c="SR="+O(a,a.b.Za,3))}c&&(c+=" ");return c}function ok(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Ej)+Z(a,Fj)+Z(a,Hj);d+=nk(a,"T")+nk(a,"N")+nk(a,"Z")+nk(a,"V")+nk(a,"C");b&&(b=d,c=""+(Z(a,Ij)+Z(a,Jj)),c+=Z(a,Kj)+Z(a,Lj)+Z(a,Gj),c=c+"\n"+(Z(a,Oj)+Z(a,Mj)+Z(a,Nj)),d=b+("\n"+c));return d}h.dd=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=ab(n,l,a.dd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.C.push({xh:b,K:c,Qd:d,ea:e,ad:f})}function pk(a,b,c){var d=[],e=tj(b)>>>0;for(b=0;b>>0,k=f.Qd;if(e>=g&&eb)){e.g[b]= +g&65535;break}a.u("unknown register: "+f);return}J(a.J);a.u("updated registers:")}}a.u(ok(a,d));c&&(a.H=V(e.g[7]),Uj(a,Bj(a,a.H)))}}function tk(a,b){b=Za(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.u(m)}k[3]&&(g=k[3],f=null);f=bk(a,b,g,f);a.u(f);a.H=b;e-=b.K-l;c++}}} +function ak(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(Sj+b):(a.P&&(a.u("ended assemble at "+Bj(a,a.O)),a.H=a.O,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(Ka(a)&&0n||"z"Ga.length&&(a.u("note: only "+Ga.length+" available"),qa=Ga.length);wa-=qa;0>wa&&(null==Ga[Ga.length-1].K?(qa=wa+qa,wa=0):wa+=Ga.length);var Qe=[];"call"==pi&&(sc=1E5,Qe=["CALL"]);for(void 0!==oi&&a.u(qa+" instructions earlier:");0=Ga.length&&(wa=0);a.na=qa;ri++;sc--}}ri||(a.u("no "+qi+"history available"),a.na=void 0)}else{var ga=yj(a,Fa);if(ga)if("da"==Ta){var Re=ga.Ka||65535K.length?(2ib&&(ib=0);65536Ve?String.fromCharCode(Ve):"."),yd=yd>>8}kb&&(kb+="\n");kb=Se?kb+(lb+","):kb+(Fa+": "+lb+(xd?"":" "+Ue))}kb&&a.u(kb);a.ya=ga;a.Ba=Xk}}}}break;case "e":if("else"==g[0])break;var Lb,We,Xe,Ye,Ze=g[0],$e=g[1];"eb"==Ze? +(Lb=1,We=255,Xe=a.Nc,Ye=a.Oc):"e"==Ze||"ew"==Ze?(Lb=2,We=65535,Xe=a.Oa,Ye=a.yd):$e=null;if(null==$e)a.u("edit memory commands:"),a.u("\teb [a] [...] edit bytes at address a"),a.u("\tew [a] [...] edit words at address a");else{var zd=yj(a,$e);if(zd)for(var Ad=2;Adcf;){for(var mb=null,al=256;65536>yc.K>>>0;){df.K=a.Oa(yc,2);if(null==yc.K||!al--)break;if(!(df.K&1)){for(var bl=a,Bd=df,wi=null,zc=Bd.K,xi=zc,ef=1;6>=ef&&zc;ef++){if(2> ";wb(function(){for(var a=y(document,x,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.u("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bBk){if(Ck(d,this.I)){this.v=new M(this,"1.32.2",Lk);Ck(this.v)&&(Mk(this,d),a=Nk,Ok(this.v));this.v.set(Ik,bb());Pk(this.v);var e=this.b&&!this.G;if(a==Jk||za("Click OK to restore the previous "+Fb+" machine state, or CANCEL to reset the machine.")){if(c=Hk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ck(d,g):("error"==f&&"no machine state"!= +g?(this.N("Error: "+g),"unable to verify user"==g&&(ob(Qk,""),this.g=null)):this.u(f+": "+g),Ok(d),Ck(d)?(c=Hk(d),e=!0):c=!1))}e&&Fk(this,c?d:null)}else a==Nk&&d.clear()}else Fk(this);delete this.I;delete this.w}e=Aa(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.A.fa=!0;var d=this.B.power;d&&(d.textContent="Shutdown");this.f&&(Rk(this,this.f,b,c,a),J(this),this.f.ta());this.O&&(Mk(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0}; +function Mk(a,b){if(za("There may be a problem with your "+Fb+" machine.\n\nTo help us diagnose it, click OK to send this "+Fb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Fb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;cb("http://www.pcjs.org/api/v1/report",d,!0)}} +function vk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new M(a,"1.32.2"),g=new M(a,"1.32.2",Gk),k=bb();g.set(Ik,k);f.set(Ik,k);f.set(Sk,"1.32.2");f.set(Tk,window?window.location.href:null);f.set(Wk,window?window.navigator.userAgent:"");a.f&&a.f.va&&(c&&(b&&(a.f.A.ta=a.f.A.U),a.f.Z()),d=a.f.va(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.fa=!1,!1===d&&(e=null)));for(var k=Aa(a.id),l=0;l=d||30<=(c.rc+=d))&&(e.textContent=c.A.U?c.ob.toFixed(2)+"Mhz":"Stopped",c.rc=0)}if(a.i&&(a=a.i,b=b||0,a.v)){c=a.f.A.U;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;ef.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");cb(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);ml(a,b,c)}})}else c(a,null)} +function nl(a,b,c,d){function e(a){if(void 0===k){var b=g&&y(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Wa(a))}function f(a){e("Error: "+a);l&&(--jl||Ab(!0));l=!1}var g,k,l=!0;jl++;xa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?kl(c,null,null,!1,e,function(d,l){l?(va(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--jl||Ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--jl||Ab(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?kl(b,a,d,!0,e,m):ll(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Ab(!1);return nl(a,b,c,d)};window.findMachineComponent=function(a,b){return Ca(b,a+".machine")};window.enableEvents=Ab;window.sendEvent=Cb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11-dbg.map diff --git a/versions/pdpjs/1.32.2/pdp11.js b/versions/pdpjs/1.32.2/pdp11.js index 373fc6597..96d3c8f91 100644 --- a/versions/pdpjs/1.32.2/pdp11.js +++ b/versions/pdpjs/1.32.2/pdp11.js @@ -33,251 +33,253 @@ http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2017 */ var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var ea=0;function da(a){return"jscomp_symbol_"+(a||"")+ea++} -function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ga(this)}});fa=function(){}}function ga(a){var b=0;return ha(function(){return b":62,"?":63,"@":64,hc:65,Gf:66,If:67,eg:68,E:69,fg:70,gg:71,hg:72,ig:73,jg:74,kg:75,lg:76,mg:77,ng:78,og:79,pg:80,Q:81,qg:82,rg:83,sg:84,tg:85,ug:86,vg:87,wg:88,xg:89,Uc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,yg:97,zg:98,Ag:99,d:100,e:101,Cg:102,Dg:103,Eg:104,Fg:105,Ig:106,k:107,Jg:108,Kg:109,n:110,Lg:111,p:112,q:113,r:114,Mg:115,t:116,Ng:117,Og:118,Pg:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Jc:127};function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.mc=b.comment;this.Rc=b;this.exports={};this.j=this.bindings={};a=this.id.indexOf(".");0>a?this.La=this.id:(this.Ma=this.id.substr(0,a),this.La=this.id.substr(a+1));this.l={ready:!1,Ta:!1,Xb:!1,R:!1,error:!1};this.Bb=null;this.l.error=!1;this.Kc=d||0;this.D=this.c=this.u=this.A=this.ab=null;u.push(this)}function qa(a,b,c){ra[a]&&b&&(ra[a][b]=c)} -function sa(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function ta(a){var b=!1;window&&(b=window.confirm(a));return b}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b":62,"?":63,"@":64,jc:65,Gf:66,If:67,eg:68,E:69,fg:70,gg:71,hg:72,ig:73,jg:74,kg:75,lg:76,mg:77,ng:78,og:79,pg:80,Q:81,qg:82,rg:83,sg:84,tg:85,ug:86,vg:87,wg:88,xg:89,Uc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,yg:97,zg:98,Ag:99,d:100,e:101,Bg:102,Cg:103,Dg:104,Eg:105,Hg:106,k:107,Ig:108,Jg:109,n:110,Kg:111,p:112,q:113,r:114,Lg:115,t:116,Mg:117,Ng:118,Og:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,Kc:127};function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.oc=b.comment;this.Tc=b;this.exports={};this.j=this.bindings={};a=this.id.indexOf(".");0>a?this.Ma=this.id:(this.Na=this.id.substr(0,a),this.Ma=this.id.substr(a+1));this.l={ready:!1,Ua:!1,ac:!1,S:!1,error:!1};this.Db=null;this.l.error=!1;this.Rc=d||0;this.C=this.c=this.u=this.A=this.bb=null;u.push(this)}function ra(a,b,c){sa[a]&&b&&(sa[a][b]=c)} +function ta(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=3;return""+c}function Aa(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} -function F(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Fa[a]})}function Ga(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} -var Fa={"&":"&","<":"<",">":">",'"':""","'":"'"},Ha={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; -function Ia(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function Aa(a,b){var c="";b?11>=3;return""+c}function Ba(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} +function F(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Ga[a]})}function Ha(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} +var Ga={"&":"&","<":"<",">":">",'"':""","'":"'"},Ia={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function Ja(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function G(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function Ja(a,b){var c,d={N:null,fa:null,Z:null,Y:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Z=g.load;d.Y=g.exec;if(e=g.bytes)d.N=e;else if(e=g.words)for(d.N=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.N=Array(4*e.length),f=c=0;c>8&255,d.N[f++]=e[c]>>16&255,d.N[f++]=e[c]>>24&255;else d.N=g;d.fa=g.symbols;d.N.length?1==d.N.length&&(v(d.N[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.a["S"+a]=[0,0,!1,!1,this.od,a];this.D=this.c=this.u=this.A=null;D(this)}n(gb,r);h=gb.prototype;h.reset=function(){this.stop()}; -h.ca=function(a,b,c,d){if(this.A&&this.A.ca(a,b,c,d)||this.c&&this.c.ca(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.f[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.j[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ib(a, -b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){jb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ib(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){jb(a,b)}}(this,b),!0):r.prototype.ca.call(this,a,b,c,d)}};h.aa=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;kb(b,this,lb);mb(b,this.reset.bind(this));nb(this);ob(this)};h.ha=function(a,b){b||(this.C&&pb(),this.reset());return!0};h.ga=function(){return!0}; -function qb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function nb(a,b){for(var c in a.f)qb(a,c,null!=b?b:a.f[c])}function rb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function ob(a){for(var b in a.a)rb(a,b,a.a[b][1])}function sb(a,b,c,d){a.j[b]&&(void 0===c&&(wa(a,"Value for "+b+" is invalid"),H(a.c)),c=8==(a.D&&a.D.h||8)?za(c,d):Aa(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))} -function ib(a,b){var c=a.a[b];rb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=tb&&(a.s=b==ub,a.v=b==vb)}function jb(a,b){var c=a.a[b];c[2]&&c[3]&&(rb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.md=function(a){a||this.c.l.P||(a=this.c,a.u.reset(),wb(a),this.a[xb]&&this.a[xb][1]&&yb(this.c))};h.nd=function(){};h.hd=function(a){a||H(this.c)}; -h.fd=function(a){if(!a&&!this.c.l.P)if(this.a[xb]&&this.a[xb][1])yb(this.c);else{a=this.D;var b;if(b=a)a.l.Ta&&(a.l.Xb=!0),b=!a.l.Ta;if(b)ya(a,!0),a.f(0,null),ya(a,!1);else try{var c=this.c.Qb(1);0a;a++)this.a["S"+a][1]=0&1<=a.c.pa?8:16,c=65472<=a.ja&&a.ja<65472+b,b=c?1:2,c=c?15:a.u.v;a.a[tb]&&a.a[tb][1]||(b=-b);Ib(a,a.ja&~c|a.ja+b&c)}function Ib(a,b){a.ja=b&a.u.v;b=a.ja;for(var c=0;22>c;c++)Kb(a,"A"+c,b&1<c;c++)Kb(a,"D"+c,b&1<>2;this.f=this.g-1;this.s=this.F/this.g|0;this.L=this.s-1;this.Ha=[];this.m=0;this.o=!1;this.G=[];this.Vc=[Ob,Pb,Qb,Rb];this.a=this.b=[];this.C=this.w=this.i=this.H=this.I=0;a=new I(this);Sb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.v;D(this)}n(Mb,r);function Vb(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Mb.prototype;h.reset=function(){for(var a=0;ab.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.aa=g.load;d.Z=g.exec;if(e=g.bytes)d.O=e;else if(e=g.words)for(d.O=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.O=Array(4*e.length),f=c=0;c>8&255,d.O[f++]=e[c]>>16&255,d.O[f++]=e[c]>>24&255;else d.O=g;d.ja=g.symbols;d.O.length?1==d.O.length&&(v(d.O[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.a["S"+a]=[0,0,!1,!1,this.od,a];this.C=this.c=this.u=this.A=null;D(this)}n(hb,r);h=hb.prototype;h.reset=function(){this.stop()}; +h.ga=function(a,b,c,d){if(this.A&&this.A.ga(a,b,c,d)||this.c&&this.c.ga(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.f[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.j[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){jb(a, +b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){kb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){jb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){kb(a,b)}}(this,b),!0):r.prototype.ga.call(this,a,b,c,d)}};h.ca=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.C=d;lb(b,this,mb);nb(b,this.reset.bind(this));ob(this);pb(this)};h.ea=function(a,b){b||(this.D&&qb(),this.reset());return!0};h.da=function(){return!0}; +function rb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ob(a,b){for(var c in a.f)rb(a,c,null!=b?b:a.f[c])}function sb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function pb(a){for(var b in a.a)sb(a,b,a.a[b][1])}function tb(a,b,c,d){a.j[b]&&(void 0===c&&(xa(a,"Value for "+b+" is invalid"),H(a.c)),c=8==(a.C&&a.C.h||8)?Aa(c,d):Ba(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))} +function jb(a,b){var c=a.a[b];sb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=ub&&(a.s=b==vb,a.v=b==wb)}function kb(a,b){var c=a.a[b];c[2]&&c[3]&&(sb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.md=function(a){a||this.c.l.N||(a=this.c,a.u.reset(),xb(a),this.a[yb]&&this.a[yb][1]&&zb(this.c))};h.nd=function(){};h.hd=function(a){a||H(this.c)}; +h.fd=function(a){if(!a&&!this.c.l.N)if(this.a[yb]&&this.a[yb][1])zb(this.c);else{a=this.C;var b;if(b=a)a.l.Ua&&(a.l.ac=!0),b=!a.l.Ua;if(b)za(a,!0),a.f(0,null),za(a,!1);else try{var c=this.c.Sb(1);0a;a++)this.a["S"+a][1]=0&1<=a.c.qa?8:16,c=65472<=a.la&&a.la<65472+b,b=c?1:2,c=c?15:a.u.v;a.a[ub]&&a.a[ub][1]||(b=-b);Jb(a,a.la&~c|a.la+b&c)}function Jb(a,b){a.la=b&a.u.v;b=a.la;for(var c=0;22>c;c++)Lb(a,"A"+c,b&1<c;c++)Lb(a,"D"+c,b&1<>2;this.f=this.g-1;this.s=this.F/this.g|0;this.L=this.s-1;this.Ia=[];this.m=0;this.o=!1;this.G=[];this.Vc=[Pb,Qb,Rb,Sb];this.a=this.b=[];this.D=this.w=this.i=this.H=this.I=0;a=new I(this);Tb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.v;D(this)}n(Nb,r);function Wb(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Nb.prototype;h.reset=function(){for(var a=0;a>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Sa)return l.vb+=l.Sa-f,l.Sa=f,!0;if(f>=l.Sa+l.vb){p=l.size-(f-m);p>g&&(p=g);l.vb=f-l.Sa+p;f=m+a.g;g-=p;k++;continue}}return Xb(Yb,f,g)}f=new I(a,f,p,a.g,d,e);Sb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Zb[d]+" at "+za(b)),!0):Xb($b,b,c)}h.Ec=function(a){return this.b[(a&this.i)>>>this.h].hb(a&this.f,a)}; -h.xb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return eb||b!=this.f?this.b[c].V(b,a):this.b[c++].hb(b,a)|this.b[c&this.L].hb(0,a+1)<<8};h.Fc=function(a,b){this.b[(a&this.i)>>>this.h].kb(a&this.f,b,a)};h.yb=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;eb||c!=this.f?this.b[d].nb(c,b,a):(this.b[d++].kb(c,b&255,a),this.b[d&this.L].kb(0,b>>8&255,a+1))};function ac(a,b){return a.a[(b&a.v)>>>a.h]} -function Hb(a,b){var c;a.o=!1;a.m++;var d=b&a.f,e=ac(a,b);eb||d!=a.f?c=e.D(d,b):c=e.i(d,b)|ac(a,b+1).i(0,b+1)<<8;a.m--;return c}function bc(a,b,c){a.o=!1;a.m++;ac(a,b).j(b&a.f,c&255,b);a.m--}function Fb(a,b,c){a.o=!1;a.m++;var d=b&a.f,e=ac(a,b);eb||d!=a.f?e.m(d,c&65535,b):(e.j(d,c&255,b),ac(a,b+1).j(0,c>>8&255,b+1));a.m--} -function Wb(a){for(var b=0,c=[],d=0;da.c.pa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],x=g[5]||1,w=0;w>8:e[2](f)&255):f&1&&(e=d.Ha[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;K(d,b,16);return 255} -function Pb(a,b,c){var d=!1,e=this.controller,f=e.Ha[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ha[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||K(e,c,16)}function Qb(a,b){var c=-1,d=this.controller;a=d.Ha[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;K(d,b,16);return 65535} -function Rb(a,b,c){var d=!1,e=this.controller;a=e.Ha[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||K(e,c,16)}function M(a){r.call(this,"Device",a,0,256);this.a={Bg:0,bc:-1}}n(M,r);h=M.prototype;h.aa=function(a,b,c,d){this.u=b;this.A=a;this.c=c;this.D=d;var e=this;this.a.bc=ic(c,function(){e.a.fb|=128;e.a.fb&64&&N(e.c,e.a.Ja);e.A&&Cb(e.A,1);jc(e.c,e.a.bc,1E3/60)});this.a.Ja=kc(c,64,6,524288);kb(b,this,lc);mb(b,this.reset.bind(this));D(this)}; -h.reset=function(){this.a.fb=128;jc(this.c,this.a.bc,1E3/60,!0)};h.Ad=function(){return this.a.fb};h.Me=function(a){this.a.fb=a&192;this.a.fb&64||(a=this.a.Ja)&&mc(this.c,a)};h.Cd=function(){var a=this.c,b=a.H;b&57344||(b=b&-3199|a.Oa<<5|a.Pa<<1);return b};h.Oe=function(a){nc(this.c,a&-129|this.c.H&128)};h.Dd=function(){var a=this.c;a.H&57344||(a.cb=a.F>>16&65535);a=a.cb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ed=function(){var a=this.c;a.H&57344||(a.eb=a.F&65535);return a.eb};h.Fd=function(){return this.c.la}; -h.Pe=function(a){var b=this.c;1170>b.pa&&(a&=-49);b.la!=a&&(b.la=a,b.Ba=a&16?4194303:262143,oc(b))};h.me=function(a){a=a>>1&63;var b=this.c.Ga[a>>1];return a&1?b>>16:b&65535};h.yf=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ga[c]=b&1?this.c.Ga[c]&65535|(a&63)<<16:this.c.Ga[c]&-65536|a&65534};h.fe=function(a){return this.c.s[1][a>>1&7]};h.rf=function(a,b){this.c.s[1][b>>1&7]=a&65295};h.de=function(a){return this.c.s[1][(a>>1&7)+8]};h.pf=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295}; -h.ee=function(a){return this.c.I[1][a>>1&7]};h.qf=function(a,b){b=b>>1&7;this.c.I[1][b]=a;this.c.s[1][b]&=65295};h.ce=function(a){return this.c.I[1][(a>>1&7)+8]};h.nf=function(a,b){b=(b>>1&7)+8;this.c.I[1][b]=a;this.c.s[1][b]&=65295};h.zd=function(a){return this.c.s[0][a>>1&7]};h.Le=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.xd=function(a){return this.c.s[0][(a>>1&7)+8]};h.Je=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.yd=function(a){return this.c.I[0][a>>1&7]}; -h.Ke=function(a,b){b=b>>1&7;this.c.I[0][b]=a;this.c.s[0][b]&=65295};h.wd=function(a){return this.c.I[0][(a>>1&7)+8]};h.Ie=function(a,b){b=(b>>1&7)+8;this.c.I[0][b]=a;this.c.s[0][b]&=65295};h.le=function(a){return this.c.s[3][a>>1&7]};h.xf=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.je=function(a){return this.c.s[3][(a>>1&7)+8]};h.vf=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295};h.ke=function(a){return this.c.I[3][a>>1&7]};h.wf=function(a,b){b=b>>1&7;this.c.I[3][b]=a;this.c.s[3][b]&=65295}; -h.ie=function(a){return this.c.I[3][(a>>1&7)+8]};h.uf=function(a,b){b=(b>>1&7)+8;this.c.I[3][b]=a;this.c.s[3][b]&=65295};h.ib=function(a){a&=7;return this.c.i&2048?this.c.qa[a]:this.c.b[a]};h.lb=function(a,b){b&=7;this.c.i&2048?this.c.qa[b]=a:this.c.b[b]=a};h.Kd=function(){return this.c.i&49152?this.c.W[0]:this.c.b[6]};h.Ue=function(a){this.c.i&49152?this.c.W[0]=a:this.c.b[6]=a};h.Nd=function(){return this.c.b[7]};h.Xe=function(a){this.c.b[7]=a}; -h.jb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.qa[a]};h.mb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.qa[b]=a};h.Ld=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.W[1]};h.Ve=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.W[1]=a};h.Md=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.W[3]};h.We=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.W[3]=a};h.vd=function(a){return this.c.tb[a-65504>>1]}; -h.He=function(a,b){this.c.tb[b-65504>>1]=a};h.zc=function(a){return 65520==a?(cc(this.u)>>6)-1:0};h.Cc=function(){};h.he=function(){return 1};h.tf=function(){};h.ud=function(){return this.c.G};h.Ge=function(){this.c.G=0};h.Bd=function(){return this.c.sb};h.Ne=function(a,b){b&1||(a&=255);this.c.sb=a};h.Gd=function(a,b){return b?0:this.c.Ra};h.Qe=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Ra=a};h.ge=function(a,b){return b?0:this.c.Fa&65280}; -h.sf=function(a){this.c.Fa=a|255};h.Jd=function(){return pc(this.c)};h.Te=function(a){qc(this.c,a)};h.Bc=function(){}; -var O={},lc=(O[61568]=[null,null,M.prototype.me,M.prototype.yf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.fe,M.prototype.rf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.de,M.prototype.pf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.ee,M.prototype.qf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.ce,M.prototype.nf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.zd,M.prototype.Le,"KIPDR",8,1140,64],O[62672]=[null,null,M.prototype.xd,M.prototype.Je,"KDPDR",8,1145,64],O[62688]= -[null,null,M.prototype.yd,M.prototype.Ke,"KIPAR",8,1140,64],O[62704]=[null,null,M.prototype.wd,M.prototype.Ie,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Fd,M.prototype.Pe,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Ad,M.prototype.Me,"LKS"],O[65402]=[null,null,M.prototype.Cd,M.prototype.Oe,"MMR0",1,1140,64],O[65404]=[null,null,M.prototype.Dd,M.prototype.Bc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Ed,M.prototype.Bc,"MMR2",1,1140,64],O[65408]=[null,null,M.prototype.le,M.prototype.xf, +function Ub(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ta)return l.wb+=l.Ta-f,l.Ta=f,!0;if(f>=l.Ta+l.wb){p=l.size-(f-m);p>g&&(p=g);l.wb=f-l.Ta+p;f=m+a.g;g-=p;k++;continue}}return Yb(Zb,f,g)}f=new I(a,f,p,a.g,d,e);Tb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+$b[d]+" at "+Aa(b)),!0):Yb(ac,b,c)}h.Fc=function(a){return this.b[(a&this.i)>>>this.h].hb(a&this.f,a)}; +h.zb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return fb||b!=this.f?this.b[c].V(b,a):this.b[c++].hb(b,a)|this.b[c&this.L].hb(0,a+1)<<8};h.Gc=function(a,b){this.b[(a&this.i)>>>this.h].kb(a&this.f,b,a)};h.Ab=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;fb||c!=this.f?this.b[d].nb(c,b,a):(this.b[d++].kb(c,b&255,a),this.b[d&this.L].kb(0,b>>8&255,a+1))};function bc(a,b){return a.a[(b&a.v)>>>a.h]} +function Ib(a,b){var c;a.o=!1;a.m++;var d=b&a.f,e=bc(a,b);fb||d!=a.f?c=e.C(d,b):c=e.i(d,b)|bc(a,b+1).i(0,b+1)<<8;a.m--;return c}function cc(a,b,c){a.o=!1;a.m++;bc(a,b).j(b&a.f,c&255,b);a.m--}function Gb(a,b,c){a.o=!1;a.m++;var d=b&a.f,e=bc(a,b);fb||d!=a.f?e.m(d,c&65535,b):(e.j(d,c&255,b),bc(a,b+1).j(0,c>>8&255,b+1));a.m--} +function Xb(a){for(var b=0,c=[],d=0;da.c.qa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],x=g[5]||1,w=0;w>8:e[2](f)&255):f&1&&(e=d.Ia[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;K(d,b,16);return 255} +function Qb(a,b,c){var d=!1,e=this.controller,f=e.Ia[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ia[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||K(e,c,16)}function Rb(a,b){var c=-1,d=this.controller;a=d.Ia[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;K(d,b,16);return 65535} +function Sb(a,b,c){var d=!1,e=this.controller;a=e.Ia[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||K(e,c,16)}function M(a){r.call(this,"Device",a,0,256);this.a={za:128,fc:-1}}n(M,r);h=M.prototype;h.ca=function(a,b,c,d){this.u=b;this.A=a;this.c=c;this.C=d;var e=this;this.a.fc=jc(c,function(){e.a.za|=128;e.a.za&64&&N(e.c,e.a.Ka);e.A&&Db(e.A,1);kc(e.c,e.a.fc,1E3/60)});this.a.Ka=lc(c,64,6,524288);lb(b,this,mc);nb(b,this.reset.bind(this));D(this)}; +h.ea=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.da=function(a){return a?this.save():!0};h.reset=function(){this.a.za=128;kc(this.c,this.a.fc,1E3/60,!0)};h.save=function(){var a=new J(this);a.set(0,[this.a.za]);return a.data()};h.restore=function(a){a=ia(a[0]);this.a.za=a.next().value;return!0};h.Ad=function(){return this.a.za};h.Me=function(a){this.a.za=a&192;this.a.za&64||(a=this.a.Ka)&&nc(this.c,a)}; +h.Cd=function(){var a=this.c,b=a.H;b&57344||(b=b&-3199|a.Pa<<5|a.Qa<<1);return b};h.Oe=function(a){oc(this.c,a&-129|this.c.H&128)};h.Dd=function(){var a=this.c;a.H&57344||(a.eb=a.F>>16&65535);a=a.eb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ed=function(){var a=this.c;a.H&57344||(a.fb=a.F&65535);return a.fb};h.Fd=function(){return this.c.na};h.Pe=function(a){var b=this.c;1170>b.qa&&(a&=-49);b.na!=a&&(b.na=a,b.Ca=a&16?4194303:262143,pc(b))}; +h.me=function(a){a=a>>1&63;var b=this.c.Ha[a>>1];return a&1?b>>16:b&65535};h.yf=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ha[c]=b&1?this.c.Ha[c]&65535|(a&63)<<16:this.c.Ha[c]&-65536|a&65534};h.fe=function(a){return this.c.s[1][a>>1&7]};h.rf=function(a,b){this.c.s[1][b>>1&7]=a&65295};h.de=function(a){return this.c.s[1][(a>>1&7)+8]};h.pf=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.ee=function(a){return this.c.I[1][a>>1&7]};h.qf=function(a,b){b=b>>1&7;this.c.I[1][b]=a;this.c.s[1][b]&=65295}; +h.ce=function(a){return this.c.I[1][(a>>1&7)+8]};h.nf=function(a,b){b=(b>>1&7)+8;this.c.I[1][b]=a;this.c.s[1][b]&=65295};h.zd=function(a){return this.c.s[0][a>>1&7]};h.Le=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.xd=function(a){return this.c.s[0][(a>>1&7)+8]};h.Je=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.yd=function(a){return this.c.I[0][a>>1&7]};h.Ke=function(a,b){b=b>>1&7;this.c.I[0][b]=a;this.c.s[0][b]&=65295};h.wd=function(a){return this.c.I[0][(a>>1&7)+8]}; +h.Ie=function(a,b){b=(b>>1&7)+8;this.c.I[0][b]=a;this.c.s[0][b]&=65295};h.le=function(a){return this.c.s[3][a>>1&7]};h.xf=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.je=function(a){return this.c.s[3][(a>>1&7)+8]};h.vf=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295};h.ke=function(a){return this.c.I[3][a>>1&7]};h.wf=function(a,b){b=b>>1&7;this.c.I[3][b]=a;this.c.s[3][b]&=65295};h.ie=function(a){return this.c.I[3][(a>>1&7)+8]};h.uf=function(a,b){b=(b>>1&7)+8;this.c.I[3][b]=a;this.c.s[3][b]&=65295}; +h.ib=function(a){a&=7;return this.c.i&2048?this.c.ra[a]:this.c.b[a]};h.lb=function(a,b){b&=7;this.c.i&2048?this.c.ra[b]=a:this.c.b[b]=a};h.Kd=function(){return this.c.i&49152?this.c.ia[0]:this.c.b[6]};h.Ue=function(a){this.c.i&49152?this.c.ia[0]=a:this.c.b[6]=a};h.Nd=function(){return this.c.b[7]};h.Xe=function(a){this.c.b[7]=a};h.jb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.ra[a]};h.mb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.ra[b]=a}; +h.Ld=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.ia[1]};h.Ve=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ia[1]=a};h.Md=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.ia[3]};h.We=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ia[3]=a};h.vd=function(a){return this.c.ub[a-65504>>1]};h.He=function(a,b){this.c.ub[b-65504>>1]=a};h.Ac=function(a){return 65520==a?(dc(this.u)>>6)-1:0};h.Dc=function(){};h.he=function(){return 1};h.tf=function(){};h.ud=function(){return this.c.G}; +h.Ge=function(){this.c.G=0};h.Bd=function(){return this.c.tb};h.Ne=function(a,b){b&1||(a&=255);this.c.tb=a};h.Gd=function(a,b){return b?0:this.c.Sa};h.Qe=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Sa=a};h.ge=function(a,b){return b?0:this.c.Ga&65280};h.sf=function(a){this.c.Ga=a|255};h.Jd=function(){return qc(this.c)};h.Te=function(a){rc(this.c,a)};h.Cc=function(){}; +var O={},mc=(O[61568]=[null,null,M.prototype.me,M.prototype.yf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.fe,M.prototype.rf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.de,M.prototype.pf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.ee,M.prototype.qf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.ce,M.prototype.nf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.zd,M.prototype.Le,"KIPDR",8,1140,64],O[62672]=[null,null,M.prototype.xd,M.prototype.Je,"KDPDR",8,1145,64],O[62688]= +[null,null,M.prototype.yd,M.prototype.Ke,"KIPAR",8,1140,64],O[62704]=[null,null,M.prototype.wd,M.prototype.Ie,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Fd,M.prototype.Pe,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Ad,M.prototype.Me,"LKS"],O[65402]=[null,null,M.prototype.Cd,M.prototype.Oe,"MMR0",1,1140,64],O[65404]=[null,null,M.prototype.Dd,M.prototype.Cc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Ed,M.prototype.Cc,"MMR2",1,1140,64],O[65408]=[null,null,M.prototype.le,M.prototype.xf, "UIPDR",8,1140,64],O[65424]=[null,null,M.prototype.je,M.prototype.vf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.ke,M.prototype.wf,"UIPAR",8,1140,64],O[65456]=[null,null,M.prototype.ie,M.prototype.uf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.ib,M.prototype.lb,"R0SET0"],O[65473]=[null,null,M.prototype.ib,M.prototype.lb,"R1SET0"],O[65474]=[null,null,M.prototype.ib,M.prototype.lb,"R2SET0"],O[65475]=[null,null,M.prototype.ib,M.prototype.lb,"R3SET0"],O[65476]=[null,null,M.prototype.ib, M.prototype.lb,"R4SET0"],O[65477]=[null,null,M.prototype.ib,M.prototype.lb,"R5SET0"],O[65478]=[null,null,M.prototype.Kd,M.prototype.Ue,"R6KERNEL"],O[65479]=[null,null,M.prototype.Nd,M.prototype.Xe,"R7KERNEL"],O[65480]=[null,null,M.prototype.jb,M.prototype.mb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.jb,M.prototype.mb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.jb,M.prototype.mb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.jb,M.prototype.mb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.jb, -M.prototype.mb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.jb,M.prototype.mb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Ld,M.prototype.Ve,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.Md,M.prototype.We,"R6USER",1,1145],O[65504]=[null,null,M.prototype.vd,M.prototype.He,"CTRL",8,1170],O[65520]=[null,null,M.prototype.zc,M.prototype.Cc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.zc,M.prototype.Cc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.he,M.prototype.tf,"SYSID",1,1170],O[65526]= +M.prototype.mb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.jb,M.prototype.mb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Ld,M.prototype.Ve,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.Md,M.prototype.We,"R6USER",1,1145],O[65504]=[null,null,M.prototype.vd,M.prototype.He,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Ac,M.prototype.Dc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Ac,M.prototype.Dc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.he,M.prototype.tf,"SYSID",1,1170],O[65526]= [null,null,M.prototype.ud,M.prototype.Ge,"ERR",1,1170],O[65528]=[null,null,M.prototype.Bd,M.prototype.Ne,"MBR",1,1170],O[65530]=[null,null,M.prototype.Gd,M.prototype.Qe,"PIR"],O[65532]=[null,null,M.prototype.ge,M.prototype.sf,"SLR"],O[65534]=[null,null,M.prototype.Jd,M.prototype.Te,"PSW"],O); -Ua(function(){for(var a=C(document,B,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),vc(this,wc?xc:yc);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.sd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.re=function(a,b){db&&a&1&&K(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; -h.Ee=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.xa=!0};h.qd=function(a,b){return this.i(a,b)};h.oe=function(a,b){return this.D(a,b)};h.Ce=function(a,b,c){this.A?this.wb(0,0,c):this.j(a,b,c)};h.Af=function(a,b,c){this.A?this.wb(0,0,c):this.m(a,b,c)};h.pd=function(a){return this.a[a]}; -h.rd=function(a){return this.a[a]};h.ne=function(a,b){db&&a&1&&K(this.b,b,64);return this.u.getUint16(a,!0)};h.qe=function(a,b){db&&a&1&&K(this.b,b,64);return!eb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Be=function(a,b){this.a[a]=b;this.xa=!0};h.De=function(a,b){this.a[a]=b;this.xa=!0};h.zf=function(a,b,c){db&&a&1&&K(this.b,c,64);this.u.setUint16(a,b,!0);this.xa=!0};h.Bf=function(a,b,c){db&&a&1&&K(this.b,c,64);!eb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.xa=!0}; -var tc=0,dc=1,uc=2,Ub=4,Zb=["NONE","RAM","ROM","VID","H/W"],sc=0,Bc=[],Ac=[I.prototype.sd,I.prototype.Ee,I.prototype.re,I.prototype.Cf],Ec=[I.prototype.qd,I.prototype.Ce,I.prototype.oe,I.prototype.Af];if(bb)var yc=[I.prototype.pd,I.prototype.Be,I.prototype.ne,I.prototype.zf],xc=[I.prototype.rd,I.prototype.De,I.prototype.qe,I.prototype.Bf];var Fc;if(bb){var Gc=new ArrayBuffer(2);(new DataView(Gc)).setUint16(0,256,!0);Fc=256===(new Uint16Array(Gc))[0]}else Fc=!1;var wc=Fc; -function Hc(a,b){r.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.ec=0;this.Lb=b;this.Qa=c;this.Tb=Math.round(this.Lb/1E4)/100;this.Wa=this.Tb*this.Qa;this.Ub=this.rb=this.Za=this.Mb=0;this.l.P=!1;this.l.ac=!1;this.l.ma=a.autoStart;"string"==typeof this.l.ma&&(this.l.ma="true"==this.l.ma);this.l.zb=!1;this.Jb=this.Ya=0;this.Kb=+a.csStart;this.pb=+a.csInterval;this.qb=+a.csStop;this.sa=[];this.pc=this.ve.bind(this);this.Ea=this.va=this.Da=this.a=this.S=this.ua=this.ob=this.Ca=this.$a= -this.Vb=this.Na=0;this.ka=null;D(this)}n(Hc,r);h=Hc.prototype;h.aa=function(a,b,c,d){this.A=a;this.u=b;this.D=d;this.ka=a.f;for(a=0;a=a.Ya&&(a.Ya+=a.pb,c=!0);0<=a.qb&&a.qb<=Mc(a)&&(a.pb=a.qb=-1,Lc(a),H(a),c=!0);c&&a.X(Mc(a)+" cycles: checksum="+Aa(a.Jb))}} -h.ca=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.l.R)a=!0;else{var b=null,c,k=y(a.id);for(c=0;ca.Na/a.Wa&&(b=1);a.Qa=b;b=a.Tb*a.Qa;if(a.Wa!=b){a.Wa=b;b=a.Wa.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.X("target speed: "+b)}c&&a.A&&Qc(a.A)}Ab(a,a.va);a.va=0;a.ua=sa();a.Ca=0;Oc(a)}function ic(a,b){var c=a.sa.length;a.sa.push([-1,b]);return c}function jc(a,b,c,d){0<=b&&ba.sa[b][0])&&(c=a.Lb*a.Qa/1E3*c|0,a.l.P&&(c+=Rc(a)),a.sa[b][0]=c)} -function zb(a,b){for(var c=a.sa.length-1;0<=c;c--){var d=a.sa[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Rc(a,b){var c=a.Da-=a.a;a.a=a.S=0;b&&(a.Da=0);return c} -h.ve=function(){if(this.l.P){this.Mb>=this.Lb&&Oc(this,!0);this.$a=0;this.ob=sa();if(this.Ca){var a=this.ob-this.Ca;a>this.Ub&&(this.ua+=a,this.ua>this.ob&&(this.ua=this.ob))}try{do{for(var b,c=this.l.zb?1:this.rb,d=this.sa.length-1;0<=d;d--){var e=this.sa[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Qb(b)}catch(f){if("number"!=typeof f)throw f;}b=Rc(this,!0);this.$a+=b;this.va+=b;Bb(this,b);zb(this,b);this.Za-=b;if(0>=this.Za){this.Za+=this.rb;++this.Vb>=Sc&&(this.A&&Cb(this.A,void 0),this.Vb=0);break}}while(this.l.P)}catch(f){H(this); -this.A&&this.A.stop(sa(),Mc(this));wa(this,f.stack||f.message);return}if(this.l.P){a=setTimeout;b=this.pc;this.Ca=sa();c=this.Ub;this.$a&&(c=Math.round(c*this.$a/this.rb));c-=this.Ca-this.ob;if(d=this.Ca-this.ua)this.Na=Math.round(this.va/(10*d))/100,864E5<=d&&(this.Ea=0,Nc(this));if(0>c||this.Nac&&(this.ua-=c),c=0;this.Mb+=this.$a;this.Ca+=c;a(b,c)}}}; -function yb(a){var b;a.l.error?(a.X(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.P)a.X(a.toString()+" busy");else{Nc(a);a.l.P=!0;a.l.ac=!0;if(b=a.j.run)b.textContent="Halt";a.A&&a.A.start(a.ua,Mc(a));a.D||a.status("Started");setTimeout(a.pc,0)}}h.Qb=function(){return 0};function H(a){var b=!1;if(a.l.P){Rc(a);Ab(a,a.va);a.va=0;a.l.P=!1;if(b=a.j.run)b.textContent="Run";a.A&&a.A.stop(sa(),Mc(a));b=!0;a.D||a.status("Stopped")}a.l.complete=void 0;return b}var Pc=30,Sc=15,Ic=["power","reset"]; -function Tc(a){var b=+a.model||1170;Hc.call(this,a,6666667);this.pa=b;this.lc=+a.addrReset||0;this.i=this.v=this.m=this.o=this.w=0;this.b=this.qa=this.W=[];this.C=0;this.nc=[];this.s=this.I=this.Ga=this.tb=[];this.Nb=this.za=this.F=this.kc=this.Aa=this.Oa=this.Pa=this.Ba=this.G=this.Ra=this.Fa=this.H=this.cb=this.eb=this.la=this.wa=this.h=this.f=this.Gb=this.K=this.L=this.g=this.sb=0;this.oc=255;1120>=this.pa?(this.jc=Uc.bind(this),this.Xa=this.Zc,this.Nb=8,this.oc=-1,this.rc=255,this.qc=0):(this.jc= -Vc.bind(this),this.Xa=this.$c,this.rc=~(1792|(1140>=this.pa?2048:0))&65535,this.qc=1140e.cc&&(e.cc=c,c+=4)}return Hc.prototype.ha.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.pa);this.l.P&&H(this);this.v=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.lc,-1,-2,-3,-4,-5,-6,-7,-8];this.qa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.C=0;this.nc=[4,2,0,1];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], -[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ga=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.tb=[0,0,0,0,0,0,0,0];this.h=this.f=this.Gb=this.K=this.L=this.g=this.sb=0;this.wa=-1;wb(this);Kc(this);this.l.error=!1;Hc.prototype.reset.call(this)};function wb(a){a.H=0;a.cb=0;a.eb=0;a.la=0;a.G=0;a.Ra=0;a.Fa=255;a.Aa=0;a.Oa=0;a.Pa=0;a.Ba=262143;a.za=a.b[7];a.F=0;a.ea=null;a.u&&(oc(a),a.kc=cc(a.u))} -function oc(a){a.Db=a.fc;a.Eb=a.gc;a.Ob=a.Pb;a.Fb=a.Rb;a.Aa?(a.ta=65536,a.Cb=a.la&16?4186112:253952,a.oa=a.xc,a.V=a.Ac,a.nb=a.Dc,Vb(a.u,a.la&16?22:18)):(a.ta=0,a.Cb=57344,a.oa=a.cd,a.V=a.pe,a.nb=a.Df,Vb(a.u,16))}function nc(a,b){b&=-3073;if(a.H!=b){b&57344&&!(a.H&57344)&&(a.cb=a.F>>16&65535,a.eb=a.F&65535);a.H=b;a.Oa=(b&96)>>5;a.Pa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Aa!=c&&(a.Aa=c,oc(a))}} -function Wc(a,b,c){a.lc=b;a.u.reset();wb(a);R(a,b);qc(a,0);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.l.P||yb(a)}else a.D?H(a)||a.D.g():!1===c&&H(a);!a.l.P&&a.ka&&a.ka.stop()}h.wc=function(){return 0};h.save=function(){var a=new J(this);a.set(0,[this.b,this.qa,this.W,this.Ga,this.tb,this.G,this.sb,this.Ra,this.Fa,this.wa,this.C,this.g,this.H,this.cb,this.eb,this.la,this.Oa,this.Pa,this.s,this.I,this.Aa,this.Ba,this.za,this.F]);a.set(1,[pc(this)]);a.set(2,[this.Ea,this.Qa]);return a.data()}; -h.restore=function(a){var b;b=a[0];fa();ca();fa();var c=b[Symbol.iterator];b=c?c.call(b):ga(b);this.b=b.next().value;this.qa=b.next().value;this.W=b.next().value;this.Ga=b.next().value;this.tb=b.next().value;this.G=b.next().value;this.sb=b.next().value;this.Ra=b.next().value;this.Fa=b.next().value;this.wa=b.next().value;this.C=b.next().value;this.g=b.next().value;this.H=b.next().value;this.cb=b.next().value;this.eb=b.next().value;this.la=b.next().value;this.Oa=b.next().value;this.Pa=b.next().value; -this.s=b.next().value;this.I=b.next().value;this.Aa=b.next().value;this.Ba=b.next().value;this.za=b.next().value;this.F=b.next().value;b=a[1];qc(this,b[0]);b=a[2];this.Ea=b[0];Nc(this,b[1]);return!0};function Xc(a){return a.v&65536?1:0}function Yc(a){return a.w&32768?8:0}function Zc(a,b){var c=a.b[7];a.b[7]=c+b&65535;return c}function S(a,b,c){c&&(R(a,a.b[7]+(b<<24>>23)),a.a-=2);a.a-=3}function R(a,b){a.b[7]=b&65535} -function kc(a,b,c,d){c={cc:b,gb:c,message:d||0,next:null};c.name=fb[b];a.Sb.push(c);return c}function mc(a,b){var c=a.ea;if(c==b)a.ea=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.ea&&(a.g|=1)}function N(a,b){if(b){if(b!=a.ea){var c=a.ea;if(!c||c.gb<=b.gb)b.next=c,a.ea=b;else{do{var d=c.next;if(!d||d.gb<=b.gb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}function $c(a){return a.g&64?(L(a,168,64,-6),!0):a.g&32?(L(a,4,32,-5),!0):a.g&16?(L(a,12,16,-7),!0):!1} -function pc(a){return a.i=a.i&63728|Yc(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|Xc(a)}function qc(a,b){b&=a.rc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.v=b<<16;if((b^a.i)&a.qc)for(var c=a.qa.length;0<=--c;){var d=a.b[c];a.b[c]=a.qa[c];a.qa[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.W[c]=a.b[6],a.b[6]=a.W[a.C]);a.i=b;a.g&=-3;a.g|=a.ea?2:1}h.da=function(a){this.w=this.o=a;this.m=0};h.Ka=function(a,b){this.w=this.o=this.v=a;this.m=b||0};function ad(a,b){a.w=a.o=a.v=b;a.m=a.w^a.v>>1} -function bd(a,b,c,d){a.w=a.o=a.v=b;a.m=(c^d)&(d^b)}function L(a,b,c,d){if(!a.bb){0>a.wa?a.wa=pc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.C=0;var e=a.V(b|a.ta),f=a.V(b+2&65535|a.ta);qc(a,f&-12289|a.wa>>2&12288);cd(a,a.wa);cd(a,a.b[7]);R(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.Tc=b;a.Sc=d;-1==d&&H(a);if(-4<=d)throw b;}}function dd(a){var b=ed(a),c=ed(a);a.i&49152&&(c=c&-225|a.i&63712);R(a,b);qc(a,c);a.g&=-17} -function fd(a,b){var c=b>>13&31;31>c&&(b=a.la&32?a.Ga[c]+(b&8191)&4194303:b&-3932161);return b} -function Gb(a,b,c){var d,e,f;if(!(c&a.Aa))return f=b&65535,57344<=f&&(f|=a.Cb),f;d=b>>13;a.la&a.nc[a.C]||(d&=7);e=a.s[a.C][d];f=(a.I[a.C][d]<<6)+(b&8191)&a.Ba;3932160<=f&&(f=fd(a,f));if(a.bb)return f;f>=a.kc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.s[a.C][d]=e;if(f!=(4194170&a.Ba)||a.C)a.Oa=a.C,a.Pa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.H&57344||(g|=a.H&4096|a.Oa<<5|a.Pa<<1,nc(a,a.H&-61695|g&61694)),L(a,168,64,-2)),a.H&61440||!(f<(4191360&a.Ba)||f>(4194239&a.Ba))||(a.H|=4096,a.H&512&&(a.g|=64)));return f}function ed(a){var b=a.V(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function cd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Xa(4,-2,c);a.nb(c,b)} -function gd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return L(a,4,0,-3),0;case 1:return 6==c&&a.Xa(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Xa(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Xa(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Zc(a,2)),e=e+a.b[c]&65535,6==c&&a.Xa(d,0, -e),a.a-=6,e|g;case 7:return e=a.V(Zc(a,2)),e=e+a.b[c]&65535,e=a.V(e|a.ta),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.Zc=function(a,b,c){!this.C&&0>=b&&c<=this.Fa&&(this.g|=32)};h.$c=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Fa&&(c<=this.Fa-32?L(this,4,0,-4):(this.G|=8,this.g|=32)))};h.bd=function(a){return this.fc(a)};h.dd=function(a){return this.gc(a)};h.ye=function(a,b){this.Pb(a,b)};h.Ae=function(a,b){this.Rb(a,b)}; -h.cd=function(a,b,c){return gd(this,a,b,c)};h.xc=function(a,b,c){return Gb(this,gd(this,a,b,c),c)};h.pe=function(a){return this.u.xb(this.za=a)};h.Ac=function(a){return this.u.xb(this.za=Gb(this,a,2))};h.Df=function(a,b){this.u.yb(this.za=a,b)};h.Dc=function(a,b){this.u.yb(this.za=Gb(this,a,4),b)}; -function hd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=gd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.V(d|c&a.ta),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.W[a.i>>12&3];return c}function id(a,b,c,d){a.F=a.F&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=gd(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=Gb(a,e|c&65536,4),a.C=a.i>>14&3,a.Fb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.W[a.i>>12&3]=d} -function jd(a,b){b>>=6;var c=a.L=b&7;return(b=a.K=(b&56)>>3)?a.Db(a.oa(b,c,3)):a.b[c+a.Nb]&a.oc}function kd(a,b){var c;b>>=6;var d=a.L=b&7;(b=a.K=(b&56)>>3)?c=a.Eb(a.oa(b,d,2)):c=a.b[d+a.Nb];return c}function ld(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return gd(a,b,c,8)}function md(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Db(a.oa(b,c,3)):a.b[c]&255}function nd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Eb(a.oa(b,d,2)):c=a.b[d];return c} -function T(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Gb=a.oa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.Ob(e,d.call(a,c,a.Db(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function U(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,6),a.Fb(e,d.call(a,0>c?a.b[-c-1]:c,a.Eb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} -function od(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.oa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.Ob(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function pd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Fb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} -h.Qb=function(a){this.l.complete=!0;var b=a?this.l.ac?0:1:-1;this.l.ac=!1;this.Da=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Ra&224)>>5,e=this.ea&&this.ea.gb>d?this.ea:null;e&&(c=e.cc,d=e.gb);d>(this.i&224)>>5?(this.g&8&&(Zc(this,2),this.g&=-9),L(this,c,0,-10),d=!0):d=!1;d&&(e&&mc(this,e),a=!0);this.ea||this.Ra||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){H(this);break}if(0>b)break}if(this.g&112&&$c(this)){if(this.g& -4&&this.D.b(this.b[7],b)){H(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.V(a);this.b[7]=a+2&65535;this.jc(e)}while(0>1|b<<16;ad(this,a);return a&65535}function vd(a,b){a=b&128|b>>1|b<<8;ad(this,a<<8);return a&255}function wd(a,b){a=b&~a;this.da(a);return a}function xd(a,b){a=b&~a;this.da(a<<8);return a}function yd(a,b){a|=b;this.da(a);return a}function zd(a,b){a|=b;this.da(a<<8);return a} -function Ad(a,b){a=~b|65536;this.Ka(a);return a&65535}function Bd(a,b){a=~b|256;this.Ka(a<<8);return a&255}function Cd(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function Dd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function Ed(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function Fd(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function Gd(a,b){a=-b;this.Ka(a,a&b&32768);return a&65535} -function Hd(a,b){a=-b;this.Ka(a<<8,(a&b&128)<<8);return a&255}function Id(a,b){a=b<<1|this.v>>16&1;ad(this,a);return a&65535}function Jd(a,b){a=b<<1|this.v>>16&1;ad(this,a<<8);return a&255}function Kd(a,b){a=(this.v&65536|b)>>1|b<<16;ad(this,a);return a&65535}function Ld(a,b){a=((this.v&65536)>>8|b)>>1|b<<8;ad(this,a<<8);return a&255}function Md(a,b){var c=b-a;bd(this,c,a,b);return c&65535}function Nd(a,b){var c=b-a;bd(this,c<<8,a<<8,b<<8);return c&255} -function Od(a,b){this.w=this.o=b&65280;this.m=this.v=0;return(b<<8|b>>8)&65535}function Pd(a,b){a^=b;this.da(a);return a&65535}function Qd(a){U(this,a,kd(this,a),qd);this.a-=this.h?9+(this.L&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)} -function Rd(a){var b=nd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.v=this.m=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} -function Sd(a){var b=nd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&=63;if(b&32){b=64-b;32>b-1;this.v=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function Td(a){S(this,a,!Xc(this))}function Ud(a){S(this,a,Xc(this))} -function Vd(a){U(this,a,kd(this,a),wd);this.a-=this.h?9+(this.L&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Wd(a){T(this,a,jd(this,a),xd);this.a-=this.h?9+(this.L&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Xd(a){U(this,a,kd(this,a),yd);this.a-=this.h?9+(this.L&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Yd(a){T(this,a,jd(this,a),zd);this.a-=this.h?9+(this.L&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)} -function Zd(a){var b=kd(this,a);a=nd(this,a);this.da((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.L&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function $d(a){var b=jd(this,a);a=md(this,a);this.da(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.L&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function ae(a){S(this,a,this.o&65535?0:4)}function be(a){S(this,a,!Yc(this)==!(this.m&32768))}function ce(a){S(this,a,!!(this.o&65535)&&!Yc(this)==!(this.m&32768))} -function de(a){S(this,a,!Xc(this)&&!!(this.o&65535))}function ee(a){S(this,a,(this.o&65535?0:4)||!Yc(this)!=!(this.m&32768))}function fe(a){S(this,a,Xc(this)||(this.o&65535?0:4))}function ge(a){S(this,a,!Yc(this)!=!(this.m&32768))}function he(a){S(this,a,Yc(this))}function ie(a){S(this,a,!!(this.o&65535))}function je(a){S(this,a,!Yc(this))}function ke(){L(this,12,0,-9)}function le(a){S(this,a,!0)}function me(a){S(this,a,!(this.m&32768))}function ne(a){S(this,a,this.m&32768?2:0)} -function V(a){a&1&&(this.v=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function oe(a){var b=kd(this,a);a=nd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;bd(this,c,a,b);this.a-=this.h?4+(this.L&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function pe(a){var b=jd(this,a);a=md(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);bd(this,c,a,b);this.a-=this.h?4+(this.L&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)} -function qe(a){var b=nd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.v=65536,this.a-=7}function re(){L(this,24,0,-9);this.a-=20} -function se(){this.i&49152?(this.G|=128,L(this,4,0,-8)):(this.ka&&1120==this.pa&&this.ka.setData(this.b[0],!0),this.D?this.D.i():H(this));this.a-=7}function te(){L(this,16,0,-9);this.a-=20}var ue=[0,7,7,10,7,11,9,13];function ve(a){this.S=this.a;R(this,ld(this,a));this.a=this.S-ue[this.h]}var we=[0,14,14,17,14,18,16,20];function xe(a){this.S=this.a;var b=ld(this,a);a=a>>6&7;cd(this,this.b[a]);this.b[a]=this.b[7];R(this,b);this.a=this.S-we[this.h]}var ye=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function ze(a){var b=kd(this,a);this.S=this.a;pd(this,a,b,this.da);this.a=this.S-ye[(this.K?8:0)+this.h]+(7!=this.f||this.h?0:2)}function Ae(a){var b=jd(this,a);od(this,a,b,65535,this.da);this.a-=this.h?9+(this.L&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}var Be=[7,13,13,17,14,18,17,21];function Ce(a){var b=nd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.m=0;this.v=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)R(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6} -function Ie(a){U(this,a,kd(this,a),Md);this.a-=this.h?9+(this.L&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Je(a){U(this,a,0,Od);this.a-=this.h?9:3+(7==this.f?2:0)}function Ke(){L(this,28,0,-9)}function Le(){this.ka&&(this.ka.ja=this.b[7],this.ka.setData(this.b[0],!0));this.g|=8;Zc(this,-2);this.a-=3}function Me(a){U(this,a,this.b[(a>>6&7)+this.Nb],Pd);this.a-=this.h?9:3+(7==this.f?2:0)}function X(){L(this,8,0,-9)}function Uc(a){Ne[a>>12].call(this,a)} -function Oe(a){Pe[a>>6&3].call(this,a)}function Qe(a){Re[a>>6&3].call(this,a)}function Se(a){Te[a>>6&3].call(this,a)}function Ue(a){Ve[a&15].call(this,a)}function We(a){Xe[a&15].call(this,a)}function Ye(a){Ze[a>>6&3].call(this,a)}function $e(a){af[a>>6&3].call(this,a)}function bf(a){cf[a>>6&3].call(this,a)} -var Ne=[function(a){df[a>>8&15].call(this,a)},ze,oe,Zd,Vd,Xd,Qd,X,function(a){ef[a>>8&15].call(this,a)},Ae,pe,$d,Wd,Yd,Ie,X],df=[function(a){ff[a>>4&15].call(this,a)},le,ie,ae,be,ge,ce,ee,xe,xe,Oe,Qe,Se,X,X,X],Pe=[function(a){pd(this,a,0,this.Ka);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Ad);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Cd);this.a-=this.h?9:3+(7==this.f?2:0)}],Re=[function(a){U(this,a,0,Gd); -this.a-=this.h?11:6},function(a){U(this,a,Xc(this)?1:0,qd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,Xc(this)?1:0,Md);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=nd(this,a);this.Ka(a);this.a-=this.h?4:3+(7==this.f?2:0)}],Te=[function(a){U(this,a,0,Kd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,ud);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,sd);this.a-=this.h?9:3+(7==this.f?2:0)}],ff= -[function(a){gf[a&15].call(this,a)},X,X,X,ve,ve,ve,ve,Fe,X,Ue,We,Je,Je,Je,Je],gf=[se,Le,Ge,ke,te,Ee,X,X,X,X,X,X,X,X,X,X],Ve=[De,function(){this.v=0;this.a-=5},function(){this.m=0;this.a-=5},V,function(){this.o=1;this.a-=5},V,V,V,function(){this.w=0;this.a-=5},V,V,V,V,V,V,V],Xe=[De,function(){this.v=65536;this.a-=5},function(){this.m=32768;this.a-=5},W,function(){this.o=0;this.a-=5},W,W,W,function(){this.w=32768;this.a-=5},W,W,W,W,W,W,W],ef=[je,he,de,fe,me,ne,Td,Ud,re,Ke,Ye,$e,bf,X,X,X],Ze=[function(a){od(this, -a,0,255,this.Ka);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Bd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Fd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Dd);this.a-=this.h?9:3+(7==this.f?2:0)}],af=[function(a){T(this,a,0,Hd);this.a-=this.h?11:6},function(a){T(this,a,Xc(this)?1:0,rd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,Xc(this)?1:0,Nd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=md(this,a);this.Ka(a<<8);this.a-=this.h?4:3+ -(7==this.f?2:0)}],cf=[function(a){T(this,a,0,Ld);this.a-=this.h?9+(this.Gb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Jd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,vd);this.a-=this.h?9+(this.Gb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,td);this.a-=this.h?9:3+(7==this.f?2:0)}];function Vc(a){hf[a>>12].call(this,a)} -var hf=[function(a){jf[a>>8&15].call(this,a)},ze,oe,Zd,Vd,Xd,Qd,function(a){kf[a>>8&15].call(this,a)},function(a){lf[a>>8&15].call(this,a)},Ae,pe,$d,Wd,Yd,Ie,X],jf=[function(a){mf[a>>4&15].call(this,a)},le,ie,ae,be,ge,ce,ee,xe,xe,Oe,Qe,Se,function(a){nf[a>>6&3].call(this,a)},X,X],nf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.V(a|this.ta);R(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=hd(this,a,0);this.da(a);cd(this,a);this.a-=11},function(a){var b=ed(this);this.S= -this.a;this.da(b);id(this,a,0,b);this.a=this.S-Be[this.h]},function(a){pd(this,a,Yc(this)?65535:0,this.da);this.a-=this.h?9:3+(7==this.f?2:0)}],mf=[function(a){of[a&15].call(this,a)},X,X,X,ve,ve,ve,ve,Fe,function(a){!(a&8)||1145>this.pa?L(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},Ue,We,Je,Je,Je,Je],of=[se,Le,function(){dd(this);this.g|=this.i&16;this.a-=13},ke,te,Ee,Ge,function(){L(this,8,0,-9)},X,X,X,X,X,X,X,X],kf=[Ce,Ce,qe,qe,Rd,Rd,Sd,Sd,Me,Me,X, -X,X,X,He,He],lf=[je,he,de,fe,me,ne,Td,Ud,re,Ke,Ye,$e,bf,function(a){1145>this.pa?L(this,8,0,-9):pf[a>>6&3].call(this,a)},X,X],pf=[function(){L(this,8,0,-9)},function(a){a=hd(this,a,65536);this.da(a);cd(this,a);this.a-=11},function(a){var b=ed(this);this.S=this.a;this.da(b);id(this,a,65536,b);this.a=this.S-Be[this.h]},function(){L(this,8,0,-9)}]; -function qf(a){r.call(this,"ROM",a,0,128);this.fa=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=F(this.g);if(this.g){a=this.g;var b=Ba(this.m);"json"!=b&&"hex"!=b&&(a=Ka()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;G(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(qa(c.Ma,a,b),(a=Ja(a,b))?(c.b=a.N,c.fa=a.fa):c.g=null);rf(c)})}}n(qf,r); -h=qf.prototype;h.aa=function(a,b,c,d){this.u=b;this.c=c;this.D=d;rf(this)};h.ha=function(){this.fa&&(this.D&&this.D.a(this.id,this.h,this.a,this.fa),delete this.fa);return!0};h.ga=function(){return!0}; -function rf(a){if(!xa(a)){if(a.g){if(!a.b||!a.u)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a)wa(a,"ROM size ("+Aa(a.b.length,8,!0)+") does not match specified size ("+Aa(a.a,8,!0)+")");else{var b;a:{b=a.h;if(57344<=b&&b<57344+Nb){var c={},c=(c[b]=[qf.prototype.be,qf.prototype.mf,null,null,null,a.a>>1],c);if(kb(a.u,a,c)){a.status("Added "+a.a+"-byte ROM at "+za(b));b=a.i=!0;break a}}else if(Tb(a.u,b,a.a,uc)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),x=l,w=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(w)for(;w--;)bc(a.u,t++,b[x++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< -b.length;e++)bc(a.u,c+e,b[e]);k=!0}if(k){if(null==d||g)H(a.c),f=!1;null!=d&&Wc(a.c,d,f)}return k}Ua(function(){for(var a=C(document,B,"ram"),b=0;b=q.hc&&c<=q.Uc&&(b=c-(q.hc-q.Gc));b&&(a.preventDefault&&a.preventDefault(),d.Hb(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Ic&&(b=q.Hc);d.Hb(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); -a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Hb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.aa=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;var e=this;this.H=kc(this.c,this.C?-1:48,4,262144);this.I=ic(this.c,function(){var a;a=-1;e.h.length&&(a=e.h.shift()&255,e.w&&97<=a&&122>a&&(a-=32),jc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&N(c,e.H))});this.F=kc(this.c,this.C?-1:52,4,262144);this.W=ic(this.c,function(){e.b|=128;e.b&64&&N(c,e.F)});kb(b,this,xf,this.C?64832+8*(this.C-1)-65392:0);mb(b,this.reset.bind(this));D(this)}; -h.yc=function(a){if(!this.f){var b=Jc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ga(c[0]);if(d!=this.La)return;c=Ga(c[1]);if(this.f=ua(c)){var e=this.f.exports;if(e){var f=e.connect;f&&f.call(this.f,this.v);if(this.s=e.receiveData){this.v=a;this.G=e.receiveStatus;this.status("Connected "+this.Ma+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -h.ha=function(a,b){if(!b)if(this.yc(this.v),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){yf(this)};h.save=function(){var a=new J(this);a.set(0,[]);return a.data()};h.restore=function(){return yf(this)};function yf(a){a.o=0;a.a=8192;a.b=128;a.h=[];return!0} -h.Hb=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.m%a,this.S&&(b=" ".slice(0,c)));this.L&&!this.m&&c&&(b=String.fromCharCode(this.L)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.m+=c}}else if(null!= -this.i){if(10==a||1024<=this.i.length)this.X(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}jc(this.c,this.W,1E3/Math.round(this.ea/10));this.b&=-129};var wf="buffer",zf={},xf=(zf[65392]=[null,null,Z.prototype.Pd,Z.prototype.Ze,"RCSR"],zf[65394]=[null,null,Z.prototype.Od,Z.prototype.Ye,"RBUF"],zf[65396]=[null,null,Z.prototype.te,Z.prototype.Ff,"XCSR"],zf[65398]=[null,null,Z.prototype.se,Z.prototype.Ef,"XBUF"],zf); -Ua(function(){for(var a=C(document,B,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "readTape":e=Df;case "loadTape":return e||(e=Ef),this.j[b]=c,c.onclick= -function(){var a=d.j.listTapes;a&&Ff(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ff(d,F(b,!0),b,Ef,a)}return!1};return!0;case Gf:return this.j[b]=c,!0}return!1}; -h.aa=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;this.v=Hf(a);var e=this;if(a=Af(this,Jc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.s=kc(this.c,56,4,4096);this.H=ic(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.mc.indexOf("/api/v1/dump")&&(e=Ba(c),f="json"==e||"gz"==e?encodeURI(c):Ka()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!G(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.l.R;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(qa(a.Ma,e,f),(e=Ja(e,f))&&Sf(a,b,c,d,e.N,e.Z,e.Y)); -a.l.Ta=!1;a.b&&(a.b--,a.b||D(a));Pf(a)})}function Kf(a,b,c,d){if((a=a.j.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ba(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ca(c,"/")&&(d="dir"),f=Ka()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Ab?"":e)+"&format=json"));return!!G(f, -null,!0,function(b,c,d){$f(a,b,c,d)})} -function $f(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.l.R;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.na+'" (error '+d+": "+b+")",f);else{qa(a.controller.Ma,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.J=k.length;a.O=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.U=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var x=l.bytes;if(void 0!==x&&x.length){for(var w=m<<2,Y=x.length;Y>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ia?f=a.ra+a.ia&&(a.ia+=f-(a.ra+a.ia)+1):(a.ra=f,a.ia=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.B("Unable to restore disk '"+this.na+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=bg(this,a++);)eg(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function eg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var Wf=0;function Q(a){r.call(this,"RK11",a,0,65536);this.o=fg(this,a.autoMount);this.m=0;this.f=Array(8);this.s=!Pa("Mobi")&&window&&"FileReader"in window;this.Ja=null;this.w=this.b=this.a=this.i=this.h=this.g=this.v=0}n(Q,r); -function fg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Q.prototype; -h.ca=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.j[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&gg(d,a)}, -!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&hg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.f.length||!(a=d.f[b])?d.B("Unable to boot the selected drive"):a.T?(Wc(d.c,0,!0),(a=d.sc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.s){c.parentNode.removeChild(c); -break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.f&&((a=d.f[E(a.value)||0])?(a=a.T)?(a=Sa(dg(a),a.Ib.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.s)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;hg(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.aa=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;if(a=fg(this,Jc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.o[e]=a[e]);ig(this);this.Ja=kc(this.c,144,5,65536);kb(b,this,jg);mb(b,this.reset.bind(this));kg(this,"None",lg,!0);this.s&&kg(this,"Local Disk",mg);kg(this,"Remote Disk",ng);og(this)||D(this)}; -h.ha=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";gg(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){ig(this)};h.save=function(){return(new J(this)).data()}; -h.restore=function(a){return ig(this,a[0])};function og(a,b){b||(a.m=0);for(var c in a.o){var d=a.o[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.f.length)a.B("Unable to load the selected drive");else if(c)if(c==mg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==ng){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}qg(a,e,b,c,!1,d)}else pg(a,e)} -function qg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.ba.toLowerCase()!=d.toLowerCase()&&(g++,pg(a,b,!0),k.Va?a.B("RK11 busy"):(k.Va=!0,e&&(k.Ua=!0,a.m++),k.ya=!!f,Zf(new Vf(a,k,"preload"),c,d,f,a.Mc)&&g++));return g}h.Mc=function(a,b,c,d,e){a.Va=!1;b&&(b.J>a.J||b.O>a.O)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Ia)),b=null);b?(a.T=b,a.na=c,a.ba=d,this.B('Loaded disk "'+c+'" in drive '+("RK"+a.Ia),a.Ua||e),this.A&&Qc(this.A)):a.ya=!1;a.Ua&&(a.Ua=!1,--this.m||D(this));gg(this,a.Ia)}; -function kg(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e=a.J){m=64;break}p=a.seek(b,c,d+1);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.O&&(c=0,++b))}var x,w;if(0>(x=a.read(p,t++))||0>(w=a.read(p,t++))){m=32;break}if(!k&&(Fb(this.u,fd(this.c,f),x|w<<8),hc(this.u))){m=1024;break}t>=a.U&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Nc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.T;var p=null,t;a||(m=128,e=0);for(;e;){var x=Hb(this.u,fd(this.c,f));if(hc(this.u)){m=1024;break}if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1,!0);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.O&&(c=0,++b))}if(k){var w,Y;if(0>(w=a.read(p,t++))||0>(Y=a.read(p,t++))){m=32;break}if(x!=(w|Y<<8)){m=1;break}}else if(!a.write(p,t++,x&255)||!a.write(p,t++,x>>8)){m=32;break}t>=a.U&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Lc=function(a,b,c,d,e,f){this.h=f&65535;this.a=this.a&-49|f>>12&48;this.i=65536-e&65535;this.g=this.g&-16|d&15;this.b|=a;rg(this);return!0};function rg(a){a.a&=-32769;a.b&&(a.b|=32768,a.a|=32768,a.b&32736&&(a.a|=16384))}h.Ud=function(){return this.w};h.df=function(){};h.Vd=function(){return this.b};h.ef=function(){};h.Rd=function(){return this.a&61438}; -h.af=function(a){this.a=this.a&-3968|a&3967;if(this.a&1){a=!0;var b,c,d=(this.g&57344)>>13,e=this.f[d],f,g,k,l,m,p;this.a&=-8321;this.b&=-4;switch(c=this.a&14){case 0:this.b=this.g=0;this.a=128;break;case 10:case 4:b=this.sc;case 6:case 2:b||(b=this.Nc);f=(this.g&8160)>>5;g=(this.g&16)>>4;k=this.g&15;l=65536-this.i&65535;m=(this.a&48)<<12|this.h;p=this.a&2048?0:2;if(f>=e.J){this.b|=64;break}if(k>=e.M){this.b|=32;break}a=b.call(this,e,f,g,k,l,m,p,6<=c,this.Lc.bind(this));break;case 8:f=(this.g&8160)>> -5;f'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&ug(d,a)}, -!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&vg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.T?(Wc(d.c,0,!0),(a=d.tc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.v){c.parentNode.removeChild(c); -break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.b&&((a=d.b[E(a.value)||0])?(a=a.T)?(a=Sa(dg(a),a.Ib.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.v)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;vg(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.aa=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;if(a=tg(this,Jc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.s[e]=a[e]);wg(this);this.Ja=kc(this.c,112,5,131072);kb(b,this,xg);mb(b,this.reset.bind(this));yg(this,"None",zg,!0);this.v&&yg(this,"Local Disk",Ag);yg(this,"Remote Disk",Bg);Cg(this)||D(this)}; -h.ha=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";ug(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){wg(this)};h.save=function(){return(new J(this)).data()}; -h.restore=function(a){return wg(this,a[0])};function Cg(a,b){b||(a.o=0);for(var c in a.s){var d=a.s[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==Ag)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Bg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}Eg(a,e,b,c,!1,d)}else Dg(a,e)} -function Eg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.ba.toLowerCase()!=d.toLowerCase()&&(g++,Dg(a,b,!0),k.Va?a.B("RL11 busy"):(k.Va=!0,e&&(k.Ua=!0,a.o++),k.ya=!!f,Zf(new Vf(a,k,"preload"),c,d,f,a.Pc)&&g++));return g}h.Pc=function(a,b,c,d,e){a.Va=!1;b&&(b.J>a.J||b.O>a.O)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Ia)),b=null);b?(a.T=b,a.na=c,a.ba=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Ia),a.Ua||e),this.A&&Qc(this.A)):a.ya=!1;a.Ua&&(a.Ua=!1,--this.o||D(this));ug(this,a.Ia)}; -function yg(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}Fb(this.u,fd(this.c,f),p|t<<8);if(hc(this.u)){k=8192;break}f+=2;e--;if(m>=a.U&&(l=null,++d>=a.M&&(d=0,++c>=a.O&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Qc=function(a,b,c,d,e,f,g){var k=0;a=a.T;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Hb(this.u,fd(this.c,f));if(hc(this.u)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.U&&(l=null,++d>=a.M&&(d=0,++c>=a.O&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +Va(function(){for(var a=C(document,B,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),wc(this,xc?yc:Ac);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.sd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.re=function(a,b){eb&&a&1&&K(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; +h.Ee=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.xa=!0};h.qd=function(a,b){return this.i(a,b)};h.oe=function(a,b){return this.C(a,b)};h.Ce=function(a,b,c){this.A?this.yb(0,0,c):this.j(a,b,c)};h.Af=function(a,b,c){this.A?this.yb(0,0,c):this.m(a,b,c)};h.pd=function(a){return this.a[a]}; +h.rd=function(a){return this.a[a]};h.ne=function(a,b){eb&&a&1&&K(this.b,b,64);return this.u.getUint16(a,!0)};h.qe=function(a,b){eb&&a&1&&K(this.b,b,64);return!fb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Be=function(a,b){this.a[a]=b;this.xa=!0};h.De=function(a,b){this.a[a]=b;this.xa=!0};h.zf=function(a,b,c){eb&&a&1&&K(this.b,c,64);this.u.setUint16(a,b,!0);this.xa=!0};h.Bf=function(a,b,c){eb&&a&1&&K(this.b,c,64);!fb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.xa=!0}; +var uc=0,ec=1,vc=2,Vb=4,$b=["NONE","RAM","ROM","VID","H/W"],tc=0,Cc=[],Bc=[I.prototype.sd,I.prototype.Ee,I.prototype.re,I.prototype.Cf],Fc=[I.prototype.qd,I.prototype.Ce,I.prototype.oe,I.prototype.Af];if(cb)var Ac=[I.prototype.pd,I.prototype.Be,I.prototype.ne,I.prototype.zf],yc=[I.prototype.rd,I.prototype.De,I.prototype.qe,I.prototype.Bf];var Gc;if(cb){var Hc=new ArrayBuffer(2);(new DataView(Hc)).setUint16(0,256,!0);Gc=256===(new Uint16Array(Hc))[0]}else Gc=!1;var xc=Gc; +function Ic(a,b){r.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.hc=0;this.Nb=b;this.Ra=c;this.Vb=Math.round(this.Nb/1E4)/100;this.Xa=this.Vb*this.Ra;this.Wb=this.sb=this.$a=this.Ob=0;this.l.N=this.l.ec=!1;this.l.ba=a.autoStart;"string"==typeof this.l.ba&&(this.l.ba="true"==this.l.ba);this.l.Bb=!1;this.Lb=this.Za=0;this.Mb=+a.csStart;this.qb=+a.csInterval;this.rb=+a.csStop;this.W=[];this.qc=this.ve.bind(this);this.Fa=this.va=this.Ea=this.a=this.Y=this.ua=this.pb=this.Da=this.ab= +this.Xb=this.Oa=0;this.ma=null;D(this)}n(Ic,r);h=Ic.prototype;h.ca=function(a,b,c,d){this.A=a;this.u=b;this.C=d;this.ma=a.f;for(a=0;a=a.Za&&(a.Za+=a.qb,c=!0);0<=a.rb&&a.rb<=Nc(a)&&(a.qb=a.rb=-1,Mc(a),H(a),c=!0);c&&a.X(Nc(a)+" cycles: checksum="+Ba(a.Lb))}} +h.ga=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.l.S)a=!0;else{var b=null,c,k=y(a.id);for(c=0;ca.Oa/a.Xa&&(b=1);a.Ra=b;b=a.Vb*a.Ra;if(a.Xa!=b){a.Xa=b;b=a.Xa.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.X("target speed: "+b)}c&&a.A&&Rc(a.A)}Bb(a,a.va);a.va=0;a.ua=ta();a.Da=0;Pc(a)}function jc(a,b){var c=a.W.length;a.W.push([-1,b]);return c}function kc(a,b,c,d){0<=b&&ba.W[b][0])&&(c=a.Nb*a.Ra/1E3*c|0,a.l.N&&(c+=Sc(a)),a.W[b][0]=c)}function Tc(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Sc(a,b){var c=a.Ea-=a.a;a.a=a.Y=0;b&&(a.Ea=0);return c} +h.ve=function(){if(this.l.N){this.Ob>=this.Nb&&Pc(this,!0);this.ab=0;this.pb=ta();if(this.Da){var a=this.pb-this.Da;a>this.Wb&&(this.ua+=a,this.ua>this.pb&&(this.ua=this.pb))}try{do{for(var b,c=this.l.Bb?1:this.sb,d=this.W.length-1;0<=d;d--){var e=this.W[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Sb(b)}catch(f){if("number"!=typeof f)throw f;}b=Sc(this,!0);this.ab+=b;this.va+=b;Cb(this,b);Ab(this,b);this.$a-=b;if(0>=this.$a){this.$a+=this.sb;++this.Xb>=Uc&&(this.A&&Db(this.A,void 0),this.Xb=0);break}}while(this.l.N)}catch(f){H(this); +this.A&&this.A.stop(ta(),Nc(this));xa(this,f.stack||f.message);return}if(this.l.N){a=setTimeout;b=this.qc;this.Da=ta();c=this.Wb;this.ab&&(c=Math.round(c*this.ab/this.sb));c-=this.Da-this.pb;if(d=this.Da-this.ua)this.Oa=Math.round(this.va/(10*d))/100,864E5<=d&&(this.Fa=0,Oc(this));if(0>c||this.Oac&&(this.ua-=c),c=0;this.Ob+=this.ab;this.Da+=c;a(b,c)}}}; +function zb(a){var b;a.l.error?(a.X(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.N)a.X(a.toString()+" busy");else{Oc(a);a.l.N=!0;a.l.ec=!0;if(b=a.j.run)b.textContent="Halt";a.A&&a.A.start(a.ua,Nc(a));a.C||a.status("Started");setTimeout(a.qc,0)}}h.Sb=function(){return 0};function H(a){var b=!1;if(a.l.N){Sc(a);Bb(a,a.va);a.va=0;a.l.N=!1;if(b=a.j.run)b.textContent="Run";a.A&&a.A.stop(ta(),Nc(a));b=!0;a.C||a.status("Stopped")}a.l.complete=void 0;return b}var Qc=30,Uc=15,Jc=["power","reset"]; +function Vc(a){var b=+a.model||1170;Ic.call(this,a,6666667);this.qa=b;this.nc=+a.addrReset||0;this.wa=this.i=this.D=this.v=this.m=this.o=this.w=0;this.b=this.ra=this.ia=[];this.I=this.s=this.Ha=this.ub=[];this.Aa=this.F=this.mc=this.Ba=this.Pa=this.Qa=this.Ca=this.G=this.tb=this.Sa=this.Ga=this.H=this.eb=this.fb=this.na=this.g=0;this.Sc=[4,2,0,1];this.Pb=0;this.pc=255;1120>=this.qa?(this.lc=Wc.bind(this),this.Ya=this.Zc,this.Pb=8,this.pc=-1,this.sc=255,this.rc=0):(this.lc=Xc.bind(this),this.Ya=this.$c, +this.sc=~(1792|(1140>=this.qa?2048:0))&65535,this.rc=1140e.xb&&(e.xb=c,c+=4)}return Ic.prototype.ea.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.qa);this.l.N&&H(this);this.v=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.nc,-1,-2,-3,-4,-5,-6,-7,-8];this.ra=[0,0,0,0,0,0];this.ia=[0,0,0,0];this.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, +65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ha=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ub=[0,0,0,0,0,0,0,0];this.D=0;this.wa=-1;this.h=this.f=this.Kb=this.L=this.R=this.g=this.tb=0;xb(this);Lc(this);this.l.error=!1;Ic.prototype.reset.call(this)};function xb(a){a.H=0;a.eb=0;a.fb=0;a.na=0;a.G=0;a.Sa=0;a.Ga=255;a.Ba=0;a.Pa=0;a.Qa=0;a.Ca=262143;a.Aa=a.b[7];a.F=0;a.K=null;a.u&&(pc(a),a.mc=dc(a.u))} +function pc(a){a.Fb=a.ic;a.Gb=a.Qb;a.Rb=a.Tb;a.Hb=a.Ub;a.Ba?(a.ta=65536,a.Eb=a.na&16?4186112:253952,a.pa=a.yc,a.V=a.Bc,a.nb=a.Ec,Wb(a.u,a.na&16?22:18)):(a.ta=0,a.Eb=57344,a.pa=a.cd,a.V=a.pe,a.nb=a.Df,Wb(a.u,16))}function oc(a,b){b&=-3073;if(a.H!=b){b&57344&&!(a.H&57344)&&(a.eb=a.F>>16&65535,a.fb=a.F&65535);a.H=b;a.Pa=(b&96)>>5;a.Qa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ba!=c&&(a.Ba=c,pc(a))}} +function Yc(a,b,c){a.nc=b;a.u.reset();xb(a);R(a,b);rc(a,0);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.l.N||zb(a)}else a.C?H(a)||a.C.g():!1===c&&H(a);!a.l.N&&a.ma&&a.ma.stop()}h.xc=function(){return 0}; +h.save=function(){var a=new J(this);a.set(0,[this.b,this.ra,this.ia,this.I,this.s,this.Ha,this.ub,this.G,this.tb,this.Sa,this.Ga,this.H,this.eb,this.fb,this.na,this.Ba,this.Pa,this.Qa,this.Ca,this.Aa,this.g,this.F,this.wa,this.Yb,this.Zb]);a.set(1,[qc(this)]);a.set(2,[this.Fa,this.Ra,this.l.ba]);a.set(3,Zc(this));a.set(4,Tc(this));return a.data()}; +h.restore=function(a){var b=ia(a[0]);this.b=b.next().value;this.ra=b.next().value;this.ia=b.next().value;this.I=b.next().value;this.s=b.next().value;this.Ha=b.next().value;this.ub=b.next().value;this.G=b.next().value;this.tb=b.next().value;this.Sa=b.next().value;this.Ga=b.next().value;this.H=b.next().value;this.eb=b.next().value;this.fb=b.next().value;this.na=b.next().value;this.Ba=b.next().value;this.Pa=b.next().value;this.Qa=b.next().value;this.Ca=b.next().value;this.Aa=b.next().value;this.g=b.next().value; +this.F=b.next().value;this.wa=b.next().value;this.Yb=b.next().value;this.Zb=b.next().value;b=a[1];rc(this,b[0]);b=a[2];this.Fa=b[0];Oc(this,b[1]);this.l.ba=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function R(a,b){a.b[7]=b&65535}function lc(a,b,c,d){b={xb:b,gb:c,message:d||0,name:gb[b],next:null};a.ob.push(b);return b}function nc(a,b){var c=a.K;if(c==b)a.K=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.K&&(a.g|=1)} +function N(a,b){if(b){if(b!=a.K){var c=a.K;if(!c||c.gb<=b.gb)b.next=c,a.K=b;else{do{var d=c.next;if(!d||d.gb<=b.gb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}function Zc(a){var b=[];for(a=a.K;a;)b.push(a.xb),a=a.next;return b}function cd(a){return a.g&64?(L(a,168,64,-6),!0):a.g&32?(L(a,4,32,-5),!0):a.g&16?(L(a,12,16,-7),!0):!1}function qc(a){return a.i=a.i&63728|ad(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|$c(a)} +function rc(a,b){b&=a.sc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.v=b<<16;if((b^a.i)&a.rc)for(var c=a.ra.length;0<=--c;){var d=a.b[c];a.b[c]=a.ra[c];a.ra[c]=d}a.D=b>>14&3;c=a.i>>14&3;a.D!=c&&(a.ia[c]=a.b[6],a.b[6]=a.ia[a.D]);a.i=b;a.g&=-3;a.g|=a.K?2:1}h.ha=function(a){this.w=this.o=a;this.m=0};h.La=function(a,b){this.w=this.o=this.v=a;this.m=b||0};function dd(a,b){a.w=a.o=a.v=b;a.m=a.w^a.v>>1}function ed(a,b,c,d){a.w=a.o=a.v=b;a.m=(c^d)&(d^b)} +function L(a,b,c,d){if(!a.cb){0>a.wa?a.wa=qc(a):a.D||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.D=0;var e=a.V(b|a.ta),f=a.V(b+2&65535|a.ta);rc(a,f&-12289|a.wa>>2&12288);fd(a,a.wa);fd(a,a.b[7]);R(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.Yb=d;a.Zb=b;-1==d&&H(a);if(-4<=d)throw b;}}function gd(a){var b=hd(a),c=hd(a);a.i&49152&&(c=c&-225|a.i&63712);R(a,b);rc(a,c);a.g&=-17} +function id(a,b){var c=b>>13&31;31>c&&(b=a.na&32?a.Ha[c]+(b&8191)&4194303:b&-3932161);return b} +function Hb(a,b,c){var d,e,f;if(!(c&a.Ba))return f=b&65535,57344<=f&&(f|=a.Eb),f;d=b>>13;a.na&a.Sc[a.D]||(d&=7);e=a.s[a.D][d];f=(a.I[a.D][d]<<6)+(b&8191)&a.Ca;3932160<=f&&(f=id(a,f));if(a.cb)return f;f>=a.mc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.s[a.D][d]=e;if(f!=(4194170&a.Ca)||a.D)a.Pa=a.D,a.Qa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.H&57344||(g|=a.H&4096|a.Pa<<5|a.Qa<<1,oc(a,a.H&-61695|g&61694)),L(a,168,64,-2)),a.H&61440||!(f<(4191360&a.Ca)||f>(4194239&a.Ca))||(a.H|=4096,a.H&512&&(a.g|=64)));return f}function hd(a){var b=a.V(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function fd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Ya(4,-2,c);a.nb(c,b)} +function jd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return L(a,4,0,-3),0;case 1:return 6==c&&a.Ya(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Ya(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Ya(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(bd(a,2)),e=e+a.b[c]&65535,6==c&&a.Ya(d,0, +e),a.a-=6,e|g;case 7:return e=a.V(bd(a,2)),e=e+a.b[c]&65535,e=a.V(e|a.ta),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.Zc=function(a,b,c){!this.D&&0>=b&&c<=this.Ga&&(this.g|=32)};h.$c=function(a,b,c){this.D||(65534<=c&&(c|=-65536),a&4&&c<=this.Ga&&(c<=this.Ga-32?L(this,4,0,-4):(this.G|=8,this.g|=32)))};h.bd=function(a){return this.ic(a)};h.dd=function(a){return this.Qb(a)};h.ye=function(a,b){this.Tb(a,b)};h.Ae=function(a,b){this.Ub(a,b)}; +h.cd=function(a,b,c){return jd(this,a,b,c)};h.yc=function(a,b,c){return Hb(this,jd(this,a,b,c),c)};h.pe=function(a){return this.u.zb(this.Aa=a)};h.Bc=function(a){return this.u.zb(this.Aa=Hb(this,a,2))};h.Df=function(a,b){this.u.Ab(this.Aa=a,b)};h.Ec=function(a,b){this.u.Ab(this.Aa=Hb(this,a,4),b)}; +function kd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=jd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.D=a.i>>12&3,c=a.V(d|c&a.ta),a.D=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.ia[a.i>>12&3];return c}function ld(a,b,c,d){a.F=a.F&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=jd(a,b,e,4),c&65536||(e&=65535),a.D=a.i>>12&3,e=Hb(a,e|c&65536,4),a.D=a.i>>14&3,a.Hb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.ia[a.i>>12&3]=d} +function md(a,b){b>>=6;var c=a.R=b&7;return(b=a.L=(b&56)>>3)?a.Fb(a.pa(b,c,3)):a.b[c+a.Pb]&a.pc}function nd(a,b){var c;b>>=6;var d=a.R=b&7;(b=a.L=(b&56)>>3)?c=a.Gb(a.pa(b,d,2)):c=a.b[d+a.Pb];return c}function od(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return jd(a,b,c,8)}function pd(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Fb(a.pa(b,c,3)):a.b[c]&255}function qd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Gb(a.pa(b,d,2)):c=a.b[d];return c} +function T(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Kb=a.pa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.Rb(e,d.call(a,c,a.Fb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function U(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.pa(b,e,6),a.Hb(e,d.call(a,0>c?a.b[-c-1]:c,a.Gb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} +function rd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.pa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.Rb(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function sd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.pa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Hb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} +h.Sb=function(a){this.l.complete=!0;var b=a?this.l.ec?0:1:-1;this.l.ec=!1;this.Ea=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Sa&224)>>5,e=this.K&&this.K.gb>d?this.K:null;e&&(c=e.xb,d=e.gb);d>(this.i&224)>>5?(this.g&8&&(bd(this,2),this.g&=-9),L(this,c,0,-10),d=!0):d=!1;d&&(e&&nc(this,e),a=!0);this.K||this.Sa||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.C.b(this.b[7],b)){H(this);break}if(0>b)break}if(this.g&112&&cd(this)){if(this.g& +4&&this.C.b(this.b[7],b)){H(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.V(a);this.b[7]=a+2&65535;this.lc(e)}while(0>1|b<<16;dd(this,a);return a&65535}function yd(a,b){a=b&128|b>>1|b<<8;dd(this,a<<8);return a&255}function zd(a,b){a=b&~a;this.ha(a);return a}function Ad(a,b){a=b&~a;this.ha(a<<8);return a}function Bd(a,b){a|=b;this.ha(a);return a}function Cd(a,b){a|=b;this.ha(a<<8);return a} +function Dd(a,b){a=~b|65536;this.La(a);return a&65535}function Ed(a,b){a=~b|256;this.La(a<<8);return a&255}function Fd(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function Gd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function Hd(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function Id(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function Jd(a,b){a=-b;this.La(a,a&b&32768);return a&65535} +function Kd(a,b){a=-b;this.La(a<<8,(a&b&128)<<8);return a&255}function Ld(a,b){a=b<<1|this.v>>16&1;dd(this,a);return a&65535}function Md(a,b){a=b<<1|this.v>>16&1;dd(this,a<<8);return a&255}function Nd(a,b){a=(this.v&65536|b)>>1|b<<16;dd(this,a);return a&65535}function Od(a,b){a=((this.v&65536)>>8|b)>>1|b<<8;dd(this,a<<8);return a&255}function Pd(a,b){var c=b-a;ed(this,c,a,b);return c&65535}function Qd(a,b){var c=b-a;ed(this,c<<8,a<<8,b<<8);return c&255} +function Rd(a,b){this.w=this.o=b&65280;this.m=this.v=0;return(b<<8|b>>8)&65535}function Sd(a,b){a^=b;this.ha(a);return a&65535}function Td(a){U(this,a,nd(this,a),td);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} +function Ud(a){var b=qd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.v=this.m=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} +function Vd(a){var b=qd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&=63;if(b&32){b=64-b;32>b-1;this.v=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function Wd(a){S(this,a,!$c(this))}function Xd(a){S(this,a,$c(this))} +function Yd(a){U(this,a,nd(this,a),zd);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Zd(a){T(this,a,md(this,a),Ad);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function $d(a){U(this,a,nd(this,a),Bd);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ae(a){T(this,a,md(this,a),Cd);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} +function be(a){var b=nd(this,a);a=qd(this,a);this.ha((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function ce(a){var b=md(this,a);a=pd(this,a);this.ha(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function de(a){S(this,a,this.o&65535?0:4)}function ee(a){S(this,a,!ad(this)==!(this.m&32768))}function fe(a){S(this,a,!!(this.o&65535)&&!ad(this)==!(this.m&32768))} +function ge(a){S(this,a,!$c(this)&&!!(this.o&65535))}function he(a){S(this,a,(this.o&65535?0:4)||!ad(this)!=!(this.m&32768))}function ie(a){S(this,a,$c(this)||(this.o&65535?0:4))}function je(a){S(this,a,!ad(this)!=!(this.m&32768))}function ke(a){S(this,a,ad(this))}function le(a){S(this,a,!!(this.o&65535))}function me(a){S(this,a,!ad(this))}function ne(){L(this,12,0,-9)}function oe(a){S(this,a,!0)}function pe(a){S(this,a,!(this.m&32768))}function qe(a){S(this,a,this.m&32768?2:0)} +function V(a){a&1&&(this.v=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function re(a){var b=nd(this,a);a=qd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;ed(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function se(a){var b=md(this,a);a=pd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);ed(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)} +function te(a){var b=qd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.v=65536,this.a-=7}function ue(){L(this,24,0,-9);this.a-=20} +function ve(){this.i&49152?(this.G|=128,L(this,4,0,-8)):(this.ma&&1120==this.qa&&this.ma.setData(this.b[0],!0),this.C?this.C.i():H(this));this.a-=7}function we(){L(this,16,0,-9);this.a-=20}var xe=[0,7,7,10,7,11,9,13];function ye(a){this.Y=this.a;R(this,od(this,a));this.a=this.Y-xe[this.h]}var ze=[0,14,14,17,14,18,16,20];function Ae(a){this.Y=this.a;var b=od(this,a);a=a>>6&7;fd(this,this.b[a]);this.b[a]=this.b[7];R(this,b);this.a=this.Y-ze[this.h]}var Be=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function Ce(a){var b=nd(this,a);this.Y=this.a;sd(this,a,b,this.ha);this.a=this.Y-Be[(this.L?8:0)+this.h]+(7!=this.f||this.h?0:2)}function De(a){var b=md(this,a);rd(this,a,b,65535,this.ha);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}var Ee=[7,13,13,17,14,18,17,21];function Fe(a){var b=qd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.m=0;this.v=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)R(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6} +function Le(a){U(this,a,nd(this,a),Pd);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Me(a){U(this,a,0,Rd);this.a-=this.h?9:3+(7==this.f?2:0)}function Ne(){L(this,28,0,-9)}function Oe(){this.ma&&(this.ma.la=this.b[7],this.ma.setData(this.b[0],!0));this.g|=8;bd(this,-2);this.a-=3}function Pe(a){U(this,a,this.b[(a>>6&7)+this.Pb],Sd);this.a-=this.h?9:3+(7==this.f?2:0)}function X(){L(this,8,0,-9)}function Wc(a){Qe[a>>12].call(this,a)} +function Re(a){Se[a>>6&3].call(this,a)}function Te(a){Ue[a>>6&3].call(this,a)}function Ve(a){We[a>>6&3].call(this,a)}function Xe(a){Ye[a&15].call(this,a)}function Ze(a){$e[a&15].call(this,a)}function af(a){bf[a>>6&3].call(this,a)}function cf(a){df[a>>6&3].call(this,a)}function ef(a){ff[a>>6&3].call(this,a)} +var Qe=[function(a){gf[a>>8&15].call(this,a)},Ce,re,be,Yd,$d,Td,X,function(a){hf[a>>8&15].call(this,a)},De,se,ce,Zd,ae,Le,X],gf=[function(a){jf[a>>4&15].call(this,a)},oe,le,de,ee,je,fe,he,Ae,Ae,Re,Te,Ve,X,X,X],Se=[function(a){sd(this,a,0,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Dd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Hd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Fd);this.a-=this.h?9:3+(7==this.f?2:0)}],Ue=[function(a){U(this,a,0,Jd); +this.a-=this.h?11:6},function(a){U(this,a,$c(this)?1:0,td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,$c(this)?1:0,Pd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=qd(this,a);this.La(a);this.a-=this.h?4:3+(7==this.f?2:0)}],We=[function(a){U(this,a,0,Nd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Ld);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,xd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,vd);this.a-=this.h?9:3+(7==this.f?2:0)}],jf= +[function(a){kf[a&15].call(this,a)},X,X,X,ye,ye,ye,ye,Ie,X,Xe,Ze,Me,Me,Me,Me],kf=[ve,Oe,Je,ne,we,He,X,X,X,X,X,X,X,X,X,X],Ye=[Ge,function(){this.v=0;this.a-=5},function(){this.m=0;this.a-=5},V,function(){this.o=1;this.a-=5},V,V,V,function(){this.w=0;this.a-=5},V,V,V,V,V,V,V],$e=[Ge,function(){this.v=65536;this.a-=5},function(){this.m=32768;this.a-=5},W,function(){this.o=0;this.a-=5},W,W,W,function(){this.w=32768;this.a-=5},W,W,W,W,W,W,W],hf=[me,ke,ge,ie,pe,qe,Wd,Xd,ue,Ne,af,cf,ef,X,X,X],bf=[function(a){rd(this, +a,0,255,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Gd);this.a-=this.h?9:3+(7==this.f?2:0)}],df=[function(a){T(this,a,0,Kd);this.a-=this.h?11:6},function(a){T(this,a,$c(this)?1:0,ud);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,$c(this)?1:0,Qd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=pd(this,a);this.La(a<<8);this.a-=this.h?4:3+ +(7==this.f?2:0)}],ff=[function(a){T(this,a,0,Od);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Md);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,yd);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,wd);this.a-=this.h?9:3+(7==this.f?2:0)}];function Xc(a){lf[a>>12].call(this,a)} +var lf=[function(a){mf[a>>8&15].call(this,a)},Ce,re,be,Yd,$d,Td,function(a){nf[a>>8&15].call(this,a)},function(a){of[a>>8&15].call(this,a)},De,se,ce,Zd,ae,Le,X],mf=[function(a){pf[a>>4&15].call(this,a)},oe,le,de,ee,je,fe,he,Ae,Ae,Re,Te,Ve,function(a){qf[a>>6&3].call(this,a)},X,X],qf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.V(a|this.ta);R(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=kd(this,a,0);this.ha(a);fd(this,a);this.a-=11},function(a){var b=hd(this);this.Y= +this.a;this.ha(b);ld(this,a,0,b);this.a=this.Y-Ee[this.h]},function(a){sd(this,a,ad(this)?65535:0,this.ha);this.a-=this.h?9:3+(7==this.f?2:0)}],pf=[function(a){rf[a&15].call(this,a)},X,X,X,ye,ye,ye,ye,Ie,function(a){!(a&8)||1145>this.qa?L(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},Xe,Ze,Me,Me,Me,Me],rf=[ve,Oe,function(){gd(this);this.g|=this.i&16;this.a-=13},ne,we,He,Je,function(){L(this,8,0,-9)},X,X,X,X,X,X,X,X],nf=[Fe,Fe,te,te,Ud,Ud,Vd,Vd,Pe,Pe,X, +X,X,X,Ke,Ke],of=[me,ke,ge,ie,pe,qe,Wd,Xd,ue,Ne,af,cf,ef,function(a){1145>this.qa?L(this,8,0,-9):sf[a>>6&3].call(this,a)},X,X],sf=[function(){L(this,8,0,-9)},function(a){a=kd(this,a,65536);this.ha(a);fd(this,a);this.a-=11},function(a){var b=hd(this);this.Y=this.a;this.ha(b);ld(this,a,65536,b);this.a=this.Y-Ee[this.h]},function(){L(this,8,0,-9)}]; +function tf(a){r.call(this,"ROM",a,0,128);this.ja=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=F(this.g);if(this.g){a=this.g;var b=Ca(this.m);"json"!=b&&"hex"!=b&&(a=La()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;G(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ra(c.Na,a,b),(a=Ka(a,b))?(c.b=a.O,c.ja=a.ja):c.g=null);uf(c)})}}n(tf,r); +h=tf.prototype;h.ca=function(a,b,c,d){this.u=b;this.c=c;this.C=d;uf(this)};h.ea=function(){this.ja&&(this.C&&this.C.a(this.id,this.h,this.a,this.ja),delete this.ja);return!0};h.da=function(){return!0}; +function uf(a){if(!ya(a)){if(a.g){if(!a.b||!a.u)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a)xa(a,"ROM size ("+Ba(a.b.length,8,!0)+") does not match specified size ("+Ba(a.a,8,!0)+")");else{var b;a:{b=a.h;if(57344<=b&&b<57344+Ob){var c={},c=(c[b]=[tf.prototype.be,tf.prototype.mf,null,null,null,a.a>>1],c);if(lb(a.u,a,c)){a.status("Added "+a.a+"-byte ROM at "+Aa(b));b=a.i=!0;break a}}else if(Ub(a.u,b,a.a,vc)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),x=l,w=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(w)for(;w--;)cc(a.u,t++,b[x++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< +b.length;e++)cc(a.u,c+e,b[e]);k=!0}if(k){if(null==d||g)H(a.c),f=!1;null!=d&&Yc(a.c,d,f)}return k}Va(function(){for(var a=C(document,B,"ram"),b=0;b=q.jc&&c<=q.Uc&&(b=c-(q.jc-q.Hc));b&&(a.preventDefault&&a.preventDefault(),d.Ib(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Jc&&(b=q.Ic);d.Ib(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Ib(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +h.ca=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.C=d;var e=this;this.H=lc(this.c,this.D?-1:48,4,262144);this.I=jc(this.c,function(){var a;a=-1;e.h.length&&(a=e.h.shift()&255,e.w&&97<=a&&122>a&&(a-=32),kc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&N(c,e.H))});this.F=lc(this.c,this.D?-1:52,4,262144);this.W=jc(this.c,function(){e.b|=128;e.b&64&&N(c,e.F)});lb(b,this,Af,this.D?64832+8*(this.D-1)-65392:0);nb(b,this.reset.bind(this));D(this)}; +h.zc=function(a){if(!this.f){var b=Kc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ha(c[0]);if(d!=this.Ma)return;c=Ha(c[1]);if(this.f=va(c)){var e=this.f.exports;if(e){var f=e.connect;f&&f.call(this.f,this.v);if(this.s=e.receiveData){this.v=a;this.G=e.receiveStatus;this.status("Connected "+this.Na+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ea=function(a,b){if(!b)if(this.zc(this.v),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +h.da=function(a){return a?this.save():!0};h.reset=function(){Bf(this)};h.save=function(){var a=new J(this);a.set(0,[]);return a.data()};h.restore=function(){return Bf(this)};function Bf(a){a.o=0;a.a=8192;a.b=128;a.h=[];return!0}h.Ib=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.R||8,c=a-this.m%a,this.R&&(b=" ".slice(0,c)));this.L&&!this.m&&c&&(b=String.fromCharCode(this.L)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.m+=c}}else if(null!= +this.i){if(10==a||1024<=this.i.length)this.X(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}kc(this.c,this.W,1E3/Math.round(this.Y/10));this.b&=-129};var zf="buffer",Cf={},Af=(Cf[65392]=[null,null,Z.prototype.Pd,Z.prototype.Ze,"RCSR"],Cf[65394]=[null,null,Z.prototype.Od,Z.prototype.Ye,"RBUF"],Cf[65396]=[null,null,Z.prototype.te,Z.prototype.Ff,"XCSR"],Cf[65398]=[null,null,Z.prototype.se,Z.prototype.Ef,"XBUF"],Cf); +Va(function(){for(var a=C(document,B,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "readTape":e=Gf;case "loadTape":return e||(e=Hf),this.j[b]=c,c.onclick= +function(){var a=d.j.listTapes;a&&If(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;If(d,F(b,!0),b,Hf,a)}return!1};return!0;case Jf:return this.j[b]=c,!0}return!1}; +h.ca=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.C=d;this.v=Kf(a);var e=this;if(a=Df(this,Kc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.D[f]=a[f]);this.s=lc(this.c,56,4,4096);this.H=jc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.mc.indexOf("/api/v1/dump")&&(e=Ca(c),f="json"==e||"gz"==e?encodeURI(c):La()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!G(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.l.S;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ra(a.Na,e,f),(e=Ka(e,f))&&Vf(a,b,c,d,e.O,e.aa,e.Z)); +a.l.Ua=!1;a.b&&(a.b--,a.b||D(a));Sf(a)})}function Nf(a,b,c,d){if((a=a.j.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ca(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ea(c,"/")&&(d="dir"),f=La()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Cb?"":e)+"&format=json"));return!!G(f, +null,!0,function(b,c,d){cg(a,b,c,d)})} +function cg(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.l.S;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.oa+'" (error '+d+": "+b+")",f);else{ra(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)v(k[0]);else{a.J=k.length;a.P=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.U=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var x=l.bytes;if(void 0!==x&&x.length){for(var w=m<<2,Y=x.length;Y>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ka?f=a.sa+a.ka&&(a.ka+=f-(a.sa+a.ka)+1):(a.sa=f,a.ka=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.B("Unable to restore disk '"+this.oa+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=eg(this,a++);)hg(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function hg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var Zf=0;function Q(a){r.call(this,"RK11",a,0,65536);this.o=ig(this,a.autoMount);this.m=0;this.f=Array(8);this.s=!Qa("Mobi")&&window&&"FileReader"in window;this.Ka=null;this.w=this.b=this.a=this.i=this.h=this.g=this.v=0}n(Q,r); +function ig(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Q.prototype; +h.ga=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.j[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&jg(d,a)}, +!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&kg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.f.length||!(a=d.f[b])?d.B("Unable to boot the selected drive"):a.T?(Yc(d.c,0,!0),(a=d.tc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.s){c.parentNode.removeChild(c); +break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.f&&((a=d.f[E(a.value)||0])?(a=a.T)?(a=Ta(gg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.s)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;kg(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ca=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.C=d;if(a=ig(this,Kc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.o[e]=a[e]);lg(this);this.Ka=lc(this.c,144,5,65536);lb(b,this,mg);nb(b,this.reset.bind(this));ng(this,"None",og,!0);this.s&&ng(this,"Local Disk",pg);ng(this,"Remote Disk",qg);rg(this)||D(this)}; +h.ea=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";jg(this,0)}}return!0};h.da=function(a){return a?this.save():!0};h.reset=function(){lg(this)};h.save=function(){return(new J(this)).data()}; +h.restore=function(a){return lg(this,a[0])};function rg(a,b){b||(a.m=0);for(var c in a.o){var d=a.o[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.f.length)a.B("Unable to load the selected drive");else if(c)if(c==pg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==qg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}tg(a,e,b,c,!1,d)}else sg(a,e)} +function tg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.fa.toLowerCase()!=d.toLowerCase()&&(g++,sg(a,b,!0),k.Wa?a.B("RK11 busy"):(k.Wa=!0,e&&(k.Va=!0,a.m++),k.ya=!!f,bg(new Yf(a,k,"preload"),c,d,f,a.Mc)&&g++));return g}h.Mc=function(a,b,c,d,e){a.Wa=!1;b&&(b.J>a.J||b.P>a.P)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Ja)),b=null);b?(a.T=b,a.oa=c,a.fa=d,this.B('Loaded disk "'+c+'" in drive '+("RK"+a.Ja),a.Va||e),this.A&&Rc(this.A)):a.ya=!1;a.Va&&(a.Va=!1,--this.m||D(this));jg(this,a.Ja)}; +function ng(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e=a.J){m=64;break}p=a.seek(b,c,d+1);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.P&&(c=0,++b))}var x,w;if(0>(x=a.read(p,t++))||0>(w=a.read(p,t++))){m=32;break}if(!k&&(Gb(this.u,id(this.c,f),x|w<<8),ic(this.u))){m=1024;break}t>=a.U&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Nc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.T;var p=null,t;a||(m=128,e=0);for(;e;){var x=Ib(this.u,id(this.c,f));if(ic(this.u)){m=1024;break}if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1,!0);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.P&&(c=0,++b))}if(k){var w,Y;if(0>(w=a.read(p,t++))||0>(Y=a.read(p,t++))){m=32;break}if(x!=(w|Y<<8)){m=1;break}}else if(!a.write(p,t++,x&255)||!a.write(p,t++,x>>8)){m=32;break}t>=a.U&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Lc=function(a,b,c,d,e,f){this.h=f&65535;this.a=this.a&-49|f>>12&48;this.i=65536-e&65535;this.g=this.g&-16|d&15;this.b|=a;ug(this);return!0};function ug(a){a.a&=-32769;a.b&&(a.b|=32768,a.a|=32768,a.b&32736&&(a.a|=16384))}h.Ud=function(){return this.w};h.df=function(){};h.Vd=function(){return this.b};h.ef=function(){};h.Rd=function(){return this.a&61438}; +h.af=function(a){this.a=this.a&-3968|a&3967;if(this.a&1){a=!0;var b,c,d=(this.g&57344)>>13,e=this.f[d],f,g,k,l,m,p;this.a&=-8321;this.b&=-4;switch(c=this.a&14){case 0:this.b=this.g=0;this.a=128;break;case 10:case 4:b=this.tc;case 6:case 2:b||(b=this.Nc);f=(this.g&8160)>>5;g=(this.g&16)>>4;k=this.g&15;l=65536-this.i&65535;m=(this.a&48)<<12|this.h;p=this.a&2048?0:2;if(f>=e.J){this.b|=64;break}if(k>=e.M){this.b|=32;break}a=b.call(this,e,f,g,k,l,m,p,6<=c,this.Lc.bind(this));break;case 8:f=(this.g&8160)>> +5;f'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&xg(d,a)}, +!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&yg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.T?(Yc(d.c,0,!0),(a=d.uc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.v){c.parentNode.removeChild(c); +break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.b&&((a=d.b[E(a.value)||0])?(a=a.T)?(a=Ta(gg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.v)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;yg(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ca=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.C=d;if(a=wg(this,Kc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.s[e]=a[e]);zg(this);this.Ka=lc(this.c,112,5,131072);lb(b,this,Ag);nb(b,this.reset.bind(this));Bg(this,"None",Cg,!0);this.v&&Bg(this,"Local Disk",Dg);Bg(this,"Remote Disk",Eg);Fg(this)||D(this)}; +h.ea=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";xg(this,0)}}return!0};h.da=function(a){return a?this.save():!0};h.reset=function(){zg(this)};h.save=function(){return(new J(this)).data()}; +h.restore=function(a){return zg(this,a[0])};function Fg(a,b){b||(a.o=0);for(var c in a.s){var d=a.s[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==Dg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Eg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}Hg(a,e,b,c,!1,d)}else Gg(a,e)} +function Hg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.fa.toLowerCase()!=d.toLowerCase()&&(g++,Gg(a,b,!0),k.Wa?a.B("RL11 busy"):(k.Wa=!0,e&&(k.Va=!0,a.o++),k.ya=!!f,bg(new Yf(a,k,"preload"),c,d,f,a.Pc)&&g++));return g}h.Pc=function(a,b,c,d,e){a.Wa=!1;b&&(b.J>a.J||b.P>a.P)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Ja)),b=null);b?(a.T=b,a.oa=c,a.fa=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Ja),a.Va||e),this.A&&Rc(this.A)):a.ya=!1;a.Va&&(a.Va=!1,--this.o||D(this));xg(this,a.Ja)}; +function Bg(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}Gb(this.u,id(this.c,f),p|t<<8);if(ic(this.u)){k=8192;break}f+=2;e--;if(m>=a.U&&(l=null,++d>=a.M&&(d=0,++c>=a.P&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +h.Qc=function(a,b,c,d,e,f,g){var k=0;a=a.T;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Ib(this.u,id(this.c,f));if(ic(this.u)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.U&&(l=null,++d>=a.M&&(d=0,++c>=a.P&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; h.Oc=function(a,b,c,d,e,f){this.m=f&65535;this.a=this.a&-49|f>>12&48;this.h=f>>16&63;this.g=this.f=b<<7|(c?64:0)|d&63;this.i=65536-e&65535;a&&(this.a=this.a|a|32768);return!0};h.Zd=function(){return this.a&65535}; -h.jf=function(a){this.a=this.a&-1023|a&1022;this.h=this.h&60|(a&48)>>4;if(!(this.a&128)){a=!0;var b,c=this.b[(this.a&768)>>8],d=c.T,e,f,g;this.a&=-2;switch(this.a&14){case 4:this.i&8&&(this.a&=63);this.i=c.status|this.g&64|(d&&512==d.J?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.g=this.f&4?this.g+b:this.g-b,this.f=this.g=this.g&65408|c);break;case 8:this.i=this.g;break;case 12:b=this.tc;case 10:b||(b=this.Qc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.J||g>=d.M? -this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Oc.bind(this)))}a&&(this.a|=129,this.a&64&&N(this.c,this.Ja))}};h.Xd=function(){return this.m};h.gf=function(a){this.m=a&65534};h.$d=function(){return this.f};h.kf=function(a){this.f=a};h.ae=function(){return this.i};h.lf=function(a){this.i=a};h.Yd=function(){return this.h};h.hf=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4}; -var zg="",Ag="?",Bg="??",Fg={},xg=(Fg[63744]=[null,null,P.prototype.Zd,P.prototype.jf,"RLCS"],Fg[63746]=[null,null,P.prototype.Xd,P.prototype.gf,"RLBA"],Fg[63748]=[null,null,P.prototype.$d,P.prototype.kf,"RLDA"],Fg[63750]=[null,null,P.prototype.ae,P.prototype.lf,"RLMP"],Fg[63752]=[null,null,P.prototype.Yd,P.prototype.hf,"RLBE"],Fg); -function Gg(a,b,c){r.call(this,"Computer",a,0,33554432);this.l.R=!1;this.G=null;Hg(this,b);this.C=Jc(this,"autoPower",a,6);this.g=0;this.K=+a.busWidth||+a.buswidth;this.v=this.s=this.w=null;this.o=this.I=!1;this.i=this.h=null;this.H=this.m=this.F=!1;this.L=Jc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Ig(this);if(this.c=va("CPU",this.id)){this.D=va("Debugger",this.id);this.u=new Mb({id:this.Ma+".bus",busWidth:this.K},this.c,this.D);var d,e=y(this.id);if((this.f=va("Panel",this.id))&&this.f.ab)for(b= -0;b\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bJg){if(Kg(d,this.v)){this.h=new J(this,"1.32.2",Tg);Kg(this.h)&&(Ug(this,d),a=Vg,Yg(this.h));this.h.set(Qg,Ia());Zg(this.h);var e=this.a&&!this.o;if(a==Rg||ta("Click OK to restore the previous "+cb+" machine state, or CANCEL to reset the machine.")){if(c=Pg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Kg(d,g):("error"==f&&"no machine state"!= -g?(this.B("Error: "+g),"unable to verify user"==g&&(Oa($g,""),this.b=null)):this.X(f+": "+g),Yg(d),Kg(d)?(c=Pg(d),e=!0):c=!1))}e&&Ng(this,c?d:null)}else a==Vg&&d.clear()}else Ng(this);delete this.v;delete this.i}e=y(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.l.R=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.c&&(ah(this,this.c,b,c,a),Cb(this),this.c.ma());this.F&&(Ug(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; -function Ug(a,b){if(ta("There may be a problem with your "+cb+" machine.\n\nTo help us diagnose it, click OK to send this "+cb+" machine state to http://www.pcjs.org.")){var c=a.L;a=a.b||"";b=b.toString();var d={};d.app=cb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;G("http://www.pcjs.org/api/v1/report",d,!0)}} -function bh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new J(a,"1.32.2"),g=new J(a,"1.32.2",Og),k=Ia();g.set(Qg,k);f.set(Qg,k);f.set(ch,"1.32.2");f.set(dh,window?window.location.href:null);f.set(eh,window?window.navigator.userAgent:"");a.c&&a.c.ga&&(c&&H(a.c),d=a.c.ga(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.l.R=!1,!1===d&&(e=null)));for(var k=y(a.id),l=0;l=d||30<=(c.ec+=d))&&(e.textContent=c.l.P?c.Na.toFixed(2)+"Mhz":"Stopped",c.ec=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.l.P;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;ef.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");G(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);mh(a,b,c)}})}else c(a,null)} -function nh(a,b,c,d){function e(a){if(void 0===k){var b=g&&C(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ea(a))}function f(a){e("Error: "+a);l&&(--jh||Ya(!0));l=!1}var g,k,l=!0;jh++;ra[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?kh(c,null,null,!1,e,function(d,l){l?(qa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--jh||Ya(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--jh||Ya(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?kh(b,a,d,!0,e,m):lh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(x){f(x.message)}return l}window.embedPDP11=function(a,b,c,d){Ya(!1);return nh(a,b,c,d)};window.findMachineComponent=function(a,b){return va(b,a+".machine")};window.enableEvents=Ya;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map +h.jf=function(a){this.a=this.a&-1023|a&1022;this.h=this.h&60|(a&48)>>4;if(!(this.a&128)){a=!0;var b,c=this.b[(this.a&768)>>8],d=c.T,e,f,g;this.a&=-2;switch(this.a&14){case 4:this.i&8&&(this.a&=63);this.i=c.status|this.g&64|(d&&512==d.J?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.g=this.f&4?this.g+b:this.g-b,this.f=this.g=this.g&65408|c);break;case 8:this.i=this.g;break;case 12:b=this.uc;case 10:b||(b=this.Qc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.J||g>=d.M? +this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Oc.bind(this)))}a&&(this.a|=129,this.a&64&&N(this.c,this.Ka))}};h.Xd=function(){return this.m};h.gf=function(a){this.m=a&65534};h.$d=function(){return this.f};h.kf=function(a){this.f=a};h.ae=function(){return this.i};h.lf=function(a){this.i=a};h.Yd=function(){return this.h};h.hf=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4}; +var Cg="",Dg="?",Eg="??",Ig={},Ag=(Ig[63744]=[null,null,P.prototype.Zd,P.prototype.jf,"RLCS"],Ig[63746]=[null,null,P.prototype.Xd,P.prototype.gf,"RLBA"],Ig[63748]=[null,null,P.prototype.$d,P.prototype.kf,"RLDA"],Ig[63750]=[null,null,P.prototype.ae,P.prototype.lf,"RLMP"],Ig[63752]=[null,null,P.prototype.Yd,P.prototype.hf,"RLBE"],Ig); +function Jg(a,b,c){r.call(this,"Computer",a,0,33554432);this.l.S=!1;this.G=null;Kg(this,b);this.D=Kc(this,"autoPower",a,6);this.g=0;this.K=+a.busWidth||+a.buswidth;this.v=this.s=this.w=null;this.o=this.I=!1;this.i=this.h=null;this.H=this.m=this.F=!1;this.L=Kc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Lg(this);if(this.c=wa("CPU",this.id)){this.C=wa("Debugger",this.id);this.u=new Nb({id:this.Na+".bus",busWidth:this.K},this.c,this.C);var d,e=y(this.id);if((this.f=wa("Panel",this.id))&&this.f.bb)for(b= +0;b\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bMg){if(Ng(d,this.v)){this.h=new J(this,"1.32.2",Wg);Ng(this.h)&&(Xg(this,d),a=Yg,ah(this.h));this.h.set(Tg,Ja());bh(this.h);var e=this.a&&!this.o;if(a==Ug||ua("Click OK to restore the previous "+db+" machine state, or CANCEL to reset the machine.")){if(c=Sg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ng(d,g):("error"==f&&"no machine state"!= +g?(this.B("Error: "+g),"unable to verify user"==g&&(Pa(ch,""),this.b=null)):this.X(f+": "+g),ah(d),Ng(d)?(c=Sg(d),e=!0):c=!1))}e&&Qg(this,c?d:null)}else a==Yg&&d.clear()}else Qg(this);delete this.v;delete this.i}e=y(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.l.S=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.c&&(dh(this,this.c,b,c,a),Db(this),this.c.ba());this.F&&(Xg(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; +function Xg(a,b){if(ua("There may be a problem with your "+db+" machine.\n\nTo help us diagnose it, click OK to send this "+db+" machine state to http://www.pcjs.org.")){var c=a.L;a=a.b||"";b=b.toString();var d={};d.app=db;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;G("http://www.pcjs.org/api/v1/report",d,!0)}} +function eh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new J(a,"1.32.2"),g=new J(a,"1.32.2",Rg),k=Ja();g.set(Tg,k);f.set(Tg,k);f.set(fh,"1.32.2");f.set(gh,window?window.location.href:null);f.set(hh,window?window.navigator.userAgent:"");a.c&&a.c.da&&(c&&(b&&(a.c.l.ba=a.c.l.N),H(a.c)),d=a.c.da(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.l.S=!1,!1===d&&(e=null)));for(var k=y(a.id),l=0;l=d||30<=(c.hc+=d))&&(e.textContent=c.l.N?c.Oa.toFixed(2)+"Mhz":"Stopped",c.hc=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.l.N;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;ef.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");G(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);ph(a,b,c)}})}else c(a,null)} +function qh(a,b,c,d){function e(a){if(void 0===k){var b=g&&C(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Fa(a))}function f(a){e("Error: "+a);l&&(--mh||Za(!0));l=!1}var g,k,l=!0;mh++;sa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?nh(c,null,null,!1,e,function(d,l){l?(ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--mh||Za(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--mh||Za(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?nh(b,a,d,!0,e,m):oh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(x){f(x.message)}return l}window.embedPDP11=function(a,b,c,d){Za(!1);return qh(a,b,c,d)};window.findMachineComponent=function(a,b){return wa(b,a+".machine")};window.enableEvents=Za;window.sendEvent=ab;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map From 6f83ee8bebbf0be5c8726e8967fd80118900ded1 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Wed, 25 Jan 2017 20:59:27 -0800 Subject: [PATCH 05/15] Fixed the autoStart state of the PDP-11 test machine used for resume testing --- devices/pdp11/machine/1170/panel/debugger/cpuexer/README.md | 1 - modules/pdp11/lib/bus.js | 6 +++--- modules/pdp11/lib/computer.js | 6 +----- modules/pdp11/lib/cpu.js | 4 ---- modules/pdp11/lib/cpuops.js | 6 +++--- modules/pdp11/lib/cpustate.js | 6 +++--- modules/pdp11/lib/debugger.js | 4 ---- modules/pdp11/lib/defines.js | 6 +++--- modules/pdp11/lib/device.js | 6 +++--- modules/pdp11/lib/keyboard.js | 4 ---- modules/pdp11/lib/memory.js | 4 ---- modules/pdp11/lib/messages.js | 4 ---- modules/pdp11/lib/nodebugger.js | 4 ---- modules/pdp11/lib/panel.js | 6 +++--- modules/pdp11/lib/ram.js | 4 ---- modules/pdp11/lib/rk11.js | 4 ++++ modules/pdp11/lib/rl11.js | 4 ++++ modules/pdp11/lib/rom.js | 4 ---- modules/pdp11/lib/serial.js | 6 +++--- versions/pdpjs/1.32.2/pdp11-dbg.js | 4 ++-- versions/pdpjs/1.32.2/pdp11.js | 4 ++-- 21 files changed, 34 insertions(+), 63 deletions(-) diff --git a/devices/pdp11/machine/1170/panel/debugger/cpuexer/README.md b/devices/pdp11/machine/1170/panel/debugger/cpuexer/README.md index d17bf0be3..7543bdd34 100644 --- a/devices/pdp11/machine/1170/panel/debugger/cpuexer/README.md +++ b/devices/pdp11/machine/1170/panel/debugger/cpuexer/README.md @@ -6,7 +6,6 @@ machines: - id: test1170 type: pdp11 debugger: true - autoStart: true --- This machine runs the [11/70 CPU Instruction Exerciser](/apps/pdp11/tapes/diags/#md-11-1170-cpu-exerciser): MAINDEC-11-DEQKC-B1-PB. diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index ffb4a7d9d..0e108aa19 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -5,9 +5,9 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. + * It has been adapted from the JavaScript PDP 11/70 Emulator written by Paul Nankervis + * (paulnank@hotmail.com) at . This code may be used + * freely provided the original authors are acknowledged in any modified source code. * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 diff --git a/modules/pdp11/lib/computer.js b/modules/pdp11/lib/computer.js index 63880cc61..af3cfd812 100644 --- a/modules/pdp11/lib/computer.js +++ b/modules/pdp11/lib/computer.js @@ -5,10 +5,6 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. - * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. @@ -186,7 +182,7 @@ class ComputerPDP11 extends Component { this.println(PDP11.APPNAME + " v" + PDP11.APPVERSION + "\n" + COPYRIGHT + "\n" + LICENSE); - this.println("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis "); + this.println("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis "); if (DEBUG && this.messageEnabled()) this.printMessage("TYPEDARRAYS: " + TYPEDARRAYS); diff --git a/modules/pdp11/lib/cpu.js b/modules/pdp11/lib/cpu.js index 87e750587..d07582f6a 100644 --- a/modules/pdp11/lib/cpu.js +++ b/modules/pdp11/lib/cpu.js @@ -5,10 +5,6 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. - * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index e94038843..a1cfcdf12 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -5,9 +5,9 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. + * It has been adapted from the JavaScript PDP 11/70 Emulator written by Paul Nankervis + * (paulnank@hotmail.com) at . This code may be used + * freely provided the original authors are acknowledged in any modified source code. * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index fa1d49eb8..27cd9e438 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -5,9 +5,9 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. + * It has been adapted from the JavaScript PDP 11/70 Emulator written by Paul Nankervis + * (paulnank@hotmail.com) at . This code may be used + * freely provided the original authors are acknowledged in any modified source code. * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index 1787e2cc9..23004ed66 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -5,10 +5,6 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. - * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index bb4a5358e..f29010248 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -5,9 +5,9 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. + * It has been adapted from the JavaScript PDP 11/70 Emulator written by Paul Nankervis + * (paulnank@hotmail.com) at . This code may be used + * freely provided the original authors are acknowledged in any modified source code. * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index e9f0beea6..887dd9c7c 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -5,9 +5,9 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. + * It has been adapted from the JavaScript PDP 11/70 Emulator written by Paul Nankervis + * (paulnank@hotmail.com) at . This code may be used + * freely provided the original authors are acknowledged in any modified source code. * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 diff --git a/modules/pdp11/lib/keyboard.js b/modules/pdp11/lib/keyboard.js index 889aecc8e..da8f8b02c 100644 --- a/modules/pdp11/lib/keyboard.js +++ b/modules/pdp11/lib/keyboard.js @@ -5,10 +5,6 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. - * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. diff --git a/modules/pdp11/lib/memory.js b/modules/pdp11/lib/memory.js index 1b520d14d..a2cd5a235 100644 --- a/modules/pdp11/lib/memory.js +++ b/modules/pdp11/lib/memory.js @@ -5,10 +5,6 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. - * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. diff --git a/modules/pdp11/lib/messages.js b/modules/pdp11/lib/messages.js index ec2ed2761..f4ca592f9 100644 --- a/modules/pdp11/lib/messages.js +++ b/modules/pdp11/lib/messages.js @@ -5,10 +5,6 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. - * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. diff --git a/modules/pdp11/lib/nodebugger.js b/modules/pdp11/lib/nodebugger.js index 64f6be7e8..e4c83aa08 100644 --- a/modules/pdp11/lib/nodebugger.js +++ b/modules/pdp11/lib/nodebugger.js @@ -5,10 +5,6 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. - * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. diff --git a/modules/pdp11/lib/panel.js b/modules/pdp11/lib/panel.js index 8133c1b37..469af8d49 100644 --- a/modules/pdp11/lib/panel.js +++ b/modules/pdp11/lib/panel.js @@ -5,9 +5,9 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. + * It has been adapted from the JavaScript PDP 11/70 Emulator written by Paul Nankervis + * (paulnank@hotmail.com) at . This code may be used + * freely provided the original authors are acknowledged in any modified source code. * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 diff --git a/modules/pdp11/lib/ram.js b/modules/pdp11/lib/ram.js index af57b002b..87a4264fe 100644 --- a/modules/pdp11/lib/ram.js +++ b/modules/pdp11/lib/ram.js @@ -5,10 +5,6 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. - * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. diff --git a/modules/pdp11/lib/rk11.js b/modules/pdp11/lib/rk11.js index ccfd191d4..bf7c27b23 100644 --- a/modules/pdp11/lib/rk11.js +++ b/modules/pdp11/lib/rk11.js @@ -5,6 +5,10 @@ * * This file is part of PCjs, a computer emulation software project at . * + * It has been adapted from the JavaScript PDP 11/70 Emulator written by Paul Nankervis + * (paulnank@hotmail.com) at . This code may be used + * freely provided the original authors are acknowledged in any modified source code. + * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. diff --git a/modules/pdp11/lib/rl11.js b/modules/pdp11/lib/rl11.js index d564f4733..d2369c8be 100644 --- a/modules/pdp11/lib/rl11.js +++ b/modules/pdp11/lib/rl11.js @@ -5,6 +5,10 @@ * * This file is part of PCjs, a computer emulation software project at . * + * It has been adapted from the JavaScript PDP 11/70 Emulator written by Paul Nankervis + * (paulnank@hotmail.com) at . This code may be used + * freely provided the original authors are acknowledged in any modified source code. + * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. diff --git a/modules/pdp11/lib/rom.js b/modules/pdp11/lib/rom.js index 816b63a74..cb334145b 100644 --- a/modules/pdp11/lib/rom.js +++ b/modules/pdp11/lib/rom.js @@ -5,10 +5,6 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. - * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. diff --git a/modules/pdp11/lib/serial.js b/modules/pdp11/lib/serial.js index 00ad402de..557305c54 100644 --- a/modules/pdp11/lib/serial.js +++ b/modules/pdp11/lib/serial.js @@ -5,9 +5,9 @@ * * This file is part of PCjs, a computer emulation software project at . * - * It has been adapted from the JavaScript PDP 11/70 Emulator v1.4 written by Paul Nankervis - * (paulnank@hotmail.com) as of September 2016 at . This code - * may be used freely provided the original authors are acknowledged in any modified source code. + * It has been adapted from the JavaScript PDP 11/70 Emulator written by Paul Nankervis + * (paulnank@hotmail.com) at . This code may be used + * freely provided the original authors are acknowledged in any modified source code. * * PCjs is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 diff --git a/versions/pdpjs/1.32.2/pdp11-dbg.js b/versions/pdpjs/1.32.2/pdp11-dbg.js index dd05343eb..2e546ae13 100644 --- a/versions/pdpjs/1.32.2/pdp11-dbg.js +++ b/versions/pdpjs/1.32.2/pdp11-dbg.js @@ -343,8 +343,8 @@ Ej=20,Fj=21,Gj=22,Hj=23,Ij=24,Jj=25,Kj=26,Lj=27,Mj=28,Nj=29,Oj=30,Cj={SP:6,PC:7, Y],3456:[65,Y],3520:[96,Y],35328:[40,Y],35392:[50,Y],35456:[54,Y],35520:[52,Y],35584:[68,Y],35648:[2,Y],35712:[78,Y],35776:[98,Y],35840:[74,Y],35904:[72,Y],35968:[7,Y],36032:[5,Y],36096:[66,Y],36160:[59,Y],36224:[64,Y],36288:[61,Y]},65528:{128:[76,kk],152:[108,gk]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88], 179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},ck=[0],wj=[58,60,65,96,110,100,101,102,103,104,105],xj=[108,59,64],Pj=1E3,Sj=">> ";wb(function(){for(var a=y(document,x,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.u("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;b\nLicense: GPL version 3 or later ");this.u("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bBk){if(Ck(d,this.I)){this.v=new M(this,"1.32.2",Lk);Ck(this.v)&&(Mk(this,d),a=Nk,Ok(this.v));this.v.set(Ik,bb());Pk(this.v);var e=this.b&&!this.G;if(a==Jk||za("Click OK to restore the previous "+Fb+" machine state, or CANCEL to reset the machine.")){if(c=Hk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ck(d,g):("error"==f&&"no machine state"!= diff --git a/versions/pdpjs/1.32.2/pdp11.js b/versions/pdpjs/1.32.2/pdp11.js index 96d3c8f91..95c184f46 100644 --- a/versions/pdpjs/1.32.2/pdp11.js +++ b/versions/pdpjs/1.32.2/pdp11.js @@ -252,8 +252,8 @@ h.jf=function(a){this.a=this.a&-1023|a&1022;this.h=this.h&60|(a&48)>>4;if(!(this this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Oc.bind(this)))}a&&(this.a|=129,this.a&64&&N(this.c,this.Ka))}};h.Xd=function(){return this.m};h.gf=function(a){this.m=a&65534};h.$d=function(){return this.f};h.kf=function(a){this.f=a};h.ae=function(){return this.i};h.lf=function(a){this.i=a};h.Yd=function(){return this.h};h.hf=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4}; var Cg="",Dg="?",Eg="??",Ig={},Ag=(Ig[63744]=[null,null,P.prototype.Zd,P.prototype.jf,"RLCS"],Ig[63746]=[null,null,P.prototype.Xd,P.prototype.gf,"RLBA"],Ig[63748]=[null,null,P.prototype.$d,P.prototype.kf,"RLDA"],Ig[63750]=[null,null,P.prototype.ae,P.prototype.lf,"RLMP"],Ig[63752]=[null,null,P.prototype.Yd,P.prototype.hf,"RLBE"],Ig); function Jg(a,b,c){r.call(this,"Computer",a,0,33554432);this.l.S=!1;this.G=null;Kg(this,b);this.D=Kc(this,"autoPower",a,6);this.g=0;this.K=+a.busWidth||+a.buswidth;this.v=this.s=this.w=null;this.o=this.I=!1;this.i=this.h=null;this.H=this.m=this.F=!1;this.L=Kc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Lg(this);if(this.c=wa("CPU",this.id)){this.C=wa("Debugger",this.id);this.u=new Nb({id:this.Na+".bus",busWidth:this.K},this.c,this.C);var d,e=y(this.id);if((this.f=wa("Panel",this.id))&&this.f.bb)for(b= -0;b\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;b\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bMg){if(Ng(d,this.v)){this.h=new J(this,"1.32.2",Wg);Ng(this.h)&&(Xg(this,d),a=Yg,ah(this.h));this.h.set(Tg,Ja());bh(this.h);var e=this.a&&!this.o;if(a==Ug||ua("Click OK to restore the previous "+db+" machine state, or CANCEL to reset the machine.")){if(c=Sg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ng(d,g):("error"==f&&"no machine state"!= From d182c7eced65903b3bd79ba68b3f07c8f23f7139 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Thu, 26 Jan 2017 10:04:44 -0800 Subject: [PATCH 06/15] Improved PDP-11 save/restore support (added to Device, Panel, RK11, and Serial) --- docs/pcx86/examples/pcx86-dbg.js | 4 +- docs/pcx86/examples/pcx86.js | 4 +- modules/pcx86/lib/fdc.js | 4 +- modules/pcx86/lib/hdc.js | 2 +- modules/pdp11/lib/computer.js | 2 +- modules/pdp11/lib/cpustate.js | 5 +- modules/pdp11/lib/debugger.js | 4 +- modules/pdp11/lib/device.js | 2 +- modules/pdp11/lib/panel.js | 71 +++- modules/pdp11/lib/rk11.js | 313 ++++++++++----- modules/pdp11/lib/serial.js | 34 +- versions/pcx86/1.32.2/pcx86-dbg.js | 4 +- versions/pcx86/1.32.2/pcx86.js | 4 +- versions/pdpjs/1.32.2/pdp11-dbg.js | 598 +++++++++++++++-------------- versions/pdpjs/1.32.2/pdp11.js | 434 ++++++++++----------- 15 files changed, 850 insertions(+), 635 deletions(-) diff --git a/docs/pcx86/examples/pcx86-dbg.js b/docs/pcx86/examples/pcx86-dbg.js index a8f6930f1..7b04db0a2 100644 --- a/docs/pcx86/examples/pcx86-dbg.js +++ b/docs/pcx86/examples/pcx86-dbg.js @@ -654,7 +654,7 @@ l.Pb=function(a,b,c){var d=this;switch(b){case "listDisks":this.qa[b]=c;if(this. void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}};return!0;case "descDisk":case "listDrives":return this.qa[b]=c,c.onchange=function(){var a=ea(c.value,10);null!=a&&xp(d,a)},!0;case "loadDisk":return this.qa[b]=c,c.onclick=function(){var a=d.qa.listDisks;a&&yp(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDisk":if(!this.ia){c.parentNode.removeChild(c);break}this.qa[b]=c;c.onclick=function(){var a=d.qa.listDrives;a&&a.options&&d.A&&((a= d.A[ea(a.value,10)||0])?(a=a.za)?(a=Qa(tp(a),"octet-stream",!0,a.Ug.replace(".json",".img")),w(a)):d.Na("No diskette loaded in drive."):d.Na("No diskette drive selected."))};return!0;case "mountDisk":if(this.ia)return this.qa[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;yp(d,ja(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; l.Jc=function(a,b,c,d){this.ga=b;this.F=c;this.ha=d;this.X=a;this.N=Gb(a,"ChipSet");if((this.U=Vc(this.X,"autoMount")||this.U)&&"string"==typeof this.U)try{this.U=eval("("+this.U+")")}catch(e){w("FDC auto-mount error: "+e.message+" ("+this.U+")"),this.U=null}zp(this);nc(b,this,Ap);rc(b,this,Bp);Cp(this,"None","",!0);this.ia&&Cp(this,"Local Disk","?");Cp(this,"Remote Disk","??");Dp(this)||ub(this)}; -l.hc=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.X.lh){this.B=[];for(a=0;ak.za.restore(g)&&(A=!1),A&&void 0!==k.eb&&(k.pb=k.za.seek(k.be,k.kb,k.xb+k.sg)));A||(e=!1);null!=a.pa&& diff --git a/docs/pcx86/examples/pcx86.js b/docs/pcx86/examples/pcx86.js index d10c0ba12..8bbd80e10 100644 --- a/docs/pcx86/examples/pcx86.js +++ b/docs/pcx86/examples/pcx86.js @@ -603,7 +603,7 @@ l.zb=function(a,b,c){var d=this;switch(b){case "listDisks":this.la[b]=c;if(this. b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}};return!0;case "descDisk":case "listDrives":return this.la[b]=c,c.onchange=function(){var a=ea(c.value,10);null!=a&&vm(d,a)},!0;case "loadDisk":return this.la[b]=c,c.onclick=function(){var a=d.la.listDisks;a&&wm(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDisk":if(!this.Y){c.parentNode.removeChild(c);break}this.la[b]=c;c.onclick=function(){var a=d.la.listDrives;a&&a.options&&d.B&&((a=d.B[ea(a.value, 10)||0])?(a=a.ua)?(a=Ca(rm(a),"octet-stream",!0,a.th.replace(".json",".img")),r(a)):d.Ba("No diskette loaded in drive."):d.Ba("No diskette drive selected."))};return!0;case "mountDisk":if(this.Y)return this.la[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;wm(d,ga(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; l.pc=function(a,b,c,d){this.ia=b;this.A=c;this.Ia=d;this.ba=a;this.S=jb(a,"ChipSet");if((this.K=kc(this.ba,"autoMount")||this.K)&&"string"==typeof this.K)try{this.K=eval("("+this.K+")")}catch(e){r("FDC auto-mount error: "+e.message+" ("+this.K+")"),this.K=null}xm(this);Pb(b,this,ym);Rb(b,this,zm);Am(this,"None","",!0);this.Y&&Am(this,"Local Disk","?");Am(this,"Remote Disk","??");Bm(this)||t(this)}; -l.Ub=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.ba.pg){this.C=[];for(a=0;ak.ua.restore(g)&&(z=!1),z&&void 0!==k.Ua&&(k.Wa=k.ua.seek(k.Id,k.Ya,k.mb+k.yf)));z||(e=!1);null!=a.da&&1>=d&& diff --git a/modules/pcx86/lib/fdc.js b/modules/pcx86/lib/fdc.js index 911de007d..8d50a7868 100644 --- a/modules/pcx86/lib/fdc.js +++ b/modules/pcx86/lib/fdc.js @@ -684,7 +684,7 @@ FDC.prototype.initBus = function(cmp, bus, cpu, dbg) FDC.prototype.powerUp = function(data, fRepower) { if (!fRepower) { - if (!data || !this.restore) { + if (!data) { this.reset(); if (this.cmp.fReload) { /* @@ -798,7 +798,7 @@ FDC.prototype.initController = function(data) var i = 0, iDrive; var fSuccess = true; - if (data === undefined) { + if (!data) { data = [0, 0, FDC.REG_STATUS.RQM, new Array(9), 0, 0, 0, []]; } diff --git a/modules/pcx86/lib/hdc.js b/modules/pcx86/lib/hdc.js index e9aea46d5..3a5d63c5c 100644 --- a/modules/pcx86/lib/hdc.js +++ b/modules/pcx86/lib/hdc.js @@ -668,7 +668,7 @@ HDC.prototype.initBus = function(cmp, bus, cpu, dbg) HDC.prototype.powerUp = function(data, fRepower) { if (!fRepower) { - if (!data || !this.restore) { + if (!data) { this.initController(); if (this.cmp.fReload) { /* diff --git a/modules/pdp11/lib/computer.js b/modules/pdp11/lib/computer.js index af3cfd812..d9f0b9b14 100644 --- a/modules/pdp11/lib/computer.js +++ b/modules/pdp11/lib/computer.js @@ -727,7 +727,7 @@ class ComputerPDP11 extends Component { * TODO: Do we not care about the return value here? (ie, is checking fRestoreError sufficient)? */ this.powerRestore(this.cpu, stateComputer, fRepower, fRestore); - this.updateDisplays(); + this.updateDisplays(-2); this.cpu.autoStart(); } diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 27cd9e438..5e2d21f60 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -577,10 +577,11 @@ class CPUStatePDP11 extends CPUPDP11 { { this.addrReset = addr; - this.resetCPU(); this.setPC(addr); this.setPSW(0); + this.resetCPU(); + if (fStart) { /* * TODO: Review. I'm zeroing R2-R5 in the fStart case (ie, for boot code) simply because that's what I @@ -677,7 +678,7 @@ class CPUStatePDP11 extends CPUPDP11 { restore(data) { /* - * ES6 ALERT: Gotta love these destructuring assignments, which make it easy to perform the + * ES6 ALERT: Love these destructuring assignments, which make it easy to perform the * inverse of what save() does when it collects a bunch of object properties into an array. */ [ diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index 23004ed66..f200c2a9c 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -2752,7 +2752,9 @@ class DebuggerPDP11 extends Debugger { if (sParm == 'n') { this.nBreakInstructions = this.parseValue(sAddr); - this.println("break after " + this.nBreakInstructions + " instruction(s)"); + if (this.nBreakInstructions != null) { + this.println("break after " + this.nBreakInstructions + " instruction(s)"); + } return; } diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index 887dd9c7c..f2bc71c1a 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -241,7 +241,7 @@ class DevicePDP11 extends Component { restore(data) { /* - * ES6 ALERT: Gotta love these destructuring assignments, which make it easy to perform the + * ES6 ALERT: Love these destructuring assignments, which make it easy to perform the * inverse of what save() does when it collects a bunch of object properties into an array. */ [ diff --git a/modules/pdp11/lib/panel.js b/modules/pdp11/lib/panel.js index 469af8d49..b13f33f51 100644 --- a/modules/pdp11/lib/panel.js +++ b/modules/pdp11/lib/panel.js @@ -36,6 +36,7 @@ if (NODE) { var Str = require("../../shared/es6/strlib"); var Web = require("../../shared/es6/weblib"); var Component = require("../../shared/es6/component"); + var State = require("../../shared/es6/state"); var PDP11 = require("./defines"); var BusPDP11 = require("./bus"); var MessagesPDP11 = require("./messages"); @@ -80,6 +81,7 @@ class PanelPDP11 extends Component { this.regDisplay = 0; this.regSwitches = 0; this.regAddr = this.regData = 0; + this.ledAddr = this.ledData = -1; /* * The panel hardware has the following additional (supported) state; note that there are several @@ -246,6 +248,7 @@ class PanelPDP11 extends Component { * Simulate a call to our stop() handler, to update the panel's ADDRESS register with the current PC. */ this.stop(); + this.setDR(0); } /** @@ -396,10 +399,11 @@ class PanelPDP11 extends Component { */ if (this.fBindings) PanelPDP11.init(); - /* - * TODO: Until we implement a restore() function, all we can do is reset() - */ - this.reset(); + if (!data) { + this.reset(); + } else { + if (!this.restore(data)) return false; + } } return true; } @@ -414,6 +418,45 @@ class PanelPDP11 extends Component { */ powerDown(fSave, fShutdown) { + return fSave? this.save() : true; + } + + /** + * save() + * + * This implements save support for the PanelPDP11 component. + * + * @this {PanelPDP11} + * @return {Object} + */ + save() + { + var state = new State(this); + state.set(0, [ + this.getAR(), + this.getDR(), + this.getSR() + ]); + return state.data(); + } + + /** + * restore(data) + * + * This implements restore support for the PanelPDP11 component. + * + * @this {PanelPDP11} + * @param {Object} data + * @return {boolean} true if successful, false if failure + */ + restore(data) + { + var a = data[0]; + if (a) { + this.setAR(a[0]); + this.setDR(a[1]); + this.setSR(a[2]); + } return true; } @@ -865,7 +908,10 @@ class PanelPDP11 extends Component { updateAddr(value) { this.regAddr = value & this.bus.nBusMask; - this.updateLEDArray("A", this.regAddr, 22); + if (this.ledAddr !== this.regAddr) { + this.ledAddr = this.regAddr; + this.updateLEDArray("A", this.ledAddr, 22); + } return this.regAddr; } @@ -879,7 +925,10 @@ class PanelPDP11 extends Component { updateData(value) { this.regData = value & 0xffff; - this.updateLEDArray("D", this.regData, 16); + if (this.ledData !== this.regData) { + this.ledData = this.regData; + this.updateLEDArray("D", this.ledData, 16); + } return this.regData; } @@ -996,7 +1045,7 @@ class PanelPDP11 extends Component { * Called by the Computer component at intervals to update registers, LEDs, etc. * * @this {PanelPDP11} - * @param {number} [nUpdate] (< 0 for forced, > 0 for periodic, 0 otherwise) + * @param {number} [nUpdate] (-2 for power on, -1 for forced, > 0 for periodic, 0 or undefined otherwise) */ updateDisplay(nUpdate) { @@ -1032,7 +1081,13 @@ class PanelPDP11 extends Component { * TODO: There is currently no mechanism for selecting regData over regDisplay; * we are acting as if the DATASEL switch setting is locked to "DISPLAY REGISTER". */ - this.updateAddr(nUpdate > 0 && fRunning && !fWaiting? this.cpu.getLastAddr() : this.regAddr); + if (nUpdate < -1) { + this.regAddr = this.cpu.regsGen[7]; + } else if (nUpdate > 0 && fRunning && !fWaiting) { + this.regAddr = this.cpu.getLastAddr(); + } + + this.updateAddr(this.regAddr); this.updateData(this.regDisplay); var bits = this.cpu.getMMUState(); diff --git a/modules/pdp11/lib/rk11.js b/modules/pdp11/lib/rk11.js index bf7c27b23..f8589ab16 100644 --- a/modules/pdp11/lib/rk11.js +++ b/modules/pdp11/lib/rk11.js @@ -79,10 +79,24 @@ class RK11 extends Component { this.fLocalDisks = (!Web.isMobile() && window && 'FileReader' in window); this.sDiskSource = RK11.SOURCE.NONE; + /* + * The following array keeps track of every disk image we've ever mounted. Each entry in the + * array is another array whose elements are: + * + * [0]: name of disk + * [1]: path of disk + * [2]: array of deltas, uninitialized until the disk is unmounted and/or all state is saved + * + * See functions addDiskHistory() and updateDiskHistory(). + */ + this.aDiskHistory = []; + this.irq = null; /* * Define all the properties to be initialized by initController() + * + * TODO: Determine what we should really be doing with the RKDB register. */ this.regRKDS = this.regRKER = this.regRKCS = this.regRKWC = this.regRKBA = this.regRKDA = this.regRKDB = 0; } @@ -436,7 +450,7 @@ class RK11 extends Component { save() { var state = new State(this); - // state.set(0, this.saveController()); + state.set(0, this.saveController()); return state.data(); } @@ -454,17 +468,156 @@ class RK11 extends Component { return this.initController(data[0]); } + /** + * initController(a) + * + * @this {RK11} + * @param {Array} [a] + * @return {boolean} true if successful, false if failure + */ + initController(a) + { + var fSuccess = true; + + if (!a) { + a = [(RK11.RKDS.RK05 | RK11.RKDS.SOK | RK11.RKDS.RRDY), 0, (RK11.RKCS.CRDY), 0, 0, 0, 0]; + } + + /* + * ES6 ALERT: Love these destructuring assignments, which make it easy to perform the + * inverse of what save() does when it collects a bunch of object properties into an array. + */ + [ + this.regRKDS, + this.regRKER, + this.regRKCS, + this.regRKWC, + this.regRKBA, + this.regRKDA, + this.regRKDB + ] = a; + + /* + * Initialize the disk history (if available) before initializing the drives, so that any disk deltas can be + * applied to disk images that are already loaded. + */ + if (a[7]) { + this.aDiskHistory = a[7]; + } + + for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { + var drive = this.aDrives[iDrive]; + if (drive === undefined) { + drive = this.aDrives[iDrive] = {}; + } + if (!this.initDrive(drive, iDrive)) { + fSuccess = false; + } + } + return fSuccess; + } + /** * saveController() * - * TODO: Implement. + * Basically, the inverse of initController(). * * @this {RK11} * @return {Array} */ saveController() { - return []; + return [ + this.regRKDS, + this.regRKER, + this.regRKCS, + this.regRKWC, + this.regRKBA, + this.regRKDA, + this.regRKDB, + this.saveDeltas() + ]; + } + + /** + * saveDeltas() + * + * This returns an array of entries, one for each disk image we've ever mounted, including any deltas; ie: + * + * [name, path, deltas] + * + * aDiskHistory contains exactly that, except that deltas may not be up-to-date for any currently mounted + * disk image(s), so we call updateHistory() for all those disks, and then aDiskHistory is ready to be saved. + * + * @this {RK11} + * @return {Array} + */ + saveDeltas() + { + for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { + var drive = this.aDrives[iDrive]; + if (drive.disk) { + this.updateDiskHistory(drive.sDiskName, drive.sDiskPath, drive.disk); + } + } + return this.aDiskHistory; + } + + /** + * initDrive(drive, iDrive, data) + * + * TODO: Consider a separate Drive class that any drive controller can use, since there's a lot of commonality + * between the drive objects created by disk controllers. This will clean up overall drive management and allow + * us to factor out some common Drive methods. + * + * Also, either use or eliminate the data parameter; if there are no drive properties that need to be preserved + * across save/restore, then eliminate it. + * + * @this {RK11} + * @param {Object} drive + * @param {number} iDrive + * @param {Array|undefined} [data] + * @return {boolean} true if successful, false if failure + */ + initDrive(drive, iDrive, data) + { + var i = 0; + var fSuccess = true; + + drive.iDrive = iDrive; + drive.name = this.idComponent; + drive.fBusy = drive.fLocal = false; + + /* + * NOTE: We initialize the following drive properties to their MAXIMUMs; disks may have + * these or SMALLER values (subject to the limits of what the controller supports, of course). + */ + drive.nCylinders = 203; + drive.nHeads = 2; + drive.nSectors = 12; + drive.cbSector = 512; + drive.fRemovable = true; + + /* + * The next group of properties are set by various controller command sequences. + */ + drive.bHead = 0; + drive.bCylinder = 0; + drive.bSector = 1; + drive.bSectorEnd = drive.nSectors; // aka EOT + drive.nBytes = drive.cbSector; + + /* + * The next group of properties are managed by worker functions (eg, doRead()) to maintain state across DMA requests. + */ + drive.ibSector = 0; + drive.sector = null; + + if (!drive.disk) drive.sDiskPath = ""; // ensure this is initialized to a default that displayDisk() can deal with + + drive.status = RK11.RKDS.RK05 | RK11.RKDS.SOK | RK11.RKDS.RRDY; + + return fSuccess; } /** @@ -637,8 +790,6 @@ class RK11 extends Component { */ finishLoadDrive(drive, disk, sDiskName, sDiskPath, fAutoMount) { - var aDiskInfo; - drive.fBusy = false; if (disk) { @@ -669,23 +820,7 @@ class RK11 extends Component { * of a local disk image, it will map all such disks to "Local Disk", and any attempt to "Mount" such * a disk, will essentially result in a "Disk not found" error. */ - // this.addDiskHistory(sDiskName, sDiskPath, disk); - - /* - * For a local disk (ie, one loaded via mountDrive()), the disk.restore() performed by addDiskHistory() - * may have altered the disk geometry, so refresh the disk info. - */ - // aDiskInfo = disk.info(); - - /* - * Clearly, a successful mount implies a disk change, and I suppose that, technically, an *unsuccessful* - * mount should imply the same, but what would the real-world analog be? Inserting a piece of cardboard - * instead of an actual disk? In any case, if we can do the user a favor by pretending (as far as the - * disk change line is concerned) that an unsuccessful mount never happened, let's do it. - * - * Successful unmounts are a different story, however; those *do* trigger a change. See unloadDrive(). - */ - // this.regInput |= FDC.REG_INPUT.DISK_CHANGE; + this.addDiskHistory(sDiskName, sDiskPath, disk); /* * With the addition of notify(), users are now "alerted" whenever a disk has finished loading; @@ -826,7 +961,7 @@ class RK11 extends Component { /* * Before we toss the disk's information, capture any deltas that may have occurred. */ - // this.updateDiskHistory(drive.sDiskName, drive.sDiskPath, drive.disk); + this.updateDiskHistory(drive.sDiskName, drive.sDiskPath, drive.disk); drive.sDiskName = ""; drive.sDiskPath = ""; @@ -851,7 +986,7 @@ class RK11 extends Component { */ unloadAllDrives(fDiscard) { - // if (fDiscard) this.aDiskHistory = []; + if (fDiscard) this.aDiskHistory = []; for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { this.unloadDrive(iDrive, true); @@ -859,89 +994,85 @@ class RK11 extends Component { } /** - * initController(data) + * addDiskHistory(sDiskName, sDiskPath, disk) * * @this {RK11} - * @param {Array} [data] - * @return {boolean} true if successful, false if failure + * @param {string} sDiskName + * @param {string} sDiskPath + * @param {DiskPDP11} disk containing corresponding disk image */ - initController(data) + addDiskHistory(sDiskName, sDiskPath, disk) { - var i = 0; - if (!data) data = []; - this.regRKDS = data[i++] || (RK11.RKDS.RK05 | RK11.RKDS.SOK | RK11.RKDS.RRDY); - this.regRKER = data[i++] || 0; - this.regRKCS = data[i++] || (RK11.RKCS.CRDY); - this.regRKWC = data[i++] || 0; - this.regRKBA = data[i++] || 0; - this.regRKDA = data[i++] || 0; - this.regRKDB = data[i] || 0; // TODO: Determine if there's anything we should be doing to the RKDB register - - var fSuccess = true; - for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { - var drive = this.aDrives[iDrive]; - if (drive === undefined) { - drive = this.aDrives[iDrive] = {}; - } - if (!this.initDrive(drive, iDrive)) { - fSuccess = false; + var i; + this.assert(!!sDiskPath); + for (i = 0; i < this.aDiskHistory.length; i++) { + if (this.aDiskHistory[i][1] == sDiskPath) { + var nChanges = disk.restore(this.aDiskHistory[i][2]); + if (DEBUG && this.messageEnabled()) { + this.printMessage("disk '" + sDiskName + "' restored from history (" + nChanges + " changes)"); + } + return; } } - return fSuccess; + if (DEBUG && this.messageEnabled()) { + this.printMessage("disk '" + sDiskName + "' added to history (nothing to restore)"); + } + this.aDiskHistory[i] = [sDiskName, sDiskPath, []]; } /** - * initDrive(drive, iDrive, data) - * - * TODO: Consider a separate Drive class that any drive controller can use, since there's a lot of commonality - * between the drive objects created by disk controllers. This will clean up overall drive management and allow - * us to factor out some common Drive methods. + * removeDiskHistory(sDiskName, sDiskPath) * * @this {RK11} - * @param {Object} drive - * @param {number} iDrive - * @param {Array|undefined} [data] - * @return {boolean} true if successful, false if failure + * @param {string} sDiskName + * @param {string} sDiskPath */ - initDrive(drive, iDrive, data) + removeDiskHistory(sDiskName, sDiskPath) { - var i = 0; - var fSuccess = true; - - drive.iDrive = iDrive; - drive.name = this.idComponent; - drive.fBusy = drive.fLocal = false; + var i; + for (i = 0; i < this.aDiskHistory.length; i++) { + if (this.aDiskHistory[i][1] == sDiskPath) { + this.aDiskHistory.splice(i, 1); + if (DEBUG && this.messageEnabled()) { + this.printMessage("disk '" + sDiskName + "' removed from history"); + } + return; + } + } + if (DEBUG && this.messageEnabled()) { + this.printMessage("unable to remove disk '" + sDiskName + "' from history (" + sDiskPath + ")"); + } + } + /** + * updateDiskHistory(sDiskName, sDiskPath, disk) + * + * @this {RK11} + * @param {string} sDiskName + * @param {string} sDiskPath + * @param {DiskPDP11} disk containing corresponding disk image, with possible deltas + */ + updateDiskHistory(sDiskName, sDiskPath, disk) + { + var i; + for (i = 0; i < this.aDiskHistory.length; i++) { + if (this.aDiskHistory[i][1] == sDiskPath) { + this.aDiskHistory[i][2] = disk.save(); + if (DEBUG && this.messageEnabled()) { + this.printMessage("disk '" + sDiskName + "' updated in history"); + } + return; + } + } /* - * NOTE: We initialize the following drive properties to their MAXIMUMs; disks may have - * these or SMALLER values (subject to the limits of what the controller supports, of course). + * I used to report this as an error (at least in the DEBUG release), but it's no longer really + * an error, because if we're trying to re-mount a clean copy of a disk, we toss its history, then + * unload, and then reload/remount. And since unloadDrive's normal behavior is to call updateDiskHistory() + * before unloading, the fact that the disk is no longer listed here can't be treated as an error. */ - drive.nCylinders = 203; - drive.nHeads = 2; - drive.nSectors = 12; - drive.cbSector = 512; - drive.fRemovable = true; - - /* - * The next group of properties are set by various controller command sequences. - */ - drive.bHead = 0; - drive.bCylinder = 0; - drive.bSector = 1; - drive.bSectorEnd = drive.nSectors; // aka EOT - drive.nBytes = drive.cbSector; - - /* - * The next group of properties are managed by worker functions (eg, doRead()) to maintain state across DMA requests. - */ - drive.ibSector = 0; - drive.sector = null; - - if (!drive.disk) drive.sDiskPath = ""; // ensure this is initialized to a default that displayDisk() can deal with - - drive.status = RK11.RKDS.RK05 | RK11.RKDS.SOK | RK11.RKDS.RRDY; - - return fSuccess; + if (DEBUG && this.messageEnabled()) { + this.printMessage("unable to update disk '" + sDiskName + "' in history (" + sDiskPath + ")"); + } } /** diff --git a/modules/pdp11/lib/serial.js b/modules/pdp11/lib/serial.js index 557305c54..3a0e462d5 100644 --- a/modules/pdp11/lib/serial.js +++ b/modules/pdp11/lib/serial.js @@ -485,32 +485,48 @@ class SerialPortPDP11 extends Component { } /** - * initState(data) + * initState(a) * * @this {SerialPortPDP11} - * @param {Array} [data] + * @param {Array} [a] * @return {boolean} true if successful, false if failure */ - initState(data) + initState(a) { - this.regRBUF = 0; - this.regRCSR = PDP11.DL11.RCSR.CTS; // TODO: I didn't use to set this initially; is this wise? - this.regXCSR = PDP11.DL11.XCSR.READY; - this.abReceive = []; + if (!a) { + a = [0, PDP11.DL11.RCSR.CTS, PDP11.DL11.XCSR.READY, this.abReceive]; + } + + /* + * ES6 ALERT: Love these destructuring assignments, which make it easy to perform the + * inverse of what save() does when it collects a bunch of object properties into an array. + */ + [ + this.regRBUF, + this.regRCSR, + this.regXCSR, + this.abReceive + ] = a; + return true; } /** * saveRegisters() * - * TODO: Implement. + * Basically, the inverse of initState(). * * @this {SerialPortPDP11} * @return {Array} */ saveRegisters() { - return []; + return [ + this.regRBUF, + this.regRCSR, + this.regXCSR, + this.abReceive + ]; } /** diff --git a/versions/pcx86/1.32.2/pcx86-dbg.js b/versions/pcx86/1.32.2/pcx86-dbg.js index a8f6930f1..7b04db0a2 100644 --- a/versions/pcx86/1.32.2/pcx86-dbg.js +++ b/versions/pcx86/1.32.2/pcx86-dbg.js @@ -654,7 +654,7 @@ l.Pb=function(a,b,c){var d=this;switch(b){case "listDisks":this.qa[b]=c;if(this. void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}};return!0;case "descDisk":case "listDrives":return this.qa[b]=c,c.onchange=function(){var a=ea(c.value,10);null!=a&&xp(d,a)},!0;case "loadDisk":return this.qa[b]=c,c.onclick=function(){var a=d.qa.listDisks;a&&yp(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDisk":if(!this.ia){c.parentNode.removeChild(c);break}this.qa[b]=c;c.onclick=function(){var a=d.qa.listDrives;a&&a.options&&d.A&&((a= d.A[ea(a.value,10)||0])?(a=a.za)?(a=Qa(tp(a),"octet-stream",!0,a.Ug.replace(".json",".img")),w(a)):d.Na("No diskette loaded in drive."):d.Na("No diskette drive selected."))};return!0;case "mountDisk":if(this.ia)return this.qa[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;yp(d,ja(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; l.Jc=function(a,b,c,d){this.ga=b;this.F=c;this.ha=d;this.X=a;this.N=Gb(a,"ChipSet");if((this.U=Vc(this.X,"autoMount")||this.U)&&"string"==typeof this.U)try{this.U=eval("("+this.U+")")}catch(e){w("FDC auto-mount error: "+e.message+" ("+this.U+")"),this.U=null}zp(this);nc(b,this,Ap);rc(b,this,Bp);Cp(this,"None","",!0);this.ia&&Cp(this,"Local Disk","?");Cp(this,"Remote Disk","??");Dp(this)||ub(this)}; -l.hc=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.X.lh){this.B=[];for(a=0;ak.za.restore(g)&&(A=!1),A&&void 0!==k.eb&&(k.pb=k.za.seek(k.be,k.kb,k.xb+k.sg)));A||(e=!1);null!=a.pa&& diff --git a/versions/pcx86/1.32.2/pcx86.js b/versions/pcx86/1.32.2/pcx86.js index d10c0ba12..8bbd80e10 100644 --- a/versions/pcx86/1.32.2/pcx86.js +++ b/versions/pcx86/1.32.2/pcx86.js @@ -603,7 +603,7 @@ l.zb=function(a,b,c){var d=this;switch(b){case "listDisks":this.la[b]=c;if(this. b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}};return!0;case "descDisk":case "listDrives":return this.la[b]=c,c.onchange=function(){var a=ea(c.value,10);null!=a&&vm(d,a)},!0;case "loadDisk":return this.la[b]=c,c.onclick=function(){var a=d.la.listDisks;a&&wm(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDisk":if(!this.Y){c.parentNode.removeChild(c);break}this.la[b]=c;c.onclick=function(){var a=d.la.listDrives;a&&a.options&&d.B&&((a=d.B[ea(a.value, 10)||0])?(a=a.ua)?(a=Ca(rm(a),"octet-stream",!0,a.th.replace(".json",".img")),r(a)):d.Ba("No diskette loaded in drive."):d.Ba("No diskette drive selected."))};return!0;case "mountDisk":if(this.Y)return this.la[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;wm(d,ga(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; l.pc=function(a,b,c,d){this.ia=b;this.A=c;this.Ia=d;this.ba=a;this.S=jb(a,"ChipSet");if((this.K=kc(this.ba,"autoMount")||this.K)&&"string"==typeof this.K)try{this.K=eval("("+this.K+")")}catch(e){r("FDC auto-mount error: "+e.message+" ("+this.K+")"),this.K=null}xm(this);Pb(b,this,ym);Rb(b,this,zm);Am(this,"None","",!0);this.Y&&Am(this,"Local Disk","?");Am(this,"Remote Disk","??");Bm(this)||t(this)}; -l.Ub=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.ba.pg){this.C=[];for(a=0;ak.ua.restore(g)&&(z=!1),z&&void 0!==k.Ua&&(k.Wa=k.ua.seek(k.Id,k.Ya,k.mb+k.yf)));z||(e=!1);null!=a.da&&1>=d&& diff --git a/versions/pdpjs/1.32.2/pdp11-dbg.js b/versions/pdpjs/1.32.2/pdp11-dbg.js index 2e546ae13..36962eb9a 100644 --- a/versions/pdpjs/1.32.2/pdp11-dbg.js +++ b/versions/pdpjs/1.32.2/pdp11-dbg.js @@ -37,14 +37,14 @@ function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol(" function p(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}for(var ka=ba,la=["Math","log2"],ma=0;ma":62,"?":63,"@":64,Jc:65,qg:66,sg:67,Pg:68,E:69,Qg:70,Rg:71,Sg:72,Tg:73,Ug:74,Vg:75,Wg:76,Xg:77,Yg:78,Zg:79,$g:80,Q:81,ah:82,bh:83,dh:84,eh:85,fh:86,gh:87,hh:88,ih:89,Gd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,jh:97,kh:98,lh:99,d:100,e:101,mh:102,nh:103,oh:104,ph:105,sh:106,k:107,th:108,uh:109,n:110,vh:111,p:112,q:113,r:114,wh:115,t:116,yh:117,zh:118,Ah:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,xd:127};function q(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Sc=b.comment;this.Fd=b;this.exports={};this.B=this.bindings={};a=this.id.indexOf(".");0>a?this.mb=this.id:(this.nb=this.id.substr(0,a),this.mb=this.id.substr(a+1));this.A={ready:!1,fb:!1,Ac:!1,fa:!1,error:!1};this.hc=null;this.A.error=!1;this.ha=d||0;this.F=this.f=this.D=this.J=this.Pa=null;ua.push(this)}function va(a,b,c){xa[a]&&b&&(xa[a][b]=c)} +"|":124,"}":125,"~":126,xd:127};function q(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Sc=b.comment;this.Fd=b;this.exports={};this.C=this.bindings={};a=this.id.indexOf(".");0>a?this.nb=this.id:(this.ob=this.id.substr(0,a),this.nb=this.id.substr(a+1));this.A={ready:!1,gb:!1,Ac:!1,ha:!1,error:!1};this.hc=null;this.A.error=!1;this.ja=d||0;this.G=this.f=this.D=this.J=this.Pa=null;ua.push(this)}function va(a,b,c){xa[a]&&b&&(xa[a][b]=c)} function ya(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function za(a){var b=!1;window&&(b=window.confirm(a));return b}function Aa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;bb?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function cb(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function db(a,b){var c,d={ca:null,ea:null,Aa:null,za:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Aa=g.load;d.za=g.exec;if(e=g.bytes)d.ca=e;else if(e=g.words)for(d.ca=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ca=Array(4*e.length),f=c=0;c>8&255,d.ca[f++]=e[c]>>16&255,d.ca[f++]=e[c]>>24&255;else d.ca=g;d.ea=g.symbols;d.ca.length?1==d.ca.length&&(v(d.ca[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Ba=g.load;d.Aa=g.exec;if(e=g.bytes)d.ca=e;else if(e=g.words)for(d.ca=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ca=Array(4*e.length),f=c=0;c>8&255,d.ca[f++]=e[c]>>16&255,d.ca[f++]=e[c]>>24&255;else d.ca=g;d.ga=g.symbols;d.ca.length?1==d.ca.length&&(v(d.ca[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.b["S"+a]=[0,0,!1,!1,this.Zd,a];this.F=this.f=this.D=this.J=null;A(this)}p(Tb,q);h=Tb.prototype;h.reset=function(){this.stop()}; -h.qa=function(a,b,c,d){if(this.J&&this.J.qa(a,b,c,d)||this.f&&this.f.qa(a,b,c,d)||this.F&&this.F.qa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.B[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.B[b]=c,this.g[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.B[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, -b){return function(){Vb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Wb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Vb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Wb(a,b)}}(this,b),!0):q.prototype.qa.call(this,a,b,c,d)}};h.ua=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;Xb(b,this,Yb);Zb(b,this.reset.bind(this));$b(this);ac(this)};h.wa=function(a,b){b||(this.I&&bc(),this.reset());return!0};h.va=function(){return!0}; -function cc(a,b,c){if(a=a.B[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function $b(a,b){for(var c in a.g)cc(a,c,null!=b?b:a.g[c])}function dc(a,b,c){if(a=a.B[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function ac(a){for(var b in a.b)dc(a,b,a.b[b][1])}function ec(a,b,c,d){a.B[b]&&(void 0===c&&(Ea(a,"Value for "+b+" is invalid"),a.f.Z()),c=8==(a.F&&a.F.Ba||8)?H(c,d):I(c,d),a.B[b].textContent!=c&&(a.B[b].textContent=c))} -function Vb(a,b){var c=a.b[b];dc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=fc&&(a.C=b==gc,a.G=b==hc)}function Wb(a,b){var c=a.b[b];c[2]&&c[3]&&(dc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Xd=function(a){a||this.f.A.U||(a=this.f,a.D.reset(),ic(a),this.b[jc]&&this.b[jc][1]&&kc(this.f))};h.Yd=function(){};h.Td=function(a){a||this.f.Z()}; -h.Rd=function(a){if(!a&&!this.f.A.U)if(this.b[jc]&&this.b[jc][1])kc(this.f);else{if((a=this.F)&&!La(a,!0))Ma(a,!0),lc(a,0,null),Ma(a,!1);else try{var b=this.f.ec(1);0=a.f.ia?8:16,c=65472<=a.xa&&a.xa<65472+b,b=c?1:2,c=c?15:a.D.I;a.b[fc]&&a.b[fc][1]||(b=-b);Gc(a,a.xa&~c|a.xa+b&c)} -function Gc(a,b){a.xa=b&a.D.I;b=a.xa;for(var c=0;22>c;c++)Ic(a,"A"+c,b&1<c;c++)Ic(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.H=this.M/this.j|0;this.T=this.H-1;this.Ma=[];this.la=0;this.G=!1;this.O=[];this.Hd=[Oc,Pc,Qc,Rc];this.b=this.v=[];this.C=this.L=this.w=this.P=this.R=0;a=new L(this);Sc(a,this.F);this.b=Array(this.H);this.v=Array(this.H);for(b=0;b>>this.g;this.L=0;this.w=this.I;A(this)}p(Mc,q);function Vc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.v[a.R]=a.b[a.P])}}h=Mc.prototype;h.reset=function(){for(var a=0;aa;a++)this.b["S"+a]=[0,0,!1,!1,this.Zd,a];this.G=this.f=this.D=this.J=null;A(this)}p(Tb,q);h=Tb.prototype; +h.reset=function(){this.stop();Vb(this,this.Sa=0)}; +h.sa=function(a,b,c,d){if(this.J&&this.J.sa(a,b,c,d)||this.f&&this.f.sa(a,b,c,d)||this.G&&this.G.sa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.C[b]=c,this.u++,!0;default:return"led"==a||"rled"==a?(this.C[b]=c,this.i[b]=d?1:0,this.u++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.C[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, +b){return function(){Wb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Xb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Wb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Xb(a,b)}}(this,b),!0):q.prototype.sa.call(this,a,b,c,d)}};h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;Yb(b,this,Zb);$b(b,this.reset.bind(this));ac(this);bc(this)}; +h.ya=function(a,b){if(!b)if(this.M&&cc(),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.save=function(){var a=new J(this);a.set(0,[this.fa,this.Sa,this.Ta]);return a.data()};h.restore=function(a){if(a=a[0])dc(this,this.fa=a[0]),Vb(this,this.Sa=a[1]),ec(this,a[2]);return!0};function fc(a,b,c){if(a=a.C[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ac(a,b){for(var c in a.i)fc(a,c,null!=b?b:a.i[c])} +function gc(a,b,c){if(a=a.C[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function bc(a){for(var b in a.b)gc(a,b,a.b[b][1])}function hc(a,b,c,d){a.C[b]&&(void 0===c&&(Ea(a,"Value for "+b+" is invalid"),a.f.Z()),c=8==(a.G&&a.G.Ca||8)?H(c,d):I(c,d),a.C[b].textContent!=c&&(a.C[b].textContent=c))}function Wb(a,b){var c=a.b[b];gc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=ic&&(a.H=b==jc,a.I=b==kc)} +function Xb(a,b){var c=a.b[b];c[2]&&c[3]&&(gc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Xd=function(a){a||this.f.A.U||(a=this.f,a.D.reset(),lc(a),this.b[mc]&&this.b[mc][1]&&nc(this.f))};h.Yd=function(){};h.Td=function(a){a||this.f.Z()}; +h.Rd=function(a){if(!a&&!this.f.A.U)if(this.b[mc]&&this.b[mc][1])nc(this.f);else{if((a=this.G)&&!La(a,!0))Ma(a,!0),oc(a,0,null),Ma(a,!1);else try{var b=this.f.ec(1);0=a.f.ka?8:16,c=65472<=a.fa&&a.fa<65472+b,b=c?1:2,c=c?15:a.D.I;a.b[ic]&&a.b[ic][1]||(b=-b);dc(a,a.fa&~c|a.fa+b&c)} +function dc(a,b){a.fa=b&a.D.I;if(a.B!==a.fa){a.B=a.fa;b=a.B;for(var c=0;22>c;c++)Ic(a,"A"+c,b&1<c;c++)Ic(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.H=this.M/this.j|0;this.T=this.H-1;this.Ma=[];this.ma=0;this.F=!1;this.O=[];this.Hd=[Oc,Pc,Qc,Rc];this.b=this.u=[];this.B=this.L=this.w=this.P=this.R=0;a=new M(this);Sc(a,this.G);this.b=Array(this.H);this.u=Array(this.H);for(b=0;b>>this.g;this.L=0;this.w=this.I;A(this)}p(Mc,q);function Vc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.u[a.R]=a.b[a.P])}}h=Mc.prototype;h.reset=function(){for(var a=0;a>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.K)return l.Kb+=l.K-f,l.K=f,!0;if(f>=l.K+l.Kb){n=l.size-(f-m);n>g&&(n=g);l.Kb=f-l.K+n;f=m+a.j;g-=n;k++;continue}}return Xc(Yc,f,g)}f=new L(a,f,n,a.j,d,e);Sc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Zc[d]+" at "+H(b)),!0):Xc($c,b,c)}h.Kc=function(a){return this.v[(a&this.w)>>>this.g].vb(a&this.i,a)}; -h.dc=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Pb||b!=this.i?this.v[c].ma(b,a):this.v[c++].vb(b,a)|this.v[c&this.T].vb(0,a+1)<<8};h.Lc=function(a,b){this.v[(a&this.w)>>>this.g].yb(a&this.i,b,a)};h.Ob=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Pb||c!=this.i?this.v[d].zb(c,b,a):(this.v[d++].yb(c,b&255,a),this.v[d&this.T].yb(0,b>>8&255,a+1))};function ad(a,b){return a.b[(b&a.I)>>>a.g]} -function Ec(a,b){var c;a.G=!1;a.la++;var d=b&a.i,e=ad(a,b);Pb||d!=a.i?c=e.C(d,b):c=e.j(d,b)|ad(a,b+1).j(0,b+1)<<8;a.la--;return c}function bd(a,b,c){a.G=!1;a.la++;ad(a,b).D(b&a.i,c&255,b);a.la--}function rc(a,b,c){a.G=!1;a.la++;var d=b&a.i,e=ad(a,b);Pb||d!=a.i?e.G(d,c&65535,b):(e.D(d,c&255,b),ad(a,b+1).D(0,c>>8&255,b+1));a.la--} -function Wc(a){for(var b=0,c=[],d=0;d>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.K)return l.Kb+=l.K-f,l.K=f,!0;if(f>=l.K+l.Kb){n=l.size-(f-m);n>g&&(n=g);l.Kb=f-l.K+n;f=m+a.j;g-=n;k++;continue}}return Xc(Yc,f,g)}f=new M(a,f,n,a.j,d,e);Sc(f,a.G,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Zc[d]+" at "+H(b)),!0):Xc($c,b,c)}h.Kc=function(a){return this.u[(a&this.w)>>>this.g].wb(a&this.i,a)}; +h.dc=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Pb||b!=this.i?this.u[c].na(b,a):this.u[c++].wb(b,a)|this.u[c&this.T].wb(0,a+1)<<8};h.Lc=function(a,b){this.u[(a&this.w)>>>this.g].yb(a&this.i,b,a)};h.Ob=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Pb||c!=this.i?this.u[d].zb(c,b,a):(this.u[d++].yb(c,b&255,a),this.u[d&this.T].yb(0,b>>8&255,a+1))};function ad(a,b){return a.b[(b&a.I)>>>a.g]} +function Gc(a,b){var c;a.F=!1;a.ma++;var d=b&a.i,e=ad(a,b);Pb||d!=a.i?c=e.B(d,b):c=e.j(d,b)|ad(a,b+1).j(0,b+1)<<8;a.ma--;return c}function bd(a,b,c){a.F=!1;a.ma++;ad(a,b).D(b&a.i,c&255,b);a.ma--}function Ec(a,b,c){a.F=!1;a.ma++;var d=b&a.i,e=ad(a,b);Pb||d!=a.i?e.F(d,c&65535,b):(e.D(d,c&255,b),ad(a,b+1).D(0,c>>8&255,b+1));a.ma--} +function Wc(a){for(var b=0,c=[],d=0;da.f.ia)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Ma[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&B(this.f,16|e[5])&&C(this.f,e[4]+".readByte("+O(this.f,b)+"): "+O(this.f,c),!0,!d.la),c;d.La(b,16,3);c=255;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to byte @"+O(this.f,b)+": "+O(this.f,c),!0,!d.la);return c} -function Pc(a,b,c){var d=!1,e=this.controller,f=e.Ma[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ma[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&B(this.f,16|f[5])&&C(this.f,f[4]+".writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.la):(e.La(c,16,5),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to byte @"+O(this.f,c)+": "+O(this.f, -b),!0,!e.la))}function Qc(a,b){var c=-1,d=this.controller;a=d.Ma[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".readWord("+O(this.f,b)+"): "+O(this.f,c),!0,!d.la),c;d.La(b,16,2);c=65535;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to word @"+O(this.f,b)+": "+O(this.f,c),!0,!d.la);return c} -function Rc(a,b,c){var d=!1,e=this.controller;a=e.Ma[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".writeWord("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.la):(e.La(c,16,4),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to word @"+O(this.f,c)+": "+O(this.f,b),!0,!e.la))}function P(a){q.call(this,"Device",a,0,256);this.b={Ya:128,Hc:-1}}p(P,q);h=P.prototype; -h.ua=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.F=d;var e=this;this.b.Hc=hd(c,function(){e.b.Ya|=128;e.b.Ya&64&&id(e.f,e.b.hb);e.J&&J(e.J,1);jd(e.f,e.b.Hc,1E3/60)});this.b.hb=kd(c,64,6,524288);Xb(b,this,ld);Zb(b,this.reset.bind(this));d&&md(d,64,function(a){var b=e.f;nd(e,"KIPDR",b.C[0],0,a[0]);nd(e,"KDPDR",b.C[0],8,a[0]);nd(e,"KIPAR",b.M[0],0,a[0]);nd(e,"KDPAR",b.M[0],8,a[0],!0);nd(e,"SIPDR",b.C[1],0,a[0]);nd(e,"SDPDR",b.C[1],8,a[0]);nd(e,"SIPAR",b.M[1],0,a[0]);nd(e,"SDPAR",b.M[1],8,a[0], -!0);nd(e,"UIPDR",b.C[3],0,a[0]);nd(e,"UDPDR",b.C[3],8,a[0]);nd(e,"UIPAR",b.M[3],0,a[0]);nd(e,"UDPAR",b.M[3],8,a[0],!0);b.T&32&&nd(e,"UNIMAP",b.Ga,-1,a[0])});A(this)};function nd(a,b,c,d,e,f){a=a.F;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Ga[a>>1];return a&1?b>>16:b&65535};h.hg=function(a,b){b=b>>1&63;var c=b>>1;this.f.Ga[c]=b&1?this.f.Ga[c]&65535|(a&63)<<16:this.f.Ga[c]&-65536|a&65534};h.Qe=function(a){return this.f.C[1][a>>1&7]};h.ag=function(a,b){this.f.C[1][b>>1&7]=a&65295};h.Oe=function(a){return this.f.C[1][(a>>1&7)+8]};h.Zf=function(a,b){this.f.C[1][(b>>1&7)+8]=a&65295};h.Pe=function(a){return this.f.M[1][a>>1&7]}; -h.$f=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.C[1][b]&=65295};h.Ne=function(a){return this.f.M[1][(a>>1&7)+8]};h.Yf=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.C[1][b]&=65295};h.je=function(a){return this.f.C[0][a>>1&7]};h.wf=function(a,b){this.f.C[0][b>>1&7]=a&65295};h.he=function(a){return this.f.C[0][(a>>1&7)+8]};h.uf=function(a,b){this.f.C[0][(b>>1&7)+8]=a&65295};h.ie=function(a){return this.f.M[0][a>>1&7]};h.vf=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.C[0][b]&=65295}; -h.ge=function(a){return this.f.M[0][(a>>1&7)+8]};h.tf=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.C[0][b]&=65295};h.We=function(a){return this.f.C[3][a>>1&7]};h.gg=function(a,b){this.f.C[3][b>>1&7]=a&65295};h.Ue=function(a){return this.f.C[3][(a>>1&7)+8]};h.eg=function(a,b){this.f.C[3][(b>>1&7)+8]=a&65295};h.Ve=function(a){return this.f.M[3][a>>1&7]};h.fg=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.C[3][b]&=65295};h.Te=function(a){return this.f.M[3][(a>>1&7)+8]}; -h.dg=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.C[3][b]&=65295};h.Ib=function(a){a&=7;return this.f.w&2048?this.f.oa[a]:this.f.g[a]};h.Mb=function(a,b){b&=7;this.f.w&2048?this.f.oa[b]=a:this.f.g[b]=a};h.ue=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.Ff=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.xe=function(){return this.f.g[7]};h.If=function(a){this.f.g[7]=a};h.Jb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.oa[a]}; -h.Nb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.oa[b]=a};h.ve=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Gf=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.we=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Hf=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.fe=function(a){return this.f.ac[a-65504>>1]};h.sf=function(a,b){this.f.ac[b-65504>>1]=a};h.nd=function(a){return 65520==a?(cd(this.D)>>6)-1:0}; -h.sd=function(){};h.Se=function(){return 1};h.cg=function(){};h.ee=function(){return this.f.R};h.rf=function(){this.f.R=0};h.le=function(){return this.f.$b};h.yf=function(a,b){b&1||(a&=255);this.f.$b=a};h.qe=function(a,b){return b?0:this.f.Va};h.Bf=function(a){ud(this.f,a)};h.Re=function(a,b){return b?0:this.f.ya&65280};h.bg=function(a){this.f.ya=a|255};h.te=function(){return vd(this.f)};h.Ef=function(a){Ed(this.f,a)};h.rd=function(a,b){B(this)&&C(this,"writeIgnored("+H(b)+"): "+H(a),!0,!0)}; +function Yb(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.f.ka)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Ma[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&B(this.f,16|e[5])&&C(this.f,e[4]+".readByte("+O(this.f,b)+"): "+O(this.f,c),!0,!d.ma),c;d.La(b,16,3);c=255;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to byte @"+O(this.f,b)+": "+O(this.f,c),!0,!d.ma);return c} +function Pc(a,b,c){var d=!1,e=this.controller,f=e.Ma[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ma[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&B(this.f,16|f[5])&&C(this.f,f[4]+".writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.ma):(e.La(c,16,5),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to byte @"+O(this.f,c)+": "+O(this.f, +b),!0,!e.ma))}function Qc(a,b){var c=-1,d=this.controller;a=d.Ma[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".readWord("+O(this.f,b)+"): "+O(this.f,c),!0,!d.ma),c;d.La(b,16,2);c=65535;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to word @"+O(this.f,b)+": "+O(this.f,c),!0,!d.ma);return c} +function Rc(a,b,c){var d=!1,e=this.controller;a=e.Ma[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".writeWord("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.ma):(e.La(c,16,4),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to word @"+O(this.f,c)+": "+O(this.f,b),!0,!e.ma))}function P(a){q.call(this,"Device",a,0,256);this.b={$a:128,Hc:-1}}p(P,q);h=P.prototype; +h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.G=d;var e=this;this.b.Hc=hd(c,function(){e.b.$a|=128;e.b.$a&64&&id(e.f,e.b.ib);e.J&&L(e.J,1);jd(e.f,e.b.Hc,1E3/60)});this.b.ib=kd(c,64,6,524288);Yb(b,this,ld);$b(b,this.reset.bind(this));d&&md(d,64,function(a){var b=e.f;nd(e,"KIPDR",b.B[0],0,a[0]);nd(e,"KDPDR",b.B[0],8,a[0]);nd(e,"KIPAR",b.M[0],0,a[0]);nd(e,"KDPAR",b.M[0],8,a[0],!0);nd(e,"SIPDR",b.B[1],0,a[0]);nd(e,"SDPDR",b.B[1],8,a[0]);nd(e,"SIPAR",b.M[1],0,a[0]);nd(e,"SDPAR",b.M[1],8,a[0], +!0);nd(e,"UIPDR",b.B[3],0,a[0]);nd(e,"UDPDR",b.B[3],8,a[0]);nd(e,"UIPAR",b.M[3],0,a[0]);nd(e,"UDPAR",b.M[3],8,a[0],!0);b.T&32&&nd(e,"UNIMAP",b.Ga,-1,a[0])});A(this)};function nd(a,b,c,d,e,f){a=a.G;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Ga[a>>1];return a&1?b>>16:b&65535};h.hg=function(a,b){b=b>>1&63;var c=b>>1;this.f.Ga[c]=b&1?this.f.Ga[c]&65535|(a&63)<<16:this.f.Ga[c]&-65536|a&65534};h.Qe=function(a){return this.f.B[1][a>>1&7]};h.ag=function(a,b){this.f.B[1][b>>1&7]=a&65295};h.Oe=function(a){return this.f.B[1][(a>>1&7)+8]};h.Zf=function(a,b){this.f.B[1][(b>>1&7)+8]=a&65295};h.Pe=function(a){return this.f.M[1][a>>1&7]}; +h.$f=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.Ne=function(a){return this.f.M[1][(a>>1&7)+8]};h.Yf=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.je=function(a){return this.f.B[0][a>>1&7]};h.wf=function(a,b){this.f.B[0][b>>1&7]=a&65295};h.he=function(a){return this.f.B[0][(a>>1&7)+8]};h.uf=function(a,b){this.f.B[0][(b>>1&7)+8]=a&65295};h.ie=function(a){return this.f.M[0][a>>1&7]};h.vf=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.B[0][b]&=65295}; +h.ge=function(a){return this.f.M[0][(a>>1&7)+8]};h.tf=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.B[0][b]&=65295};h.We=function(a){return this.f.B[3][a>>1&7]};h.gg=function(a,b){this.f.B[3][b>>1&7]=a&65295};h.Ue=function(a){return this.f.B[3][(a>>1&7)+8]};h.eg=function(a,b){this.f.B[3][(b>>1&7)+8]=a&65295};h.Ve=function(a){return this.f.M[3][a>>1&7]};h.fg=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Te=function(a){return this.f.M[3][(a>>1&7)+8]}; +h.dg=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Ib=function(a){a&=7;return this.f.w&2048?this.f.pa[a]:this.f.g[a]};h.Mb=function(a,b){b&=7;this.f.w&2048?this.f.pa[b]=a:this.f.g[b]=a};h.ue=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.Ff=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.xe=function(){return this.f.g[7]};h.If=function(a){this.f.g[7]=a};h.Jb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.pa[a]}; +h.Nb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.pa[b]=a};h.ve=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Gf=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.we=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Hf=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.fe=function(a){return this.f.ac[a-65504>>1]};h.sf=function(a,b){this.f.ac[b-65504>>1]=a};h.nd=function(a){return 65520==a?(cd(this.D)>>6)-1:0}; +h.sd=function(){};h.Se=function(){return 1};h.cg=function(){};h.ee=function(){return this.f.R};h.rf=function(){this.f.R=0};h.le=function(){return this.f.$b};h.yf=function(a,b){b&1||(a&=255);this.f.$b=a};h.qe=function(a,b){return b?0:this.f.Xa};h.Bf=function(a){ud(this.f,a)};h.Re=function(a,b){return b?0:this.f.za&65280};h.bg=function(a){this.f.za=a|255};h.te=function(){return vd(this.f)};h.Ef=function(a){wd(this.f,a)};h.rd=function(a,b){B(this)&&C(this,"writeIgnored("+H(b)+"): "+H(a),!0,!0)}; var Q={},ld=(Q[61568]=[null,null,P.prototype.Xe,P.prototype.hg,"UNIMAP",64,1170],Q[62592]=[null,null,P.prototype.Qe,P.prototype.ag,"SIPDR",8,1145,64],Q[62608]=[null,null,P.prototype.Oe,P.prototype.Zf,"SDPDR",8,1145,64],Q[62624]=[null,null,P.prototype.Pe,P.prototype.$f,"SIPAR",8,1145,64],Q[62640]=[null,null,P.prototype.Ne,P.prototype.Yf,"SDPAR",8,1145,64],Q[62656]=[null,null,P.prototype.je,P.prototype.wf,"KIPDR",8,1140,64],Q[62672]=[null,null,P.prototype.he,P.prototype.uf,"KDPDR",8,1145,64],Q[62688]= [null,null,P.prototype.ie,P.prototype.vf,"KIPAR",8,1140,64],Q[62704]=[null,null,P.prototype.ge,P.prototype.tf,"KDPAR",8,1145,64],Q[62798]=[null,null,P.prototype.pe,P.prototype.Af,"MMR3",1,1145,64],Q[65382]=[null,null,P.prototype.ke,P.prototype.xf,"LKS"],Q[65402]=[null,null,P.prototype.me,P.prototype.zf,"MMR0",1,1140,64],Q[65404]=[null,null,P.prototype.ne,P.prototype.rd,"MMR1",1,1145,64],Q[65406]=[null,null,P.prototype.oe,P.prototype.rd,"MMR2",1,1140,64],Q[65408]=[null,null,P.prototype.We,P.prototype.gg, "UIPDR",8,1140,64],Q[65424]=[null,null,P.prototype.Ue,P.prototype.eg,"UDPDR",8,1145,64],Q[65440]=[null,null,P.prototype.Ve,P.prototype.fg,"UIPAR",8,1140,64],Q[65456]=[null,null,P.prototype.Te,P.prototype.dg,"UDPAR",8,1145,64],Q[65472]=[null,null,P.prototype.Ib,P.prototype.Mb,"R0SET0"],Q[65473]=[null,null,P.prototype.Ib,P.prototype.Mb,"R1SET0"],Q[65474]=[null,null,P.prototype.Ib,P.prototype.Mb,"R2SET0"],Q[65475]=[null,null,P.prototype.Ib,P.prototype.Mb,"R3SET0"],Q[65476]=[null,null,P.prototype.Ib, @@ -104,274 +106,276 @@ P.prototype.Mb,"R4SET0"],Q[65477]=[null,null,P.prototype.Ib,P.prototype.Mb,"R5SE P.prototype.Nb,"R4SET1",1,1145],Q[65485]=[null,null,P.prototype.Jb,P.prototype.Nb,"R5SET1",1,1145],Q[65486]=[null,null,P.prototype.ve,P.prototype.Gf,"R6SUPER",1,1145],Q[65487]=[null,null,P.prototype.we,P.prototype.Hf,"R6USER",1,1145],Q[65504]=[null,null,P.prototype.fe,P.prototype.sf,"CTRL",8,1170],Q[65520]=[null,null,P.prototype.nd,P.prototype.sd,"LSIZE",1,1170],Q[65522]=[null,null,P.prototype.nd,P.prototype.sd,"HSIZE",1,1170],Q[65524]=[null,null,P.prototype.Se,P.prototype.cg,"SYSID",1,1170],Q[65526]= [null,null,P.prototype.ee,P.prototype.rf,"ERR",1,1170],Q[65528]=[null,null,P.prototype.le,P.prototype.yf,"MBR",1,1170],Q[65530]=[null,null,P.prototype.qe,P.prototype.Bf,"PIR"],Q[65532]=[null,null,P.prototype.Re,P.prototype.bg,"SLR"],Q[65534]=[null,null,P.prototype.te,P.prototype.Ef,"PSW"],Q); wb(function(){for(var a=y(document,x,"device"),b=0;b>1),this.b=new Int32Array(this.v,0,this.size>>2),Kd(this,Ld?Md:Nd);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.ce=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.cf=function(a,b){Ob&&a&1&&this.B.La(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8}; -h.pf=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Wa=!0};h.ae=function(a,b){this.f&&null!=this.K&&Ud(this.f,this.K+a);return this.j(a,b)};h.Ze=function(a,b){this.f&&null!=this.K&&Ud(this.f,this.K+a,2);return this.C(a,b)}; -h.mf=function(a,b,c){this.f&&null!=this.K&&Vd(this.f,this.K+a);this.J?this.Lb(0,b,c):this.D(a,b,c)};h.jg=function(a,b,c){this.f&&null!=this.K&&Vd(this.f,this.K+a,2);this.J?this.Lb(0,b,c):this.G(a,b,c)};h.$d=function(a){return this.g[a]};h.be=function(a,b){a=this.g[a];this.f&&B(this.f,32)&&C(this.f,"Memory.readByte("+O(this.f,b)+"): "+O(this.f,a),!0);return a};h.Ye=function(a,b){Ob&&a&1&&this.B.La(b,64,2);return this.w.getUint16(a,!0)}; -h.bf=function(a,b){Ob&&a&1&&this.B.La(b,64,2);a=!Pb&&a&1?this.g[a]|this.g[a+1]<<8:this.H[a>>1];this.f&&B(this.f,32)&&C(this.f,"Memory.readWord("+O(this.f,b)+"): "+O(this.f,a),!0);return a};h.lf=function(a,b){this.g[a]=b;this.Wa=!0};h.nf=function(a,b,c){this.g[a]=b;this.Wa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0)};h.ig=function(a,b,c){Ob&&a&1&&this.B.La(c,64,4);this.w.setUint16(a,b,!0);this.Wa=!0}; -h.kg=function(a,b,c){Ob&&a&1&&this.B.La(c,64,4);!Pb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.H[a>>1]=b;this.Wa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeWord("+O(this.f,c)+","+O(this.f,b)+")",!0)};var Id=0,dd=1,Jd=2,Uc=4,Zc=["NONE","RAM","ROM","VID","H/W"],Hd=0,Pd=[],Od=[L.prototype.ce,L.prototype.pf,L.prototype.cf,L.prototype.lg],Sd=[L.prototype.ae,L.prototype.mf,L.prototype.Ze,L.prototype.jg]; -if(Eb)var Nd=[L.prototype.$d,L.prototype.lf,L.prototype.Ye,L.prototype.ig],Md=[L.prototype.be,L.prototype.nf,L.prototype.bf,L.prototype.kg];var Wd;if(Eb){var Xd=new ArrayBuffer(2);(new DataView(Xd)).setUint16(0,256,!0);Wd=256===(new Uint16Array(Xd))[0]}else Wd=!1;var Ld=Wd; -function Yd(a,b){q.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.rc=0;this.pc=b;this.cb=c;this.wc=Math.round(this.pc/1E4)/100;this.pb=this.wc*this.cb;this.xc=this.Xb=this.sb=this.qc=0;this.A.U=this.A.lc=!1;this.A.ta=a.autoStart;"string"==typeof this.A.ta&&(this.A.ta="true"==this.A.ta);this.A.Bb=!1;this.Ub=this.Db=0;this.Wb=+a.csStart;this.Cb=+a.csInterval;this.Eb=+a.csStop;this.ga=[];this.Xc=this.gf.bind(this);this.eb=this.Ta=this.bb=this.b=this.ja=this.Sa=this.Tb=this.ab=this.Fb= -this.yc=this.ob=0;this.sa=null;A(this)}p(Yd,q);h=Yd.prototype;h.ua=function(a,b,c,d){this.J=a;this.D=b;this.F=d;this.sa=a.i;for(a=0;a=a.Db&&(a.Db+=a.Cb,c=!0);0<=a.Eb&&a.Eb<=fe(a)&&(a.Cb=a.Eb=-1,be(a),a.Z(),c=!0);c&&a.u(fe(a)+" cycles: checksum="+I(a.Ub))}} -h.qa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.B[b]=c,!0;case "run":return this.B[b]=c,c.onclick=function(){var a;if(a=d.J)if(a=d.J,a.A.fa)a=!0;else{var b=null,c,k=Aa(a.id);for(c=0;ca.ob/a.pb?b=1:d=!0;a.cb=b;b=a.wc*a.cb;if(a.pb!=b){a.pb=b;b=a.pb.toFixed(2)+"Mhz";var e=a.B.setSpeed;e&&(e.textContent=b);a.u("target speed: "+b)}c&&a.J&&je(a.J)}nc(a,a.Ta);a.Ta=0;a.Sa=ya();a.ab=0;he(a);return d}function hd(a,b){var c=a.ga.length;a.ga.push([-1,b]);return c}function jd(a,b,c,d){0<=b&&ba.ga[b][0])&&(c=a.pc*a.cb/1E3*c|0,a.A.U&&(c+=ke(a)),a.ga[b][0]=c)} -function le(a,b){for(var c=a.ga.length-1;0<=c;c--){var d=a.ga[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function me(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ke(a,b){var c=a.bb-=a.b;a.b=a.ja=0;b&&(a.bb=0);return c} -h.gf=function(){if(this.A.U){this.qc>=this.pc&&he(this,!0);this.Fb=0;this.Tb=ya();if(this.ab){var a=this.Tb-this.ab;a>this.xc&&(this.Sa+=a,this.Sa>this.Tb&&(this.Sa=this.Tb))}try{do{var b=le(this,this.A.Bb?1:this.Xb);try{this.ec(b)}catch(e){if("number"!=typeof e)throw e;}b=ke(this,!0);this.Fb+=b;this.Ta+=b;oc(this,b);mc(this,b);this.sb-=b;if(0>=this.sb){this.sb+=this.Xb;++this.yc>=ne&&(this.J&&J(this.J,void 0),this.yc=0);break}}while(this.A.U)}catch(e){this.Z();this.J&&this.J.stop(ya(),fe(this)); -Ea(this,e.stack||e.message);return}if(this.A.U){a=setTimeout;b=this.Xc;this.ab=ya();var c=this.xc;this.Fb&&(c=Math.round(c*this.Fb/this.Xb));var c=c-(this.ab-this.Tb),d=this.ab-this.Sa;d&&(this.ob=Math.round(this.Ta/(10*d))/100,864E5<=d&&(this.eb=0,ge(this)));if(0>c||this.obc&&(this.Sa-=c),c=0;this.qc+=this.Fb;this.ab+=c;a(b,c)}}}; -function kc(a,b){if(!Ja(a))if(a.A.U)a.u(a.toString()+" busy");else{ge(a);a.A.U=!0;a.A.lc=!0;var c=a.B.run;c&&(c.textContent="Halt");a.J&&(b&&je(a.J,!0),a.J.start(a.Sa,fe(a)));a.F||a.status("Started");setTimeout(a.Xc,0)}}h.ec=function(){return 0};h.Z=function(a){var b=!1;if(this.A.U){ke(this);nc(this,this.Ta);this.Ta=0;this.A.U=!1;if(b=this.B.run)b.textContent="Run";this.J&&this.J.stop(ya(),fe(this));b=!0;this.F||this.status("Stopped")}this.A.complete=a;return b};var ie=30,ne=15,Zd=["power","reset"]; -function oe(a){var b=+a.model||1170;Yd.call(this,a,6666667);this.ia=b;this.Rc=+a.addrReset||0;this.Ua=this.w=this.O=this.G=this.H=this.L=this.I=0;this.g=this.oa=this.W=[];this.M=this.C=this.Ga=this.ac=[];this.$a=this.P=this.Qc=this.Ia=this.kb=this.qb=this.Fa=this.R=this.$b=this.Va=this.ya=this.S=this.Gb=this.Hb=this.T=this.i=0;this.Tc=[4,2,0,1];this.bc=0;this.Uc=255;1120>=this.ia?(this.Pc=pe.bind(this),this.Ab=this.Ld,this.bc=8,this.Uc=-1,this.Zc=255,this.Yc=0):(this.Pc=qe.bind(this),this.Ab=this.Md, -this.Zc=~(1792|(1140>=this.ia?2048:0))&65535,this.Yc=1140e.xb&&(e.xb=c,c+=4)}return Yd.prototype.wa.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.ia);this.A.U&&this.Z();this.G=65536;this.H=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Rc,-1,-2,-3,-4,-5,-6,-7,-8];this.oa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, -65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ga=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ac=[0,0,0,0,0,0,0,0];this.O=0;this.Ua=-1;this.v=this.j=this.oc=this.X=this.aa=this.i=this.$b=0;ic(this);ae(this);this.A.error=!1;Yd.prototype.reset.call(this)};function ic(a){a.S=0;a.Gb=0;a.Hb=0;a.T=0;a.R=0;a.Va=0;a.ya=255;a.Ia=0;a.kb=0;a.qb=0;a.Fa=262143;a.$a=a.g[7];a.P=0;a.V=null;a.D&&(re(a),a.Qc=cd(a.D))} -function re(a){a.Pb=a.sc;a.Qb=a.tc;a.mc=a.uc;a.Rb=a.vc;a.Yb&&(a.Pb=a.fd,a.Qb=a.ld);a.Zb&&(a.mc=a.pd,a.Rb=a.qd);a.Ia?(a.Ha=65536,a.lb=a.T&16?4186112:253952,a.Ea=a.kd,a.ma=a.Yb?a.af:a.Fc,a.zb=a.Zb?a.ng:a.Ic,Vc(a.D,a.T&16?22:18)):(a.Ha=0,a.lb=57344,a.Ea=a.Od,a.ma=a.Yb?a.$e:a.od,a.zb=a.Zb?a.mg:a.td,Vc(a.D,16))}function pd(a){var b=a.S;b&57344||(b=b&-3199|a.kb<<5|a.qb<<1);return b} -function qd(a,b){b&=-3073;if(a.S!=b){b&57344&&!(a.S&57344)&&(a.Gb=a.P>>16&65535,a.Hb=a.P&65535);a.S=b;a.kb=(b&96)>>5;a.qb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ia!=c&&(a.Ia=c,re(a))}}function rd(a){a.S&57344||(a.Gb=a.P>>16&65535);a=a.Gb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function sd(a){a.S&57344||(a.Hb=a.P&65535);return a.Hb}function td(a,b){1170>a.ia&&(b&=-49);a.T!=b&&(a.T=b,a.Fa=b&16?4194303:262143,re(a))} -function se(a,b,c){a.Rc=b;a.D.reset();ic(a);te(a,b);Ed(a,0);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.U||kc(a)}else a.F?a.Z()||ce(a.F):!1===c&&a.Z();!a.A.U&&a.sa&&a.sa.stop()}h.gd=function(){return 0}; -h.save=function(){var a=new M(this);a.set(0,[this.g,this.oa,this.W,this.M,this.C,this.Ga,this.ac,this.R,this.$b,this.Va,this.ya,this.S,this.Gb,this.Hb,this.T,this.Ia,this.kb,this.qb,this.Fa,this.$a,this.i,this.P,this.Ua,this.cc,this.fc]);a.set(1,[vd(this)]);a.set(2,[this.eb,this.cb,this.A.ta]);a.set(3,ue(this));a.set(4,me(this));return a.data()}; -h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.oa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.C=b.next().value;this.Ga=b.next().value;this.ac=b.next().value;this.R=b.next().value;this.$b=b.next().value;this.Va=b.next().value;this.ya=b.next().value;this.S=b.next().value;this.Gb=b.next().value;this.Hb=b.next().value;this.T=b.next().value;this.Ia=b.next().value;this.kb=b.next().value;this.qb=b.next().value;this.Fa=b.next().value;this.$a=b.next().value;this.i=b.next().value; -this.P=b.next().value;this.Ua=b.next().value;this.cc=b.next().value;this.fc=b.next().value;b=a[1];Ed(this,b[0]);b=a[2];this.eb=b[0];ge(this,b[1]);this.A.ta=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function te(a,b){a.g[7]=b&65535}function kd(a,b,c,d){b={xb:b,ib:c,message:d||0,name:Rb[b],next:null};a.Sb.push(b);return b}function Ae(a,b){var c=a.V;if(c==b)a.V=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.V&&(a.i|=1)} -function id(a,b){if(b){if(b!=a.V){var c=a.V;if(!c||c.ib<=b.ib)b.next=c,a.V=b;else{do{var d=c.next;if(!d||d.ib<=b.ib){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&B(a,b.message|8)&&C(a,"setIRQ(vector="+H(b.xb)+",priority="+b.ib+")",!0,!0)}}function od(a,b){b&&(Ae(a,b),b.message&&B(a,b.message|8)&&C(a,"clearIRQ(vector="+H(b.xb)+",priority="+b.ib+")",!0,!0))}function ue(a){var b=[];for(a=a.V;a;)b.push(a.xb),a=a.next;return b} -function Be(a){return a.i&64?(a.ra(168,64,-6),!0):a.i&32?(a.ra(4,32,-5),!0):a.i&16?(a.ra(12,16,-7),!0):!1}function vd(a){return a.w=a.w&63728|ye(a)|xe(a)|we(a)|ve(a)}function Ed(a,b){b&=a.Zc;a.I=b<<12;a.L=~b&4;a.H=b<<14;a.G=b<<16;if((b^a.w)&a.Yc)for(var c=a.oa.length;0<=--c;){var d=a.g[c];a.g[c]=a.oa[c];a.oa[c]=d}a.O=b>>14&3;c=a.w>>14&3;a.O!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.O]);a.w=b;a.i&=-3;a.i|=a.V?2:1}function ud(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.Va=b} -h.Da=function(a){this.I=this.L=a;this.H=0};h.jb=function(a,b){this.I=this.L=this.G=a;this.H=b||0};function Ce(a,b){a.I=a.L=a.G=b;a.H=a.I^a.G>>1}function De(a,b,c,d){a.I=a.L=a.G=b;a.H=(c^d)&(d^b)} -h.ra=function(a,b,c){if(!this.na){0>this.Ua?this.Ua=vd(this):this.O||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.R|=4,this.g[6]=a=4);if(-1!=c){this.P=a|4143316992;this.O=0;var d=this.ma(a|this.Ha),e=this.ma(a+2&65535|this.Ha);Ed(this,e&-12289|this.Ua>>2&12288);Ee(this,this.Ua);Ee(this,this.g[7]);te(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Ua=-1;this.cc=c;this.fc=a;-1==c&&this.Z();if(-4<=c)throw a;}}; -function Fe(a){var b=Ge(a),c=Ge(a);a.w&49152&&(c=c&-225|a.w&63712);te(a,b);Ed(a,c);a.i&=-17}function He(a,b){var c=b>>13&31;31>c&&(b=a.T&32?a.Ga[c]+(b&8191)&4194303:b&-3932161);return b} -function Ie(a,b,c){var d=[];if(c){c=He(a,b);var e=b>>13&31;d.push(c);d.push(e);a.T&32&&(d.push(a.Ga[e]),d.push(b&8191))}else if(a.Ia){var e=a.O<<1,f=b>>13;7>13;a.T&a.Tc[a.O]||(d&=7);e=a.C[a.O][d];f=(a.M[a.O][d]<<6)+(b&8191)&a.Fa;3932160<=f&&(f=He(a,f));if(a.na)return f;f>=a.Qc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.C[a.O][d]=e;if(f!=(4194170&a.Fa)||a.O)a.kb=a.O,a.qb=d;g&&(g&57344&&(0<=a.Ua&&(g|=128),a.S&57344||(g|=a.S&4096|a.kb<<5|a.qb<<1,qd(a,a.S&-61695|g&61694)),a.ra(168,64,-2)),a.S&61440||!(f<(4191360&a.Fa)||f>(4194239&a.Fa))||(a.S|=4096,a.S&512&&(a.i|=64)));return f}function Ge(a){var b=a.ma(a.g[6]|a.Ha);a.g[6]=a.g[6]+2&65535;return b}function Ee(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.P=a.P&65535|(a.P&-65536)<<8|16121856;a.i&256||a.Ab(4,-2,c);a.zb(c,b)} -function Je(a,b,c,d){var e,f,g=d&8?0:a.Ha;switch(b){case 0:return a.ra(4,0,-3),0;case 1:return 6==c&&a.Ab(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Ab(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.ma(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Ab(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.ma(e)|g;a.b-=8;break;case 6:return e=a.ma(ze(a,2)),e=e+a.g[c]&65535,6==c&&a.Ab(d, -0,e),a.b-=6,e|g;case 7:return e=a.ma(ze(a,2)),e=e+a.g[c]&65535,e=a.ma(e|a.Ha),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.P=a.P&65535|(a.P&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ld=function(a,b,c){!this.O&&0>=b&&c<=this.ya&&(this.i|=32)};h.Md=function(a,b,c){this.O||(65534<=c&&(c|=-65536),a&4&&c<=this.ya&&(c<=this.ya-32?this.ra(4,0,-4):(this.R|=8,this.i|=32)))};h.fd=function(a){this.F&&Ud(this.F,a,1);return this.sc(a)};h.ld=function(a){this.F&&Ud(this.F,a,2);return this.tc(a)}; -h.pd=function(a,b){this.F&&Vd(this.F,a,1);this.uc(a,b)};h.qd=function(a,b){this.F&&Vd(this.F,a,2);this.vc(a,b)};function Fc(a,b){a.na++;b=a.D.dc(Dc(a,b,2));a.na--;return b}function Ke(a,b){(b?--a.Zb:--a.Yb)||re(a)}h.Od=function(a,b,c){return Je(this,a,b,c)};h.kd=function(a,b,c){return Dc(this,Je(this,a,b,c),c)};h.od=function(a){return this.D.dc(this.$a=a)};h.$e=function(a){this.F&&Ud(this.F,a,2);return this.od(a)};h.Fc=function(a){return this.D.dc(this.$a=Dc(this,a,2))}; -h.af=function(a){this.F&&Ud(this.F,a,2);return this.Fc(a)};h.td=function(a,b){this.D.Ob(this.$a=a,b)};h.mg=function(a,b){this.F&&Vd(this.F,a,2);this.td(a,b)};h.Ic=function(a,b){this.D.Ob(this.$a=Dc(this,a,4),b)};h.ng=function(a,b){this.F&&Vd(this.F,a,2);this.Ic(a,b)};function Le(a,b,c){var d=a.j=b&7;(b=a.v=(b&56)>>3)?(d=Je(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.O=a.w>>12&3,c=a.ma(d|c&a.Ha),a.O=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} -function Me(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=Je(a,b,e,4),c&65536||(e&=65535),a.O=a.w>>12&3,e=Dc(a,e|c&65536,4),a.O=a.w>>14&3,a.Rb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function hf(a,b){b>>=6;var c=a.aa=b&7;return(b=a.X=(b&56)>>3)?a.Pb(a.Ea(b,c,3)):a.g[c+a.bc]&a.Uc}function jf(a,b){var c;b>>=6;var d=a.aa=b&7;(b=a.X=(b&56)>>3)?c=a.Qb(a.Ea(b,d,2)):c=a.g[d+a.bc];return c}function kf(a,b){var c=a.j=b&7;b=a.v=(b&56)>>3;return Je(a,b,c,8)} -function lf(a,b){var c=a.j=b&7;return(b=a.v=(b&56)>>3)?a.Pb(a.Ea(b,c,3)):a.g[c]&255}function mf(a,b){var c,d=a.j=b&7;(b=a.v=(b&56)>>3)?c=a.Qb(a.Ea(b,d,2)):c=a.g[d];return c}function nf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.oc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.mc(e,d.call(a,c,a.Pb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} -function T(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,6),a.Rb(e,d.call(a,0>c?a.g[-c-1]:c,a.Qb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function of(a,b,c,d,e){var f=a.j=b&7;(b=a.v=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.mc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} -function pf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Rb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} -h.ec=function(a){this.A.complete=!0;var b=this.F?qf(this.F)?1:this.A.lc?-1:0:0,c=a?this.A.lc?0:1:-1;this.A.lc=!1;this.bb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(rf(this.F,this.g[7],c)){this.Z();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.Va&224)>>5,f=this.V&&this.V.ib>e?this.V:null;f&&(d=f.xb,e=f.ib);e>(this.w&224)>>5?(this.i&8&&(ze(this,2),this.i&=-9),this.ra(d,0,-10),e=!0):e=!1;e&&(f&&Ae(this,f),a=!0);this.V||this.Va||(this.i&=-3)}else this.i& -1&&this.i++;if(a){if(this.i&4&&rf(this.F,this.g[7],c)){this.Z();break}if(0>c)break}if(this.i&112&&Be(this)){if(this.i&4&&rf(this.F,this.g[7],c)){this.Z();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.ma(a);this.g[7]=a+2&65535;this.Pc(f)}while(0>1|b<<16;Ce(this,a);return a&65535}function xf(a,b){a=b&128|b>>1|b<<8;Ce(this,a<<8);return a&255}function yf(a,b){a=b&~a;this.Da(a);return a}function zf(a,b){a=b&~a;this.Da(a<<8);return a} -function Af(a,b){a|=b;this.Da(a);return a}function Bf(a,b){a|=b;this.Da(a<<8);return a}function Cf(a,b){a=~b|65536;this.jb(a);return a&65535}function Df(a,b){a=~b|256;this.jb(a<<8);return a&255}function Ef(a,b){this.I=this.L=a=b-a;this.H=b&(b^a);return a&65535}function Ff(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.H=b&(b^c);return a&255}function Gf(a,b){this.I=this.L=a=b+a;this.H=a&(b^a);return a&65535}function Hf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.H=c&(b<<8^c);return a&255} -function If(a,b){a=-b;this.jb(a,a&b&32768);return a&65535}function Jf(a,b){a=-b;this.jb(a<<8,(a&b&128)<<8);return a&255}function Kf(a,b){a=b<<1|this.G>>16&1;Ce(this,a);return a&65535}function Lf(a,b){a=b<<1|this.G>>16&1;Ce(this,a<<8);return a&255}function Mf(a,b){a=(this.G&65536|b)>>1|b<<16;Ce(this,a);return a&65535}function Nf(a,b){a=((this.G&65536)>>8|b)>>1|b<<8;Ce(this,a<<8);return a&255}function Of(a,b){var c=b-a;De(this,c,a,b);return c&65535} -function Pf(a,b){var c=b-a;De(this,c<<8,a<<8,b<<8);return c&255}function Qf(a,b){this.I=this.L=b&65280;this.H=this.G=0;return(b<<8|b>>8)&65535}function Rf(a,b){a^=b;this.Da(a);return a&65535}function Sf(a){T(this,a,jf(this,a),sf);this.b-=this.v?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} -function Tf(a){var b=mf(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.G=this.H=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.H=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.v?6:7)+b} -function Uf(a){var b=mf(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.G=this.H=0;b&=63;if(b&32){b=64-b;32>b-1;this.G=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.v?6:7)+b}function Vf(a){S(this,a,!ve(this))}function Wf(a){S(this,a,ve(this))} -function Xf(a){T(this,a,jf(this,a),yf);this.b-=this.v?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Yf(a){nf(this,a,hf(this,a),zf);this.b-=this.v?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Zf(a){T(this,a,jf(this,a),Af);this.b-=this.v?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function $f(a){nf(this,a,hf(this,a),Bf);this.b-=this.v?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} -function ag(a){var b=jf(this,a);a=mf(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.v?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function bg(a){var b=hf(this,a);a=lf(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.v?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function cg(a){S(this,a,xe(this))}function dg(a){S(this,a,!ye(this)==!we(this))}function eg(a){S(this,a,!xe(this)&&!ye(this)==!we(this))}function fg(a){S(this,a,!ve(this)&&!xe(this))} -function gg(a){S(this,a,xe(this)||!ye(this)!=!we(this))}function hg(a){S(this,a,ve(this)||xe(this))}function ig(a){S(this,a,!ye(this)!=!we(this))}function jg(a){S(this,a,ye(this))}function kg(a){S(this,a,!xe(this))}function lg(a){S(this,a,!ye(this))}function mg(){this.ra(12,0,-9)}function ng(a){S(this,a,!0)}function og(a){S(this,a,!we(this))}function pg(a){S(this,a,we(this))}function qg(a){a&1&&(this.G=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} -function rg(a){var b=jf(this,a);a=mf(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;De(this,c,a,b);this.b-=this.v?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function sg(a){var b=hf(this,a);a=lf(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);De(this,c,a,b);this.b-=this.v?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} -function tg(a){var b=mf(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.G=this.H=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.H=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.H=32768,this.G=65536,this.b-=7}function ug(){this.ra(24,0,-9);this.b-=20} -function vg(){this.w&49152?(this.R|=128,this.ra(4,0,-8)):(this.sa&&1120==this.ia&&this.sa.setData(this.g[0],!0),this.F?wg(this.F):this.Z());this.b-=7}function xg(){this.ra(16,0,-9);this.b-=20}var yg=[0,7,7,10,7,11,9,13];function zg(a){this.ja=this.b;te(this,kf(this,a));this.b=this.ja-yg[this.v]}var Ag=[0,14,14,17,14,18,16,20];function Bg(a){this.ja=this.b;var b=kf(this,a);a=a>>6&7;Ee(this,this.g[a]);this.g[a]=this.g[7];te(this,b);this.b=this.ja-Ag[this.v]} -var Cg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Dg(a){var b=jf(this,a);this.ja=this.b;pf(this,a,b,this.Da);this.b=this.ja-Cg[(this.X?8:0)+this.v]+(7!=this.j||this.v?0:2)}function Eg(a){var b=hf(this,a);of(this,a,b,65535,this.Da);this.b-=this.v?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Fg=[7,13,13,17,14,18,17,21]; -function Gg(a){var b=mf(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.H=0;this.G=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)te(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Ng(a){T(this,a,jf(this,a),Of);this.b-=this.v?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Og(a){T(this,a,0,Qf);this.b-=this.v?9:3+(7==this.j?2:0)}function Pg(){this.ra(28,0,-9)} -function Qg(){this.sa&&(this.sa.Gc(this.g[7],!0),this.sa.setData(this.g[0],!0));this.i|=8;ze(this,-2);this.b-=3}function Rg(a){T(this,a,this.g[(a>>6&7)+this.bc],Rf);this.b-=this.v?9:3+(7==this.j?2:0)}function U(a){var b;if(b=this.F)b=this.F,B(b,1)?(C(b,"undefined opcode "+O(b,a),!0,!0),b=wg(b)):b=!1;b||this.ra(8,0,-9)}function pe(a){Sg[a>>12].call(this,a)}function Tg(a){Ug[a>>6&3].call(this,a)}function Vg(a){Wg[a>>6&3].call(this,a)}function Xg(a){Yg[a>>6&3].call(this,a)} +function M(a,b,c,d,e,f){this.C=a;this.id=Hd+=2;this.b=null;this.K=b;this.Kb=c;this.size=d||0;this.type=e||Id;this.J=e==Jd;this.f=this.controller=null;this.wb=this.j=this.Dc;this.na=this.B=this.Ec;this.yb=this.D=this.Lb;this.zb=this.F=this.nc;this.G=this.i=0;Sc(this);this.Ya=this.Nd=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],Kd(this,f.Hd);else if(Eb)this.u=new ArrayBuffer(this.size),this.w=new DataView(this.u,0,this.size),this.g=new Uint8Array(this.u,0,this.size),this.H=new Uint16Array(this.u, +0,this.size>>1),this.b=new Int32Array(this.u,0,this.size>>2),Kd(this,Ld?Md:Nd);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.ce=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.cf=function(a,b){Ib&&a&1&&this.C.La(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8}; +h.pf=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Ya=!0};h.ae=function(a,b){this.f&&null!=this.K&&Ud(this.f,this.K+a);return this.j(a,b)};h.Ze=function(a,b){this.f&&null!=this.K&&Ud(this.f,this.K+a,2);return this.B(a,b)}; +h.mf=function(a,b,c){this.f&&null!=this.K&&Vd(this.f,this.K+a);this.J?this.Lb(0,b,c):this.D(a,b,c)};h.jg=function(a,b,c){this.f&&null!=this.K&&Vd(this.f,this.K+a,2);this.J?this.Lb(0,b,c):this.F(a,b,c)};h.$d=function(a){return this.g[a]};h.be=function(a,b){a=this.g[a];this.f&&B(this.f,32)&&C(this.f,"Memory.readByte("+O(this.f,b)+"): "+O(this.f,a),!0);return a};h.Ye=function(a,b){Ib&&a&1&&this.C.La(b,64,2);return this.w.getUint16(a,!0)}; +h.bf=function(a,b){Ib&&a&1&&this.C.La(b,64,2);a=!Pb&&a&1?this.g[a]|this.g[a+1]<<8:this.H[a>>1];this.f&&B(this.f,32)&&C(this.f,"Memory.readWord("+O(this.f,b)+"): "+O(this.f,a),!0);return a};h.lf=function(a,b){this.g[a]=b;this.Ya=!0};h.nf=function(a,b,c){this.g[a]=b;this.Ya=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0)};h.ig=function(a,b,c){Ib&&a&1&&this.C.La(c,64,4);this.w.setUint16(a,b,!0);this.Ya=!0}; +h.kg=function(a,b,c){Ib&&a&1&&this.C.La(c,64,4);!Pb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.H[a>>1]=b;this.Ya=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeWord("+O(this.f,c)+","+O(this.f,b)+")",!0)};var Id=0,dd=1,Jd=2,Uc=4,Zc=["NONE","RAM","ROM","VID","H/W"],Hd=0,Pd=[],Od=[M.prototype.ce,M.prototype.pf,M.prototype.cf,M.prototype.lg],Sd=[M.prototype.ae,M.prototype.mf,M.prototype.Ze,M.prototype.jg]; +if(Eb)var Nd=[M.prototype.$d,M.prototype.lf,M.prototype.Ye,M.prototype.ig],Md=[M.prototype.be,M.prototype.nf,M.prototype.bf,M.prototype.kg];var Wd;if(Eb){var Xd=new ArrayBuffer(2);(new DataView(Xd)).setUint16(0,256,!0);Wd=256===(new Uint16Array(Xd))[0]}else Wd=!1;var Ld=Wd; +function Yd(a,b){q.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.rc=0;this.pc=b;this.eb=c;this.wc=Math.round(this.pc/1E4)/100;this.qb=this.wc*this.eb;this.xc=this.Xb=this.tb=this.qc=0;this.A.U=this.A.lc=!1;this.A.va=a.autoStart;"string"==typeof this.A.va&&(this.A.va="true"==this.A.va);this.A.Bb=!1;this.Ub=this.Db=0;this.Wb=+a.csStart;this.Cb=+a.csInterval;this.Eb=+a.csStop;this.ia=[];this.Xc=this.gf.bind(this);this.fb=this.Va=this.cb=this.b=this.la=this.Ua=this.Tb=this.bb=this.Fb= +this.yc=this.pb=0;this.ua=null;A(this)}p(Yd,q);h=Yd.prototype;h.wa=function(a,b,c,d){this.J=a;this.D=b;this.G=d;this.ua=a.i;for(a=0;a=a.Db&&(a.Db+=a.Cb,c=!0);0<=a.Eb&&a.Eb<=fe(a)&&(a.Cb=a.Eb=-1,be(a),a.Z(),c=!0);c&&a.v(fe(a)+" cycles: checksum="+I(a.Ub))}} +h.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.C[b]=c,!0;case "run":return this.C[b]=c,c.onclick=function(){var a;if(a=d.J)if(a=d.J,a.A.ha)a=!0;else{var b=null,c,k=Aa(a.id);for(c=0;ca.pb/a.qb?b=1:d=!0;a.eb=b;b=a.wc*a.eb;if(a.qb!=b){a.qb=b;b=a.qb.toFixed(2)+"Mhz";var e=a.C.setSpeed;e&&(e.textContent=b);a.v("target speed: "+b)}c&&a.J&&je(a.J)}qc(a,a.Va);a.Va=0;a.Ua=ya();a.bb=0;he(a);return d}function hd(a,b){var c=a.ia.length;a.ia.push([-1,b]);return c}function jd(a,b,c,d){0<=b&&ba.ia[b][0])&&(c=a.pc*a.eb/1E3*c|0,a.A.U&&(c+=ke(a)),a.ia[b][0]=c)} +function le(a,b){for(var c=a.ia.length-1;0<=c;c--){var d=a.ia[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function me(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ke(a,b){var c=a.cb-=a.b;a.b=a.la=0;b&&(a.cb=0);return c} +h.gf=function(){if(this.A.U){this.qc>=this.pc&&he(this,!0);this.Fb=0;this.Tb=ya();if(this.bb){var a=this.Tb-this.bb;a>this.xc&&(this.Ua+=a,this.Ua>this.Tb&&(this.Ua=this.Tb))}try{do{var b=le(this,this.A.Bb?1:this.Xb);try{this.ec(b)}catch(e){if("number"!=typeof e)throw e;}b=ke(this,!0);this.Fb+=b;this.Va+=b;rc(this,b);pc(this,b);this.tb-=b;if(0>=this.tb){this.tb+=this.Xb;++this.yc>=ne&&(this.J&&L(this.J,void 0),this.yc=0);break}}while(this.A.U)}catch(e){this.Z();this.J&&this.J.stop(ya(),fe(this)); +Ea(this,e.stack||e.message);return}if(this.A.U){a=setTimeout;b=this.Xc;this.bb=ya();var c=this.xc;this.Fb&&(c=Math.round(c*this.Fb/this.Xb));var c=c-(this.bb-this.Tb),d=this.bb-this.Ua;d&&(this.pb=Math.round(this.Va/(10*d))/100,864E5<=d&&(this.fb=0,ge(this)));if(0>c||this.pbc&&(this.Ua-=c),c=0;this.qc+=this.Fb;this.bb+=c;a(b,c)}}}; +function nc(a,b){if(!Ja(a))if(a.A.U)a.v(a.toString()+" busy");else{ge(a);a.A.U=!0;a.A.lc=!0;var c=a.C.run;c&&(c.textContent="Halt");a.J&&(b&&je(a.J,!0),a.J.start(a.Ua,fe(a)));a.G||a.status("Started");setTimeout(a.Xc,0)}}h.ec=function(){return 0};h.Z=function(a){var b=!1;if(this.A.U){ke(this);qc(this,this.Va);this.Va=0;this.A.U=!1;if(b=this.C.run)b.textContent="Run";this.J&&this.J.stop(ya(),fe(this));b=!0;this.G||this.status("Stopped")}this.A.complete=a;return b};var ie=30,ne=15,Zd=["power","reset"]; +function oe(a){var b=+a.model||1170;Yd.call(this,a,6666667);this.ka=b;this.Rc=+a.addrReset||0;this.Wa=this.w=this.O=this.F=this.H=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Ga=this.ac=[];this.ab=this.P=this.Qc=this.Ia=this.lb=this.rb=this.Fa=this.R=this.$b=this.Xa=this.za=this.S=this.Gb=this.Hb=this.T=this.i=0;this.Tc=[4,2,0,1];this.bc=0;this.Uc=255;1120>=this.ka?(this.Pc=pe.bind(this),this.Ab=this.Ld,this.bc=8,this.Uc=-1,this.Zc=255,this.Yc=0):(this.Pc=qe.bind(this),this.Ab=this.Md, +this.Zc=~(1792|(1140>=this.ka?2048:0))&65535,this.Yc=1140e.xb&&(e.xb=c,c+=4)}return Yd.prototype.ya.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.ka);this.A.U&&this.Z();this.F=65536;this.H=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Rc,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, +65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ga=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ac=[0,0,0,0,0,0,0,0];this.O=0;this.Wa=-1;this.u=this.j=this.oc=this.X=this.aa=this.i=this.$b=0;lc(this);ae(this);this.A.error=!1;Yd.prototype.reset.call(this)};function lc(a){a.S=0;a.Gb=0;a.Hb=0;a.T=0;a.R=0;a.Xa=0;a.za=255;a.Ia=0;a.lb=0;a.rb=0;a.Fa=262143;a.ab=a.g[7];a.P=0;a.V=null;a.D&&(re(a),a.Qc=cd(a.D))} +function re(a){a.Pb=a.sc;a.Qb=a.tc;a.mc=a.uc;a.Rb=a.vc;a.Yb&&(a.Pb=a.fd,a.Qb=a.ld);a.Zb&&(a.mc=a.pd,a.Rb=a.qd);a.Ia?(a.Ha=65536,a.mb=a.T&16?4186112:253952,a.Ea=a.kd,a.na=a.Yb?a.af:a.Fc,a.zb=a.Zb?a.ng:a.Ic,Vc(a.D,a.T&16?22:18)):(a.Ha=0,a.mb=57344,a.Ea=a.Od,a.na=a.Yb?a.$e:a.od,a.zb=a.Zb?a.mg:a.td,Vc(a.D,16))}function pd(a){var b=a.S;b&57344||(b=b&-3199|a.lb<<5|a.rb<<1);return b} +function qd(a,b){b&=-3073;if(a.S!=b){b&57344&&!(a.S&57344)&&(a.Gb=a.P>>16&65535,a.Hb=a.P&65535);a.S=b;a.lb=(b&96)>>5;a.rb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ia!=c&&(a.Ia=c,re(a))}}function rd(a){a.S&57344||(a.Gb=a.P>>16&65535);a=a.Gb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function sd(a){a.S&57344||(a.Hb=a.P&65535);return a.Hb}function td(a,b){1170>a.ka&&(b&=-49);a.T!=b&&(a.T=b,a.Fa=b&16?4194303:262143,re(a))} +function se(a,b,c){a.Rc=b;te(a,b);wd(a,0);a.D.reset();lc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.U||nc(a)}else a.G?a.Z()||ce(a.G):!1===c&&a.Z();!a.A.U&&a.ua&&a.ua.stop()}h.gd=function(){return 0}; +h.save=function(){var a=new J(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Ga,this.ac,this.R,this.$b,this.Xa,this.za,this.S,this.Gb,this.Hb,this.T,this.Ia,this.lb,this.rb,this.Fa,this.ab,this.i,this.P,this.Wa,this.cc,this.fc]);a.set(1,[vd(this)]);a.set(2,[this.fb,this.eb,this.A.va]);a.set(3,ue(this));a.set(4,me(this));return a.data()}; +h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Ga=b.next().value;this.ac=b.next().value;this.R=b.next().value;this.$b=b.next().value;this.Xa=b.next().value;this.za=b.next().value;this.S=b.next().value;this.Gb=b.next().value;this.Hb=b.next().value;this.T=b.next().value;this.Ia=b.next().value;this.lb=b.next().value;this.rb=b.next().value;this.Fa=b.next().value;this.ab=b.next().value;this.i=b.next().value; +this.P=b.next().value;this.Wa=b.next().value;this.cc=b.next().value;this.fc=b.next().value;b=a[1];wd(this,b[0]);b=a[2];this.fb=b[0];ge(this,b[1]);this.A.va=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function te(a,b){a.g[7]=b&65535}function kd(a,b,c,d){b={xb:b,jb:c,message:d||0,name:Rb[b],next:null};a.Sb.push(b);return b}function Ae(a,b){var c=a.V;if(c==b)a.V=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.V&&(a.i|=1)} +function id(a,b){if(b){if(b!=a.V){var c=a.V;if(!c||c.jb<=b.jb)b.next=c,a.V=b;else{do{var d=c.next;if(!d||d.jb<=b.jb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&B(a,b.message|8)&&C(a,"setIRQ(vector="+H(b.xb)+",priority="+b.jb+")",!0,!0)}}function od(a,b){b&&(Ae(a,b),b.message&&B(a,b.message|8)&&C(a,"clearIRQ(vector="+H(b.xb)+",priority="+b.jb+")",!0,!0))}function ue(a){var b=[];for(a=a.V;a;)b.push(a.xb),a=a.next;return b} +function Be(a){return a.i&64?(a.ta(168,64,-6),!0):a.i&32?(a.ta(4,32,-5),!0):a.i&16?(a.ta(12,16,-7),!0):!1}function vd(a){return a.w=a.w&63728|ye(a)|xe(a)|we(a)|ve(a)}function wd(a,b){b&=a.Zc;a.I=b<<12;a.L=~b&4;a.H=b<<14;a.F=b<<16;if((b^a.w)&a.Yc)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.O=b>>14&3;c=a.w>>14&3;a.O!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.O]);a.w=b;a.i&=-3;a.i|=a.V?2:1}function ud(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.Xa=b} +h.Da=function(a){this.I=this.L=a;this.H=0};h.kb=function(a,b){this.I=this.L=this.F=a;this.H=b||0};function Ce(a,b){a.I=a.L=a.F=b;a.H=a.I^a.F>>1}function De(a,b,c,d){a.I=a.L=a.F=b;a.H=(c^d)&(d^b)} +h.ta=function(a,b,c){if(!this.oa){0>this.Wa?this.Wa=vd(this):this.O||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.R|=4,this.g[6]=a=4);if(-1!=c){this.P=a|4143316992;this.O=0;var d=this.na(a|this.Ha),e=this.na(a+2&65535|this.Ha);wd(this,e&-12289|this.Wa>>2&12288);Ee(this,this.Wa);Ee(this,this.g[7]);te(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Wa=-1;this.cc=c;this.fc=a;-1==c&&this.Z();if(-4<=c)throw a;}}; +function Fe(a){var b=Ge(a),c=Ge(a);a.w&49152&&(c=c&-225|a.w&63712);te(a,b);wd(a,c);a.i&=-17}function He(a,b){var c=b>>13&31;31>c&&(b=a.T&32?a.Ga[c]+(b&8191)&4194303:b&-3932161);return b} +function Ie(a,b,c){var d=[];if(c){c=He(a,b);var e=b>>13&31;d.push(c);d.push(e);a.T&32&&(d.push(a.Ga[e]),d.push(b&8191))}else if(a.Ia){var e=a.O<<1,f=b>>13;7>13;a.T&a.Tc[a.O]||(d&=7);e=a.B[a.O][d];f=(a.M[a.O][d]<<6)+(b&8191)&a.Fa;3932160<=f&&(f=He(a,f));if(a.oa)return f;f>=a.Qc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.B[a.O][d]=e;if(f!=(4194170&a.Fa)||a.O)a.lb=a.O,a.rb=d;g&&(g&57344&&(0<=a.Wa&&(g|=128),a.S&57344||(g|=a.S&4096|a.lb<<5|a.rb<<1,qd(a,a.S&-61695|g&61694)),a.ta(168,64,-2)),a.S&61440||!(f<(4191360&a.Fa)||f>(4194239&a.Fa))||(a.S|=4096,a.S&512&&(a.i|=64)));return f}function Ge(a){var b=a.na(a.g[6]|a.Ha);a.g[6]=a.g[6]+2&65535;return b}function Ee(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.P=a.P&65535|(a.P&-65536)<<8|16121856;a.i&256||a.Ab(4,-2,c);a.zb(c,b)} +function Je(a,b,c,d){var e,f,g=d&8?0:a.Ha;switch(b){case 0:return a.ta(4,0,-3),0;case 1:return 6==c&&a.Ab(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Ab(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Ab(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(ze(a,2)),e=e+a.g[c]&65535,6==c&&a.Ab(d, +0,e),a.b-=6,e|g;case 7:return e=a.na(ze(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ha),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.P=a.P&65535|(a.P&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ld=function(a,b,c){!this.O&&0>=b&&c<=this.za&&(this.i|=32)};h.Md=function(a,b,c){this.O||(65534<=c&&(c|=-65536),a&4&&c<=this.za&&(c<=this.za-32?this.ta(4,0,-4):(this.R|=8,this.i|=32)))};h.fd=function(a){this.G&&Ud(this.G,a,1);return this.sc(a)};h.ld=function(a){this.G&&Ud(this.G,a,2);return this.tc(a)}; +h.pd=function(a,b){this.G&&Vd(this.G,a,1);this.uc(a,b)};h.qd=function(a,b){this.G&&Vd(this.G,a,2);this.vc(a,b)};function Hc(a,b){a.oa++;b=a.D.dc(Fc(a,b,2));a.oa--;return b}function Ke(a,b){(b?--a.Zb:--a.Yb)||re(a)}h.Od=function(a,b,c){return Je(this,a,b,c)};h.kd=function(a,b,c){return Fc(this,Je(this,a,b,c),c)};h.od=function(a){return this.D.dc(this.ab=a)};h.$e=function(a){this.G&&Ud(this.G,a,2);return this.od(a)};h.Fc=function(a){return this.D.dc(this.ab=Fc(this,a,2))}; +h.af=function(a){this.G&&Ud(this.G,a,2);return this.Fc(a)};h.td=function(a,b){this.D.Ob(this.ab=a,b)};h.mg=function(a,b){this.G&&Vd(this.G,a,2);this.td(a,b)};h.Ic=function(a,b){this.D.Ob(this.ab=Fc(this,a,4),b)};h.ng=function(a,b){this.G&&Vd(this.G,a,2);this.Ic(a,b)};function Le(a,b,c){var d=a.j=b&7;(b=a.u=(b&56)>>3)?(d=Je(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.O=a.w>>12&3,c=a.na(d|c&a.Ha),a.O=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} +function Me(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=Je(a,b,e,4),c&65536||(e&=65535),a.O=a.w>>12&3,e=Fc(a,e|c&65536,4),a.O=a.w>>14&3,a.Rb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Ne(a,b){b>>=6;var c=a.aa=b&7;return(b=a.X=(b&56)>>3)?a.Pb(a.Ea(b,c,3)):a.g[c+a.bc]&a.Uc}function Oe(a,b){var c;b>>=6;var d=a.aa=b&7;(b=a.X=(b&56)>>3)?c=a.Qb(a.Ea(b,d,2)):c=a.g[d+a.bc];return c}function kf(a,b){var c=a.j=b&7;b=a.u=(b&56)>>3;return Je(a,b,c,8)} +function lf(a,b){var c=a.j=b&7;return(b=a.u=(b&56)>>3)?a.Pb(a.Ea(b,c,3)):a.g[c]&255}function mf(a,b){var c,d=a.j=b&7;(b=a.u=(b&56)>>3)?c=a.Qb(a.Ea(b,d,2)):c=a.g[d];return c}function nf(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.oc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.mc(e,d.call(a,c,a.Pb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} +function T(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,6),a.Rb(e,d.call(a,0>c?a.g[-c-1]:c,a.Qb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function of(a,b,c,d,e){var f=a.j=b&7;(b=a.u=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.mc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} +function pf(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Rb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} +h.ec=function(a){this.A.complete=!0;var b=this.G?qf(this.G)?1:this.A.lc?-1:0:0,c=a?this.A.lc?0:1:-1;this.A.lc=!1;this.cb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(rf(this.G,this.g[7],c)){this.Z();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.Xa&224)>>5,f=this.V&&this.V.jb>e?this.V:null;f&&(d=f.xb,e=f.jb);e>(this.w&224)>>5?(this.i&8&&(ze(this,2),this.i&=-9),this.ta(d,0,-10),e=!0):e=!1;e&&(f&&Ae(this,f),a=!0);this.V||this.Xa||(this.i&=-3)}else this.i& +1&&this.i++;if(a){if(this.i&4&&rf(this.G,this.g[7],c)){this.Z();break}if(0>c)break}if(this.i&112&&Be(this)){if(this.i&4&&rf(this.G,this.g[7],c)){this.Z();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.Pc(f)}while(0>1|b<<16;Ce(this,a);return a&65535}function xf(a,b){a=b&128|b>>1|b<<8;Ce(this,a<<8);return a&255}function yf(a,b){a=b&~a;this.Da(a);return a}function zf(a,b){a=b&~a;this.Da(a<<8);return a} +function Af(a,b){a|=b;this.Da(a);return a}function Bf(a,b){a|=b;this.Da(a<<8);return a}function Cf(a,b){a=~b|65536;this.kb(a);return a&65535}function Df(a,b){a=~b|256;this.kb(a<<8);return a&255}function Ef(a,b){this.I=this.L=a=b-a;this.H=b&(b^a);return a&65535}function Ff(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.H=b&(b^c);return a&255}function Gf(a,b){this.I=this.L=a=b+a;this.H=a&(b^a);return a&65535}function Hf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.H=c&(b<<8^c);return a&255} +function If(a,b){a=-b;this.kb(a,a&b&32768);return a&65535}function Jf(a,b){a=-b;this.kb(a<<8,(a&b&128)<<8);return a&255}function Kf(a,b){a=b<<1|this.F>>16&1;Ce(this,a);return a&65535}function Lf(a,b){a=b<<1|this.F>>16&1;Ce(this,a<<8);return a&255}function Mf(a,b){a=(this.F&65536|b)>>1|b<<16;Ce(this,a);return a&65535}function Nf(a,b){a=((this.F&65536)>>8|b)>>1|b<<8;Ce(this,a<<8);return a&255}function Of(a,b){var c=b-a;De(this,c,a,b);return c&65535} +function Pf(a,b){var c=b-a;De(this,c<<8,a<<8,b<<8);return c&255}function Qf(a,b){this.I=this.L=b&65280;this.H=this.F=0;return(b<<8|b>>8)&65535}function Rf(a,b){a^=b;this.Da(a);return a&65535}function Sf(a){T(this,a,Oe(this,a),sf);this.b-=this.u?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function Tf(a){var b=mf(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.F=this.H=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.H=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.u?6:7)+b} +function Uf(a){var b=mf(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&=63;if(b&32){b=64-b;32>b-1;this.F=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.u?6:7)+b}function Vf(a){S(this,a,!ve(this))}function Wf(a){S(this,a,ve(this))} +function Xf(a){T(this,a,Oe(this,a),yf);this.b-=this.u?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Yf(a){nf(this,a,Ne(this,a),zf);this.b-=this.u?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Zf(a){T(this,a,Oe(this,a),Af);this.b-=this.u?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function $f(a){nf(this,a,Ne(this,a),Bf);this.b-=this.u?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function ag(a){var b=Oe(this,a);a=mf(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.u?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function bg(a){var b=Ne(this,a);a=lf(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.u?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function cg(a){S(this,a,xe(this))}function dg(a){S(this,a,!ye(this)==!we(this))}function eg(a){S(this,a,!xe(this)&&!ye(this)==!we(this))}function fg(a){S(this,a,!ve(this)&&!xe(this))} +function gg(a){S(this,a,xe(this)||!ye(this)!=!we(this))}function hg(a){S(this,a,ve(this)||xe(this))}function ig(a){S(this,a,!ye(this)!=!we(this))}function jg(a){S(this,a,ye(this))}function kg(a){S(this,a,!xe(this))}function lg(a){S(this,a,!ye(this))}function mg(){this.ta(12,0,-9)}function ng(a){S(this,a,!0)}function og(a){S(this,a,!we(this))}function pg(a){S(this,a,we(this))}function qg(a){a&1&&(this.F=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} +function rg(a){var b=Oe(this,a);a=mf(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;De(this,c,a,b);this.b-=this.u?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function sg(a){var b=Ne(this,a);a=lf(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);De(this,c,a,b);this.b-=this.u?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} +function tg(a){var b=mf(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.H=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.H=32768,this.F=65536,this.b-=7}function ug(){this.ta(24,0,-9);this.b-=20} +function vg(){this.w&49152?(this.R|=128,this.ta(4,0,-8)):(this.ua&&1120==this.ka&&this.ua.setData(this.g[0],!0),this.G?wg(this.G):this.Z());this.b-=7}function xg(){this.ta(16,0,-9);this.b-=20}var yg=[0,7,7,10,7,11,9,13];function zg(a){this.la=this.b;te(this,kf(this,a));this.b=this.la-yg[this.u]}var Ag=[0,14,14,17,14,18,16,20];function Bg(a){this.la=this.b;var b=kf(this,a);a=a>>6&7;Ee(this,this.g[a]);this.g[a]=this.g[7];te(this,b);this.b=this.la-Ag[this.u]} +var Cg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Dg(a){var b=Oe(this,a);this.la=this.b;pf(this,a,b,this.Da);this.b=this.la-Cg[(this.X?8:0)+this.u]+(7!=this.j||this.u?0:2)}function Eg(a){var b=Ne(this,a);of(this,a,b,65535,this.Da);this.b-=this.u?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Fg=[7,13,13,17,14,18,17,21]; +function Gg(a){var b=mf(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.H=0;this.F=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)te(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Ng(a){T(this,a,Oe(this,a),Of);this.b-=this.u?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Og(a){T(this,a,0,Qf);this.b-=this.u?9:3+(7==this.j?2:0)}function Pg(){this.ta(28,0,-9)} +function Qg(){this.ua&&(this.ua.Gc(this.g[7],!0),this.ua.setData(this.g[0],!0));this.i|=8;ze(this,-2);this.b-=3}function Rg(a){T(this,a,this.g[(a>>6&7)+this.bc],Rf);this.b-=this.u?9:3+(7==this.j?2:0)}function U(a){var b;if(b=this.G)b=this.G,B(b,1)?(C(b,"undefined opcode "+O(b,a),!0,!0),b=wg(b)):b=!1;b||this.ta(8,0,-9)}function pe(a){Sg[a>>12].call(this,a)}function Tg(a){Ug[a>>6&3].call(this,a)}function Vg(a){Wg[a>>6&3].call(this,a)}function Xg(a){Yg[a>>6&3].call(this,a)} function Zg(a){$g[a&15].call(this,a)}function ah(a){bh[a&15].call(this,a)}function ch(a){dh[a>>6&3].call(this,a)}function eh(a){fh[a>>6&3].call(this,a)}function gh(a){hh[a>>6&3].call(this,a)} -var Sg=[function(a){ih[a>>8&15].call(this,a)},Dg,rg,ag,Xf,Zf,Sf,U,function(a){jh[a>>8&15].call(this,a)},Eg,sg,bg,Yf,$f,Ng,U],ih=[function(a){kh[a>>4&15].call(this,a)},ng,kg,cg,dg,ig,eg,gg,Bg,Bg,Tg,Vg,Xg,U,U,U],Ug=[function(a){pf(this,a,0,this.jb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,Cf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,1,Gf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,1,Ef);this.b-=this.v?9:3+(7==this.j?2:0)}],Wg=[function(a){T(this,a,0,If); -this.b-=this.v?11:6},function(a){T(this,a,ve(this)?1:0,sf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,ve(this)?1:0,Of);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=mf(this,a);this.jb(a);this.b-=this.v?4:3+(7==this.j?2:0)}],Yg=[function(a){T(this,a,0,Mf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,Kf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,wf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,uf);this.b-=this.v?9:3+(7==this.j?2:0)}],kh= -[function(a){lh[a&15].call(this,a)},U,U,U,zg,zg,zg,zg,Jg,U,Zg,ah,Og,Og,Og,Og],lh=[vg,Qg,Kg,mg,xg,Ig,U,U,U,U,U,U,U,U,U,U],$g=[Hg,function(){this.G=0;this.b-=5},function(){this.H=0;this.b-=5},qg,function(){this.L=1;this.b-=5},qg,qg,qg,function(){this.I=0;this.b-=5},qg,qg,qg,qg,qg,qg,qg],bh=[Hg,function(){this.G=65536;this.b-=5},function(){this.H=32768;this.b-=5},Lg,function(){this.L=0;this.b-=5},Lg,Lg,Lg,function(){this.I=32768;this.b-=5},Lg,Lg,Lg,Lg,Lg,Lg,Lg],jh=[lg,jg,fg,hg,og,pg,Vf,Wf,ug,Pg,ch,eh, -gh,U,U,U],dh=[function(a){of(this,a,0,255,this.jb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){nf(this,a,0,Df);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){nf(this,a,1,Hf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){nf(this,a,1,Ff);this.b-=this.v?9:3+(7==this.j?2:0)}],fh=[function(a){nf(this,a,0,Jf);this.b-=this.v?11:6},function(a){nf(this,a,ve(this)?1:0,tf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){nf(this,a,ve(this)?1:0,Pf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=lf(this, -a);this.jb(a<<8);this.b-=this.v?4:3+(7==this.j?2:0)}],hh=[function(a){nf(this,a,0,Nf);this.b-=this.v?9+(this.oc&1):3+(7==this.j?2:0)},function(a){nf(this,a,0,Lf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){nf(this,a,0,xf);this.b-=this.v?9+(this.oc&1):3+(7==this.j?2:0)},function(a){nf(this,a,0,vf);this.b-=this.v?9:3+(7==this.j?2:0)}];function qe(a){mh[a>>12].call(this,a)} -var mh=[function(a){nh[a>>8&15].call(this,a)},Dg,rg,ag,Xf,Zf,Sf,function(a){oh[a>>8&15].call(this,a)},function(a){ph[a>>8&15].call(this,a)},Eg,sg,bg,Yf,$f,Ng,U],nh=[function(a){qh[a>>4&15].call(this,a)},ng,kg,cg,dg,ig,eg,gg,Bg,Bg,Tg,Vg,Xg,function(a){rh[a>>6&3].call(this,a)},U,U],rh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.ma(a|this.Ha);te(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Le(this,a,0);this.Da(a);Ee(this,a);this.b-=11},function(a){var b=Ge(this); -this.ja=this.b;this.Da(b);Me(this,a,0,b);this.b=this.ja-Fg[this.v]},function(a){pf(this,a,ye(this)?65535:0,this.Da);this.b-=this.v?9:3+(7==this.j?2:0)}],qh=[function(a){sh[a&15].call(this,a)},U,U,U,zg,zg,zg,zg,Jg,function(a){!(a&8)||1145>this.ia?U.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},Zg,ah,Og,Og,Og,Og],sh=[vg,Qg,function(){Fe(this);this.i|=this.w&16;this.b-=13},mg,xg,Ig,Kg,function(a){U.call(this,a)},U,U,U,U,U,U,U,U],oh=[Gg,Gg,tg,tg,Tf,Tf,Uf,Uf, -Rg,Rg,U,U,U,U,Mg,Mg],ph=[lg,jg,fg,hg,og,pg,Vf,Wf,ug,Pg,ch,eh,gh,function(a){1145>this.ia?U.call(this,a):th[a>>6&3].call(this,a)},U,U],th=[function(a){U.call(this,a)},function(a){a=Le(this,a,65536);this.Da(a);Ee(this,a);this.b-=11},function(a){var b=Ge(this);this.ja=this.b;this.Da(b);Me(this,a,65536,b);this.b=this.ja-Fg[this.v]},function(a){U.call(this,a)}]; -function uh(a){q.call(this,"ROM",a,0,128);this.ea=this.g=null;this.v=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.C=Qa(this.j);if(this.j){a=this.j;var b=Ra(this.C);"json"!=b&&"hex"!=b&&(a=eb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;cb(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(va(c.nb,a,b),(a=db(a,b))?(c.g=a.ca,c.ea=a.ea):c.j=null);vh(c)})}}p(uh,q); -h=uh.prototype;h.ua=function(a,b,c,d){this.D=b;this.f=c;this.F=d;vh(this)};h.wa=function(){this.ea&&(this.F&&wh(this.F,this.id,this.v,this.b,this.ea),delete this.ea);return!0};h.va=function(){return!0}; -function vh(a){if(!Ka(a)){if(a.j){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Ea(a,"ROM size ("+I(a.g.length,8,!0)+") does not match specified size ("+I(a.b,8,!0)+")");else{var b;a:{b=a.v;if(57344<=b&&b<57344+Nc){var c={},c=(c[b]=[uh.prototype.Me,uh.prototype.Xf,null,null,null,a.b>>1],c);if(Xb(a.D,a,c)){a.status("Added "+a.b+"-byte ROM at "+H(b));b=a.w=!0;break a}}else if(Tc(a.D,b,a.b,Jd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0>8&15].call(this,a)},Dg,rg,ag,Xf,Zf,Sf,U,function(a){jh[a>>8&15].call(this,a)},Eg,sg,bg,Yf,$f,Ng,U],ih=[function(a){kh[a>>4&15].call(this,a)},ng,kg,cg,dg,ig,eg,gg,Bg,Bg,Tg,Vg,Xg,U,U,U],Ug=[function(a){pf(this,a,0,this.kb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,0,Cf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,1,Gf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,1,Ef);this.b-=this.u?9:3+(7==this.j?2:0)}],Wg=[function(a){T(this,a,0,If); +this.b-=this.u?11:6},function(a){T(this,a,ve(this)?1:0,sf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,ve(this)?1:0,Of);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=mf(this,a);this.kb(a);this.b-=this.u?4:3+(7==this.j?2:0)}],Yg=[function(a){T(this,a,0,Mf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,0,Kf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,0,wf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,0,uf);this.b-=this.u?9:3+(7==this.j?2:0)}],kh= +[function(a){lh[a&15].call(this,a)},U,U,U,zg,zg,zg,zg,Jg,U,Zg,ah,Og,Og,Og,Og],lh=[vg,Qg,Kg,mg,xg,Ig,U,U,U,U,U,U,U,U,U,U],$g=[Hg,function(){this.F=0;this.b-=5},function(){this.H=0;this.b-=5},qg,function(){this.L=1;this.b-=5},qg,qg,qg,function(){this.I=0;this.b-=5},qg,qg,qg,qg,qg,qg,qg],bh=[Hg,function(){this.F=65536;this.b-=5},function(){this.H=32768;this.b-=5},Lg,function(){this.L=0;this.b-=5},Lg,Lg,Lg,function(){this.I=32768;this.b-=5},Lg,Lg,Lg,Lg,Lg,Lg,Lg],jh=[lg,jg,fg,hg,og,pg,Vf,Wf,ug,Pg,ch,eh, +gh,U,U,U],dh=[function(a){of(this,a,0,255,this.kb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){nf(this,a,0,Df);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){nf(this,a,1,Hf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){nf(this,a,1,Ff);this.b-=this.u?9:3+(7==this.j?2:0)}],fh=[function(a){nf(this,a,0,Jf);this.b-=this.u?11:6},function(a){nf(this,a,ve(this)?1:0,tf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){nf(this,a,ve(this)?1:0,Pf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=lf(this, +a);this.kb(a<<8);this.b-=this.u?4:3+(7==this.j?2:0)}],hh=[function(a){nf(this,a,0,Nf);this.b-=this.u?9+(this.oc&1):3+(7==this.j?2:0)},function(a){nf(this,a,0,Lf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){nf(this,a,0,xf);this.b-=this.u?9+(this.oc&1):3+(7==this.j?2:0)},function(a){nf(this,a,0,vf);this.b-=this.u?9:3+(7==this.j?2:0)}];function qe(a){mh[a>>12].call(this,a)} +var mh=[function(a){nh[a>>8&15].call(this,a)},Dg,rg,ag,Xf,Zf,Sf,function(a){oh[a>>8&15].call(this,a)},function(a){ph[a>>8&15].call(this,a)},Eg,sg,bg,Yf,$f,Ng,U],nh=[function(a){qh[a>>4&15].call(this,a)},ng,kg,cg,dg,ig,eg,gg,Bg,Bg,Tg,Vg,Xg,function(a){rh[a>>6&3].call(this,a)},U,U],rh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.na(a|this.Ha);te(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Le(this,a,0);this.Da(a);Ee(this,a);this.b-=11},function(a){var b=Ge(this); +this.la=this.b;this.Da(b);Me(this,a,0,b);this.b=this.la-Fg[this.u]},function(a){pf(this,a,ye(this)?65535:0,this.Da);this.b-=this.u?9:3+(7==this.j?2:0)}],qh=[function(a){sh[a&15].call(this,a)},U,U,U,zg,zg,zg,zg,Jg,function(a){!(a&8)||1145>this.ka?U.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},Zg,ah,Og,Og,Og,Og],sh=[vg,Qg,function(){Fe(this);this.i|=this.w&16;this.b-=13},mg,xg,Ig,Kg,function(a){U.call(this,a)},U,U,U,U,U,U,U,U],oh=[Gg,Gg,tg,tg,Tf,Tf,Uf,Uf, +Rg,Rg,U,U,U,U,Mg,Mg],ph=[lg,jg,fg,hg,og,pg,Vf,Wf,ug,Pg,ch,eh,gh,function(a){1145>this.ka?U.call(this,a):th[a>>6&3].call(this,a)},U,U],th=[function(a){U.call(this,a)},function(a){a=Le(this,a,65536);this.Da(a);Ee(this,a);this.b-=11},function(a){var b=Ge(this);this.la=this.b;this.Da(b);Me(this,a,65536,b);this.b=this.la-Fg[this.u]},function(a){U.call(this,a)}]; +function uh(a){q.call(this,"ROM",a,0,128);this.ga=this.g=null;this.u=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Qa(this.j);if(this.j){a=this.j;var b=Ra(this.B);"json"!=b&&"hex"!=b&&(a=eb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;cb(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(va(c.ob,a,b),(a=db(a,b))?(c.g=a.ca,c.ga=a.ga):c.j=null);vh(c)})}}p(uh,q); +h=uh.prototype;h.wa=function(a,b,c,d){this.D=b;this.f=c;this.G=d;vh(this)};h.ya=function(){this.ga&&(this.G&&wh(this.G,this.id,this.u,this.b,this.ga),delete this.ga);return!0};h.xa=function(){return!0}; +function vh(a){if(!Ka(a)){if(a.j){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Ea(a,"ROM size ("+I(a.g.length,8,!0)+") does not match specified size ("+I(a.b,8,!0)+")");else{var b;a:{b=a.u;if(57344<=b&&b<57344+Nc){var c={},c=(c[b]=[uh.prototype.Me,uh.prototype.Xf,null,null,null,a.b>>1],c);if(Yb(a.D,a,c)){a.status("Added "+a.b+"-byte ROM at "+H(b));b=a.w=!0;break a}}else if(Tc(a.D,b,a.b,Jd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){C(a,"invalid block at offset "+Pa(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,E=r-=6;0=b.length){C(a,"insufficient data for block at offset "+Pa(n),4096); break}m+=b[l++]&255;if(m&255){C(a,"invalid checksum ("+I(m,2,!0)+") for block at offset "+Pa(n),4096);break}if(E)for(C(a,"loading "+Pa(E)+" bytes at "+Pa(u)+"-"+Pa(u+E),4096);E--;)bd(a.D,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&C(a,"starting address: "+Pa(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=ta.Jc&&c<=ta.Gd&&(b=c-(ta.Jc-ta.ud));b&&(a.preventDefault&&a.preventDefault(),d.ic(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ta.wd&&(b=ta.vd);d.ic(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +h.sa=function(a,b,c){var d=this;switch(b){case Ch:return this.C[b]=this.u=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?ta.Mc:ta.xd:46==c?b=ta.Mc:a.ctrlKey&&c>=ta.Jc&&c<=ta.Gd&&(b=c-(ta.Jc-ta.ud));b&&(a.preventDefault&&a.preventDefault(),d.ic(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ta.wd&&(b=ta.vd);d.ic(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ic(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.ua=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;var e=this;this.R=kd(this.f,this.M?-1:48,4,262144);this.S=hd(this.f,function(){var a;a=-1;e.v.length&&(a=e.v.shift()&255,C(e,"receiveByte("+I(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),jd(e.f,e.S,1E3/Math.round(e.T/10)));0<=a&&(e.G=a,e.b&128?e.G|=49152:e.b|=128,e.b&64&&id(c,e.R))});this.O=kd(this.f,this.M?-1:52,4,262144);this.X=hd(this.f,function(){e.g|=128;e.g&64&&id(c,e.O)});Xb(b,this,Dh,this.M?64832+8*(this.M-1)-65392:0);Zb(b,this.reset.bind(this)); -A(this)};h.md=function(a){if(!this.i){var b=$d(this.J,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Za(c[0]);if(d!=this.mb)return;c=Za(c[1]);if(this.i=Ba(c)){var e=this.i.exports;if(e){var f=e.connect;f&&f.call(this.i,this.I);if(this.H=e.receiveData){this.I=a;this.P=e.receiveStatus;this.status("Connected "+this.nb+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -h.wa=function(a,b){if(!b)if(this.md(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.va=function(a){return a?this.save():!0};h.reset=function(){Eh(this)};h.save=function(){var a=new M(this);a.set(0,[]);return a.data()};h.restore=function(){return Eh(this)};function Eh(a){a.G=0;a.b=8192;a.g=128;a.v=[];return!0} -h.ic=function(a){if("number"==typeof a)this.v.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.C%a,this.W&&(b=Ya("",c)));this.V&&!this.C&&c&&(b=String.fromCharCode(this.V)+b);this.j.value+=b;this.j.scrollTop=this.j.scrollHeight;this.C+=c}}else if(null!=this.w){if(10== -a||1024<=this.w.length)this.u(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}jd(this.f,this.X,1E3/Math.round(this.aa/10));this.g&=-129};var Ch="buffer",Fh={},Dh=(Fh[65392]=[null,null,Bh.prototype.ze,Bh.prototype.Kf,"RCSR"],Fh[65394]=[null,null,Bh.prototype.ye,Bh.prototype.Jf,"RBUF"],Fh[65396]=[null,null,Bh.prototype.ef,Bh.prototype.pg,"XCSR"],Fh[65398]=[null,null,Bh.prototype.df,Bh.prototype.og,"XBUF"],Fh); -wb(function(){for(var a=y(document,x,"serial"),b=0;ba&&(a-=32),jd(e.f,e.S,1E3/Math.round(e.T/10)));0<=a&&(e.F=a,e.b&128?e.F|=49152:e.b|=128,e.b&64&&id(c,e.R))});this.O=kd(this.f,this.M?-1:52,4,262144);this.X=hd(this.f,function(){e.g|=128;e.g&64&&id(c,e.O)});Yb(b,this,Dh,this.M?64832+8*(this.M-1)-65392:0);$b(b,this.reset.bind(this)); +A(this)};h.md=function(a){if(!this.j){var b=$d(this.J,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Za(c[0]);if(d!=this.nb)return;c=Za(c[1]);if(this.j=Ba(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.H=e.receiveData){this.I=a;this.P=e.receiveStatus;this.status("Connected "+this.ob+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +h.ya=function(a,b){if(!b)if(this.md(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Eh(this)};h.save=function(){var a=new J(this);a.set(0,[this.F,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Eh(this,a[0])};function Eh(a,b){b||(b=[0,8192,128,a.i]);b=ja(b);a.F=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0} +h.ic=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Ya("",c)));this.V&&!this.B&&c&&(b=String.fromCharCode(this.V)+b);this.u.value+=b;this.u.scrollTop=this.u.scrollHeight;this.B+=c}}else if(null!=this.w){if(10== +a||1024<=this.w.length)this.v(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}jd(this.f,this.X,1E3/Math.round(this.aa/10));this.g&=-129};var Ch="buffer",Fh={},Dh=(Fh[65392]=[null,null,Bh.prototype.ze,Bh.prototype.Kf,"RCSR"],Fh[65394]=[null,null,Bh.prototype.ye,Bh.prototype.Jf,"RBUF"],Fh[65396]=[null,null,Bh.prototype.ef,Bh.prototype.pg,"XCSR"],Fh[65398]=[null,null,Bh.prototype.df,Bh.prototype.og,"XBUF"],Fh); +wb(function(){for(var a=y(document,x,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.B[b]=c,!0;case "readTape":e=Jh;case "loadTape":return e||(e=Kh),this.B[b]=c,c.onclick= -function(){var a=d.B.listTapes;a&&Lh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.B[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Lh(d,Qa(b,!0),b,Kh,a)}return!1};return!0;case Mh:return this.B[b]=c,!0}return!1}; -h.ua=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;this.I=Nh(a);var e=this;if(a=Gh(this,$d(this.J,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.H=kd(this.f,56,4,4096);this.R=hd(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Cc.indexOf("/api/v1/dump")&&(e=Ra(c),f="json"==e||"gz"==e?encodeURI(c):eb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!cb(f,null,!0,function(e,f,g){var k=0>g&&!!a.J&&!a.J.A.fa;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(va(a.nb,e,f),(e=db(e,f))&&Yh(a,b,c,d,e.ca,e.Aa, -e.za));a.A.fb=!1;a.g&&(a.g--,a.g||A(a));Vh(a)})}function Qh(a,b,c,d){if((a=a.B.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.Y);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ra(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Sa(c,"/")&&(d="dir"),f=eb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.gc?"":e)+"&format=json"));return!!cb(f, +h.sa=function(a,b,c){var d=this,e=Ih;switch(b){case "listTapes":return this.C[b]=c,c.onchange=function(){var a=d.C.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){v("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b=''+b+"");a.innerHTML=b}},!0;case "descTape":return this.C[b]=c,!0;case "readTape":e=Jh;case "loadTape":return e||(e=Kh),this.C[b]=c,c.onclick= +function(){var a=d.C.listTapes;a&&Lh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.C[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Lh(d,Qa(b,!0),b,Kh,a)}return!1};return!0;case Mh:return this.C[b]=c,!0}return!1}; +h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;this.I=Nh(a);var e=this;if(a=Gh(this,$d(this.J,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.H=kd(this.f,56,4,4096);this.R=hd(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=Ra(c),f="json"==e||"gz"==e?encodeURI(c):eb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!cb(f,null,!0,function(e,f,g){var k=0>g&&!!a.J&&!a.J.A.ha;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(va(a.ob,e,f),(e=db(e,f))&&Yh(a,b,c,d,e.ca,e.Ba, +e.Aa));a.A.gb=!1;a.g&&(a.g--,a.g||A(a));Vh(a)})}function Qh(a,b,c,d){if((a=a.C.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.Y);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ra(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Sa(c,"/")&&(d="dir"),f=eb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.gc?"":e)+"&format=json"));return!!cb(f, null,!0,function(b,c,d){fi(a,b,c,d)})} -function fi(a,b,c,d){var e=null,f=0>d&&!!a.J&&!a.J.A.fa;a.j=!1;if(d)a.controller.N('Unable to load disk "'+a.Na+'" (error '+d+": "+b+")",f);else{va(a.controller.nb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.Y=k.length;a.da=k[0].length;a.ba=k[0][0].length;var l=k[0][0][0];a.pa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;E>2,e=Array(d),f=0;fd&&!!a.J&&!a.J.A.ha;a.j=!1;if(d)a.controller.N('Unable to load disk "'+a.Na+'" (error '+d+": "+b+")",f);else{va(a.controller.ob,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)v(k[0]);else{a.Y=k.length;a.ea=k[0].length;a.ba=k[0][0].length;var l=k[0][0][0];a.qa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;E>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ja?f=a.Ra+a.Ja&&(a.Ja+=f-(a.Ra+a.Ja)+1):(a.Ra=f,a.Ja=1);d[f]=d[f]&~(255<g)break;e|=g<g)break;e|=g<=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.N("Unable to restore disk '"+this.Na+": "+c);return b}; h.toJSON=function(){var a;a=0;for(var b;b=hi(this,a++);)ki(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function ki(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var bi=0;function R(a){q.call(this,"RK11",a,0,65536);this.G=Ei(this,a.autoMount);this.C=0;this.i=Array(8);this.H=!pb("Mobi")&&window&&"FileReader"in window;this.hb=null;this.L=this.g=this.b=this.w=this.v=this.j=this.I=0}p(R,q); -function Ei(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=R.prototype; -h.qa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.B[b]=c,c.onchange=function(){var a=d.B.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.B[b]=c,c.onchange=function(){var a=G(c.value,10);null!=a&&Gi(d, -a)},!0;case "loadDisk":return this.B[b]=c,c.onclick=function(){var a=d.B.listDisks;a&&a.options&&Hi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.B[b]=c,c.onclick=function(){var a,b=d.B.listDrives,b=b&&G(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.N("Unable to boot the selected drive"):a.ka?(se(d.f,0,!0),(a=d.Vc(a,0,0,0,512,0,2))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.H){c.parentNode.removeChild(c); -break}this.B[b]=c;c.onclick=function(){var a=d.B.listDrives;a&&a.options&&d.i&&((a=d.i[G(a.value,10)||0])?(a=a.ka)?(a=sb(ji(a),a.kc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.H)return this.B[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Hi(d,Qa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ua=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;if(a=Ei(this,$d(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.G[e]=a[e]);Ii(this);this.hb=kd(this.f,144,5,65536);Xb(b,this,Ji);Zb(b,this.reset.bind(this));Ki(this,"None",Li,!0);this.H&&Ki(this,"Local Disk",Mi);Ki(this,"Remote Disk",Ni);Oi(this)||A(this)}; -h.wa=function(a,b){if(!b){if(!a){if(this.reset(),this.J.C){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Gi(this,0)}}return!0};h.va=function(a){return a?this.save():!0};h.reset=function(){Ii(this)};h.save=function(){return(new M(this)).data()}; -h.restore=function(a){return Ii(this,a[0])};function Oi(a,b){b||(a.C=0);for(var c in a.G){var d=a.G[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.B.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.i.length)a.N("Unable to load the selected drive");else if(c)if(c==Mi)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Ni){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Qa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Qi(a,e,b,c,!1,d)}else Pi(a,e)} -function Qi(a,b,c,d,e,f){var g=-1,k=a.i[b];k.Ca.toLowerCase()!=d.toLowerCase()&&(g++,Pi(a,b,!0),k.ub?a.N("RK11 busy"):(k.ub=!0,e&&(k.tb=!0,a.C++,B(a)&&C(a,"auto-loading disk: "+c)),k.Xa=!!f,ei(new ai(a,k,"preload"),c,d,f,a.Ad)&&g++));return g} -h.Ad=function(a,b,c,d,e){a.ub=!1;b&&(b.Y>a.Y||b.da>a.da)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.gb)),b=null);b?(a.ka=b,a.Na=c,a.Ca=d,this.N('Loaded disk "'+c+'" in drive '+("RK"+a.gb),a.tb||e),this.J&&je(this.J)):a.Xa=!1;a.tb&&(a.tb=!1,--this.C||A(this));Gi(this,a.gb)}; -function Ki(a,b,c,d){if((a=a.B.listDisks)&&a.options){for(var e=0;e=a.Y){m=64;break}n=a.seek(b,c,d+1);if(!n){m=4096;break}r=0;++d>=a.ba&&(d=0,++c>=a.da&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=32;break}if(!k&&(rc(this.D,He(this.f,f),u|t<<8),gd(this.D))){m=1024;break}r>=a.pa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Bd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ka;var n=null,r;a||(m=128,e=0);for(;e;){var u=Ec(this.D,He(this.f,f));if(gd(this.D)){m=1024;break}if(!n){if(b>=a.Y){m=64;break}n=a.seek(b,c,d+1,!0);if(!n){m=4096;break}r=0;++d>=a.ba&&(d=0,++c>=a.da&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=32;break}if(u!=(t|E<<8)){m=1;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=32;break}r>=a.pa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.zd=function(a,b,c,d,e,f){this.v=f&65535;this.b=this.b&-49|f>>12&48;this.w=65536-e&65535;this.j=this.j&-16|d&15;this.g|=a;Ri(this);return!0};function Ri(a){a.b&=-32769;a.g&&(a.g|=32768,a.b|=32768,a.g&32736&&(a.b|=16384),B(a)&&C(a,a.type+": ERROR: "+H(a.g)))}h.Ee=function(){return this.L};h.Pf=function(){};h.Fe=function(){return this.g};h.Qf=function(){};h.Be=function(){return this.b&61438}; -h.Mf=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){a=!0;var b,c,d="",e=(this.j&57344)>>13,f=this.i[e],g,k,l,m,n,r;this.b&=-8321;this.g&=-4;switch(c=this.b&14){case 0:B(this)&&C(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=128;break;case 10:d="RCHK";case 4:d||(d="READ"),b=this.Vc;case 6:d||(d="WCHK");case 2:d||(d="WRITE");b||(b=this.Bd);g=(this.j&8160)>>5;k=(this.j&16)>>4;l=this.j&15;m=65536-this.w&65535;n=(this.b&48)<<12|this.v;r=this.b&2048?0:2;B(this)&&C(this,this.type+": "+ -d+"("+g+":"+k+":"+l+") "+H(n)+"--"+H(n+(m<<1)),!0,!0);if(g>=f.Y){this.g|=64;break}if(l>=f.ba){this.g|=32;break}a=b.call(this,f,g,k,l,m,n,r,6<=c,this.zd.bind(this));break;case 8:g=(this.j&8160)>>5;B(this)&&C(this,this.type+": SEEK("+g+")",!0);g'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.B[b]=c,c.onchange=function(){var a=G(c.value,10);null!=a&&Ui(d, -a)},!0;case "loadDisk":return this.B[b]=c,c.onclick=function(){var a=d.B.listDisks;a&&a.options&&Vi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.B[b]=c,c.onclick=function(){var a,b=d.B.listDrives,b=b&&G(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.N("Unable to boot the selected drive"):a.ka?(se(d.f,0,!0),(a=d.Wc(a,0,0,0,512,0))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.I){c.parentNode.removeChild(c); -break}this.B[b]=c;c.onclick=function(){var a=d.B.listDrives;a&&a.options&&d.g&&((a=d.g[G(a.value,10)||0])?(a=a.ka)?(a=sb(ji(a),a.kc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.I)return this.B[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Vi(d,Qa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ua=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.F=d;if(a=Ti(this,$d(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.H[e]=a[e]);Wi(this);this.hb=kd(this.f,112,5,131072);Xb(b,this,Xi);Zb(b,this.reset.bind(this));Yi(this,"None",Zi,!0);this.I&&Yi(this,"Local Disk",$i);Yi(this,"Remote Disk",aj);bj(this)||A(this)}; -h.wa=function(a,b){if(!b){if(!a){if(this.reset(),this.J.C){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Ui(this,0)}}return!0};h.va=function(a){return a?this.save():!0};h.reset=function(){Wi(this)};h.save=function(){return(new M(this)).data()}; -h.restore=function(a){return Wi(this,a[0])};function bj(a,b){b||(a.G=0);for(var c in a.H){var d=a.H[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.B.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if(c==$i)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==aj){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Qa(c);a.status("Attempting to load "+c+' as "'+b+'"')}dj(a,e,b,c,!1,d)}else cj(a,e)} -function dj(a,b,c,d,e,f){var g=-1,k=a.g[b];k.Ca.toLowerCase()!=d.toLowerCase()&&(g++,cj(a,b,!0),k.ub?a.N("RL11 busy"):(k.ub=!0,e&&(k.tb=!0,a.G++,B(a)&&C(a,"auto-loading disk: "+c)),k.Xa=!!f,ei(new ai(a,k,"preload"),c,d,f,a.Dd)&&g++));return g} -h.Dd=function(a,b,c,d,e){a.ub=!1;b&&(b.Y>a.Y||b.da>a.da)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.gb)),b=null);b?(a.ka=b,a.Na=c,a.Ca=d,this.N('Loaded disk "'+c+'" in drive '+("RL"+a.gb),a.tb||e),this.J&&je(this.J)):a.Xa=!1;a.tb&&(a.tb=!1,--this.G||A(this));Ui(this,a.gb)}; -function Yi(a,b,c,d){if((a=a.B.listDisks)&&a.options){for(var e=0;e(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}rc(this.D,He(this.f,f),n|r<<8);if(gd(this.D)){k=8192;break}f+=2;e--;if(m>=a.pa&&(l=null,++d>=a.ba&&(d=0,++c>=a.da&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Ed=function(a,b,c,d,e,f,g){var k=0;a=a.ka;var l=null,m;a||(k=5120,e=0);for(;e;){var n=Ec(this.D,He(this.f,f));if(gd(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.pa&&(l=null,++d>=a.ba&&(d=0,++c>=a.da&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Cd=function(a,b,c,d,e,f){this.C=f&65535;this.b=this.b&-49|f>>12&48;this.v=f>>16&63;this.j=this.i=b<<7|(c?64:0)|d&63;this.w=65536-e&65535;a&&(this.b=this.b|a|32768);return!0};h.Je=function(){return this.b&65535}; -h.Uf=function(a){this.b=this.b&-1023|a&1022;this.v=this.v&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c="",d=this.g[(this.b&768)>>8],e=d.ka,f,g,k;this.b&=-2;switch(this.b&14){case 4:this.w&8&&(this.b&=63);this.w=d.status|this.j&64|(e&&512==e.Y?128:0);break;case 6:1==(this.i&3)&&(b=this.i&65408,c=(this.i&16)<<2,this.j=this.i&4?this.j+b:this.j-b,this.i=this.j=this.j&65408|c);break;case 8:this.w=this.j;break;case 12:c="READ",b=this.Wc;case 10:c||(c="WRITE"),b||(b=this.Ed),f=this.i>>7,g=this.i&64?1:0,k= -this.i&63,!e||f>=e.Y||k>=e.ba?this.b|=37888:(a=65536-this.w&65535,e=(this.v&63)<<16|this.C,B(this)&&C(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+H(e)+"--"+H(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.Cd.bind(this)))}a&&(this.b|=129,this.b&64&&id(this.f,this.hb))}};h.He=function(){return this.C};h.Sf=function(a){this.C=a&65534};h.Ke=function(){return this.i};h.Vf=function(a){this.i=a};h.Le=function(){return this.w};h.Wf=function(a){this.w=a};h.Ie=function(){return this.v}; -h.Tf=function(a){this.v=a&63;this.b=this.b&-49|(this.v&3)<<4};var Zi="",$i="?",aj="??",ej={},Xi=(ej[63744]=[null,null,Gd.prototype.Je,Gd.prototype.Uf,"RLCS"],ej[63746]=[null,null,Gd.prototype.He,Gd.prototype.Sf,"RLBA"],ej[63748]=[null,null,Gd.prototype.Ke,Gd.prototype.Vf,"RLDA"],ej[63750]=[null,null,Gd.prototype.Le,Gd.prototype.Wf,"RLMP"],ej[63752]=[null,null,Gd.prototype.Ie,Gd.prototype.Tf,"RLBE"],ej); -function fj(a){q.call(this,"Debugger",a);this.Ba=+a.base||16;this.ga=!1;this.w=0;this.P=!1;this.v=-1;this.j=[];this.T={}}p(fj,q);fj.prototype.hd=function(){return-1};fj.prototype.jd=function(){}; -function gj(a,b,c,d){if(c)if(b){0>a.v&&a.j.length&&(a.v=0);if(0>a.v||b!=a.j[a.v])a.j.splice(0,0,b),a.v=0;a.v--}else a.P?b="end":b=a.j[a.v+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(Za(b.substring(c,f))),c=f+1}}return a} -function hj(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +function ki(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var bi=0;function R(a){q.call(this,"RK11",a,0,65536);this.L=li(this,a.autoMount);this.F=0;this.i=Array(8);this.M=!pb("Mobi")&&window&&"FileReader"in window;this.u=[];this.ib=null;this.I=this.g=this.b=this.B=this.w=this.j=this.H=0}p(R,q); +function li(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=R.prototype; +h.sa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.C[b]=c,c.onchange=function(){var a=d.C.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.C[b]=c,c.onchange=function(){var a=G(c.value,10);null!=a&&Fi(d, +a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&Hi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&G(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.N("Unable to boot the selected drive"):a.da?(se(d.f,0,!0),(a=d.Vc(a,0,0,0,512,0,2))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c); +break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.i&&((a=d.i[G(a.value,10)||0])?(a=a.da)?(a=sb(ji(a),a.kc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.M)return this.C[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Hi(d,Qa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=li(this,$d(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.L[e]=a[e]);Ii(this);this.ib=kd(this.f,144,5,65536);Yb(b,this,Ji);$b(b,this.reset.bind(this));Ki(this,"None",Li,!0);this.M&&Ki(this,"Local Disk",Mi);Ki(this,"Remote Disk",Ni);Oi(this)||A(this)}; +h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){this.u=[];for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Fi(this,0)}}return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Ii(this)}; +h.save=function(){var a=new J(this);a.set(0,[this.I,this.g,this.b,this.B,this.w,this.j,this.H,Qi(this)]);return a.data()};h.restore=function(a){return Ii(this,a[0])}; +function Ii(a,b){b||(b=[2368,0,128,0,0,0,0]);var c=ja(b);a.I=c.next().value;a.g=c.next().value;a.b=c.next().value;a.B=c.next().value;a.w=c.next().value;a.j=c.next().value;a.H=c.next().value;b[7]&&(a.u=b[7]);for(b=0;bg||9e||e>=a.i.length)a.N("Unable to load the selected drive");else if(c)if(c==Mi)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Ni){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Qa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Si(a,e,b,c,!1,d)}else Pi(a,e)} +function Si(a,b,c,d,e,f){var g=-1,k=a.i[b];k.ra.toLowerCase()!=d.toLowerCase()&&(g++,Pi(a,b,!0),k.vb?a.N("RK11 busy"):(k.vb=!0,e&&(k.ub=!0,a.F++,B(a)&&C(a,"auto-loading disk: "+c)),k.Za=!!f,ei(new ai(a,k,"preload"),c,d,f,a.Ad)&&g++));return g} +h.Ad=function(a,b,c,d,e){a.vb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.hb)),b=null);if(b){a.da=b;a.Na=c;a.ra=d;a:{var f;for(f=0;f=a.Y){m=64;break}n=a.seek(b,c,d+1);if(!n){m=4096;break}r=0;++d>=a.ba&&(d=0,++c>=a.ea&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=32;break}if(!k&&(Ec(this.D,He(this.f,f),u|t<<8),gd(this.D))){m=1024;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Bd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var n=null,r;a||(m=128,e=0);for(;e;){var u=Gc(this.D,He(this.f,f));if(gd(this.D)){m=1024;break}if(!n){if(b>=a.Y){m=64;break}n=a.seek(b,c,d+1,!0);if(!n){m=4096;break}r=0;++d>=a.ba&&(d=0,++c>=a.ea&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=32;break}if(u!=(t|E<<8)){m=1;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=32;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.zd=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&-49|f>>12&48;this.B=65536-e&65535;this.j=this.j&-16|d&15;this.g|=a;Ti(this);return!0};function Ti(a){a.b&=-32769;a.g&&(a.g|=32768,a.b|=32768,a.g&32736&&(a.b|=16384),B(a)&&C(a,a.type+": ERROR: "+H(a.g)))}h.Ee=function(){return this.I};h.Pf=function(){};h.Fe=function(){return this.g};h.Qf=function(){};h.Be=function(){return this.b&61438}; +h.Mf=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){a=!0;var b,c,d="",e=(this.j&57344)>>13,f=this.i[e],g,k,l,m,n,r;this.b&=-8321;this.g&=-4;switch(c=this.b&14){case 0:B(this)&&C(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=128;break;case 10:d="RCHK";case 4:d||(d="READ"),b=this.Vc;case 6:d||(d="WCHK");case 2:d||(d="WRITE");b||(b=this.Bd);g=(this.j&8160)>>5;k=(this.j&16)>>4;l=this.j&15;m=65536-this.B&65535;n=(this.b&48)<<12|this.w;r=this.b&2048?0:2;B(this)&&C(this,this.type+": "+ +d+"("+g+":"+k+":"+l+") "+H(n)+"--"+H(n+(m<<1)),!0,!0);if(g>=f.Y){this.g|=64;break}if(l>=f.ba){this.g|=32;break}a=b.call(this,f,g,k,l,m,n,r,6<=c,this.zd.bind(this));break;case 8:g=(this.j&8160)>>5;B(this)&&C(this,this.type+": SEEK("+g+")",!0);g'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.C[b]=c,c.onchange=function(){var a=G(c.value,10);null!=a&&Wi(d, +a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&Xi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&G(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.N("Unable to boot the selected drive"):a.da?(se(d.f,0,!0),(a=d.Wc(a,0,0,0,512,0))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.I){c.parentNode.removeChild(c); +break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.g&&((a=d.g[G(a.value,10)||0])?(a=a.da)?(a=sb(ji(a),a.kc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.I)return this.C[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Xi(d,Qa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=Vi(this,$d(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.H[e]=a[e]);Yi(this);this.ib=kd(this.f,112,5,131072);Yb(b,this,Zi);$b(b,this.reset.bind(this));$i(this,"None",aj,!0);this.I&&$i(this,"Local Disk",bj);$i(this,"Remote Disk",cj);dj(this)||A(this)}; +h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Wi(this,0)}}return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Yi(this)};h.save=function(){return(new J(this)).data()}; +h.restore=function(a){return Yi(this,a[0])};function dj(a,b){b||(a.F=0);for(var c in a.H){var d=a.H[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.C.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if(c==bj)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==cj){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Qa(c);a.status("Attempting to load "+c+' as "'+b+'"')}fj(a,e,b,c,!1,d)}else ej(a,e)} +function fj(a,b,c,d,e,f){var g=-1,k=a.g[b];k.ra.toLowerCase()!=d.toLowerCase()&&(g++,ej(a,b,!0),k.vb?a.N("RL11 busy"):(k.vb=!0,e&&(k.ub=!0,a.F++,B(a)&&C(a,"auto-loading disk: "+c)),k.Za=!!f,ei(new ai(a,k,"preload"),c,d,f,a.Dd)&&g++));return g} +h.Dd=function(a,b,c,d,e){a.vb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.hb)),b=null);b?(a.da=b,a.Na=c,a.ra=d,this.N('Loaded disk "'+c+'" in drive '+("RL"+a.hb),a.ub||e),this.J&&je(this.J)):a.Za=!1;a.ub&&(a.ub=!1,--this.F||A(this));Wi(this,a.hb)}; +function $i(a,b,c,d){if((a=a.C.listDisks)&&a.options){for(var e=0;e(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}Ec(this.D,He(this.f,f),n|r<<8);if(gd(this.D)){k=8192;break}f+=2;e--;if(m>=a.qa&&(l=null,++d>=a.ba&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +h.Ed=function(a,b,c,d,e,f,g){var k=0;a=a.da;var l=null,m;a||(k=5120,e=0);for(;e;){var n=Gc(this.D,He(this.f,f));if(gd(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.qa&&(l=null,++d>=a.ba&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +h.Cd=function(a,b,c,d,e,f){this.B=f&65535;this.b=this.b&-49|f>>12&48;this.u=f>>16&63;this.j=this.i=b<<7|(c?64:0)|d&63;this.w=65536-e&65535;a&&(this.b=this.b|a|32768);return!0};h.Je=function(){return this.b&65535}; +h.Uf=function(a){this.b=this.b&-1023|a&1022;this.u=this.u&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c="",d=this.g[(this.b&768)>>8],e=d.da,f,g,k;this.b&=-2;switch(this.b&14){case 4:this.w&8&&(this.b&=63);this.w=d.status|this.j&64|(e&&512==e.Y?128:0);break;case 6:1==(this.i&3)&&(b=this.i&65408,c=(this.i&16)<<2,this.j=this.i&4?this.j+b:this.j-b,this.i=this.j=this.j&65408|c);break;case 8:this.w=this.j;break;case 12:c="READ",b=this.Wc;case 10:c||(c="WRITE"),b||(b=this.Ed),f=this.i>>7,g=this.i&64?1:0,k= +this.i&63,!e||f>=e.Y||k>=e.ba?this.b|=37888:(a=65536-this.w&65535,e=(this.u&63)<<16|this.B,B(this)&&C(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+H(e)+"--"+H(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.Cd.bind(this)))}a&&(this.b|=129,this.b&64&&id(this.f,this.ib))}};h.He=function(){return this.B};h.Sf=function(a){this.B=a&65534};h.Ke=function(){return this.i};h.Vf=function(a){this.i=a};h.Le=function(){return this.w};h.Wf=function(a){this.w=a};h.Ie=function(){return this.u}; +h.Tf=function(a){this.u=a&63;this.b=this.b&-49|(this.u&3)<<4};var aj="",bj="?",cj="??",gj={},Zi=(gj[63744]=[null,null,Gd.prototype.Je,Gd.prototype.Uf,"RLCS"],gj[63746]=[null,null,Gd.prototype.He,Gd.prototype.Sf,"RLBA"],gj[63748]=[null,null,Gd.prototype.Ke,Gd.prototype.Vf,"RLDA"],gj[63750]=[null,null,Gd.prototype.Le,Gd.prototype.Wf,"RLMP"],gj[63752]=[null,null,Gd.prototype.Ie,Gd.prototype.Tf,"RLBE"],gj); +function hj(a){q.call(this,"Debugger",a);this.Ca=+a.base||16;this.ia=!1;this.w=0;this.P=!1;this.u=-1;this.j=[];this.T={}}p(hj,q);hj.prototype.hd=function(){return-1};hj.prototype.jd=function(){}; +function ij(a,b,c,d){if(c)if(b){0>a.u&&a.j.length&&(a.u=0);if(0>a.u||b!=a.j[a.u])a.j.splice(0,0,b),a.u=0;a.u--}else a.P?b="end":b=a.j[a.u+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(Za(b.substring(c,f))),c=f+1}}return a} +function jj(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function ij(a,b,c){var d;if(b){b=jj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=I(c,0,!0)+" "+c+". "+H(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.u((null!=b?b+": ":"")+d);return e} -function nj(a,b){if(b)return mj(a,b,a.T[b]);var c=0;for(b in a.T)mj(a,b,a.T[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function oj(a){fj.call(this,a);this.Ea=!1;this.ga=!0;this.H=V();this.ya=V();this.O=V();this.C=[];this.g=this.L=this.G=[];pj(this);this.R=this.aa=0;this.i=[];this.na=void 0;qj(this);this.F=this;this.ia={};this.ha=this.cd=0;this.S=null;this.M=[];rj(this,a.messages);this.sa=a.commands;this.Ha=sj;this.W=[];this.I=0;this.Ia=this.oa=null;this.w=this.Ga=this.Fa=this.X=this.ja=0;this.b=this.V=null;var b=this;window?void 0===window[x]&&(window[x]=function(a){return ee(b,a)}):void 0===global[x]&&(global[x]= -function(a){return ee(b,a)})}p(oj,fj);function tj(a){a=a&&a.K;null==a&&(a=-1);return a}function V(a,b,c){return{K:void 0===a?null:a,Ka:void 0===b?!1:b,Qa:!1,Ba:c}}h=oj.prototype;h.Gc=function(a,b){a.K=b;a.Qa=!1;a.Ba=void 0;return a};function uj(a){return[a.K,a.Ka,a.Ba,a.Qa,a.jc]}function vj(a,b){var c=V(b[0],b[1],b[2]);c.Qa=b[3];b[4]&&(c.$c=gj(a,c.jc=b[4]));return c} -h.ua=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.b=a.i;(a=$d(a,"messages"))&&rj(this,a);1140>this.f.ia&&(this.W=this.W.concat(wj));1145>this.f.ia&&(this.W=this.W.concat(xj));md(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=tj(yj(d,c));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.u("blockid physical blockaddr used size type");d.u("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.u("..."): -(c=n.type,m=Zc[c],n&&d.u(I(n.id,8)+" %"+I(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -h.jd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.oa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Ej:b=vd(this.f);break;case Fj:b=c.Va;break;case Gj:b=c.R;break;case Hj:b=c.ya&65280;break;case Ij:b=pd(c);break;case Jj:b=rd(c);break;case Kj:b=sd(c);break;case Lj:b=c.T;break;case Mj:d&&(b=d.xa);break;case Nj:d&&(b=d.wb);break;case Oj:d&&Jc(d)&&(b=d.Za)}}return b}; -h.message=function(a,b){b&&(a+=" @"+Bj(this,V(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.ha&1073741824)this.M.push(a);else{var c;if(this.ha&-2147483648&&this.f&&(c=this.f.A.U)||La(this,!0))this.Z(),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,ke(a),a.sb=0,a.J&&J(a.J,void 0))}}; -function qj(a){var b;if(!qf(a))a.i&&a.i.length&&a.u("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Pj);for(b=0;b>8;a.u("trapped to "+O(a,c&255,1)+" ("+(0>d?Qb[-d]:O(a,d))+")")}a.H=V(a.f.g[7]);b&&1!=a.I?Tj(a):Uj(a)}}function Rj(a,b){var c;(c=!a.f||!Ka(a.f))||(c=a.f,c.A.fa?c=!0:(c.u(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.U?(b||a.u("cpu busy or unavailable, command ignored"),!1):!Ja(a.f)}h.wa=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; -h.va=function(a,b){b&&this.u(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){qj(this);this.X=0;this.S=null;this.w=0;this.H=V(this.f.g[7]);this.A.U=!1;Vj(this);a||ce(this)};h.save=function(){var a=new M(this);a.set(0,uj(this.H));a.set(1,uj(this.O));a.set(2,[this.j,this.P,this.ha]);a.set(3,this.C);return a.data()}; -h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=vj(this,a[b++]),this.O=vj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.ha|=a[b][2]);a[3]&&(this.C=a[3]);return!0};h.start=function(a,b){this.I||this.u("running");this.A.U=!0;this.Fa=a;this.Ga=b}; -h.stop=function(a,b){if(this.A.U){this.A.U=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Fc(a.f,b)),65535!=(d&65535)&&(a.Gc(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function wg(a){var b=a.f;if(b.A.U)throw te(b,a.f.P&65535),a.Z(),-1;return!1}function Ud(a,b,c){Wj(a,b,c||1,a.L)&&a.Z(!1)}function Vd(a,b,c){Wj(a,b,c||1,a.G)&&a.Z(!1)} -function pj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Ke(a.f,!1);a.L=["br"];if(a.G)for(b=1;b>>c.g],!0)):Ke(a.f,!0);a.G=["bw"];a.ja=0} -h.rb=function(a,b,c){var d=!0;c||Xj(this,a,b,!1,!0);if(a!=this.g){var e=tj(b);if(-1===e)this.u("invalid address: "+Bj(this,b)),d=!1;else{var f=a==this.G;65535>>g.g].rb(e&g.i,f)}else e=this.f,(f?e.Zb++:e.Yb++)||re(e)}}d&&(a.push(b),c?b.Qa=!0:(Yj(this,a,a.length-1,"set"),qj(this)));return d}; -function Xj(a,b,c,d,e){var f=!1;c=tj(c);for(var g=1;g>>d.g],b)):Ke(a.f,b));k.Qa||qj(a);break}}return f}function Zj(a,b){for(var c=1;c>23)&65535,z=O(t,u);else if(D==fk)u=u.K-((f&63)<<1)&65535,z=O(t,u);else if(D==gk)z=O(t,f&7,1);else if(D==hk)z=O(t,f&63,1);else if(D==ik)z=O(t,f&255,1);else if(D=f&E,E&jk&&(D>>=6,E>>=6),E&Y){var E=null,F=D& -kk;switch(D&lk){case 0:z=Dj(F);break;case 8:z="@"+Dj(F);E=mk(t,t.f.g[F]);break;case 16:7>F?z="("+Dj(F)+")+":(D=t.Oa(u,2),z="#"+O(t,D,0,!0));break;case 24:7>F?z="@("+Dj(F)+")+":(D=t.Oa(u,2),z="@#"+O(t,D,0,!0),E=mk(t,D));break;case 32:z="-("+Dj(F)+")";break;case 40:z="@-("+Dj(F)+")";break;case 48:D=t.Oa(u,2);z=O(t,D,0,!0)+"("+Dj(F)+")";7==F&&(z=O(t,D=D+u.K&65535),E=mk(t,D));break;case 56:D=t.Oa(u,2),z="@"+O(t,D)+"("+Dj(F)+")",7==F&&(z="@"+O(t,D=D+u.K&65535),E=mk(t,Fc(t.f,D)))}E&&(z=[z,E])}t=z;if(!t|| -!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.lb&&b=c.C&&(b=c.Ma[b&fd])&&(a=b[4]);return a}function nk(a,b){switch(b){case "N":a=ye(a.f);break;case "Z":a=xe(a.f);break;case "V":a=we(a.f);break;case "C":a=ve(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} -function Z(a,b){var c="",d=a.f;if(8>b)c=Dj(b),c+="="+O(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+O(a,d.oa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+O(a,d.W[b-16]);else switch(b){case Ej:c="PS="+O(a,vd(d));break;case Fj:c="PI="+O(a,d.Va);break;case Gj:c="ER="+O(a,d.R);break;case Hj:c="SL="+O(a,d.ya&65280);break;case Ij:c="M0="+O(a,pd(d));break;case Jj:c="M1="+O(a,rd(d));break;case Kj:c="M2="+O(a,sd(d));break;case Lj:c="M3="+O(a,d.T);break;case Mj:a.b&&(c="AR="+O(a,a.b.xa,3));break;case Nj:a.b&&(c="DR="+ -O(a,a.b.wb));break;case Oj:a.b&&Jc(a.b)&&(c="SR="+O(a,a.b.Za,3))}c&&(c+=" ");return c}function ok(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Ej)+Z(a,Fj)+Z(a,Hj);d+=nk(a,"T")+nk(a,"N")+nk(a,"Z")+nk(a,"V")+nk(a,"C");b&&(b=d,c=""+(Z(a,Ij)+Z(a,Jj)),c+=Z(a,Kj)+Z(a,Lj)+Z(a,Gj),c=c+"\n"+(Z(a,Oj)+Z(a,Mj)+Z(a,Nj)),d=b+("\n"+c));return d}h.dd=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=ab(n,l,a.dd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.C.push({xh:b,K:c,Qd:d,ea:e,ad:f})}function pk(a,b,c){var d=[],e=tj(b)>>>0;for(b=0;b>>0,k=f.Qd;if(e>=g&&eb)){e.g[b]= -g&65535;break}a.u("unknown register: "+f);return}J(a.J);a.u("updated registers:")}}a.u(ok(a,d));c&&(a.H=V(e.g[7]),Uj(a,Bj(a,a.H)))}}function tk(a,b){b=Za(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.u(m)}k[3]&&(g=k[3],f=null);f=bk(a,b,g,f);a.u(f);a.H=b;e-=b.K-l;c++}}} -function ak(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(Sj+b):(a.P&&(a.u("ended assemble at "+Bj(a,a.O)),a.H=a.O,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(Ka(a)&&0n||"z"Ga.length&&(a.u("note: only "+Ga.length+" available"),qa=Ga.length);wa-=qa;0>wa&&(null==Ga[Ga.length-1].K?(qa=wa+qa,wa=0):wa+=Ga.length);var Qe=[];"call"==pi&&(sc=1E5,Qe=["CALL"]);for(void 0!==oi&&a.u(qa+" instructions earlier:");0=Ga.length&&(wa=0);a.na=qa;ri++;sc--}}ri||(a.u("no "+qi+"history available"),a.na=void 0)}else{var ga=yj(a,Fa);if(ga)if("da"==Ta){var Re=ga.Ka||65535K.length?(2ib&&(ib=0);65536Ve?String.fromCharCode(Ve):"."),yd=yd>>8}kb&&(kb+="\n");kb=Se?kb+(lb+","):kb+(Fa+": "+lb+(xd?"":" "+Ue))}kb&&a.u(kb);a.ya=ga;a.Ba=Xk}}}}break;case "e":if("else"==g[0])break;var Lb,We,Xe,Ye,Ze=g[0],$e=g[1];"eb"==Ze? -(Lb=1,We=255,Xe=a.Nc,Ye=a.Oc):"e"==Ze||"ew"==Ze?(Lb=2,We=65535,Xe=a.Oa,Ye=a.yd):$e=null;if(null==$e)a.u("edit memory commands:"),a.u("\teb [a] [...] edit bytes at address a"),a.u("\tew [a] [...] edit words at address a");else{var zd=yj(a,$e);if(zd)for(var Ad=2;Adcf;){for(var mb=null,al=256;65536>yc.K>>>0;){df.K=a.Oa(yc,2);if(null==yc.K||!al--)break;if(!(df.K&1)){for(var bl=a,Bd=df,wi=null,zc=Bd.K,xi=zc,ef=1;6>=ef&&zc;ef++){if(2> ";wb(function(){for(var a=y(document,x,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.u("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bBk){if(Ck(d,this.I)){this.v=new M(this,"1.32.2",Lk);Ck(this.v)&&(Mk(this,d),a=Nk,Ok(this.v));this.v.set(Ik,bb());Pk(this.v);var e=this.b&&!this.G;if(a==Jk||za("Click OK to restore the previous "+Fb+" machine state, or CANCEL to reset the machine.")){if(c=Hk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ck(d,g):("error"==f&&"no machine state"!= -g?(this.N("Error: "+g),"unable to verify user"==g&&(ob(Qk,""),this.g=null)):this.u(f+": "+g),Ok(d),Ck(d)?(c=Hk(d),e=!0):c=!1))}e&&Fk(this,c?d:null)}else a==Nk&&d.clear()}else Fk(this);delete this.I;delete this.w}e=Aa(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.A.fa=!0;var d=this.B.power;d&&(d.textContent="Shutdown");this.f&&(Rk(this,this.f,b,c,a),J(this),this.f.ta());this.O&&(Mk(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0}; -function Mk(a,b){if(za("There may be a problem with your "+Fb+" machine.\n\nTo help us diagnose it, click OK to send this "+Fb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Fb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;cb("http://www.pcjs.org/api/v1/report",d,!0)}} -function vk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new M(a,"1.32.2"),g=new M(a,"1.32.2",Gk),k=bb();g.set(Ik,k);f.set(Ik,k);f.set(Sk,"1.32.2");f.set(Tk,window?window.location.href:null);f.set(Wk,window?window.navigator.userAgent:"");a.f&&a.f.va&&(c&&(b&&(a.f.A.ta=a.f.A.U),a.f.Z()),d=a.f.va(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.fa=!1,!1===d&&(e=null)));for(var k=Aa(a.id),l=0;l=d||30<=(c.rc+=d))&&(e.textContent=c.A.U?c.ob.toFixed(2)+"Mhz":"Stopped",c.rc=0)}if(a.i&&(a=a.i,b=b||0,a.v)){c=a.f.A.U;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;ef.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");cb(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);ml(a,b,c)}})}else c(a,null)} -function nl(a,b,c,d){function e(a){if(void 0===k){var b=g&&y(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Wa(a))}function f(a){e("Error: "+a);l&&(--jl||Ab(!0));l=!1}var g,k,l=!0;jl++;xa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?kl(c,null,null,!1,e,function(d,l){l?(va(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--jl||Ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--jl||Ab(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?kl(b,a,d,!0,e,m):ll(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Ab(!1);return nl(a,b,c,d)};window.findMachineComponent=function(a,b){return Ca(b,a+".machine")};window.enableEvents=Ab;window.sendEvent=Cb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11-dbg.map +function kj(a,b,c){var d;if(b){b=lj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=I(c,0,!0)+" "+c+". "+H(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.v((null!=b?b+": ":"")+d);return e} +function pj(a,b){if(b)return oj(a,b,a.T[b]);var c=0;for(b in a.T)oj(a,b,a.T[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; +function qj(a){hj.call(this,a);this.Ea=!1;this.ia=!0;this.H=V();this.za=V();this.O=V();this.B=[];this.g=this.L=this.F=[];rj(this);this.R=this.W=0;this.i=[];this.oa=void 0;sj(this);this.G=this;this.ka={};this.ja=this.cd=0;this.S=null;this.M=[];tj(this,a.messages);this.ua=a.commands;this.Ha=uj;this.X=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.aa=this.la=0;this.b=this.V=null;var b=this;window?void 0===window[x]&&(window[x]=function(a){return ee(b,a)}):void 0===global[x]&&(global[x]= +function(a){return ee(b,a)})}p(qj,hj);function vj(a){a=a&&a.K;null==a&&(a=-1);return a}function V(a,b,c){return{K:void 0===a?null:a,Ka:void 0===b?!1:b,Qa:!1,Ca:c}}h=qj.prototype;h.Gc=function(a,b){a.K=b;a.Qa=!1;a.Ca=void 0;return a};function wj(a){return[a.K,a.Ka,a.Ca,a.Qa,a.jc]}function xj(a,b){var c=V(b[0],b[1],b[2]);c.Qa=b[3];b[4]&&(c.$c=ij(a,c.jc=b[4]));return c} +h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.b=a.i;(a=$d(a,"messages"))&&tj(this,a);1140>this.f.ka&&(this.X=this.X.concat(yj));1145>this.f.ka&&(this.X=this.X.concat(zj));md(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=vj(Aj(d,c));if(-1===a){d.v("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.v("blockid physical blockaddr used size type");d.v("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.v("..."): +(c=n.type,m=Zc[c],n&&d.v(I(n.id,8)+" %"+I(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} +h.jd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Gj:b=vd(this.f);break;case Hj:b=c.Xa;break;case Ij:b=c.R;break;case Jj:b=c.za&65280;break;case Kj:b=pd(c);break;case Lj:b=rd(c);break;case Mj:b=sd(c);break;case Nj:b=c.T;break;case Oj:d&&(b=d.fa);break;case Pj:d&&(b=d.Sa);break;case Qj:d&&Jc(d)&&(b=d.Ta)}}return b}; +h.message=function(a,b){b&&(a+=" @"+Dj(this,V(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.ja&1073741824)this.M.push(a);else{var c;if(this.ja&-2147483648&&this.f&&(c=this.f.A.U)||La(this,!0))this.Z(),c&&(a+=" (cpu halted)");this.v(a);this.f&&(a=this.f,ke(a),a.tb=0,a.J&&L(a.J,void 0))}}; +function sj(a){var b;if(!qf(a))a.i&&a.i.length&&a.v("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Rj);for(b=0;b>8;a.v("trapped to "+O(a,c&255,1)+" ("+(0>d?Qb[-d]:O(a,d))+")")}a.H=V(a.f.g[7]);b&&1!=a.I?Vj(a):Wj(a)}}function Tj(a,b){var c;(c=!a.f||!Ka(a.f))||(c=a.f,c.A.ha?c=!0:(c.v(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.U?(b||a.v("cpu busy or unavailable, command ignored"),!1):!Ja(a.f)}h.ya=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; +h.xa=function(a,b){b&&this.v(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){sj(this);this.aa=0;this.S=null;this.w=0;this.H=V(this.f.g[7]);this.A.U=!1;Xj(this);a||ce(this)};h.save=function(){var a=new J(this);a.set(0,wj(this.H));a.set(1,wj(this.O));a.set(2,[this.j,this.P,this.ja]);a.set(3,this.B);return a.data()}; +h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=xj(this,a[b++]),this.O=xj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.ja|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.v("running");this.A.U=!0;this.Fa=a;this.Ga=b}; +h.stop=function(a,b){if(this.A.U){this.A.U=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Hc(a.f,b)),65535!=(d&65535)&&(a.Gc(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function wg(a){var b=a.f;if(b.A.U)throw te(b,a.f.P&65535),a.Z(),-1;return!1}function Ud(a,b,c){Yj(a,b,c||1,a.L)&&a.Z(!1)}function Vd(a,b,c){Yj(a,b,c||1,a.F)&&a.Z(!1)} +function rj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Ke(a.f,!1);a.L=["br"];if(a.F)for(b=1;b>>c.g],!0)):Ke(a.f,!0);a.F=["bw"];a.la=0} +h.sb=function(a,b,c){var d=!0;c||Zj(this,a,b,!1,!0);if(a!=this.g){var e=vj(b);if(-1===e)this.v("invalid address: "+Dj(this,b)),d=!1;else{var f=a==this.F;65535>>g.g].sb(e&g.i,f)}else e=this.f,(f?e.Zb++:e.Yb++)||re(e)}}d&&(a.push(b),c?b.Qa=!0:(ak(this,a,a.length-1,"set"),sj(this)));return d}; +function Zj(a,b,c,d,e){var f=!1;c=vj(c);for(var g=1;g>>d.g],b)):Ke(a.f,b));k.Qa||sj(a);break}}return f}function bk(a,b){for(var c=1;c>23)&65535,z=O(t,u);else if(D==hk)u=u.K-((f&63)<<1)&65535,z=O(t,u);else if(D==ik)z=O(t,f&7,1);else if(D==jk)z=O(t,f&63,1);else if(D==kk)z=O(t,f&255,1);else if(D=f&E,E&lk&&(D>>=6,E>>=6),E&Y){var E=null,F=D& +mk;switch(D&nk){case 0:z=Fj(F);break;case 8:z="@"+Fj(F);E=ok(t,t.f.g[F]);break;case 16:7>F?z="("+Fj(F)+")+":(D=t.Oa(u,2),z="#"+O(t,D,0,!0));break;case 24:7>F?z="@("+Fj(F)+")+":(D=t.Oa(u,2),z="@#"+O(t,D,0,!0),E=ok(t,D));break;case 32:z="-("+Fj(F)+")";break;case 40:z="@-("+Fj(F)+")";break;case 48:D=t.Oa(u,2);z=O(t,D,0,!0)+"("+Fj(F)+")";7==F&&(z=O(t,D=D+u.K&65535),E=ok(t,D));break;case 56:D=t.Oa(u,2),z="@"+O(t,D)+"("+Fj(F)+")",7==F&&(z="@"+O(t,D=D+u.K&65535),E=ok(t,Hc(t.f,D)))}E&&(z=[z,E])}t=z;if(!t|| +!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.mb&&b=c.B&&(b=c.Ma[b&fd])&&(a=b[4]);return a}function pk(a,b){switch(b){case "N":a=ye(a.f);break;case "Z":a=xe(a.f);break;case "V":a=we(a.f);break;case "C":a=ve(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} +function Z(a,b){var c="",d=a.f;if(8>b)c=Fj(b),c+="="+O(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+O(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+O(a,d.W[b-16]);else switch(b){case Gj:c="PS="+O(a,vd(d));break;case Hj:c="PI="+O(a,d.Xa);break;case Ij:c="ER="+O(a,d.R);break;case Jj:c="SL="+O(a,d.za&65280);break;case Kj:c="M0="+O(a,pd(d));break;case Lj:c="M1="+O(a,rd(d));break;case Mj:c="M2="+O(a,sd(d));break;case Nj:c="M3="+O(a,d.T);break;case Oj:a.b&&(c="AR="+O(a,a.b.fa,3));break;case Pj:a.b&&(c="DR="+ +O(a,a.b.Sa));break;case Qj:a.b&&Jc(a.b)&&(c="SR="+O(a,a.b.Ta,3))}c&&(c+=" ");return c}function qk(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Gj)+Z(a,Hj)+Z(a,Jj);d+=pk(a,"T")+pk(a,"N")+pk(a,"Z")+pk(a,"V")+pk(a,"C");b&&(b=d,c=""+(Z(a,Kj)+Z(a,Lj)),c+=Z(a,Mj)+Z(a,Nj)+Z(a,Ij),c=c+"\n"+(Z(a,Qj)+Z(a,Oj)+Z(a,Pj)),d=b+("\n"+c));return d}h.dd=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=ab(n,l,a.dd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({xh:b,K:c,Qd:d,ga:e,ad:f})}function rk(a,b,c){var d=[],e=vj(b)>>>0;for(b=0;b>>0,k=f.Qd;if(e>=g&&eb)){e.g[b]= +g&65535;break}a.v("unknown register: "+f);return}L(a.J);a.v("updated registers:")}}a.v(qk(a,d));c&&(a.H=V(e.g[7]),Wj(a,Dj(a,a.H)))}}function vk(a,b){b=Za(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.v(m)}k[3]&&(g=k[3],f=null);f=dk(a,b,g,f);a.v(f);a.H=b;e-=b.K-l;c++}}} +function ck(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.v(Uj+b):(a.P&&(a.v("ended assemble at "+Dj(a,a.O)),a.H=a.O,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(Ka(a)&&0n||"z"Ga.length&&(a.v("note: only "+Ga.length+" available"),qa=Ga.length);wa-=qa;0>wa&&(null==Ga[Ga.length-1].K?(qa=wa+qa,wa=0):wa+=Ga.length);var Se=[];"call"==qi&&(tc=1E5,Se=["CALL"]);for(void 0!==pi&&a.v(qa+" instructions earlier:");0=Ga.length&&(wa=0);a.oa=qa;si++;tc--}}si||(a.v("no "+ri+"history available"),a.oa=void 0)}else{var ga=Aj(a,Fa);if(ga)if("da"==Ta){var Te=ga.Ka||65535K.length?(2ib&&(ib=0);65536Xe?String.fromCharCode(Xe):"."),zd=zd>>8}kb&&(kb+="\n");kb=Ue?kb+(lb+","):kb+(Fa+": "+lb+(yd?"":" "+We))}kb&&a.v(kb);a.za=ga;a.Ca=Zk}}}}break;case "e":if("else"== +g[0])break;var Nb,Ye,Ze,$e,af=g[0],bf=g[1];"eb"==af?(Nb=1,Ye=255,Ze=a.Nc,$e=a.Oc):"e"==af||"ew"==af?(Nb=2,Ye=65535,Ze=a.Oa,$e=a.yd):bf=null;if(null==bf)a.v("edit memory commands:"),a.v("\teb [a] [...] edit bytes at address a"),a.v("\tew [a] [...] edit words at address a");else{var Ad=Aj(a,bf);if(Ad)for(var Bd=2;Bdef;){for(var mb=null,cl=256;65536>zc.K>>>0;){ff.K=a.Oa(zc,2);if(null==zc.K||!cl--)break;if(!(ff.K&1)){for(var dl=a,Cd=ff,xi=null,Ac=Cd.K,yi=Ac,gf=1;6>=gf&&Ac;gf++){if(2> ";wb(function(){for(var a=y(document,x,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.v("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bDk){if(Ek(d,this.I)){this.u=new J(this,"1.32.2",Nk);Ek(this.u)&&(Ok(this,d),a=Pk,Qk(this.u));this.u.set(Kk,bb());Rk(this.u);var e=this.b&&!this.F;if(a==Lk||za("Click OK to restore the previous "+Fb+" machine state, or CANCEL to reset the machine.")){if(c=Jk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ek(d,g):("error"==f&&"no machine state"!= +g?(this.N("Error: "+g),"unable to verify user"==g&&(ob(Sk,""),this.g=null)):this.v(f+": "+g),Qk(d),Ek(d)?(c=Jk(d),e=!0):c=!1))}e&&Hk(this,c?d:null)}else a==Pk&&d.clear()}else Hk(this);delete this.I;delete this.w}e=Aa(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.A.ha=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.f&&(Tk(this,this.f,b,c,a),L(this,-2),this.f.va());this.O&&(Ok(this,b),b.clear());!c&&this.u&&(this.u.clear(),delete this.u);this.j=0}; +function Ok(a,b){if(za("There may be a problem with your "+Fb+" machine.\n\nTo help us diagnose it, click OK to send this "+Fb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Fb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;cb("http://www.pcjs.org/api/v1/report",d,!0)}} +function xk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new J(a,"1.32.2"),g=new J(a,"1.32.2",Ik),k=bb();g.set(Kk,k);f.set(Kk,k);f.set(Uk,"1.32.2");f.set(Vk,window?window.location.href:null);f.set(Yk,window?window.navigator.userAgent:"");a.f&&a.f.xa&&(c&&(b&&(a.f.A.va=a.f.A.U),a.f.Z()),d=a.f.xa(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.ha=!1,!1===d&&(e=null)));for(var k=Aa(a.id),l=0;l=d||30<=(c.rc+=d))&&(e.textContent=c.A.U?c.pb.toFixed(2)+"Mhz":"Stopped",c.rc=0)}if(a.i&&(a=a.i,b=b||0,a.u)){c=a.f.A.U;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;eb?a.fa=a.f.g[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");cb(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);ol(a,b,c)}})}else c(a,null)} +function pl(a,b,c,d){function e(a){if(void 0===k){var b=g&&y(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Wa(a))}function f(a){e("Error: "+a);l&&(--ll||Ab(!0));l=!1}var g,k,l=!0;ll++;xa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?ml(c,null,null,!1,e,function(d,l){l?(va(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--ll||Ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--ll||Ab(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ml(b,a,d,!0,e,m):nl(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Ab(!1);return pl(a,b,c,d)};window.findMachineComponent=function(a,b){return Ca(b,a+".machine")};window.enableEvents=Ab;window.sendEvent=Cb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11-dbg.map diff --git a/versions/pdpjs/1.32.2/pdp11.js b/versions/pdpjs/1.32.2/pdp11.js index 95c184f46..7784c250d 100644 --- a/versions/pdpjs/1.32.2/pdp11.js +++ b/versions/pdpjs/1.32.2/pdp11.js @@ -37,13 +37,13 @@ function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol(" function n(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}for(var ja=ba,ka=["Math","log2"],la=0;la":62,"?":63,"@":64,jc:65,Gf:66,If:67,eg:68,E:69,fg:70,gg:71,hg:72,ig:73,jg:74,kg:75,lg:76,mg:77,ng:78,og:79,pg:80,Q:81,qg:82,rg:83,sg:84,tg:85,ug:86,vg:87,wg:88,xg:89,Uc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,yg:97,zg:98,Ag:99,d:100,e:101,Bg:102,Cg:103,Dg:104,Eg:105,Hg:106,k:107,Ig:108,Jg:109,n:110,Kg:111,p:112,q:113,r:114,Lg:115,t:116,Mg:117,Ng:118,Og:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Kc:127};function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.oc=b.comment;this.Tc=b;this.exports={};this.j=this.bindings={};a=this.id.indexOf(".");0>a?this.Ma=this.id:(this.Na=this.id.substr(0,a),this.Ma=this.id.substr(a+1));this.l={ready:!1,Ua:!1,ac:!1,S:!1,error:!1};this.Db=null;this.l.error=!1;this.Rc=d||0;this.C=this.c=this.u=this.A=this.bb=null;u.push(this)}function ra(a,b,c){sa[a]&&b&&(sa[a][b]=c)} +"|":124,"}":125,"~":126,Kc:127};function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.oc=b.comment;this.Tc=b;this.exports={};this.j=this.bindings={};a=this.id.indexOf(".");0>a?this.Ma=this.id:(this.Na=this.id.substr(0,a),this.Ma=this.id.substr(a+1));this.l={ready:!1,Ua:!1,ac:!1,T:!1,error:!1};this.Db=null;this.l.error=!1;this.Rc=d||0;this.D=this.c=this.v=this.A=this.bb=null;u.push(this)}function ra(a,b,c){sa[a]&&b&&(sa[a][b]=c)} function ta(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b":">",'"':""","'":"'"},Ia={0:"NUL" function Ja(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function G(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function Ka(a,b){var c,d={O:null,ja:null,aa:null,Z:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.aa=g.load;d.Z=g.exec;if(e=g.bytes)d.O=e;else if(e=g.words)for(d.O=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.O=Array(4*e.length),f=c=0;c>8&255,d.O[f++]=e[c]>>16&255,d.O[f++]=e[c]>>24&255;else d.O=g;d.ja=g.symbols;d.O.length?1==d.O.length&&(v(d.O[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ca=g.load;d.ba=g.exec;if(e=g.bytes)d.O=e;else if(e=g.words)for(d.O=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.O=Array(4*e.length),f=c=0;c>8&255,d.O[f++]=e[c]>>16&255,d.O[f++]=e[c]>>24&255;else d.O=g;d.ka=g.symbols;d.O.length?1==d.O.length&&(v(d.O[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.a["S"+a]=[0,0,!1,!1,this.od,a];this.C=this.c=this.u=this.A=null;D(this)}n(hb,r);h=hb.prototype;h.reset=function(){this.stop()}; -h.ga=function(a,b,c,d){if(this.A&&this.A.ga(a,b,c,d)||this.c&&this.c.ga(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.f[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.j[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){jb(a, -b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){kb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){jb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){kb(a,b)}}(this,b),!0):r.prototype.ga.call(this,a,b,c,d)}};h.ca=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.C=d;lb(b,this,mb);nb(b,this.reset.bind(this));ob(this);pb(this)};h.ea=function(a,b){b||(this.D&&qb(),this.reset());return!0};h.da=function(){return!0}; -function rb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ob(a,b){for(var c in a.f)rb(a,c,null!=b?b:a.f[c])}function sb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function pb(a){for(var b in a.a)sb(a,b,a.a[b][1])}function tb(a,b,c,d){a.j[b]&&(void 0===c&&(xa(a,"Value for "+b+" is invalid"),H(a.c)),c=8==(a.C&&a.C.h||8)?Aa(c,d):Ba(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))} -function jb(a,b){var c=a.a[b];sb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=ub&&(a.s=b==vb,a.v=b==wb)}function kb(a,b){var c=a.a[b];c[2]&&c[3]&&(sb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.md=function(a){a||this.c.l.N||(a=this.c,a.u.reset(),xb(a),this.a[yb]&&this.a[yb][1]&&zb(this.c))};h.nd=function(){};h.hd=function(a){a||H(this.c)}; -h.fd=function(a){if(!a&&!this.c.l.N)if(this.a[yb]&&this.a[yb][1])zb(this.c);else{a=this.C;var b;if(b=a)a.l.Ua&&(a.l.ac=!0),b=!a.l.Ua;if(b)za(a,!0),a.f(0,null),za(a,!1);else try{var c=this.c.Sb(1);0a;a++)this.a["S"+a][1]=0&1<=a.c.qa?8:16,c=65472<=a.la&&a.la<65472+b,b=c?1:2,c=c?15:a.u.v;a.a[ub]&&a.a[ub][1]||(b=-b);Jb(a,a.la&~c|a.la+b&c)}function Jb(a,b){a.la=b&a.u.v;b=a.la;for(var c=0;22>c;c++)Lb(a,"A"+c,b&1<c;c++)Lb(a,"D"+c,b&1<>2;this.f=this.g-1;this.s=this.F/this.g|0;this.L=this.s-1;this.Ia=[];this.m=0;this.o=!1;this.G=[];this.Vc=[Pb,Qb,Rb,Sb];this.a=this.b=[];this.D=this.w=this.i=this.H=this.I=0;a=new I(this);Tb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.v;D(this)}n(Nb,r);function Wb(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Nb.prototype;h.reset=function(){for(var a=0;aa;a++)this.a["S"+a]=[0,0,!1,!1,this.od,a];this.D=this.c=this.v=this.A=null;D(this)}n(hb,r);h=hb.prototype; +h.reset=function(){this.stop();jb(this,this.f=0)}; +h.ha=function(a,b,c,d){if(this.A&&this.A.ha(a,b,c,d)||this.c&&this.c.ha(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.h[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.j[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){kb(a, +b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){lb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){kb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){lb(a,b)}}(this,b),!0):r.prototype.ha.call(this,a,b,c,d)}};h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;mb(b,this,nb);ob(b,this.reset.bind(this));pb(this);qb(this)};h.ga=function(a,b){if(!b)if(this.G&&rb(),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +h.fa=function(a){return a?this.save():!0};h.save=function(){var a=new H(this);a.set(0,[this.U,this.f,this.b]);return a.data()};h.restore=function(a){if(a=a[0])sb(this,this.U=a[0]),jb(this,this.f=a[1]),tb(this,a[2]);return!0};function ub(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function pb(a,b){for(var c in a.h)ub(a,c,null!=b?b:a.h[c])}function vb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} +function qb(a){for(var b in a.a)vb(a,b,a.a[b][1])}function wb(a,b,c,d){a.j[b]&&(void 0===c&&(xa(a,"Value for "+b+" is invalid"),I(a.c)),c=8==(a.D&&a.D.h||8)?Aa(c,d):Ba(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))}function kb(a,b){var c=a.a[b];vb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=xb&&(a.w=b==yb,a.C=b==zb)}function lb(a,b){var c=a.a[b];c[2]&&c[3]&&(vb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1} +h.md=function(a){a||this.c.l.N||(a=this.c,a.v.reset(),Ab(a),this.a[Bb]&&this.a[Bb][1]&&Cb(this.c))};h.nd=function(){};h.hd=function(a){a||I(this.c)};h.fd=function(a){if(!a&&!this.c.l.N)if(this.a[Bb]&&this.a[Bb][1])Cb(this.c);else{a=this.D;var b;if(b=a)a.l.Ua&&(a.l.ac=!0),b=!a.l.Ua;if(b)za(a,!0),a.f(0,null),za(a,!1);else try{var c=this.c.Sb(1);0=a.c.qa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.v.u;a.a[xb]&&a.a[xb][1]||(b=-b);sb(a,a.U&~c|a.U+b&c)}function sb(a,b){a.U=b&a.v.u;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Lb(a,"A"+c,b&1<c;c++)Lb(a,"D"+c,b&1<c;c++)a.a["S"+c][1]=b&1<>2;this.f=this.g-1;this.s=this.F/this.g|0;this.L=this.s-1;this.Ia=[];this.m=0;this.o=!1;this.G=[];this.Vc=[Qb,Rb,Sb,Tb];this.a=this.b=[];this.C=this.w=this.i=this.H=this.I=0;a=new J(this);Ub(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.u;D(this)}n(Ob,r);function Xb(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Ob.prototype;h.reset=function(){for(var a=0;a>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ta)return l.wb+=l.Ta-f,l.Ta=f,!0;if(f>=l.Ta+l.wb){p=l.size-(f-m);p>g&&(p=g);l.wb=f-l.Ta+p;f=m+a.g;g-=p;k++;continue}}return Yb(Zb,f,g)}f=new I(a,f,p,a.g,d,e);Tb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+$b[d]+" at "+Aa(b)),!0):Yb(ac,b,c)}h.Fc=function(a){return this.b[(a&this.i)>>>this.h].hb(a&this.f,a)}; -h.zb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return fb||b!=this.f?this.b[c].V(b,a):this.b[c++].hb(b,a)|this.b[c&this.L].hb(0,a+1)<<8};h.Gc=function(a,b){this.b[(a&this.i)>>>this.h].kb(a&this.f,b,a)};h.Ab=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;fb||c!=this.f?this.b[d].nb(c,b,a):(this.b[d++].kb(c,b&255,a),this.b[d&this.L].kb(0,b>>8&255,a+1))};function bc(a,b){return a.a[(b&a.v)>>>a.h]} -function Ib(a,b){var c;a.o=!1;a.m++;var d=b&a.f,e=bc(a,b);fb||d!=a.f?c=e.C(d,b):c=e.i(d,b)|bc(a,b+1).i(0,b+1)<<8;a.m--;return c}function cc(a,b,c){a.o=!1;a.m++;bc(a,b).j(b&a.f,c&255,b);a.m--}function Gb(a,b,c){a.o=!1;a.m++;var d=b&a.f,e=bc(a,b);fb||d!=a.f?e.m(d,c&65535,b):(e.j(d,c&255,b),bc(a,b+1).j(0,c>>8&255,b+1));a.m--} -function Xb(a){for(var b=0,c=[],d=0;da.c.qa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],x=g[5]||1,w=0;w>8:e[2](f)&255):f&1&&(e=d.Ia[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;K(d,b,16);return 255} -function Qb(a,b,c){var d=!1,e=this.controller,f=e.Ia[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ia[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||K(e,c,16)}function Rb(a,b){var c=-1,d=this.controller;a=d.Ia[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;K(d,b,16);return 65535} -function Sb(a,b,c){var d=!1,e=this.controller;a=e.Ia[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||K(e,c,16)}function M(a){r.call(this,"Device",a,0,256);this.a={za:128,fc:-1}}n(M,r);h=M.prototype;h.ca=function(a,b,c,d){this.u=b;this.A=a;this.c=c;this.C=d;var e=this;this.a.fc=jc(c,function(){e.a.za|=128;e.a.za&64&&N(e.c,e.a.Ka);e.A&&Db(e.A,1);kc(e.c,e.a.fc,1E3/60)});this.a.Ka=lc(c,64,6,524288);lb(b,this,mc);nb(b,this.reset.bind(this));D(this)}; -h.ea=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.da=function(a){return a?this.save():!0};h.reset=function(){this.a.za=128;kc(this.c,this.a.fc,1E3/60,!0)};h.save=function(){var a=new J(this);a.set(0,[this.a.za]);return a.data()};h.restore=function(a){a=ia(a[0]);this.a.za=a.next().value;return!0};h.Ad=function(){return this.a.za};h.Me=function(a){this.a.za=a&192;this.a.za&64||(a=this.a.Ka)&&nc(this.c,a)}; -h.Cd=function(){var a=this.c,b=a.H;b&57344||(b=b&-3199|a.Pa<<5|a.Qa<<1);return b};h.Oe=function(a){oc(this.c,a&-129|this.c.H&128)};h.Dd=function(){var a=this.c;a.H&57344||(a.eb=a.F>>16&65535);a=a.eb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ed=function(){var a=this.c;a.H&57344||(a.fb=a.F&65535);return a.fb};h.Fd=function(){return this.c.na};h.Pe=function(a){var b=this.c;1170>b.qa&&(a&=-49);b.na!=a&&(b.na=a,b.Ca=a&16?4194303:262143,pc(b))}; +function Vb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ta)return l.wb+=l.Ta-f,l.Ta=f,!0;if(f>=l.Ta+l.wb){p=l.size-(f-m);p>g&&(p=g);l.wb=f-l.Ta+p;f=m+a.g;g-=p;k++;continue}}return Zb($b,f,g)}f=new J(a,f,p,a.g,d,e);Ub(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+ac[d]+" at "+Aa(b)),!0):Zb(bc,b,c)}h.Fc=function(a){return this.b[(a&this.i)>>>this.h].hb(a&this.f,a)}; +h.zb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return fb||b!=this.f?this.b[c].W(b,a):this.b[c++].hb(b,a)|this.b[c&this.L].hb(0,a+1)<<8};h.Gc=function(a,b){this.b[(a&this.i)>>>this.h].kb(a&this.f,b,a)};h.Ab=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;fb||c!=this.f?this.b[d].nb(c,b,a):(this.b[d++].kb(c,b&255,a),this.b[d&this.L].kb(0,b>>8&255,a+1))};function cc(a,b){return a.a[(b&a.u)>>>a.h]} +function Kb(a,b){var c;a.o=!1;a.m++;var d=b&a.f,e=cc(a,b);fb||d!=a.f?c=e.D(d,b):c=e.i(d,b)|cc(a,b+1).i(0,b+1)<<8;a.m--;return c}function dc(a,b,c){a.o=!1;a.m++;cc(a,b).j(b&a.f,c&255,b);a.m--}function Ib(a,b,c){a.o=!1;a.m++;var d=b&a.f,e=cc(a,b);fb||d!=a.f?e.m(d,c&65535,b):(e.j(d,c&255,b),cc(a,b+1).j(0,c>>8&255,b+1));a.m--} +function Yb(a){for(var b=0,c=[],d=0;da.c.qa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],x=g[5]||1,w=0;w>8:e[2](f)&255):f&1&&(e=d.Ia[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;K(d,b,16);return 255} +function Rb(a,b,c){var d=!1,e=this.controller,f=e.Ia[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ia[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||K(e,c,16)}function Sb(a,b){var c=-1,d=this.controller;a=d.Ia[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;K(d,b,16);return 65535} +function Tb(a,b,c){var d=!1,e=this.controller;a=e.Ia[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||K(e,c,16)}function M(a){r.call(this,"Device",a,0,256);this.a={za:128,fc:-1}}n(M,r);h=M.prototype;h.ea=function(a,b,c,d){this.v=b;this.A=a;this.c=c;this.D=d;var e=this;this.a.fc=kc(c,function(){e.a.za|=128;e.a.za&64&&N(e.c,e.a.Ka);e.A&&Gb(e.A,1);lc(e.c,e.a.fc,1E3/60)});this.a.Ka=mc(c,64,6,524288);mb(b,this,nc);ob(b,this.reset.bind(this));D(this)}; +h.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){this.a.za=128;lc(this.c,this.a.fc,1E3/60,!0)};h.save=function(){var a=new H(this);a.set(0,[this.a.za]);return a.data()};h.restore=function(a){a=ia(a[0]);this.a.za=a.next().value;return!0};h.Ad=function(){return this.a.za};h.Me=function(a){this.a.za=a&192;this.a.za&64||(a=this.a.Ka)&&oc(this.c,a)}; +h.Cd=function(){var a=this.c,b=a.H;b&57344||(b=b&-3199|a.Pa<<5|a.Qa<<1);return b};h.Oe=function(a){pc(this.c,a&-129|this.c.H&128)};h.Dd=function(){var a=this.c;a.H&57344||(a.eb=a.F>>16&65535);a=a.eb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ed=function(){var a=this.c;a.H&57344||(a.fb=a.F&65535);return a.fb};h.Fd=function(){return this.c.na};h.Pe=function(a){var b=this.c;1170>b.qa&&(a&=-49);b.na!=a&&(b.na=a,b.Ca=a&16?4194303:262143,qc(b))}; h.me=function(a){a=a>>1&63;var b=this.c.Ha[a>>1];return a&1?b>>16:b&65535};h.yf=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ha[c]=b&1?this.c.Ha[c]&65535|(a&63)<<16:this.c.Ha[c]&-65536|a&65534};h.fe=function(a){return this.c.s[1][a>>1&7]};h.rf=function(a,b){this.c.s[1][b>>1&7]=a&65295};h.de=function(a){return this.c.s[1][(a>>1&7)+8]};h.pf=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.ee=function(a){return this.c.I[1][a>>1&7]};h.qf=function(a,b){b=b>>1&7;this.c.I[1][b]=a;this.c.s[1][b]&=65295}; h.ce=function(a){return this.c.I[1][(a>>1&7)+8]};h.nf=function(a,b){b=(b>>1&7)+8;this.c.I[1][b]=a;this.c.s[1][b]&=65295};h.zd=function(a){return this.c.s[0][a>>1&7]};h.Le=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.xd=function(a){return this.c.s[0][(a>>1&7)+8]};h.Je=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.yd=function(a){return this.c.I[0][a>>1&7]};h.Ke=function(a,b){b=b>>1&7;this.c.I[0][b]=a;this.c.s[0][b]&=65295};h.wd=function(a){return this.c.I[0][(a>>1&7)+8]}; h.Ie=function(a,b){b=(b>>1&7)+8;this.c.I[0][b]=a;this.c.s[0][b]&=65295};h.le=function(a){return this.c.s[3][a>>1&7]};h.xf=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.je=function(a){return this.c.s[3][(a>>1&7)+8]};h.vf=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295};h.ke=function(a){return this.c.I[3][a>>1&7]};h.wf=function(a,b){b=b>>1&7;this.c.I[3][b]=a;this.c.s[3][b]&=65295};h.ie=function(a){return this.c.I[3][(a>>1&7)+8]};h.uf=function(a,b){b=(b>>1&7)+8;this.c.I[3][b]=a;this.c.s[3][b]&=65295}; -h.ib=function(a){a&=7;return this.c.i&2048?this.c.ra[a]:this.c.b[a]};h.lb=function(a,b){b&=7;this.c.i&2048?this.c.ra[b]=a:this.c.b[b]=a};h.Kd=function(){return this.c.i&49152?this.c.ia[0]:this.c.b[6]};h.Ue=function(a){this.c.i&49152?this.c.ia[0]=a:this.c.b[6]=a};h.Nd=function(){return this.c.b[7]};h.Xe=function(a){this.c.b[7]=a};h.jb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.ra[a]};h.mb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.ra[b]=a}; -h.Ld=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.ia[1]};h.Ve=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ia[1]=a};h.Md=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.ia[3]};h.We=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ia[3]=a};h.vd=function(a){return this.c.ub[a-65504>>1]};h.He=function(a,b){this.c.ub[b-65504>>1]=a};h.Ac=function(a){return 65520==a?(dc(this.u)>>6)-1:0};h.Dc=function(){};h.he=function(){return 1};h.tf=function(){};h.ud=function(){return this.c.G}; -h.Ge=function(){this.c.G=0};h.Bd=function(){return this.c.tb};h.Ne=function(a,b){b&1||(a&=255);this.c.tb=a};h.Gd=function(a,b){return b?0:this.c.Sa};h.Qe=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Sa=a};h.ge=function(a,b){return b?0:this.c.Ga&65280};h.sf=function(a){this.c.Ga=a|255};h.Jd=function(){return qc(this.c)};h.Te=function(a){rc(this.c,a)};h.Cc=function(){}; -var O={},mc=(O[61568]=[null,null,M.prototype.me,M.prototype.yf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.fe,M.prototype.rf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.de,M.prototype.pf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.ee,M.prototype.qf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.ce,M.prototype.nf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.zd,M.prototype.Le,"KIPDR",8,1140,64],O[62672]=[null,null,M.prototype.xd,M.prototype.Je,"KDPDR",8,1145,64],O[62688]= +h.ib=function(a){a&=7;return this.c.i&2048?this.c.ra[a]:this.c.b[a]};h.lb=function(a,b){b&=7;this.c.i&2048?this.c.ra[b]=a:this.c.b[b]=a};h.Kd=function(){return this.c.i&49152?this.c.ja[0]:this.c.b[6]};h.Ue=function(a){this.c.i&49152?this.c.ja[0]=a:this.c.b[6]=a};h.Nd=function(){return this.c.b[7]};h.Xe=function(a){this.c.b[7]=a};h.jb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.ra[a]};h.mb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.ra[b]=a}; +h.Ld=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[1]};h.Ve=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[1]=a};h.Md=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[3]};h.We=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[3]=a};h.vd=function(a){return this.c.ub[a-65504>>1]};h.He=function(a,b){this.c.ub[b-65504>>1]=a};h.Ac=function(a){return 65520==a?(ec(this.v)>>6)-1:0};h.Dc=function(){};h.he=function(){return 1};h.tf=function(){};h.ud=function(){return this.c.G}; +h.Ge=function(){this.c.G=0};h.Bd=function(){return this.c.tb};h.Ne=function(a,b){b&1||(a&=255);this.c.tb=a};h.Gd=function(a,b){return b?0:this.c.Sa};h.Qe=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Sa=a};h.ge=function(a,b){return b?0:this.c.Ga&65280};h.sf=function(a){this.c.Ga=a|255};h.Jd=function(){return rc(this.c)};h.Te=function(a){sc(this.c,a)};h.Cc=function(){}; +var O={},nc=(O[61568]=[null,null,M.prototype.me,M.prototype.yf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.fe,M.prototype.rf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.de,M.prototype.pf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.ee,M.prototype.qf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.ce,M.prototype.nf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.zd,M.prototype.Le,"KIPDR",8,1140,64],O[62672]=[null,null,M.prototype.xd,M.prototype.Je,"KDPDR",8,1145,64],O[62688]= [null,null,M.prototype.yd,M.prototype.Ke,"KIPAR",8,1140,64],O[62704]=[null,null,M.prototype.wd,M.prototype.Ie,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Fd,M.prototype.Pe,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Ad,M.prototype.Me,"LKS"],O[65402]=[null,null,M.prototype.Cd,M.prototype.Oe,"MMR0",1,1140,64],O[65404]=[null,null,M.prototype.Dd,M.prototype.Cc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Ed,M.prototype.Cc,"MMR2",1,1140,64],O[65408]=[null,null,M.prototype.le,M.prototype.xf, "UIPDR",8,1140,64],O[65424]=[null,null,M.prototype.je,M.prototype.vf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.ke,M.prototype.wf,"UIPAR",8,1140,64],O[65456]=[null,null,M.prototype.ie,M.prototype.uf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.ib,M.prototype.lb,"R0SET0"],O[65473]=[null,null,M.prototype.ib,M.prototype.lb,"R1SET0"],O[65474]=[null,null,M.prototype.ib,M.prototype.lb,"R2SET0"],O[65475]=[null,null,M.prototype.ib,M.prototype.lb,"R3SET0"],O[65476]=[null,null,M.prototype.ib, M.prototype.lb,"R4SET0"],O[65477]=[null,null,M.prototype.ib,M.prototype.lb,"R5SET0"],O[65478]=[null,null,M.prototype.Kd,M.prototype.Ue,"R6KERNEL"],O[65479]=[null,null,M.prototype.Nd,M.prototype.Xe,"R7KERNEL"],O[65480]=[null,null,M.prototype.jb,M.prototype.mb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.jb,M.prototype.mb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.jb,M.prototype.mb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.jb,M.prototype.mb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.jb, M.prototype.mb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.jb,M.prototype.mb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Ld,M.prototype.Ve,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.Md,M.prototype.We,"R6USER",1,1145],O[65504]=[null,null,M.prototype.vd,M.prototype.He,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Ac,M.prototype.Dc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Ac,M.prototype.Dc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.he,M.prototype.tf,"SYSID",1,1170],O[65526]= [null,null,M.prototype.ud,M.prototype.Ge,"ERR",1,1170],O[65528]=[null,null,M.prototype.Bd,M.prototype.Ne,"MBR",1,1170],O[65530]=[null,null,M.prototype.Gd,M.prototype.Qe,"PIR"],O[65532]=[null,null,M.prototype.ge,M.prototype.sf,"SLR"],O[65534]=[null,null,M.prototype.Jd,M.prototype.Te,"PSW"],O); -Va(function(){for(var a=C(document,B,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),wc(this,xc?yc:Ac);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.sd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.re=function(a,b){eb&&a&1&&K(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; -h.Ee=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.xa=!0};h.qd=function(a,b){return this.i(a,b)};h.oe=function(a,b){return this.C(a,b)};h.Ce=function(a,b,c){this.A?this.yb(0,0,c):this.j(a,b,c)};h.Af=function(a,b,c){this.A?this.yb(0,0,c):this.m(a,b,c)};h.pd=function(a){return this.a[a]}; -h.rd=function(a){return this.a[a]};h.ne=function(a,b){eb&&a&1&&K(this.b,b,64);return this.u.getUint16(a,!0)};h.qe=function(a,b){eb&&a&1&&K(this.b,b,64);return!fb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Be=function(a,b){this.a[a]=b;this.xa=!0};h.De=function(a,b){this.a[a]=b;this.xa=!0};h.zf=function(a,b,c){eb&&a&1&&K(this.b,c,64);this.u.setUint16(a,b,!0);this.xa=!0};h.Bf=function(a,b,c){eb&&a&1&&K(this.b,c,64);!fb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.xa=!0}; -var uc=0,ec=1,vc=2,Vb=4,$b=["NONE","RAM","ROM","VID","H/W"],tc=0,Cc=[],Bc=[I.prototype.sd,I.prototype.Ee,I.prototype.re,I.prototype.Cf],Fc=[I.prototype.qd,I.prototype.Ce,I.prototype.oe,I.prototype.Af];if(cb)var Ac=[I.prototype.pd,I.prototype.Be,I.prototype.ne,I.prototype.zf],yc=[I.prototype.rd,I.prototype.De,I.prototype.qe,I.prototype.Bf];var Gc;if(cb){var Hc=new ArrayBuffer(2);(new DataView(Hc)).setUint16(0,256,!0);Gc=256===(new Uint16Array(Hc))[0]}else Gc=!1;var xc=Gc; -function Ic(a,b){r.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.hc=0;this.Nb=b;this.Ra=c;this.Vb=Math.round(this.Nb/1E4)/100;this.Xa=this.Vb*this.Ra;this.Wb=this.sb=this.$a=this.Ob=0;this.l.N=this.l.ec=!1;this.l.ba=a.autoStart;"string"==typeof this.l.ba&&(this.l.ba="true"==this.l.ba);this.l.Bb=!1;this.Lb=this.Za=0;this.Mb=+a.csStart;this.qb=+a.csInterval;this.rb=+a.csStop;this.W=[];this.qc=this.ve.bind(this);this.Fa=this.va=this.Ea=this.a=this.Y=this.ua=this.pb=this.Da=this.ab= -this.Xb=this.Oa=0;this.ma=null;D(this)}n(Ic,r);h=Ic.prototype;h.ca=function(a,b,c,d){this.A=a;this.u=b;this.C=d;this.ma=a.f;for(a=0;a=a.Za&&(a.Za+=a.qb,c=!0);0<=a.rb&&a.rb<=Nc(a)&&(a.qb=a.rb=-1,Mc(a),H(a),c=!0);c&&a.X(Nc(a)+" cycles: checksum="+Ba(a.Lb))}} -h.ga=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.l.S)a=!0;else{var b=null,c,k=y(a.id);for(c=0;ca.Oa/a.Xa&&(b=1);a.Ra=b;b=a.Vb*a.Ra;if(a.Xa!=b){a.Xa=b;b=a.Xa.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.X("target speed: "+b)}c&&a.A&&Rc(a.A)}Bb(a,a.va);a.va=0;a.ua=ta();a.Da=0;Pc(a)}function jc(a,b){var c=a.W.length;a.W.push([-1,b]);return c}function kc(a,b,c,d){0<=b&&ba.W[b][0])&&(c=a.Nb*a.Ra/1E3*c|0,a.l.N&&(c+=Sc(a)),a.W[b][0]=c)}function Tc(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Sc(a,b){var c=a.Ea-=a.a;a.a=a.Y=0;b&&(a.Ea=0);return c} -h.ve=function(){if(this.l.N){this.Ob>=this.Nb&&Pc(this,!0);this.ab=0;this.pb=ta();if(this.Da){var a=this.pb-this.Da;a>this.Wb&&(this.ua+=a,this.ua>this.pb&&(this.ua=this.pb))}try{do{for(var b,c=this.l.Bb?1:this.sb,d=this.W.length-1;0<=d;d--){var e=this.W[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Sb(b)}catch(f){if("number"!=typeof f)throw f;}b=Sc(this,!0);this.ab+=b;this.va+=b;Cb(this,b);Ab(this,b);this.$a-=b;if(0>=this.$a){this.$a+=this.sb;++this.Xb>=Uc&&(this.A&&Db(this.A,void 0),this.Xb=0);break}}while(this.l.N)}catch(f){H(this); -this.A&&this.A.stop(ta(),Nc(this));xa(this,f.stack||f.message);return}if(this.l.N){a=setTimeout;b=this.qc;this.Da=ta();c=this.Wb;this.ab&&(c=Math.round(c*this.ab/this.sb));c-=this.Da-this.pb;if(d=this.Da-this.ua)this.Oa=Math.round(this.va/(10*d))/100,864E5<=d&&(this.Fa=0,Oc(this));if(0>c||this.Oac&&(this.ua-=c),c=0;this.Ob+=this.ab;this.Da+=c;a(b,c)}}}; -function zb(a){var b;a.l.error?(a.X(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.N)a.X(a.toString()+" busy");else{Oc(a);a.l.N=!0;a.l.ec=!0;if(b=a.j.run)b.textContent="Halt";a.A&&a.A.start(a.ua,Nc(a));a.C||a.status("Started");setTimeout(a.qc,0)}}h.Sb=function(){return 0};function H(a){var b=!1;if(a.l.N){Sc(a);Bb(a,a.va);a.va=0;a.l.N=!1;if(b=a.j.run)b.textContent="Run";a.A&&a.A.stop(ta(),Nc(a));b=!0;a.C||a.status("Stopped")}a.l.complete=void 0;return b}var Qc=30,Uc=15,Jc=["power","reset"]; -function Vc(a){var b=+a.model||1170;Ic.call(this,a,6666667);this.qa=b;this.nc=+a.addrReset||0;this.wa=this.i=this.D=this.v=this.m=this.o=this.w=0;this.b=this.ra=this.ia=[];this.I=this.s=this.Ha=this.ub=[];this.Aa=this.F=this.mc=this.Ba=this.Pa=this.Qa=this.Ca=this.G=this.tb=this.Sa=this.Ga=this.H=this.eb=this.fb=this.na=this.g=0;this.Sc=[4,2,0,1];this.Pb=0;this.pc=255;1120>=this.qa?(this.lc=Wc.bind(this),this.Ya=this.Zc,this.Pb=8,this.pc=-1,this.sc=255,this.rc=0):(this.lc=Xc.bind(this),this.Ya=this.$c, -this.sc=~(1792|(1140>=this.qa?2048:0))&65535,this.rc=1140e.xb&&(e.xb=c,c+=4)}return Ic.prototype.ea.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.qa);this.l.N&&H(this);this.v=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.nc,-1,-2,-3,-4,-5,-6,-7,-8];this.ra=[0,0,0,0,0,0];this.ia=[0,0,0,0];this.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, -65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ha=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ub=[0,0,0,0,0,0,0,0];this.D=0;this.wa=-1;this.h=this.f=this.Kb=this.L=this.R=this.g=this.tb=0;xb(this);Lc(this);this.l.error=!1;Ic.prototype.reset.call(this)};function xb(a){a.H=0;a.eb=0;a.fb=0;a.na=0;a.G=0;a.Sa=0;a.Ga=255;a.Ba=0;a.Pa=0;a.Qa=0;a.Ca=262143;a.Aa=a.b[7];a.F=0;a.K=null;a.u&&(pc(a),a.mc=dc(a.u))} -function pc(a){a.Fb=a.ic;a.Gb=a.Qb;a.Rb=a.Tb;a.Hb=a.Ub;a.Ba?(a.ta=65536,a.Eb=a.na&16?4186112:253952,a.pa=a.yc,a.V=a.Bc,a.nb=a.Ec,Wb(a.u,a.na&16?22:18)):(a.ta=0,a.Eb=57344,a.pa=a.cd,a.V=a.pe,a.nb=a.Df,Wb(a.u,16))}function oc(a,b){b&=-3073;if(a.H!=b){b&57344&&!(a.H&57344)&&(a.eb=a.F>>16&65535,a.fb=a.F&65535);a.H=b;a.Pa=(b&96)>>5;a.Qa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ba!=c&&(a.Ba=c,pc(a))}} -function Yc(a,b,c){a.nc=b;a.u.reset();xb(a);R(a,b);rc(a,0);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.l.N||zb(a)}else a.C?H(a)||a.C.g():!1===c&&H(a);!a.l.N&&a.ma&&a.ma.stop()}h.xc=function(){return 0}; -h.save=function(){var a=new J(this);a.set(0,[this.b,this.ra,this.ia,this.I,this.s,this.Ha,this.ub,this.G,this.tb,this.Sa,this.Ga,this.H,this.eb,this.fb,this.na,this.Ba,this.Pa,this.Qa,this.Ca,this.Aa,this.g,this.F,this.wa,this.Yb,this.Zb]);a.set(1,[qc(this)]);a.set(2,[this.Fa,this.Ra,this.l.ba]);a.set(3,Zc(this));a.set(4,Tc(this));return a.data()}; -h.restore=function(a){var b=ia(a[0]);this.b=b.next().value;this.ra=b.next().value;this.ia=b.next().value;this.I=b.next().value;this.s=b.next().value;this.Ha=b.next().value;this.ub=b.next().value;this.G=b.next().value;this.tb=b.next().value;this.Sa=b.next().value;this.Ga=b.next().value;this.H=b.next().value;this.eb=b.next().value;this.fb=b.next().value;this.na=b.next().value;this.Ba=b.next().value;this.Pa=b.next().value;this.Qa=b.next().value;this.Ca=b.next().value;this.Aa=b.next().value;this.g=b.next().value; -this.F=b.next().value;this.wa=b.next().value;this.Yb=b.next().value;this.Zb=b.next().value;b=a[1];rc(this,b[0]);b=a[2];this.Fa=b[0];Oc(this,b[1]);this.l.ba=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function R(a,b){a.b[7]=b&65535}function lc(a,b,c,d){b={xb:b,gb:c,message:d||0,name:gb[b],next:null};a.ob.push(b);return b}function nc(a,b){var c=a.K;if(c==b)a.K=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.K&&(a.g|=1)} -function N(a,b){if(b){if(b!=a.K){var c=a.K;if(!c||c.gb<=b.gb)b.next=c,a.K=b;else{do{var d=c.next;if(!d||d.gb<=b.gb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}function Zc(a){var b=[];for(a=a.K;a;)b.push(a.xb),a=a.next;return b}function cd(a){return a.g&64?(L(a,168,64,-6),!0):a.g&32?(L(a,4,32,-5),!0):a.g&16?(L(a,12,16,-7),!0):!1}function qc(a){return a.i=a.i&63728|ad(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|$c(a)} -function rc(a,b){b&=a.sc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.v=b<<16;if((b^a.i)&a.rc)for(var c=a.ra.length;0<=--c;){var d=a.b[c];a.b[c]=a.ra[c];a.ra[c]=d}a.D=b>>14&3;c=a.i>>14&3;a.D!=c&&(a.ia[c]=a.b[6],a.b[6]=a.ia[a.D]);a.i=b;a.g&=-3;a.g|=a.K?2:1}h.ha=function(a){this.w=this.o=a;this.m=0};h.La=function(a,b){this.w=this.o=this.v=a;this.m=b||0};function dd(a,b){a.w=a.o=a.v=b;a.m=a.w^a.v>>1}function ed(a,b,c,d){a.w=a.o=a.v=b;a.m=(c^d)&(d^b)} -function L(a,b,c,d){if(!a.cb){0>a.wa?a.wa=qc(a):a.D||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.D=0;var e=a.V(b|a.ta),f=a.V(b+2&65535|a.ta);rc(a,f&-12289|a.wa>>2&12288);fd(a,a.wa);fd(a,a.b[7]);R(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.Yb=d;a.Zb=b;-1==d&&H(a);if(-4<=d)throw b;}}function gd(a){var b=hd(a),c=hd(a);a.i&49152&&(c=c&-225|a.i&63712);R(a,b);rc(a,c);a.g&=-17} -function id(a,b){var c=b>>13&31;31>c&&(b=a.na&32?a.Ha[c]+(b&8191)&4194303:b&-3932161);return b} -function Hb(a,b,c){var d,e,f;if(!(c&a.Ba))return f=b&65535,57344<=f&&(f|=a.Eb),f;d=b>>13;a.na&a.Sc[a.D]||(d&=7);e=a.s[a.D][d];f=(a.I[a.D][d]<<6)+(b&8191)&a.Ca;3932160<=f&&(f=id(a,f));if(a.cb)return f;f>=a.mc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.s[a.D][d]=e;if(f!=(4194170&a.Ca)||a.D)a.Pa=a.D,a.Qa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.H&57344||(g|=a.H&4096|a.Pa<<5|a.Qa<<1,oc(a,a.H&-61695|g&61694)),L(a,168,64,-2)),a.H&61440||!(f<(4191360&a.Ca)||f>(4194239&a.Ca))||(a.H|=4096,a.H&512&&(a.g|=64)));return f}function hd(a){var b=a.V(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function fd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Ya(4,-2,c);a.nb(c,b)} -function jd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return L(a,4,0,-3),0;case 1:return 6==c&&a.Ya(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Ya(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Ya(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(bd(a,2)),e=e+a.b[c]&65535,6==c&&a.Ya(d,0, -e),a.a-=6,e|g;case 7:return e=a.V(bd(a,2)),e=e+a.b[c]&65535,e=a.V(e|a.ta),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.Zc=function(a,b,c){!this.D&&0>=b&&c<=this.Ga&&(this.g|=32)};h.$c=function(a,b,c){this.D||(65534<=c&&(c|=-65536),a&4&&c<=this.Ga&&(c<=this.Ga-32?L(this,4,0,-4):(this.G|=8,this.g|=32)))};h.bd=function(a){return this.ic(a)};h.dd=function(a){return this.Qb(a)};h.ye=function(a,b){this.Tb(a,b)};h.Ae=function(a,b){this.Ub(a,b)}; -h.cd=function(a,b,c){return jd(this,a,b,c)};h.yc=function(a,b,c){return Hb(this,jd(this,a,b,c),c)};h.pe=function(a){return this.u.zb(this.Aa=a)};h.Bc=function(a){return this.u.zb(this.Aa=Hb(this,a,2))};h.Df=function(a,b){this.u.Ab(this.Aa=a,b)};h.Ec=function(a,b){this.u.Ab(this.Aa=Hb(this,a,4),b)}; -function kd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=jd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.D=a.i>>12&3,c=a.V(d|c&a.ta),a.D=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.ia[a.i>>12&3];return c}function ld(a,b,c,d){a.F=a.F&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=jd(a,b,e,4),c&65536||(e&=65535),a.D=a.i>>12&3,e=Hb(a,e|c&65536,4),a.D=a.i>>14&3,a.Hb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.ia[a.i>>12&3]=d} -function md(a,b){b>>=6;var c=a.R=b&7;return(b=a.L=(b&56)>>3)?a.Fb(a.pa(b,c,3)):a.b[c+a.Pb]&a.pc}function nd(a,b){var c;b>>=6;var d=a.R=b&7;(b=a.L=(b&56)>>3)?c=a.Gb(a.pa(b,d,2)):c=a.b[d+a.Pb];return c}function od(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return jd(a,b,c,8)}function pd(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Fb(a.pa(b,c,3)):a.b[c]&255}function qd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Gb(a.pa(b,d,2)):c=a.b[d];return c} +Va(function(){for(var a=C(document,B,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),xc(this,yc?zc:Bc);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.sd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.re=function(a,b){eb&&a&1&&K(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; +h.Ee=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.xa=!0};h.qd=function(a,b){return this.i(a,b)};h.oe=function(a,b){return this.D(a,b)};h.Ce=function(a,b,c){this.A?this.yb(0,0,c):this.j(a,b,c)};h.Af=function(a,b,c){this.A?this.yb(0,0,c):this.m(a,b,c)};h.pd=function(a){return this.a[a]}; +h.rd=function(a){return this.a[a]};h.ne=function(a,b){eb&&a&1&&K(this.b,b,64);return this.v.getUint16(a,!0)};h.qe=function(a,b){eb&&a&1&&K(this.b,b,64);return!fb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Be=function(a,b){this.a[a]=b;this.xa=!0};h.De=function(a,b){this.a[a]=b;this.xa=!0};h.zf=function(a,b,c){eb&&a&1&&K(this.b,c,64);this.v.setUint16(a,b,!0);this.xa=!0};h.Bf=function(a,b,c){eb&&a&1&&K(this.b,c,64);!fb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.xa=!0}; +var vc=0,fc=1,wc=2,Wb=4,ac=["NONE","RAM","ROM","VID","H/W"],uc=0,Dc=[],Cc=[J.prototype.sd,J.prototype.Ee,J.prototype.re,J.prototype.Cf],Gc=[J.prototype.qd,J.prototype.Ce,J.prototype.oe,J.prototype.Af];if(cb)var Bc=[J.prototype.pd,J.prototype.Be,J.prototype.ne,J.prototype.zf],zc=[J.prototype.rd,J.prototype.De,J.prototype.qe,J.prototype.Bf];var Hc;if(cb){var Ic=new ArrayBuffer(2);(new DataView(Ic)).setUint16(0,256,!0);Hc=256===(new Uint16Array(Ic))[0]}else Hc=!1;var yc=Hc; +function Jc(a,b){r.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.hc=0;this.Nb=b;this.Ra=c;this.Vb=Math.round(this.Nb/1E4)/100;this.Xa=this.Vb*this.Ra;this.Wb=this.sb=this.$a=this.Ob=0;this.l.N=this.l.ec=!1;this.l.da=a.autoStart;"string"==typeof this.l.da&&(this.l.da="true"==this.l.da);this.l.Bb=!1;this.Lb=this.Za=0;this.Mb=+a.csStart;this.qb=+a.csInterval;this.rb=+a.csStop;this.Y=[];this.qc=this.ve.bind(this);this.Fa=this.va=this.Ea=this.a=this.aa=this.ua=this.pb=this.Da=this.ab= +this.Xb=this.Oa=0;this.ma=null;D(this)}n(Jc,r);h=Jc.prototype;h.ea=function(a,b,c,d){this.A=a;this.v=b;this.D=d;this.ma=a.f;for(a=0;a=a.Za&&(a.Za+=a.qb,c=!0);0<=a.rb&&a.rb<=Oc(a)&&(a.qb=a.rb=-1,Nc(a),I(a),c=!0);c&&a.Z(Oc(a)+" cycles: checksum="+Ba(a.Lb))}} +h.ha=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.l.T)a=!0;else{var b=null,c,k=y(a.id);for(c=0;ca.Oa/a.Xa&&(b=1);a.Ra=b;b=a.Vb*a.Ra;if(a.Xa!=b){a.Xa=b;b=a.Xa.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.Z("target speed: "+b)}c&&a.A&&Sc(a.A)}Eb(a,a.va);a.va=0;a.ua=ta();a.Da=0;Qc(a)}function kc(a,b){var c=a.Y.length;a.Y.push([-1,b]);return c}function lc(a,b,c,d){0<=b&&ba.Y[b][0])&&(c=a.Nb*a.Ra/1E3*c|0,a.l.N&&(c+=Tc(a)),a.Y[b][0]=c)}function Uc(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Tc(a,b){var c=a.Ea-=a.a;a.a=a.aa=0;b&&(a.Ea=0);return c} +h.ve=function(){if(this.l.N){this.Ob>=this.Nb&&Qc(this,!0);this.ab=0;this.pb=ta();if(this.Da){var a=this.pb-this.Da;a>this.Wb&&(this.ua+=a,this.ua>this.pb&&(this.ua=this.pb))}try{do{for(var b,c=this.l.Bb?1:this.sb,d=this.Y.length-1;0<=d;d--){var e=this.Y[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Sb(b)}catch(f){if("number"!=typeof f)throw f;}b=Tc(this,!0);this.ab+=b;this.va+=b;Fb(this,b);Db(this,b);this.$a-=b;if(0>=this.$a){this.$a+=this.sb;++this.Xb>=Vc&&(this.A&&Gb(this.A,void 0),this.Xb=0);break}}while(this.l.N)}catch(f){I(this); +this.A&&this.A.stop(ta(),Oc(this));xa(this,f.stack||f.message);return}if(this.l.N){a=setTimeout;b=this.qc;this.Da=ta();c=this.Wb;this.ab&&(c=Math.round(c*this.ab/this.sb));c-=this.Da-this.pb;if(d=this.Da-this.ua)this.Oa=Math.round(this.va/(10*d))/100,864E5<=d&&(this.Fa=0,Pc(this));if(0>c||this.Oac&&(this.ua-=c),c=0;this.Ob+=this.ab;this.Da+=c;a(b,c)}}}; +function Cb(a){var b;a.l.error?(a.Z(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.N)a.Z(a.toString()+" busy");else{Pc(a);a.l.N=!0;a.l.ec=!0;if(b=a.j.run)b.textContent="Halt";a.A&&a.A.start(a.ua,Oc(a));a.D||a.status("Started");setTimeout(a.qc,0)}}h.Sb=function(){return 0};function I(a){var b=!1;if(a.l.N){Tc(a);Eb(a,a.va);a.va=0;a.l.N=!1;if(b=a.j.run)b.textContent="Run";a.A&&a.A.stop(ta(),Oc(a));b=!0;a.D||a.status("Stopped")}a.l.complete=void 0;return b}var Rc=30,Vc=15,Kc=["power","reset"]; +function Wc(a){var b=+a.model||1170;Jc.call(this,a,6666667);this.qa=b;this.nc=+a.addrReset||0;this.wa=this.i=this.C=this.u=this.m=this.o=this.w=0;this.b=this.ra=this.ja=[];this.I=this.s=this.Ha=this.ub=[];this.Aa=this.F=this.mc=this.Ba=this.Pa=this.Qa=this.Ca=this.G=this.tb=this.Sa=this.Ga=this.H=this.eb=this.fb=this.na=this.g=0;this.Sc=[4,2,0,1];this.Pb=0;this.pc=255;1120>=this.qa?(this.lc=Xc.bind(this),this.Ya=this.Zc,this.Pb=8,this.pc=-1,this.sc=255,this.rc=0):(this.lc=Yc.bind(this),this.Ya=this.$c, +this.sc=~(1792|(1140>=this.qa?2048:0))&65535,this.rc=1140e.xb&&(e.xb=c,c+=4)}return Jc.prototype.ga.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.qa);this.l.N&&I(this);this.u=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.nc,-1,-2,-3,-4,-5,-6,-7,-8];this.ra=[0,0,0,0,0,0];this.ja=[0,0,0,0];this.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, +65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ha=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ub=[0,0,0,0,0,0,0,0];this.C=0;this.wa=-1;this.h=this.f=this.Kb=this.L=this.S=this.g=this.tb=0;Ab(this);Mc(this);this.l.error=!1;Jc.prototype.reset.call(this)};function Ab(a){a.H=0;a.eb=0;a.fb=0;a.na=0;a.G=0;a.Sa=0;a.Ga=255;a.Ba=0;a.Pa=0;a.Qa=0;a.Ca=262143;a.Aa=a.b[7];a.F=0;a.K=null;a.v&&(qc(a),a.mc=ec(a.v))} +function qc(a){a.Fb=a.ic;a.Gb=a.Qb;a.Rb=a.Tb;a.Hb=a.Ub;a.Ba?(a.ta=65536,a.Eb=a.na&16?4186112:253952,a.pa=a.yc,a.W=a.Bc,a.nb=a.Ec,Xb(a.v,a.na&16?22:18)):(a.ta=0,a.Eb=57344,a.pa=a.cd,a.W=a.pe,a.nb=a.Df,Xb(a.v,16))}function pc(a,b){b&=-3073;if(a.H!=b){b&57344&&!(a.H&57344)&&(a.eb=a.F>>16&65535,a.fb=a.F&65535);a.H=b;a.Pa=(b&96)>>5;a.Qa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ba!=c&&(a.Ba=c,qc(a))}} +function Zc(a,b,c){a.nc=b;R(a,b);sc(a,0);a.v.reset();Ab(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.l.N||Cb(a)}else a.D?I(a)||a.D.g():!1===c&&I(a);!a.l.N&&a.ma&&a.ma.stop()}h.xc=function(){return 0}; +h.save=function(){var a=new H(this);a.set(0,[this.b,this.ra,this.ja,this.I,this.s,this.Ha,this.ub,this.G,this.tb,this.Sa,this.Ga,this.H,this.eb,this.fb,this.na,this.Ba,this.Pa,this.Qa,this.Ca,this.Aa,this.g,this.F,this.wa,this.Yb,this.Zb]);a.set(1,[rc(this)]);a.set(2,[this.Fa,this.Ra,this.l.da]);a.set(3,$c(this));a.set(4,Uc(this));return a.data()}; +h.restore=function(a){var b=ia(a[0]);this.b=b.next().value;this.ra=b.next().value;this.ja=b.next().value;this.I=b.next().value;this.s=b.next().value;this.Ha=b.next().value;this.ub=b.next().value;this.G=b.next().value;this.tb=b.next().value;this.Sa=b.next().value;this.Ga=b.next().value;this.H=b.next().value;this.eb=b.next().value;this.fb=b.next().value;this.na=b.next().value;this.Ba=b.next().value;this.Pa=b.next().value;this.Qa=b.next().value;this.Ca=b.next().value;this.Aa=b.next().value;this.g=b.next().value; +this.F=b.next().value;this.wa=b.next().value;this.Yb=b.next().value;this.Zb=b.next().value;b=a[1];sc(this,b[0]);b=a[2];this.Fa=b[0];Pc(this,b[1]);this.l.da=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function R(a,b){a.b[7]=b&65535}function mc(a,b,c,d){b={xb:b,gb:c,message:d||0,name:gb[b],next:null};a.ob.push(b);return b}function oc(a,b){var c=a.K;if(c==b)a.K=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.K&&(a.g|=1)} +function N(a,b){if(b){if(b!=a.K){var c=a.K;if(!c||c.gb<=b.gb)b.next=c,a.K=b;else{do{var d=c.next;if(!d||d.gb<=b.gb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}function $c(a){var b=[];for(a=a.K;a;)b.push(a.xb),a=a.next;return b}function dd(a){return a.g&64?(L(a,168,64,-6),!0):a.g&32?(L(a,4,32,-5),!0):a.g&16?(L(a,12,16,-7),!0):!1}function rc(a){return a.i=a.i&63728|bd(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|ad(a)} +function sc(a,b){b&=a.sc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.u=b<<16;if((b^a.i)&a.rc)for(var c=a.ra.length;0<=--c;){var d=a.b[c];a.b[c]=a.ra[c];a.ra[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.ja[c]=a.b[6],a.b[6]=a.ja[a.C]);a.i=b;a.g&=-3;a.g|=a.K?2:1}h.ia=function(a){this.w=this.o=a;this.m=0};h.La=function(a,b){this.w=this.o=this.u=a;this.m=b||0};function ed(a,b){a.w=a.o=a.u=b;a.m=a.w^a.u>>1}function fd(a,b,c,d){a.w=a.o=a.u=b;a.m=(c^d)&(d^b)} +function L(a,b,c,d){if(!a.cb){0>a.wa?a.wa=rc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.C=0;var e=a.W(b|a.ta),f=a.W(b+2&65535|a.ta);sc(a,f&-12289|a.wa>>2&12288);gd(a,a.wa);gd(a,a.b[7]);R(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.Yb=d;a.Zb=b;-1==d&&I(a);if(-4<=d)throw b;}}function hd(a){var b=id(a),c=id(a);a.i&49152&&(c=c&-225|a.i&63712);R(a,b);sc(a,c);a.g&=-17} +function jd(a,b){var c=b>>13&31;31>c&&(b=a.na&32?a.Ha[c]+(b&8191)&4194303:b&-3932161);return b} +function Jb(a,b,c){var d,e,f;if(!(c&a.Ba))return f=b&65535,57344<=f&&(f|=a.Eb),f;d=b>>13;a.na&a.Sc[a.C]||(d&=7);e=a.s[a.C][d];f=(a.I[a.C][d]<<6)+(b&8191)&a.Ca;3932160<=f&&(f=jd(a,f));if(a.cb)return f;f>=a.mc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.s[a.C][d]=e;if(f!=(4194170&a.Ca)||a.C)a.Pa=a.C,a.Qa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.H&57344||(g|=a.H&4096|a.Pa<<5|a.Qa<<1,pc(a,a.H&-61695|g&61694)),L(a,168,64,-2)),a.H&61440||!(f<(4191360&a.Ca)||f>(4194239&a.Ca))||(a.H|=4096,a.H&512&&(a.g|=64)));return f}function id(a){var b=a.W(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function gd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Ya(4,-2,c);a.nb(c,b)} +function kd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return L(a,4,0,-3),0;case 1:return 6==c&&a.Ya(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Ya(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Ya(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.W(e)|g;a.a-=8;break;case 6:return e=a.W(cd(a,2)),e=e+a.b[c]&65535,6==c&&a.Ya(d,0, +e),a.a-=6,e|g;case 7:return e=a.W(cd(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.ta),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.Zc=function(a,b,c){!this.C&&0>=b&&c<=this.Ga&&(this.g|=32)};h.$c=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Ga&&(c<=this.Ga-32?L(this,4,0,-4):(this.G|=8,this.g|=32)))};h.bd=function(a){return this.ic(a)};h.dd=function(a){return this.Qb(a)};h.ye=function(a,b){this.Tb(a,b)};h.Ae=function(a,b){this.Ub(a,b)}; +h.cd=function(a,b,c){return kd(this,a,b,c)};h.yc=function(a,b,c){return Jb(this,kd(this,a,b,c),c)};h.pe=function(a){return this.v.zb(this.Aa=a)};h.Bc=function(a){return this.v.zb(this.Aa=Jb(this,a,2))};h.Df=function(a,b){this.v.Ab(this.Aa=a,b)};h.Ec=function(a,b){this.v.Ab(this.Aa=Jb(this,a,4),b)}; +function ld(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=kd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.W(d|c&a.ta),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.ja[a.i>>12&3];return c}function md(a,b,c,d){a.F=a.F&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=kd(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=Jb(a,e|c&65536,4),a.C=a.i>>14&3,a.Hb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.ja[a.i>>12&3]=d} +function nd(a,b){b>>=6;var c=a.S=b&7;return(b=a.L=(b&56)>>3)?a.Fb(a.pa(b,c,3)):a.b[c+a.Pb]&a.pc}function od(a,b){var c;b>>=6;var d=a.S=b&7;(b=a.L=(b&56)>>3)?c=a.Gb(a.pa(b,d,2)):c=a.b[d+a.Pb];return c}function pd(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return kd(a,b,c,8)}function qd(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Fb(a.pa(b,c,3)):a.b[c]&255}function rd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Gb(a.pa(b,d,2)):c=a.b[d];return c} function T(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Kb=a.pa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.Rb(e,d.call(a,c,a.Fb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function U(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.pa(b,e,6),a.Hb(e,d.call(a,0>c?a.b[-c-1]:c,a.Gb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} -function rd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.pa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.Rb(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function sd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.pa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Hb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} -h.Sb=function(a){this.l.complete=!0;var b=a?this.l.ec?0:1:-1;this.l.ec=!1;this.Ea=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Sa&224)>>5,e=this.K&&this.K.gb>d?this.K:null;e&&(c=e.xb,d=e.gb);d>(this.i&224)>>5?(this.g&8&&(bd(this,2),this.g&=-9),L(this,c,0,-10),d=!0):d=!1;d&&(e&&nc(this,e),a=!0);this.K||this.Sa||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.C.b(this.b[7],b)){H(this);break}if(0>b)break}if(this.g&112&&cd(this)){if(this.g& -4&&this.C.b(this.b[7],b)){H(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.V(a);this.b[7]=a+2&65535;this.lc(e)}while(0>1|b<<16;dd(this,a);return a&65535}function yd(a,b){a=b&128|b>>1|b<<8;dd(this,a<<8);return a&255}function zd(a,b){a=b&~a;this.ha(a);return a}function Ad(a,b){a=b&~a;this.ha(a<<8);return a}function Bd(a,b){a|=b;this.ha(a);return a}function Cd(a,b){a|=b;this.ha(a<<8);return a} -function Dd(a,b){a=~b|65536;this.La(a);return a&65535}function Ed(a,b){a=~b|256;this.La(a<<8);return a&255}function Fd(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function Gd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function Hd(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function Id(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function Jd(a,b){a=-b;this.La(a,a&b&32768);return a&65535} -function Kd(a,b){a=-b;this.La(a<<8,(a&b&128)<<8);return a&255}function Ld(a,b){a=b<<1|this.v>>16&1;dd(this,a);return a&65535}function Md(a,b){a=b<<1|this.v>>16&1;dd(this,a<<8);return a&255}function Nd(a,b){a=(this.v&65536|b)>>1|b<<16;dd(this,a);return a&65535}function Od(a,b){a=((this.v&65536)>>8|b)>>1|b<<8;dd(this,a<<8);return a&255}function Pd(a,b){var c=b-a;ed(this,c,a,b);return c&65535}function Qd(a,b){var c=b-a;ed(this,c<<8,a<<8,b<<8);return c&255} -function Rd(a,b){this.w=this.o=b&65280;this.m=this.v=0;return(b<<8|b>>8)&65535}function Sd(a,b){a^=b;this.ha(a);return a&65535}function Td(a){U(this,a,nd(this,a),td);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} -function Ud(a){var b=qd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.v=this.m=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} -function Vd(a){var b=qd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&=63;if(b&32){b=64-b;32>b-1;this.v=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function Wd(a){S(this,a,!$c(this))}function Xd(a){S(this,a,$c(this))} -function Yd(a){U(this,a,nd(this,a),zd);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Zd(a){T(this,a,md(this,a),Ad);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function $d(a){U(this,a,nd(this,a),Bd);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ae(a){T(this,a,md(this,a),Cd);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} -function be(a){var b=nd(this,a);a=qd(this,a);this.ha((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function ce(a){var b=md(this,a);a=pd(this,a);this.ha(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function de(a){S(this,a,this.o&65535?0:4)}function ee(a){S(this,a,!ad(this)==!(this.m&32768))}function fe(a){S(this,a,!!(this.o&65535)&&!ad(this)==!(this.m&32768))} -function ge(a){S(this,a,!$c(this)&&!!(this.o&65535))}function he(a){S(this,a,(this.o&65535?0:4)||!ad(this)!=!(this.m&32768))}function ie(a){S(this,a,$c(this)||(this.o&65535?0:4))}function je(a){S(this,a,!ad(this)!=!(this.m&32768))}function ke(a){S(this,a,ad(this))}function le(a){S(this,a,!!(this.o&65535))}function me(a){S(this,a,!ad(this))}function ne(){L(this,12,0,-9)}function oe(a){S(this,a,!0)}function pe(a){S(this,a,!(this.m&32768))}function qe(a){S(this,a,this.m&32768?2:0)} -function V(a){a&1&&(this.v=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function re(a){var b=nd(this,a);a=qd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;ed(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function se(a){var b=md(this,a);a=pd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);ed(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)} -function te(a){var b=qd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.v=65536,this.a-=7}function ue(){L(this,24,0,-9);this.a-=20} -function ve(){this.i&49152?(this.G|=128,L(this,4,0,-8)):(this.ma&&1120==this.qa&&this.ma.setData(this.b[0],!0),this.C?this.C.i():H(this));this.a-=7}function we(){L(this,16,0,-9);this.a-=20}var xe=[0,7,7,10,7,11,9,13];function ye(a){this.Y=this.a;R(this,od(this,a));this.a=this.Y-xe[this.h]}var ze=[0,14,14,17,14,18,16,20];function Ae(a){this.Y=this.a;var b=od(this,a);a=a>>6&7;fd(this,this.b[a]);this.b[a]=this.b[7];R(this,b);this.a=this.Y-ze[this.h]}var Be=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function Ce(a){var b=nd(this,a);this.Y=this.a;sd(this,a,b,this.ha);this.a=this.Y-Be[(this.L?8:0)+this.h]+(7!=this.f||this.h?0:2)}function De(a){var b=md(this,a);rd(this,a,b,65535,this.ha);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}var Ee=[7,13,13,17,14,18,17,21];function Fe(a){var b=qd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.m=0;this.v=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)R(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6} -function Le(a){U(this,a,nd(this,a),Pd);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Me(a){U(this,a,0,Rd);this.a-=this.h?9:3+(7==this.f?2:0)}function Ne(){L(this,28,0,-9)}function Oe(){this.ma&&(this.ma.la=this.b[7],this.ma.setData(this.b[0],!0));this.g|=8;bd(this,-2);this.a-=3}function Pe(a){U(this,a,this.b[(a>>6&7)+this.Pb],Sd);this.a-=this.h?9:3+(7==this.f?2:0)}function X(){L(this,8,0,-9)}function Wc(a){Qe[a>>12].call(this,a)} -function Re(a){Se[a>>6&3].call(this,a)}function Te(a){Ue[a>>6&3].call(this,a)}function Ve(a){We[a>>6&3].call(this,a)}function Xe(a){Ye[a&15].call(this,a)}function Ze(a){$e[a&15].call(this,a)}function af(a){bf[a>>6&3].call(this,a)}function cf(a){df[a>>6&3].call(this,a)}function ef(a){ff[a>>6&3].call(this,a)} -var Qe=[function(a){gf[a>>8&15].call(this,a)},Ce,re,be,Yd,$d,Td,X,function(a){hf[a>>8&15].call(this,a)},De,se,ce,Zd,ae,Le,X],gf=[function(a){jf[a>>4&15].call(this,a)},oe,le,de,ee,je,fe,he,Ae,Ae,Re,Te,Ve,X,X,X],Se=[function(a){sd(this,a,0,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Dd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Hd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Fd);this.a-=this.h?9:3+(7==this.f?2:0)}],Ue=[function(a){U(this,a,0,Jd); -this.a-=this.h?11:6},function(a){U(this,a,$c(this)?1:0,td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,$c(this)?1:0,Pd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=qd(this,a);this.La(a);this.a-=this.h?4:3+(7==this.f?2:0)}],We=[function(a){U(this,a,0,Nd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Ld);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,xd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,vd);this.a-=this.h?9:3+(7==this.f?2:0)}],jf= -[function(a){kf[a&15].call(this,a)},X,X,X,ye,ye,ye,ye,Ie,X,Xe,Ze,Me,Me,Me,Me],kf=[ve,Oe,Je,ne,we,He,X,X,X,X,X,X,X,X,X,X],Ye=[Ge,function(){this.v=0;this.a-=5},function(){this.m=0;this.a-=5},V,function(){this.o=1;this.a-=5},V,V,V,function(){this.w=0;this.a-=5},V,V,V,V,V,V,V],$e=[Ge,function(){this.v=65536;this.a-=5},function(){this.m=32768;this.a-=5},W,function(){this.o=0;this.a-=5},W,W,W,function(){this.w=32768;this.a-=5},W,W,W,W,W,W,W],hf=[me,ke,ge,ie,pe,qe,Wd,Xd,ue,Ne,af,cf,ef,X,X,X],bf=[function(a){rd(this, -a,0,255,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Gd);this.a-=this.h?9:3+(7==this.f?2:0)}],df=[function(a){T(this,a,0,Kd);this.a-=this.h?11:6},function(a){T(this,a,$c(this)?1:0,ud);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,$c(this)?1:0,Qd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=pd(this,a);this.La(a<<8);this.a-=this.h?4:3+ -(7==this.f?2:0)}],ff=[function(a){T(this,a,0,Od);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Md);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,yd);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,wd);this.a-=this.h?9:3+(7==this.f?2:0)}];function Xc(a){lf[a>>12].call(this,a)} -var lf=[function(a){mf[a>>8&15].call(this,a)},Ce,re,be,Yd,$d,Td,function(a){nf[a>>8&15].call(this,a)},function(a){of[a>>8&15].call(this,a)},De,se,ce,Zd,ae,Le,X],mf=[function(a){pf[a>>4&15].call(this,a)},oe,le,de,ee,je,fe,he,Ae,Ae,Re,Te,Ve,function(a){qf[a>>6&3].call(this,a)},X,X],qf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.V(a|this.ta);R(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=kd(this,a,0);this.ha(a);fd(this,a);this.a-=11},function(a){var b=hd(this);this.Y= -this.a;this.ha(b);ld(this,a,0,b);this.a=this.Y-Ee[this.h]},function(a){sd(this,a,ad(this)?65535:0,this.ha);this.a-=this.h?9:3+(7==this.f?2:0)}],pf=[function(a){rf[a&15].call(this,a)},X,X,X,ye,ye,ye,ye,Ie,function(a){!(a&8)||1145>this.qa?L(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},Xe,Ze,Me,Me,Me,Me],rf=[ve,Oe,function(){gd(this);this.g|=this.i&16;this.a-=13},ne,we,He,Je,function(){L(this,8,0,-9)},X,X,X,X,X,X,X,X],nf=[Fe,Fe,te,te,Ud,Ud,Vd,Vd,Pe,Pe,X, -X,X,X,Ke,Ke],of=[me,ke,ge,ie,pe,qe,Wd,Xd,ue,Ne,af,cf,ef,function(a){1145>this.qa?L(this,8,0,-9):sf[a>>6&3].call(this,a)},X,X],sf=[function(){L(this,8,0,-9)},function(a){a=kd(this,a,65536);this.ha(a);fd(this,a);this.a-=11},function(a){var b=hd(this);this.Y=this.a;this.ha(b);ld(this,a,65536,b);this.a=this.Y-Ee[this.h]},function(){L(this,8,0,-9)}]; -function tf(a){r.call(this,"ROM",a,0,128);this.ja=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=F(this.g);if(this.g){a=this.g;var b=Ca(this.m);"json"!=b&&"hex"!=b&&(a=La()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;G(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ra(c.Na,a,b),(a=Ka(a,b))?(c.b=a.O,c.ja=a.ja):c.g=null);uf(c)})}}n(tf,r); -h=tf.prototype;h.ca=function(a,b,c,d){this.u=b;this.c=c;this.C=d;uf(this)};h.ea=function(){this.ja&&(this.C&&this.C.a(this.id,this.h,this.a,this.ja),delete this.ja);return!0};h.da=function(){return!0}; -function uf(a){if(!ya(a)){if(a.g){if(!a.b||!a.u)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a)xa(a,"ROM size ("+Ba(a.b.length,8,!0)+") does not match specified size ("+Ba(a.a,8,!0)+")");else{var b;a:{b=a.h;if(57344<=b&&b<57344+Ob){var c={},c=(c[b]=[tf.prototype.be,tf.prototype.mf,null,null,null,a.a>>1],c);if(lb(a.u,a,c)){a.status("Added "+a.a+"-byte ROM at "+Aa(b));b=a.i=!0;break a}}else if(Ub(a.u,b,a.a,vc)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),x=l,w=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(w)for(;w--;)cc(a.u,t++,b[x++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< -b.length;e++)cc(a.u,c+e,b[e]);k=!0}if(k){if(null==d||g)H(a.c),f=!1;null!=d&&Yc(a.c,d,f)}return k}Va(function(){for(var a=C(document,B,"ram"),b=0;b>3)?(d=a.pa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.Rb(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function td(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.pa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Hb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} +h.Sb=function(a){this.l.complete=!0;var b=a?this.l.ec?0:1:-1;this.l.ec=!1;this.Ea=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Sa&224)>>5,e=this.K&&this.K.gb>d?this.K:null;e&&(c=e.xb,d=e.gb);d>(this.i&224)>>5?(this.g&8&&(cd(this,2),this.g&=-9),L(this,c,0,-10),d=!0):d=!1;d&&(e&&oc(this,e),a=!0);this.K||this.Sa||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){I(this);break}if(0>b)break}if(this.g&112&&dd(this)){if(this.g& +4&&this.D.b(this.b[7],b)){I(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.lc(e)}while(0>1|b<<16;ed(this,a);return a&65535}function zd(a,b){a=b&128|b>>1|b<<8;ed(this,a<<8);return a&255}function Ad(a,b){a=b&~a;this.ia(a);return a}function Bd(a,b){a=b&~a;this.ia(a<<8);return a}function Cd(a,b){a|=b;this.ia(a);return a}function Dd(a,b){a|=b;this.ia(a<<8);return a} +function Ed(a,b){a=~b|65536;this.La(a);return a&65535}function Fd(a,b){a=~b|256;this.La(a<<8);return a&255}function Gd(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function Hd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function Id(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function Jd(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function Kd(a,b){a=-b;this.La(a,a&b&32768);return a&65535} +function Ld(a,b){a=-b;this.La(a<<8,(a&b&128)<<8);return a&255}function Md(a,b){a=b<<1|this.u>>16&1;ed(this,a);return a&65535}function Nd(a,b){a=b<<1|this.u>>16&1;ed(this,a<<8);return a&255}function Od(a,b){a=(this.u&65536|b)>>1|b<<16;ed(this,a);return a&65535}function Pd(a,b){a=((this.u&65536)>>8|b)>>1|b<<8;ed(this,a<<8);return a&255}function Qd(a,b){var c=b-a;fd(this,c,a,b);return c&65535}function Rd(a,b){var c=b-a;fd(this,c<<8,a<<8,b<<8);return c&255} +function Sd(a,b){this.w=this.o=b&65280;this.m=this.u=0;return(b<<8|b>>8)&65535}function Td(a,b){a^=b;this.ia(a);return a&65535}function Ud(a){U(this,a,od(this,a),ud);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} +function Vd(a){var b=rd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.u=this.m=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} +function Wd(a){var b=rd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&=63;if(b&32){b=64-b;32>b-1;this.u=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function Xd(a){S(this,a,!ad(this))}function Yd(a){S(this,a,ad(this))} +function Zd(a){U(this,a,od(this,a),Ad);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function $d(a){T(this,a,nd(this,a),Bd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ae(a){U(this,a,od(this,a),Cd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function be(a){T(this,a,nd(this,a),Dd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} +function ce(a){var b=od(this,a);a=rd(this,a);this.ia((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function de(a){var b=nd(this,a);a=qd(this,a);this.ia(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function ee(a){S(this,a,this.o&65535?0:4)}function fe(a){S(this,a,!bd(this)==!(this.m&32768))}function ge(a){S(this,a,!!(this.o&65535)&&!bd(this)==!(this.m&32768))} +function he(a){S(this,a,!ad(this)&&!!(this.o&65535))}function ie(a){S(this,a,(this.o&65535?0:4)||!bd(this)!=!(this.m&32768))}function je(a){S(this,a,ad(this)||(this.o&65535?0:4))}function ke(a){S(this,a,!bd(this)!=!(this.m&32768))}function le(a){S(this,a,bd(this))}function me(a){S(this,a,!!(this.o&65535))}function ne(a){S(this,a,!bd(this))}function oe(){L(this,12,0,-9)}function pe(a){S(this,a,!0)}function qe(a){S(this,a,!(this.m&32768))}function re(a){S(this,a,this.m&32768?2:0)} +function V(a){a&1&&(this.u=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function se(a){var b=od(this,a);a=rd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;fd(this,c,a,b);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function te(a){var b=nd(this,a);a=qd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);fd(this,c,a,b);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)} +function ue(a){var b=rd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.u=65536,this.a-=7}function ve(){L(this,24,0,-9);this.a-=20} +function we(){this.i&49152?(this.G|=128,L(this,4,0,-8)):(this.ma&&1120==this.qa&&this.ma.setData(this.b[0],!0),this.D?this.D.i():I(this));this.a-=7}function xe(){L(this,16,0,-9);this.a-=20}var ye=[0,7,7,10,7,11,9,13];function ze(a){this.aa=this.a;R(this,pd(this,a));this.a=this.aa-ye[this.h]}var Ae=[0,14,14,17,14,18,16,20];function Be(a){this.aa=this.a;var b=pd(this,a);a=a>>6&7;gd(this,this.b[a]);this.b[a]=this.b[7];R(this,b);this.a=this.aa-Ae[this.h]} +var Ce=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function De(a){var b=od(this,a);this.aa=this.a;td(this,a,b,this.ia);this.a=this.aa-Ce[(this.L?8:0)+this.h]+(7!=this.f||this.h?0:2)}function Ee(a){var b=nd(this,a);sd(this,a,b,65535,this.ia);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}var Fe=[7,13,13,17,14,18,17,21]; +function Ge(a){var b=rd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.m=0;this.u=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)R(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Me(a){U(this,a,od(this,a),Qd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Ne(a){U(this,a,0,Sd);this.a-=this.h?9:3+(7==this.f?2:0)}function Oe(){L(this,28,0,-9)} +function Pe(){this.ma&&(this.ma.U=this.b[7],this.ma.setData(this.b[0],!0));this.g|=8;cd(this,-2);this.a-=3}function Qe(a){U(this,a,this.b[(a>>6&7)+this.Pb],Td);this.a-=this.h?9:3+(7==this.f?2:0)}function X(){L(this,8,0,-9)}function Xc(a){Re[a>>12].call(this,a)}function Se(a){Te[a>>6&3].call(this,a)}function Ue(a){Ve[a>>6&3].call(this,a)}function We(a){Xe[a>>6&3].call(this,a)}function Ye(a){Ze[a&15].call(this,a)}function $e(a){af[a&15].call(this,a)}function bf(a){cf[a>>6&3].call(this,a)} +function df(a){ef[a>>6&3].call(this,a)}function ff(a){gf[a>>6&3].call(this,a)} +var Re=[function(a){hf[a>>8&15].call(this,a)},De,se,ce,Zd,ae,Ud,X,function(a){jf[a>>8&15].call(this,a)},Ee,te,de,$d,be,Me,X],hf=[function(a){kf[a>>4&15].call(this,a)},pe,me,ee,fe,ke,ge,ie,Be,Be,Se,Ue,We,X,X,X],Te=[function(a){td(this,a,0,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Gd);this.a-=this.h?9:3+(7==this.f?2:0)}],Ve=[function(a){U(this,a,0,Kd); +this.a-=this.h?11:6},function(a){U(this,a,ad(this)?1:0,ud);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,ad(this)?1:0,Qd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=rd(this,a);this.La(a);this.a-=this.h?4:3+(7==this.f?2:0)}],Xe=[function(a){U(this,a,0,Od);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Md);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,yd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,wd);this.a-=this.h?9:3+(7==this.f?2:0)}],kf= +[function(a){lf[a&15].call(this,a)},X,X,X,ze,ze,ze,ze,Je,X,Ye,$e,Ne,Ne,Ne,Ne],lf=[we,Pe,Ke,oe,xe,Ie,X,X,X,X,X,X,X,X,X,X],Ze=[He,function(){this.u=0;this.a-=5},function(){this.m=0;this.a-=5},V,function(){this.o=1;this.a-=5},V,V,V,function(){this.w=0;this.a-=5},V,V,V,V,V,V,V],af=[He,function(){this.u=65536;this.a-=5},function(){this.m=32768;this.a-=5},W,function(){this.o=0;this.a-=5},W,W,W,function(){this.w=32768;this.a-=5},W,W,W,W,W,W,W],jf=[ne,le,he,je,qe,re,Xd,Yd,ve,Oe,bf,df,ff,X,X,X],cf=[function(a){sd(this, +a,0,255,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Fd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Jd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Hd);this.a-=this.h?9:3+(7==this.f?2:0)}],ef=[function(a){T(this,a,0,Ld);this.a-=this.h?11:6},function(a){T(this,a,ad(this)?1:0,vd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,ad(this)?1:0,Rd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=qd(this,a);this.La(a<<8);this.a-=this.h?4:3+ +(7==this.f?2:0)}],gf=[function(a){T(this,a,0,Pd);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Nd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,zd);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,xd);this.a-=this.h?9:3+(7==this.f?2:0)}];function Yc(a){mf[a>>12].call(this,a)} +var mf=[function(a){nf[a>>8&15].call(this,a)},De,se,ce,Zd,ae,Ud,function(a){of[a>>8&15].call(this,a)},function(a){pf[a>>8&15].call(this,a)},Ee,te,de,$d,be,Me,X],nf=[function(a){qf[a>>4&15].call(this,a)},pe,me,ee,fe,ke,ge,ie,Be,Be,Se,Ue,We,function(a){rf[a>>6&3].call(this,a)},X,X],rf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.ta);R(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=ld(this,a,0);this.ia(a);gd(this,a);this.a-=11},function(a){var b=id(this);this.aa= +this.a;this.ia(b);md(this,a,0,b);this.a=this.aa-Fe[this.h]},function(a){td(this,a,bd(this)?65535:0,this.ia);this.a-=this.h?9:3+(7==this.f?2:0)}],qf=[function(a){sf[a&15].call(this,a)},X,X,X,ze,ze,ze,ze,Je,function(a){!(a&8)||1145>this.qa?L(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},Ye,$e,Ne,Ne,Ne,Ne],sf=[we,Pe,function(){hd(this);this.g|=this.i&16;this.a-=13},oe,xe,Ie,Ke,function(){L(this,8,0,-9)},X,X,X,X,X,X,X,X],of=[Ge,Ge,ue,ue,Vd,Vd,Wd,Wd,Qe,Qe,X, +X,X,X,Le,Le],pf=[ne,le,he,je,qe,re,Xd,Yd,ve,Oe,bf,df,ff,function(a){1145>this.qa?L(this,8,0,-9):tf[a>>6&3].call(this,a)},X,X],tf=[function(){L(this,8,0,-9)},function(a){a=ld(this,a,65536);this.ia(a);gd(this,a);this.a-=11},function(a){var b=id(this);this.aa=this.a;this.ia(b);md(this,a,65536,b);this.a=this.aa-Fe[this.h]},function(){L(this,8,0,-9)}]; +function uf(a){r.call(this,"ROM",a,0,128);this.ka=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=F(this.g);if(this.g){a=this.g;var b=Ca(this.m);"json"!=b&&"hex"!=b&&(a=La()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;G(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ra(c.Na,a,b),(a=Ka(a,b))?(c.b=a.O,c.ka=a.ka):c.g=null);vf(c)})}}n(uf,r); +h=uf.prototype;h.ea=function(a,b,c,d){this.v=b;this.c=c;this.D=d;vf(this)};h.ga=function(){this.ka&&(this.D&&this.D.a(this.id,this.h,this.a,this.ka),delete this.ka);return!0};h.fa=function(){return!0}; +function vf(a){if(!ya(a)){if(a.g){if(!a.b||!a.v)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a)xa(a,"ROM size ("+Ba(a.b.length,8,!0)+") does not match specified size ("+Ba(a.a,8,!0)+")");else{var b;a:{b=a.h;if(57344<=b&&b<57344+Pb){var c={},c=(c[b]=[uf.prototype.be,uf.prototype.mf,null,null,null,a.a>>1],c);if(mb(a.v,a,c)){a.status("Added "+a.a+"-byte ROM at "+Aa(b));b=a.i=!0;break a}}else if(Vb(a.v,b,a.a,wc)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),x=l,w=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(w)for(;w--;)dc(a.v,t++,b[x++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< +b.length;e++)dc(a.v,c+e,b[e]);k=!0}if(k){if(null==d||g)I(a.c),f=!1;null!=d&&Zc(a.c,d,f)}return k}Va(function(){for(var a=C(document,B,"ram"),b=0;b=q.jc&&c<=q.Uc&&(b=c-(q.jc-q.Hc));b&&(a.preventDefault&&a.preventDefault(),d.Ib(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Jc&&(b=q.Ic);d.Ib(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +h.ha=function(a,b,c){var d=this;switch(b){case Af:return this.j[b]=this.h=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?q.kc:q.Kc:46==c?b=q.kc:a.ctrlKey&&c>=q.jc&&c<=q.Uc&&(b=c-(q.jc-q.Hc));b&&(a.preventDefault&&a.preventDefault(),d.Ib(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Jc&&(b=q.Ic);d.Ib(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Ib(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.ca=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.C=d;var e=this;this.H=lc(this.c,this.D?-1:48,4,262144);this.I=jc(this.c,function(){var a;a=-1;e.h.length&&(a=e.h.shift()&255,e.w&&97<=a&&122>a&&(a-=32),kc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&N(c,e.H))});this.F=lc(this.c,this.D?-1:52,4,262144);this.W=jc(this.c,function(){e.b|=128;e.b&64&&N(c,e.F)});lb(b,this,Af,this.D?64832+8*(this.D-1)-65392:0);nb(b,this.reset.bind(this));D(this)}; -h.zc=function(a){if(!this.f){var b=Kc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ha(c[0]);if(d!=this.Ma)return;c=Ha(c[1]);if(this.f=va(c)){var e=this.f.exports;if(e){var f=e.connect;f&&f.call(this.f,this.v);if(this.s=e.receiveData){this.v=a;this.G=e.receiveStatus;this.status("Connected "+this.Na+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ea=function(a,b){if(!b)if(this.zc(this.v),!a)this.reset();else if(!this.restore(a))return!1;return!0}; -h.da=function(a){return a?this.save():!0};h.reset=function(){Bf(this)};h.save=function(){var a=new J(this);a.set(0,[]);return a.data()};h.restore=function(){return Bf(this)};function Bf(a){a.o=0;a.a=8192;a.b=128;a.h=[];return!0}h.Ib=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.R||8,c=a-this.m%a,this.R&&(b=" ".slice(0,c)));this.L&&!this.m&&c&&(b=String.fromCharCode(this.L)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.m+=c}}else if(null!= -this.i){if(10==a||1024<=this.i.length)this.X(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}kc(this.c,this.W,1E3/Math.round(this.Y/10));this.b&=-129};var zf="buffer",Cf={},Af=(Cf[65392]=[null,null,Z.prototype.Pd,Z.prototype.Ze,"RCSR"],Cf[65394]=[null,null,Z.prototype.Od,Z.prototype.Ye,"RBUF"],Cf[65396]=[null,null,Z.prototype.te,Z.prototype.Ff,"XCSR"],Cf[65398]=[null,null,Z.prototype.se,Z.prototype.Ef,"XBUF"],Cf); -Va(function(){for(var a=C(document,B,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "readTape":e=Gf;case "loadTape":return e||(e=Hf),this.j[b]=c,c.onclick= -function(){var a=d.j.listTapes;a&&If(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;If(d,F(b,!0),b,Hf,a)}return!1};return!0;case Jf:return this.j[b]=c,!0}return!1}; -h.ca=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.C=d;this.v=Kf(a);var e=this;if(a=Df(this,Kc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.D[f]=a[f]);this.s=lc(this.c,56,4,4096);this.H=jc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.mc.indexOf("/api/v1/dump")&&(e=Ca(c),f="json"==e||"gz"==e?encodeURI(c):La()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!G(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.l.S;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ra(a.Na,e,f),(e=Ka(e,f))&&Vf(a,b,c,d,e.O,e.aa,e.Z)); -a.l.Ua=!1;a.b&&(a.b--,a.b||D(a));Sf(a)})}function Nf(a,b,c,d){if((a=a.j.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ca(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ea(c,"/")&&(d="dir"),f=La()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Cb?"":e)+"&format=json"));return!!G(f, -null,!0,function(b,c,d){cg(a,b,c,d)})} -function cg(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.l.S;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.oa+'" (error '+d+": "+b+")",f);else{ra(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.J=k.length;a.P=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.U=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var x=l.bytes;if(void 0!==x&&x.length){for(var w=m<<2,Y=x.length;Y>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ka?f=a.sa+a.ka&&(a.ka+=f-(a.sa+a.ka)+1):(a.sa=f,a.ka=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.B("Unable to restore disk '"+this.oa+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=eg(this,a++);)hg(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function hg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var Zf=0;function Q(a){r.call(this,"RK11",a,0,65536);this.o=ig(this,a.autoMount);this.m=0;this.f=Array(8);this.s=!Qa("Mobi")&&window&&"FileReader"in window;this.Ka=null;this.w=this.b=this.a=this.i=this.h=this.g=this.v=0}n(Q,r); -function ig(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Q.prototype; -h.ga=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.j[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&jg(d,a)}, -!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&kg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.f.length||!(a=d.f[b])?d.B("Unable to boot the selected drive"):a.T?(Yc(d.c,0,!0),(a=d.tc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.s){c.parentNode.removeChild(c); -break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.f&&((a=d.f[E(a.value)||0])?(a=a.T)?(a=Ta(gg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.s)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;kg(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ca=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.C=d;if(a=ig(this,Kc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.o[e]=a[e]);lg(this);this.Ka=lc(this.c,144,5,65536);lb(b,this,mg);nb(b,this.reset.bind(this));ng(this,"None",og,!0);this.s&&ng(this,"Local Disk",pg);ng(this,"Remote Disk",qg);rg(this)||D(this)}; -h.ea=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";jg(this,0)}}return!0};h.da=function(a){return a?this.save():!0};h.reset=function(){lg(this)};h.save=function(){return(new J(this)).data()}; -h.restore=function(a){return lg(this,a[0])};function rg(a,b){b||(a.m=0);for(var c in a.o){var d=a.o[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.f.length)a.B("Unable to load the selected drive");else if(c)if(c==pg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==qg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}tg(a,e,b,c,!1,d)}else sg(a,e)} -function tg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.fa.toLowerCase()!=d.toLowerCase()&&(g++,sg(a,b,!0),k.Wa?a.B("RK11 busy"):(k.Wa=!0,e&&(k.Va=!0,a.m++),k.ya=!!f,bg(new Yf(a,k,"preload"),c,d,f,a.Mc)&&g++));return g}h.Mc=function(a,b,c,d,e){a.Wa=!1;b&&(b.J>a.J||b.P>a.P)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Ja)),b=null);b?(a.T=b,a.oa=c,a.fa=d,this.B('Loaded disk "'+c+'" in drive '+("RK"+a.Ja),a.Va||e),this.A&&Rc(this.A)):a.ya=!1;a.Va&&(a.Va=!1,--this.m||D(this));jg(this,a.Ja)}; -function ng(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e=a.J){m=64;break}p=a.seek(b,c,d+1);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.P&&(c=0,++b))}var x,w;if(0>(x=a.read(p,t++))||0>(w=a.read(p,t++))){m=32;break}if(!k&&(Gb(this.u,id(this.c,f),x|w<<8),ic(this.u))){m=1024;break}t>=a.U&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Nc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.T;var p=null,t;a||(m=128,e=0);for(;e;){var x=Ib(this.u,id(this.c,f));if(ic(this.u)){m=1024;break}if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1,!0);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.P&&(c=0,++b))}if(k){var w,Y;if(0>(w=a.read(p,t++))||0>(Y=a.read(p,t++))){m=32;break}if(x!=(w|Y<<8)){m=1;break}}else if(!a.write(p,t++,x&255)||!a.write(p,t++,x>>8)){m=32;break}t>=a.U&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Lc=function(a,b,c,d,e,f){this.h=f&65535;this.a=this.a&-49|f>>12&48;this.i=65536-e&65535;this.g=this.g&-16|d&15;this.b|=a;ug(this);return!0};function ug(a){a.a&=-32769;a.b&&(a.b|=32768,a.a|=32768,a.b&32736&&(a.a|=16384))}h.Ud=function(){return this.w};h.df=function(){};h.Vd=function(){return this.b};h.ef=function(){};h.Rd=function(){return this.a&61438}; -h.af=function(a){this.a=this.a&-3968|a&3967;if(this.a&1){a=!0;var b,c,d=(this.g&57344)>>13,e=this.f[d],f,g,k,l,m,p;this.a&=-8321;this.b&=-4;switch(c=this.a&14){case 0:this.b=this.g=0;this.a=128;break;case 10:case 4:b=this.tc;case 6:case 2:b||(b=this.Nc);f=(this.g&8160)>>5;g=(this.g&16)>>4;k=this.g&15;l=65536-this.i&65535;m=(this.a&48)<<12|this.h;p=this.a&2048?0:2;if(f>=e.J){this.b|=64;break}if(k>=e.M){this.b|=32;break}a=b.call(this,e,f,g,k,l,m,p,6<=c,this.Lc.bind(this));break;case 8:f=(this.g&8160)>> -5;f'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&xg(d,a)}, -!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&yg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.T?(Yc(d.c,0,!0),(a=d.uc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.v){c.parentNode.removeChild(c); -break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.b&&((a=d.b[E(a.value)||0])?(a=a.T)?(a=Ta(gg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.v)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;yg(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ca=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.C=d;if(a=wg(this,Kc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.s[e]=a[e]);zg(this);this.Ka=lc(this.c,112,5,131072);lb(b,this,Ag);nb(b,this.reset.bind(this));Bg(this,"None",Cg,!0);this.v&&Bg(this,"Local Disk",Dg);Bg(this,"Remote Disk",Eg);Fg(this)||D(this)}; -h.ea=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";xg(this,0)}}return!0};h.da=function(a){return a?this.save():!0};h.reset=function(){zg(this)};h.save=function(){return(new J(this)).data()}; -h.restore=function(a){return zg(this,a[0])};function Fg(a,b){b||(a.o=0);for(var c in a.s){var d=a.s[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==Dg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Eg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}Hg(a,e,b,c,!1,d)}else Gg(a,e)} -function Hg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.fa.toLowerCase()!=d.toLowerCase()&&(g++,Gg(a,b,!0),k.Wa?a.B("RL11 busy"):(k.Wa=!0,e&&(k.Va=!0,a.o++),k.ya=!!f,bg(new Yf(a,k,"preload"),c,d,f,a.Pc)&&g++));return g}h.Pc=function(a,b,c,d,e){a.Wa=!1;b&&(b.J>a.J||b.P>a.P)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Ja)),b=null);b?(a.T=b,a.oa=c,a.fa=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Ja),a.Va||e),this.A&&Rc(this.A)):a.ya=!1;a.Va&&(a.Va=!1,--this.o||D(this));xg(this,a.Ja)}; -function Bg(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}Gb(this.u,id(this.c,f),p|t<<8);if(ic(this.u)){k=8192;break}f+=2;e--;if(m>=a.U&&(l=null,++d>=a.M&&(d=0,++c>=a.P&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Qc=function(a,b,c,d,e,f,g){var k=0;a=a.T;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Ib(this.u,id(this.c,f));if(ic(this.u)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.U&&(l=null,++d>=a.M&&(d=0,++c>=a.P&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;var e=this;this.H=mc(this.c,this.C?-1:48,4,262144);this.I=kc(this.c,function(){var a;a=-1;e.f.length&&(a=e.f.shift()&255,e.w&&97<=a&&122>a&&(a-=32),lc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&N(c,e.H))});this.F=mc(this.c,this.C?-1:52,4,262144);this.Y=kc(this.c,function(){e.b|=128;e.b&64&&N(c,e.F)});mb(b,this,Bf,this.C?64832+8*(this.C-1)-65392:0);ob(b,this.reset.bind(this));D(this)}; +h.zc=function(a){if(!this.g){var b=Lc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ha(c[0]);if(d!=this.Ma)return;c=Ha(c[1]);if(this.g=va(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.u);if(this.s=e.receiveData){this.u=a;this.G=e.receiveStatus;this.status("Connected "+this.Na+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ga=function(a,b){if(!b)if(this.zc(this.u),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +h.fa=function(a){return a?this.save():!0};h.reset=function(){Cf(this)};h.save=function(){var a=new H(this);a.set(0,[this.o,this.a,this.b,this.f]);return a.data()};h.restore=function(a){return Cf(this,a[0])};function Cf(a,b){b||(b=[0,8192,128,a.f]);b=ia(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.f=b.next().value;return!0} +h.Ib=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.m%a,this.S&&(b=" ".slice(0,c)));this.L&&!this.m&&c&&(b=String.fromCharCode(this.L)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.m+=c}}else if(null!= +this.i){if(10==a||1024<=this.i.length)this.Z(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}lc(this.c,this.Y,1E3/Math.round(this.aa/10));this.b&=-129};var Af="buffer",Df={},Bf=(Df[65392]=[null,null,Z.prototype.Pd,Z.prototype.Ze,"RCSR"],Df[65394]=[null,null,Z.prototype.Od,Z.prototype.Ye,"RBUF"],Df[65396]=[null,null,Z.prototype.te,Z.prototype.Ff,"XCSR"],Df[65398]=[null,null,Z.prototype.se,Z.prototype.Ef,"XBUF"],Df); +Va(function(){for(var a=C(document,B,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "readTape":e=Hf;case "loadTape":return e||(e=If),this.j[b]=c,c.onclick= +function(){var a=d.j.listTapes;a&&Jf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Jf(d,F(b,!0),b,If,a)}return!1};return!0;case Kf:return this.j[b]=c,!0}return!1}; +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;this.u=Lf(a);var e=this;if(a=Ef(this,Lc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.s=mc(this.c,56,4,4096);this.H=kc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.mc.indexOf("/api/v1/dump")&&(e=Ca(c),f="json"==e||"gz"==e?encodeURI(c):La()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!G(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.l.T;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ra(a.Na,e,f),(e=Ka(e,f))&&Wf(a,b,c,d,e.O,e.ca,e.ba)); +a.l.Ua=!1;a.b&&(a.b--,a.b||D(a));Tf(a)})}function Of(a,b,c,d){if((a=a.j.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ca(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ea(c,"/")&&(d="dir"),f=La()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Cb?"":e)+"&format=json"));return!!G(f, +null,!0,function(b,c,d){dg(a,b,c,d)})} +function dg(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.l.T;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.oa+'" (error '+d+": "+b+")",f);else{ra(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)v(k[0]);else{a.J=k.length;a.R=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.V=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var x=l.bytes;if(void 0!==x&&x.length){for(var w=m<<2,Y=x.length;Y>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.la?f=a.sa+a.la&&(a.la+=f-(a.sa+a.la)+1):(a.sa=f,a.la=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.B("Unable to restore disk '"+this.oa+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=fg(this,a++);)ig(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function ig(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var $f=0;function Q(a){r.call(this,"RK11",a,0,65536);this.w=jg(this,a.autoMount);this.o=0;this.f=Array(8);this.C=!Qa("Mobi")&&window&&"FileReader"in window;this.h=[];this.Ka=null;this.u=this.b=this.a=this.m=this.i=this.g=this.s=0}n(Q,r); +function jg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Q.prototype; +h.ha=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.j[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&kg(d,a)}, +!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&lg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.f.length||!(a=d.f[b])?d.B("Unable to boot the selected drive"):a.P?(Zc(d.c,0,!0),(a=d.tc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.C){c.parentNode.removeChild(c); +break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.f&&((a=d.f[E(a.value)||0])?(a=a.P)?(a=Ta(hg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.C)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;lg(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;if(a=jg(this,Lc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);mg(this);this.Ka=mc(this.c,144,5,65536);mb(b,this,ng);ob(b,this.reset.bind(this));og(this,"None",pg,!0);this.C&&og(this,"Local Disk",qg);og(this,"Remote Disk",rg);sg(this)||D(this)}; +h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){this.h=[];for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";kg(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){mg(this)}; +h.save=function(){var a=new H(this);a.set(0,[this.u,this.b,this.a,this.m,this.i,this.g,this.s,ug(this)]);return a.data()};h.restore=function(a){return mg(this,a[0])}; +function mg(a,b){b||(b=[2368,0,128,0,0,0,0]);var c=ia(b);a.u=c.next().value;a.b=c.next().value;a.a=c.next().value;a.m=c.next().value;a.i=c.next().value;a.g=c.next().value;a.s=c.next().value;b[7]&&(a.h=b[7]);for(b=0;bg||9e||e>=a.f.length)a.B("Unable to load the selected drive");else if(c)if(c==qg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==rg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}wg(a,e,b,c,!1,d)}else tg(a,e)} +function wg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,tg(a,b,!0),k.Wa?a.B("RK11 busy"):(k.Wa=!0,e&&(k.Va=!0,a.o++),k.ya=!!f,cg(new Zf(a,k,"preload"),c,d,f,a.Mc)&&g++));return g} +h.Mc=function(a,b,c,d,e){a.Wa=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Ja)),b=null);if(b){a.P=b;a.oa=c;a.X=d;a:{var f;for(f=0;f=a.J){m=64;break}p=a.seek(b,c,d+1);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}var x,w;if(0>(x=a.read(p,t++))||0>(w=a.read(p,t++))){m=32;break}if(!k&&(Ib(this.v,jd(this.c,f),x|w<<8),jc(this.v))){m=1024;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Nc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.P;var p=null,t;a||(m=128,e=0);for(;e;){var x=Kb(this.v,jd(this.c,f));if(jc(this.v)){m=1024;break}if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1,!0);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}if(k){var w,Y;if(0>(w=a.read(p,t++))||0>(Y=a.read(p,t++))){m=32;break}if(x!=(w|Y<<8)){m=1;break}}else if(!a.write(p,t++,x&255)||!a.write(p,t++,x>>8)){m=32;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Lc=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&-49|f>>12&48;this.m=65536-e&65535;this.g=this.g&-16|d&15;this.b|=a;xg(this);return!0};function xg(a){a.a&=-32769;a.b&&(a.b|=32768,a.a|=32768,a.b&32736&&(a.a|=16384))}h.Ud=function(){return this.u};h.df=function(){};h.Vd=function(){return this.b};h.ef=function(){};h.Rd=function(){return this.a&61438}; +h.af=function(a){this.a=this.a&-3968|a&3967;if(this.a&1){a=!0;var b,c,d=(this.g&57344)>>13,e=this.f[d],f,g,k,l,m,p;this.a&=-8321;this.b&=-4;switch(c=this.a&14){case 0:this.b=this.g=0;this.a=128;break;case 10:case 4:b=this.tc;case 6:case 2:b||(b=this.Nc);f=(this.g&8160)>>5;g=(this.g&16)>>4;k=this.g&15;l=65536-this.m&65535;m=(this.a&48)<<12|this.i;p=this.a&2048?0:2;if(f>=e.J){this.b|=64;break}if(k>=e.M){this.b|=32;break}a=b.call(this,e,f,g,k,l,m,p,6<=c,this.Lc.bind(this));break;case 8:f=(this.g&8160)>> +5;f'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&Ag(d,a)}, +!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&Bg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.P?(Zc(d.c,0,!0),(a=d.uc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.u){c.parentNode.removeChild(c); +break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.b&&((a=d.b[E(a.value)||0])?(a=a.P)?(a=Ta(hg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.u)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Bg(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;if(a=zg(this,Lc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.s[e]=a[e]);Cg(this);this.Ka=mc(this.c,112,5,131072);mb(b,this,Dg);ob(b,this.reset.bind(this));Eg(this,"None",Fg,!0);this.u&&Eg(this,"Local Disk",Gg);Eg(this,"Remote Disk",Hg);Ig(this)||D(this)}; +h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Ag(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){Cg(this)};h.save=function(){return(new H(this)).data()}; +h.restore=function(a){return Cg(this,a[0])};function Ig(a,b){b||(a.o=0);for(var c in a.s){var d=a.s[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==Gg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Hg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}Kg(a,e,b,c,!1,d)}else Jg(a,e)} +function Kg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,Jg(a,b,!0),k.Wa?a.B("RL11 busy"):(k.Wa=!0,e&&(k.Va=!0,a.o++),k.ya=!!f,cg(new Zf(a,k,"preload"),c,d,f,a.Pc)&&g++));return g}h.Pc=function(a,b,c,d,e){a.Wa=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Ja)),b=null);b?(a.P=b,a.oa=c,a.X=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Ja),a.Va||e),this.A&&Sc(this.A)):a.ya=!1;a.Va&&(a.Va=!1,--this.o||D(this));Ag(this,a.Ja)}; +function Eg(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}Ib(this.v,jd(this.c,f),p|t<<8);if(jc(this.v)){k=8192;break}f+=2;e--;if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +h.Qc=function(a,b,c,d,e,f,g){var k=0;a=a.P;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Kb(this.v,jd(this.c,f));if(jc(this.v)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; h.Oc=function(a,b,c,d,e,f){this.m=f&65535;this.a=this.a&-49|f>>12&48;this.h=f>>16&63;this.g=this.f=b<<7|(c?64:0)|d&63;this.i=65536-e&65535;a&&(this.a=this.a|a|32768);return!0};h.Zd=function(){return this.a&65535}; -h.jf=function(a){this.a=this.a&-1023|a&1022;this.h=this.h&60|(a&48)>>4;if(!(this.a&128)){a=!0;var b,c=this.b[(this.a&768)>>8],d=c.T,e,f,g;this.a&=-2;switch(this.a&14){case 4:this.i&8&&(this.a&=63);this.i=c.status|this.g&64|(d&&512==d.J?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.g=this.f&4?this.g+b:this.g-b,this.f=this.g=this.g&65408|c);break;case 8:this.i=this.g;break;case 12:b=this.uc;case 10:b||(b=this.Qc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.J||g>=d.M? +h.jf=function(a){this.a=this.a&-1023|a&1022;this.h=this.h&60|(a&48)>>4;if(!(this.a&128)){a=!0;var b,c=this.b[(this.a&768)>>8],d=c.P,e,f,g;this.a&=-2;switch(this.a&14){case 4:this.i&8&&(this.a&=63);this.i=c.status|this.g&64|(d&&512==d.J?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.g=this.f&4?this.g+b:this.g-b,this.f=this.g=this.g&65408|c);break;case 8:this.i=this.g;break;case 12:b=this.uc;case 10:b||(b=this.Qc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.J||g>=d.M? this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Oc.bind(this)))}a&&(this.a|=129,this.a&64&&N(this.c,this.Ka))}};h.Xd=function(){return this.m};h.gf=function(a){this.m=a&65534};h.$d=function(){return this.f};h.kf=function(a){this.f=a};h.ae=function(){return this.i};h.lf=function(a){this.i=a};h.Yd=function(){return this.h};h.hf=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4}; -var Cg="",Dg="?",Eg="??",Ig={},Ag=(Ig[63744]=[null,null,P.prototype.Zd,P.prototype.jf,"RLCS"],Ig[63746]=[null,null,P.prototype.Xd,P.prototype.gf,"RLBA"],Ig[63748]=[null,null,P.prototype.$d,P.prototype.kf,"RLDA"],Ig[63750]=[null,null,P.prototype.ae,P.prototype.lf,"RLMP"],Ig[63752]=[null,null,P.prototype.Yd,P.prototype.hf,"RLBE"],Ig); -function Jg(a,b,c){r.call(this,"Computer",a,0,33554432);this.l.S=!1;this.G=null;Kg(this,b);this.D=Kc(this,"autoPower",a,6);this.g=0;this.K=+a.busWidth||+a.buswidth;this.v=this.s=this.w=null;this.o=this.I=!1;this.i=this.h=null;this.H=this.m=this.F=!1;this.L=Kc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Lg(this);if(this.c=wa("CPU",this.id)){this.C=wa("Debugger",this.id);this.u=new Nb({id:this.Na+".bus",busWidth:this.K},this.c,this.C);var d,e=y(this.id);if((this.f=wa("Panel",this.id))&&this.f.bb)for(b= -0;b\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bMg){if(Ng(d,this.v)){this.h=new J(this,"1.32.2",Wg);Ng(this.h)&&(Xg(this,d),a=Yg,ah(this.h));this.h.set(Tg,Ja());bh(this.h);var e=this.a&&!this.o;if(a==Ug||ua("Click OK to restore the previous "+db+" machine state, or CANCEL to reset the machine.")){if(c=Sg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ng(d,g):("error"==f&&"no machine state"!= -g?(this.B("Error: "+g),"unable to verify user"==g&&(Pa(ch,""),this.b=null)):this.X(f+": "+g),ah(d),Ng(d)?(c=Sg(d),e=!0):c=!1))}e&&Qg(this,c?d:null)}else a==Yg&&d.clear()}else Qg(this);delete this.v;delete this.i}e=y(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.l.S=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.c&&(dh(this,this.c,b,c,a),Db(this),this.c.ba());this.F&&(Xg(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; -function Xg(a,b){if(ua("There may be a problem with your "+db+" machine.\n\nTo help us diagnose it, click OK to send this "+db+" machine state to http://www.pcjs.org.")){var c=a.L;a=a.b||"";b=b.toString();var d={};d.app=db;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;G("http://www.pcjs.org/api/v1/report",d,!0)}} -function eh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new J(a,"1.32.2"),g=new J(a,"1.32.2",Rg),k=Ja();g.set(Tg,k);f.set(Tg,k);f.set(fh,"1.32.2");f.set(gh,window?window.location.href:null);f.set(hh,window?window.navigator.userAgent:"");a.c&&a.c.da&&(c&&(b&&(a.c.l.ba=a.c.l.N),H(a.c)),d=a.c.da(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.l.S=!1,!1===d&&(e=null)));for(var k=y(a.id),l=0;l=d||30<=(c.hc+=d))&&(e.textContent=c.l.N?c.Oa.toFixed(2)+"Mhz":"Stopped",c.hc=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.l.N;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;ef.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");G(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);ph(a,b,c)}})}else c(a,null)} -function qh(a,b,c,d){function e(a){if(void 0===k){var b=g&&C(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Fa(a))}function f(a){e("Error: "+a);l&&(--mh||Za(!0));l=!1}var g,k,l=!0;mh++;sa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?nh(c,null,null,!1,e,function(d,l){l?(ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--mh||Za(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--mh||Za(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?nh(b,a,d,!0,e,m):oh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(x){f(x.message)}return l}window.embedPDP11=function(a,b,c,d){Za(!1);return qh(a,b,c,d)};window.findMachineComponent=function(a,b){return wa(b,a+".machine")};window.enableEvents=Za;window.sendEvent=ab;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map +var Fg="",Gg="?",Hg="??",Lg={},Dg=(Lg[63744]=[null,null,P.prototype.Zd,P.prototype.jf,"RLCS"],Lg[63746]=[null,null,P.prototype.Xd,P.prototype.gf,"RLBA"],Lg[63748]=[null,null,P.prototype.$d,P.prototype.kf,"RLDA"],Lg[63750]=[null,null,P.prototype.ae,P.prototype.lf,"RLMP"],Lg[63752]=[null,null,P.prototype.Yd,P.prototype.hf,"RLBE"],Lg); +function Mg(a,b,c){r.call(this,"Computer",a,0,33554432);this.l.T=!1;this.G=null;Ng(this,b);this.C=Lc(this,"autoPower",a,6);this.g=0;this.K=+a.busWidth||+a.buswidth;this.u=this.s=this.w=null;this.o=this.I=!1;this.i=this.h=null;this.H=this.m=this.F=!1;this.L=Lc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Og(this);if(this.c=wa("CPU",this.id)){this.D=wa("Debugger",this.id);this.v=new Ob({id:this.Na+".bus",busWidth:this.K},this.c,this.D);var d,e=y(this.id);if((this.f=wa("Panel",this.id))&&this.f.bb)for(b= +0;b\nLicense: GPL version 3 or later ");this.Z("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bPg){if(Qg(d,this.u)){this.h=new H(this,"1.32.2",Zg);Qg(this.h)&&($g(this,d),a=ch,dh(this.h));this.h.set(Wg,Ja());eh(this.h);var e=this.a&&!this.o;if(a==Xg||ua("Click OK to restore the previous "+db+" machine state, or CANCEL to reset the machine.")){if(c=Vg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Qg(d,g):("error"==f&&"no machine state"!= +g?(this.B("Error: "+g),"unable to verify user"==g&&(Pa(fh,""),this.b=null)):this.Z(f+": "+g),dh(d),Qg(d)?(c=Vg(d),e=!0):c=!1))}e&&Tg(this,c?d:null)}else a==ch&&d.clear()}else Tg(this);delete this.u;delete this.i}e=y(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.l.T=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.c&&(gh(this,this.c,b,c,a),Gb(this,-2),this.c.da());this.F&&($g(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; +function $g(a,b){if(ua("There may be a problem with your "+db+" machine.\n\nTo help us diagnose it, click OK to send this "+db+" machine state to http://www.pcjs.org.")){var c=a.L;a=a.b||"";b=b.toString();var d={};d.app=db;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;G("http://www.pcjs.org/api/v1/report",d,!0)}} +function hh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new H(a,"1.32.2"),g=new H(a,"1.32.2",Ug),k=Ja();g.set(Wg,k);f.set(Wg,k);f.set(ih,"1.32.2");f.set(jh,window?window.location.href:null);f.set(kh,window?window.navigator.userAgent:"");a.c&&a.c.fa&&(c&&(b&&(a.c.l.da=a.c.l.N),I(a.c)),d=a.c.fa(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.l.T=!1,!1===d&&(e=null)));for(var k=y(a.id),l=0;l=d||30<=(c.hc+=d))&&(e.textContent=c.l.N?c.Oa.toFixed(2)+"Mhz":"Stopped",c.hc=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.l.N;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");G(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);sh(a,b,c)}})}else c(a,null)} +function th(a,b,c,d){function e(a){if(void 0===k){var b=g&&C(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Fa(a))}function f(a){e("Error: "+a);l&&(--ph||Za(!0));l=!1}var g,k,l=!0;ph++;sa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?qh(c,null,null,!1,e,function(d,l){l?(ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--ph||Za(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--ph||Za(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?qh(b,a,d,!0,e,m):rh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(x){f(x.message)}return l}window.embedPDP11=function(a,b,c,d){Za(!1);return th(a,b,c,d)};window.findMachineComponent=function(a,b){return wa(b,a+".machine")};window.enableEvents=Za;window.sendEvent=ab;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map From 284c2cd76bc57f7978e8ef4ae749a2fb130ee7f8 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Thu, 26 Jan 2017 11:28:59 -0800 Subject: [PATCH 07/15] Fixed Panel update on a reset --- modules/pdp11/lib/cpustate.js | 9 +- modules/pdp11/lib/panel.js | 5 +- modules/pdp11/lib/ram.js | 14 +- versions/pdpjs/1.32.2/pdp11-dbg.js | 172 +++++------ versions/pdpjs/1.32.2/pdp11.js | 440 ++++++++++++++--------------- 5 files changed, 321 insertions(+), 319 deletions(-) diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 5e2d21f60..dd939c6bb 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -593,17 +593,20 @@ class CPUStatePDP11 extends CPUPDP11 { if (!this.isRunning()) this.startCPU(); } else { - if (this.dbg) { + if (this.dbg && this.flags.powered) { /* * TODO: Review the decision to always stop the CPU if the Debugger is loaded. Note that - * when stopCPU() stops a running CPU, the Debugger gets notified, so again, no need to notify it here. + * when stopCPU() stops a running CPU, the Debugger gets notified, so no need to notify it again. * * TODO: There are more serious problems to deal with if another component is slamming a new PC down * the CPU's throat (presumably while also dropping some new code into RAM) while the CPU was still running; * we should probably force a complete reset if the CPU is running, but for now, it's up to the user * to hit the reset button themselves. */ - if (!this.stopCPU()) this.dbg.updateStatus(); + if (!this.stopCPU()) { + this.dbg.updateStatus(); + this.cmp.updateDisplays(-1); + } } else if (fStart === false) { this.stopCPU(); diff --git a/modules/pdp11/lib/panel.js b/modules/pdp11/lib/panel.js index b13f33f51..464788513 100644 --- a/modules/pdp11/lib/panel.js +++ b/modules/pdp11/lib/panel.js @@ -533,12 +533,9 @@ class PanelPDP11 extends Component { displayValue(sLabel, nValue, cch) { if (this.bindings[sLabel]) { - if (nValue === undefined) { - this.setError("Value for " + sLabel + " is invalid"); - this.cpu.stopCPU(); - } var sVal; var nBase = this.dbg && this.dbg.nBase || 8; + nValue = nValue || 0; if (!this.cpu.isRunning() || this.fDisplayLiveRegs) { sVal = nBase == 8? Str.toOct(nValue, cch) : Str.toHex(nValue, cch); } else { diff --git a/modules/pdp11/lib/ram.js b/modules/pdp11/lib/ram.js index 87a4264fe..b7d066a11 100644 --- a/modules/pdp11/lib/ram.js +++ b/modules/pdp11/lib/ram.js @@ -137,12 +137,14 @@ class RAMPDP11 extends Component { */ delete this.aSymbols; } - /* - * The Computer powers up the CPU last, at which point CPUState state is restored, - * which includes the Bus state, and since we use the Bus to allocate all our memory, - * memory contents are already restored for us, so we don't need the usual restore - * logic. - */ + if (!fRepower) { + /* + * Since we use the Bus to allocate all our memory, memory contents are already restored for us, + * so we don't save any state, and therefore no state should be restored. Just do a reset(). + */ + this.assert(!data); + this.reset(); + } return true; } diff --git a/versions/pdpjs/1.32.2/pdp11-dbg.js b/versions/pdpjs/1.32.2/pdp11-dbg.js index 36962eb9a..e37b8beb7 100644 --- a/versions/pdpjs/1.32.2/pdp11-dbg.js +++ b/versions/pdpjs/1.32.2/pdp11-dbg.js @@ -37,14 +37,14 @@ function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol(" function p(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}for(var ka=ba,la=["Math","log2"],ma=0;ma":62,"?":63,"@":64,Jc:65,qg:66,sg:67,Pg:68,E:69,Qg:70,Rg:71,Sg:72,Tg:73,Ug:74,Vg:75,Wg:76,Xg:77,Yg:78,Zg:79,$g:80,Q:81,ah:82,bh:83,dh:84,eh:85,fh:86,gh:87,hh:88,ih:89,Gd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,jh:97,kh:98,lh:99,d:100,e:101,mh:102,nh:103,oh:104,ph:105,sh:106,k:107,th:108,uh:109,n:110,vh:111,p:112,q:113,r:114,wh:115,t:116,yh:117,zh:118,Ah:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,xd:127};function q(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Sc=b.comment;this.Fd=b;this.exports={};this.C=this.bindings={};a=this.id.indexOf(".");0>a?this.nb=this.id:(this.ob=this.id.substr(0,a),this.nb=this.id.substr(a+1));this.A={ready:!1,gb:!1,Ac:!1,ha:!1,error:!1};this.hc=null;this.A.error=!1;this.ja=d||0;this.G=this.f=this.D=this.J=this.Pa=null;ua.push(this)}function va(a,b,c){xa[a]&&b&&(xa[a][b]=c)} +"|":124,"}":125,"~":126,xd:127};function q(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Sc=b.comment;this.Fd=b;this.exports={};this.C=this.bindings={};a=this.id.indexOf(".");0>a?this.nb=this.id:(this.ob=this.id.substr(0,a),this.nb=this.id.substr(a+1));this.A={ready:!1,gb:!1,Ac:!1,fa:!1,error:!1};this.hc=null;this.A.error=!1;this.ja=d||0;this.G=this.f=this.D=this.J=this.Pa=null;ua.push(this)}function va(a,b,c){xa[a]&&b&&(xa[a][b]=c)} function ya(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function za(a){var b=!1;window&&(b=window.confirm(a));return b}function Aa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;bb?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function cb(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function db(a,b){var c,d={ca:null,ga:null,Ba:null,Aa:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Ba=g.load;d.Aa=g.exec;if(e=g.bytes)d.ca=e;else if(e=g.words)for(d.ca=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ca=Array(4*e.length),f=c=0;c>8&255,d.ca[f++]=e[c]>>16&255,d.ca[f++]=e[c]>>24&255;else d.ca=g;d.ga=g.symbols;d.ca.length?1==d.ca.length&&(v(d.ca[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Ba=g.load;d.Aa=g.exec;if(e=g.bytes)d.ca=e;else if(e=g.words)for(d.ca=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ca=Array(4*e.length),f=c=0;c>8&255,d.ca[f++]=e[c]>>16&255,d.ca[f++]=e[c]>>24&255;else d.ca=g;d.ha=g.symbols;d.ca.length?1==d.ca.length&&(v(d.ca[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.b["S"+a]=[0,0,!1,!1,this.Zd,a];this.G=this.f=this.D=this.J=null;A(this)}p(Tb,q);h=Tb.prototype; +function Tb(a,b){q.call(this,"Panel",a,0,512);this.j=this.u=0;this.M=b;this.ga=this.g=this.Ta=this.Sa=0;this.B=this.F=-1;this.H=this.I=this.w=!1;this.L=Ub;this.i={};this.b={START:[1,1,!0,!1,this.Xd],STEP:[1,1,!1,!1,this.Yd],ENABLE:[1,1,!1,!1,this.Td],CONT:[1,1,!0,!1,this.Rd],DEP:[0,0,!0,!1,this.Sd],EXAM:[1,1,!0,!1,this.Ud],LOAD:[1,1,!0,!1,this.Wd],TEST:[0,0,!0,!1,this.Vd]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.Zd,a];this.G=this.f=this.D=this.J=null;A(this)}p(Tb,q);h=Tb.prototype; h.reset=function(){this.stop();Vb(this,this.Sa=0)}; h.sa=function(a,b,c,d){if(this.J&&this.J.sa(a,b,c,d)||this.f&&this.f.sa(a,b,c,d)||this.G&&this.G.sa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.C[b]=c,this.u++,!0;default:return"led"==a||"rled"==a?(this.C[b]=c,this.i[b]=d?1:0,this.u++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.C[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, b){return function(){Wb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Xb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Wb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Xb(a,b)}}(this,b),!0):q.prototype.sa.call(this,a,b,c,d)}};h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;Yb(b,this,Zb);$b(b,this.reset.bind(this));ac(this);bc(this)}; -h.ya=function(a,b){if(!b)if(this.M&&cc(),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.save=function(){var a=new J(this);a.set(0,[this.fa,this.Sa,this.Ta]);return a.data()};h.restore=function(a){if(a=a[0])dc(this,this.fa=a[0]),Vb(this,this.Sa=a[1]),ec(this,a[2]);return!0};function fc(a,b,c){if(a=a.C[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ac(a,b){for(var c in a.i)fc(a,c,null!=b?b:a.i[c])} -function gc(a,b,c){if(a=a.C[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function bc(a){for(var b in a.b)gc(a,b,a.b[b][1])}function hc(a,b,c,d){a.C[b]&&(void 0===c&&(Ea(a,"Value for "+b+" is invalid"),a.f.Z()),c=8==(a.G&&a.G.Ca||8)?H(c,d):I(c,d),a.C[b].textContent!=c&&(a.C[b].textContent=c))}function Wb(a,b){var c=a.b[b];gc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=ic&&(a.H=b==jc,a.I=b==kc)} -function Xb(a,b){var c=a.b[b];c[2]&&c[3]&&(gc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Xd=function(a){a||this.f.A.U||(a=this.f,a.D.reset(),lc(a),this.b[mc]&&this.b[mc][1]&&nc(this.f))};h.Yd=function(){};h.Td=function(a){a||this.f.Z()}; -h.Rd=function(a){if(!a&&!this.f.A.U)if(this.b[mc]&&this.b[mc][1])nc(this.f);else{if((a=this.G)&&!La(a,!0))Ma(a,!0),oc(a,0,null),Ma(a,!1);else try{var b=this.f.ec(1);0=a.f.ka?8:16,c=65472<=a.fa&&a.fa<65472+b,b=c?1:2,c=c?15:a.D.I;a.b[ic]&&a.b[ic][1]||(b=-b);dc(a,a.fa&~c|a.fa+b&c)} -function dc(a,b){a.fa=b&a.D.I;if(a.B!==a.fa){a.B=a.fa;b=a.B;for(var c=0;22>c;c++)Ic(a,"A"+c,b&1<c;c++)Ic(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<=a.f.ka?8:16,c=65472<=a.ga&&a.ga<65472+b,b=c?1:2,c=c?15:a.D.I;a.b[ic]&&a.b[ic][1]||(b=-b);dc(a,a.ga&~c|a.ga+b&c)} +function dc(a,b){a.ga=b&a.D.I;if(a.B!==a.ga){a.B=a.ga;b=a.B;for(var c=0;22>c;c++)Ic(a,"A"+c,b&1<c;c++)Ic(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.H=this.M/this.j|0;this.T=this.H-1;this.Ma=[];this.ma=0;this.F=!1;this.O=[];this.Hd=[Oc,Pc,Qc,Rc];this.b=this.u=[];this.B=this.L=this.w=this.P=this.R=0;a=new M(this);Sc(a,this.G);this.b=Array(this.H);this.u=Array(this.H);for(b=0;b>>this.g;this.L=0;this.w=this.I;A(this)}p(Mc,q);function Vc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.u[a.R]=a.b[a.P])}}h=Mc.prototype;h.reset=function(){for(var a=0;a=a.Db&&(a.Db+=a.Cb,c=!0);0<=a.Eb&&a.Eb<=fe(a)&&(a.Cb=a.Eb=-1,be(a),a.Z(),c=!0);c&&a.v(fe(a)+" cycles: checksum="+I(a.Ub))}} -h.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.C[b]=c,!0;case "run":return this.C[b]=c,c.onclick=function(){var a;if(a=d.J)if(a=d.J,a.A.ha)a=!0;else{var b=null,c,k=Aa(a.id);for(c=0;c=a.Db&&(a.Db+=a.Cb,c=!0);0<=a.Eb&&a.Eb<=fe(a)&&(a.Cb=a.Eb=-1,be(a),a.ba(),c=!0);c&&a.v(fe(a)+" cycles: checksum="+I(a.Ub))}} +h.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.C[b]=c,!0;case "run":return this.C[b]=c,c.onclick=function(){var a;if(a=d.J)if(a=d.J,a.A.fa)a=!0;else{var b=null,c,k=Aa(a.id);for(c=0;ca.pb/a.qb?b=1:d=!0;a.eb=b;b=a.wc*a.eb;if(a.qb!=b){a.qb=b;b=a.qb.toFixed(2)+"Mhz";var e=a.C.setSpeed;e&&(e.textContent=b);a.v("target speed: "+b)}c&&a.J&&je(a.J)}qc(a,a.Va);a.Va=0;a.Ua=ya();a.bb=0;he(a);return d}function hd(a,b){var c=a.ia.length;a.ia.push([-1,b]);return c}function jd(a,b,c,d){0<=b&&ba.ia[b][0])&&(c=a.pc*a.eb/1E3*c|0,a.A.U&&(c+=ke(a)),a.ia[b][0]=c)} function le(a,b){for(var c=a.ia.length-1;0<=c;c--){var d=a.ia[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function me(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ke(a,b){var c=a.cb-=a.b;a.b=a.la=0;b&&(a.cb=0);return c} -h.gf=function(){if(this.A.U){this.qc>=this.pc&&he(this,!0);this.Fb=0;this.Tb=ya();if(this.bb){var a=this.Tb-this.bb;a>this.xc&&(this.Ua+=a,this.Ua>this.Tb&&(this.Ua=this.Tb))}try{do{var b=le(this,this.A.Bb?1:this.Xb);try{this.ec(b)}catch(e){if("number"!=typeof e)throw e;}b=ke(this,!0);this.Fb+=b;this.Va+=b;rc(this,b);pc(this,b);this.tb-=b;if(0>=this.tb){this.tb+=this.Xb;++this.yc>=ne&&(this.J&&L(this.J,void 0),this.yc=0);break}}while(this.A.U)}catch(e){this.Z();this.J&&this.J.stop(ya(),fe(this)); +h.gf=function(){if(this.A.U){this.qc>=this.pc&&he(this,!0);this.Fb=0;this.Tb=ya();if(this.bb){var a=this.Tb-this.bb;a>this.xc&&(this.Ua+=a,this.Ua>this.Tb&&(this.Ua=this.Tb))}try{do{var b=le(this,this.A.Bb?1:this.Xb);try{this.ec(b)}catch(e){if("number"!=typeof e)throw e;}b=ke(this,!0);this.Fb+=b;this.Va+=b;rc(this,b);pc(this,b);this.tb-=b;if(0>=this.tb){this.tb+=this.Xb;++this.yc>=ne&&(this.J&&L(this.J,void 0),this.yc=0);break}}while(this.A.U)}catch(e){this.ba();this.J&&this.J.stop(ya(),fe(this)); Ea(this,e.stack||e.message);return}if(this.A.U){a=setTimeout;b=this.Xc;this.bb=ya();var c=this.xc;this.Fb&&(c=Math.round(c*this.Fb/this.Xb));var c=c-(this.bb-this.Tb),d=this.bb-this.Ua;d&&(this.pb=Math.round(this.Va/(10*d))/100,864E5<=d&&(this.fb=0,ge(this)));if(0>c||this.pbc&&(this.Ua-=c),c=0;this.qc+=this.Fb;this.bb+=c;a(b,c)}}}; -function nc(a,b){if(!Ja(a))if(a.A.U)a.v(a.toString()+" busy");else{ge(a);a.A.U=!0;a.A.lc=!0;var c=a.C.run;c&&(c.textContent="Halt");a.J&&(b&&je(a.J,!0),a.J.start(a.Ua,fe(a)));a.G||a.status("Started");setTimeout(a.Xc,0)}}h.ec=function(){return 0};h.Z=function(a){var b=!1;if(this.A.U){ke(this);qc(this,this.Va);this.Va=0;this.A.U=!1;if(b=this.C.run)b.textContent="Run";this.J&&this.J.stop(ya(),fe(this));b=!0;this.G||this.status("Stopped")}this.A.complete=a;return b};var ie=30,ne=15,Zd=["power","reset"]; +function nc(a,b){if(!Ja(a))if(a.A.U)a.v(a.toString()+" busy");else{ge(a);a.A.U=!0;a.A.lc=!0;var c=a.C.run;c&&(c.textContent="Halt");a.J&&(b&&je(a.J,!0),a.J.start(a.Ua,fe(a)));a.G||a.status("Started");setTimeout(a.Xc,0)}}h.ec=function(){return 0};h.ba=function(a){var b=!1;if(this.A.U){ke(this);qc(this,this.Va);this.Va=0;this.A.U=!1;if(b=this.C.run)b.textContent="Run";this.J&&this.J.stop(ya(),fe(this));b=!0;this.G||this.status("Stopped")}this.A.complete=a;return b};var ie=30,ne=15,Zd=["power","reset"]; function oe(a){var b=+a.model||1170;Yd.call(this,a,6666667);this.ka=b;this.Rc=+a.addrReset||0;this.Wa=this.w=this.O=this.F=this.H=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Ga=this.ac=[];this.ab=this.P=this.Qc=this.Ia=this.lb=this.rb=this.Fa=this.R=this.$b=this.Xa=this.za=this.S=this.Gb=this.Hb=this.T=this.i=0;this.Tc=[4,2,0,1];this.bc=0;this.Uc=255;1120>=this.ka?(this.Pc=pe.bind(this),this.Ab=this.Ld,this.bc=8,this.Uc=-1,this.Zc=255,this.Yc=0):(this.Pc=qe.bind(this),this.Ab=this.Md, -this.Zc=~(1792|(1140>=this.ka?2048:0))&65535,this.Yc=1140=this.ka?2048:0))&65535,this.Yc=1140e.xb&&(e.xb=c,c+=4)}return Yd.prototype.ya.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.ka);this.A.U&&this.Z();this.F=65536;this.H=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Rc,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, -65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ga=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ac=[0,0,0,0,0,0,0,0];this.O=0;this.Wa=-1;this.u=this.j=this.oc=this.X=this.aa=this.i=this.$b=0;lc(this);ae(this);this.A.error=!1;Yd.prototype.reset.call(this)};function lc(a){a.S=0;a.Gb=0;a.Hb=0;a.T=0;a.R=0;a.Xa=0;a.za=255;a.Ia=0;a.lb=0;a.rb=0;a.Fa=262143;a.ab=a.g[7];a.P=0;a.V=null;a.D&&(re(a),a.Qc=cd(a.D))} +h.reset=function(){this.status("Model "+this.ka);this.A.U&&this.ba();this.F=65536;this.H=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Rc,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535, +65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ga=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ac=[0,0,0,0,0,0,0,0];this.O=0;this.Wa=-1;this.u=this.j=this.oc=this.X=this.Z=this.i=this.$b=0;lc(this);ae(this);this.A.error=!1;Yd.prototype.reset.call(this)};function lc(a){a.S=0;a.Gb=0;a.Hb=0;a.T=0;a.R=0;a.Xa=0;a.za=255;a.Ia=0;a.lb=0;a.rb=0;a.Fa=262143;a.ab=a.g[7];a.P=0;a.V=null;a.D&&(re(a),a.Qc=cd(a.D))} function re(a){a.Pb=a.sc;a.Qb=a.tc;a.mc=a.uc;a.Rb=a.vc;a.Yb&&(a.Pb=a.fd,a.Qb=a.ld);a.Zb&&(a.mc=a.pd,a.Rb=a.qd);a.Ia?(a.Ha=65536,a.mb=a.T&16?4186112:253952,a.Ea=a.kd,a.na=a.Yb?a.af:a.Fc,a.zb=a.Zb?a.ng:a.Ic,Vc(a.D,a.T&16?22:18)):(a.Ha=0,a.mb=57344,a.Ea=a.Od,a.na=a.Yb?a.$e:a.od,a.zb=a.Zb?a.mg:a.td,Vc(a.D,16))}function pd(a){var b=a.S;b&57344||(b=b&-3199|a.lb<<5|a.rb<<1);return b} function qd(a,b){b&=-3073;if(a.S!=b){b&57344&&!(a.S&57344)&&(a.Gb=a.P>>16&65535,a.Hb=a.P&65535);a.S=b;a.lb=(b&96)>>5;a.rb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ia!=c&&(a.Ia=c,re(a))}}function rd(a){a.S&57344||(a.Gb=a.P>>16&65535);a=a.Gb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function sd(a){a.S&57344||(a.Hb=a.P&65535);return a.Hb}function td(a,b){1170>a.ka&&(b&=-49);a.T!=b&&(a.T=b,a.Fa=b&16?4194303:262143,re(a))} -function se(a,b,c){a.Rc=b;te(a,b);wd(a,0);a.D.reset();lc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.U||nc(a)}else a.G?a.Z()||ce(a.G):!1===c&&a.Z();!a.A.U&&a.ua&&a.ua.stop()}h.gd=function(){return 0}; +function se(a,b,c){a.Rc=b;te(a,b);wd(a,0);a.D.reset();lc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.U||nc(a)}else a.G&&a.A.fa?a.ba()||(ce(a.G),L(a.J,-1)):!1===c&&a.ba();!a.A.U&&a.ua&&a.ua.stop()}h.gd=function(){return 0}; h.save=function(){var a=new J(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Ga,this.ac,this.R,this.$b,this.Xa,this.za,this.S,this.Gb,this.Hb,this.T,this.Ia,this.lb,this.rb,this.Fa,this.ab,this.i,this.P,this.Wa,this.cc,this.fc]);a.set(1,[vd(this)]);a.set(2,[this.fb,this.eb,this.A.va]);a.set(3,ue(this));a.set(4,me(this));return a.data()}; h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Ga=b.next().value;this.ac=b.next().value;this.R=b.next().value;this.$b=b.next().value;this.Xa=b.next().value;this.za=b.next().value;this.S=b.next().value;this.Gb=b.next().value;this.Hb=b.next().value;this.T=b.next().value;this.Ia=b.next().value;this.lb=b.next().value;this.rb=b.next().value;this.Fa=b.next().value;this.ab=b.next().value;this.i=b.next().value; this.P=b.next().value;this.Wa=b.next().value;this.cc=b.next().value;this.fc=b.next().value;b=a[1];wd(this,b[0]);b=a[2];this.fb=b[0];ge(this,b[1]);this.A.va=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>14&3;c=a.w>>14&3;a.O!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.O]);a.w=b;a.i&=-3;a.i|=a.V?2:1}function ud(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.Xa=b} h.Da=function(a){this.I=this.L=a;this.H=0};h.kb=function(a,b){this.I=this.L=this.F=a;this.H=b||0};function Ce(a,b){a.I=a.L=a.F=b;a.H=a.I^a.F>>1}function De(a,b,c,d){a.I=a.L=a.F=b;a.H=(c^d)&(d^b)} -h.ta=function(a,b,c){if(!this.oa){0>this.Wa?this.Wa=vd(this):this.O||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.R|=4,this.g[6]=a=4);if(-1!=c){this.P=a|4143316992;this.O=0;var d=this.na(a|this.Ha),e=this.na(a+2&65535|this.Ha);wd(this,e&-12289|this.Wa>>2&12288);Ee(this,this.Wa);Ee(this,this.g[7]);te(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Wa=-1;this.cc=c;this.fc=a;-1==c&&this.Z();if(-4<=c)throw a;}}; +h.ta=function(a,b,c){if(!this.oa){0>this.Wa?this.Wa=vd(this):this.O||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.R|=4,this.g[6]=a=4);if(-1!=c){this.P=a|4143316992;this.O=0;var d=this.na(a|this.Ha),e=this.na(a+2&65535|this.Ha);wd(this,e&-12289|this.Wa>>2&12288);Ee(this,this.Wa);Ee(this,this.g[7]);te(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Wa=-1;this.cc=c;this.fc=a;-1==c&&this.ba();if(-4<=c)throw a;}}; function Fe(a){var b=Ge(a),c=Ge(a);a.w&49152&&(c=c&-225|a.w&63712);te(a,b);wd(a,c);a.i&=-17}function He(a,b){var c=b>>13&31;31>c&&(b=a.T&32?a.Ga[c]+(b&8191)&4194303:b&-3932161);return b} function Ie(a,b,c){var d=[];if(c){c=He(a,b);var e=b>>13&31;d.push(c);d.push(e);a.T&32&&(d.push(a.Ga[e]),d.push(b&8191))}else if(a.Ia){var e=a.O<<1,f=b>>13;7>13;a.T&a.Tc[a.O]||(d&=7);e=a.B[a.O][d];f=(a.M[a.O][d]<<6)+(b&8191)&a.Fa;3932160<=f&&(f=He(a,f));if(a.oa)return f;f>=a.Qc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& @@ -151,27 +151,27 @@ function Je(a,b,c,d){var e,f,g=d&8?0:a.Ha;switch(b){case 0:return a.ta(4,0,-3),0 0,e),a.b-=6,e|g;case 7:return e=a.na(ze(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ha),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.P=a.P&65535|(a.P&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ld=function(a,b,c){!this.O&&0>=b&&c<=this.za&&(this.i|=32)};h.Md=function(a,b,c){this.O||(65534<=c&&(c|=-65536),a&4&&c<=this.za&&(c<=this.za-32?this.ta(4,0,-4):(this.R|=8,this.i|=32)))};h.fd=function(a){this.G&&Ud(this.G,a,1);return this.sc(a)};h.ld=function(a){this.G&&Ud(this.G,a,2);return this.tc(a)}; h.pd=function(a,b){this.G&&Vd(this.G,a,1);this.uc(a,b)};h.qd=function(a,b){this.G&&Vd(this.G,a,2);this.vc(a,b)};function Hc(a,b){a.oa++;b=a.D.dc(Fc(a,b,2));a.oa--;return b}function Ke(a,b){(b?--a.Zb:--a.Yb)||re(a)}h.Od=function(a,b,c){return Je(this,a,b,c)};h.kd=function(a,b,c){return Fc(this,Je(this,a,b,c),c)};h.od=function(a){return this.D.dc(this.ab=a)};h.$e=function(a){this.G&&Ud(this.G,a,2);return this.od(a)};h.Fc=function(a){return this.D.dc(this.ab=Fc(this,a,2))}; h.af=function(a){this.G&&Ud(this.G,a,2);return this.Fc(a)};h.td=function(a,b){this.D.Ob(this.ab=a,b)};h.mg=function(a,b){this.G&&Vd(this.G,a,2);this.td(a,b)};h.Ic=function(a,b){this.D.Ob(this.ab=Fc(this,a,4),b)};h.ng=function(a,b){this.G&&Vd(this.G,a,2);this.Ic(a,b)};function Le(a,b,c){var d=a.j=b&7;(b=a.u=(b&56)>>3)?(d=Je(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.O=a.w>>12&3,c=a.na(d|c&a.Ha),a.O=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} -function Me(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=Je(a,b,e,4),c&65536||(e&=65535),a.O=a.w>>12&3,e=Fc(a,e|c&65536,4),a.O=a.w>>14&3,a.Rb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Ne(a,b){b>>=6;var c=a.aa=b&7;return(b=a.X=(b&56)>>3)?a.Pb(a.Ea(b,c,3)):a.g[c+a.bc]&a.Uc}function Oe(a,b){var c;b>>=6;var d=a.aa=b&7;(b=a.X=(b&56)>>3)?c=a.Qb(a.Ea(b,d,2)):c=a.g[d+a.bc];return c}function kf(a,b){var c=a.j=b&7;b=a.u=(b&56)>>3;return Je(a,b,c,8)} +function Me(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=Je(a,b,e,4),c&65536||(e&=65535),a.O=a.w>>12&3,e=Fc(a,e|c&65536,4),a.O=a.w>>14&3,a.Rb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Ne(a,b){b>>=6;var c=a.Z=b&7;return(b=a.X=(b&56)>>3)?a.Pb(a.Ea(b,c,3)):a.g[c+a.bc]&a.Uc}function Oe(a,b){var c;b>>=6;var d=a.Z=b&7;(b=a.X=(b&56)>>3)?c=a.Qb(a.Ea(b,d,2)):c=a.g[d+a.bc];return c}function kf(a,b){var c=a.j=b&7;b=a.u=(b&56)>>3;return Je(a,b,c,8)} function lf(a,b){var c=a.j=b&7;return(b=a.u=(b&56)>>3)?a.Pb(a.Ea(b,c,3)):a.g[c]&255}function mf(a,b){var c,d=a.j=b&7;(b=a.u=(b&56)>>3)?c=a.Qb(a.Ea(b,d,2)):c=a.g[d];return c}function nf(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.oc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.mc(e,d.call(a,c,a.Pb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} function T(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,6),a.Rb(e,d.call(a,0>c?a.g[-c-1]:c,a.Qb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function of(a,b,c,d,e){var f=a.j=b&7;(b=a.u=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.mc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} function pf(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Rb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} -h.ec=function(a){this.A.complete=!0;var b=this.G?qf(this.G)?1:this.A.lc?-1:0:0,c=a?this.A.lc?0:1:-1;this.A.lc=!1;this.cb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(rf(this.G,this.g[7],c)){this.Z();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.Xa&224)>>5,f=this.V&&this.V.jb>e?this.V:null;f&&(d=f.xb,e=f.jb);e>(this.w&224)>>5?(this.i&8&&(ze(this,2),this.i&=-9),this.ta(d,0,-10),e=!0):e=!1;e&&(f&&Ae(this,f),a=!0);this.V||this.Xa||(this.i&=-3)}else this.i& -1&&this.i++;if(a){if(this.i&4&&rf(this.G,this.g[7],c)){this.Z();break}if(0>c)break}if(this.i&112&&Be(this)){if(this.i&4&&rf(this.G,this.g[7],c)){this.Z();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.Pc(f)}while(0>5,f=this.V&&this.V.jb>e?this.V:null;f&&(d=f.xb,e=f.jb);e>(this.w&224)>>5?(this.i&8&&(ze(this,2),this.i&=-9),this.ta(d,0,-10),e=!0):e=!1;e&&(f&&Ae(this,f),a=!0);this.V||this.Xa||(this.i&=-3)}else this.i& +1&&this.i++;if(a){if(this.i&4&&rf(this.G,this.g[7],c)){this.ba();break}if(0>c)break}if(this.i&112&&Be(this)){if(this.i&4&&rf(this.G,this.g[7],c)){this.ba();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.Pc(f)}while(0>1|b<<16;Ce(this,a);return a&65535}function xf(a,b){a=b&128|b>>1|b<<8;Ce(this,a<<8);return a&255}function yf(a,b){a=b&~a;this.Da(a);return a}function zf(a,b){a=b&~a;this.Da(a<<8);return a} function Af(a,b){a|=b;this.Da(a);return a}function Bf(a,b){a|=b;this.Da(a<<8);return a}function Cf(a,b){a=~b|65536;this.kb(a);return a&65535}function Df(a,b){a=~b|256;this.kb(a<<8);return a&255}function Ef(a,b){this.I=this.L=a=b-a;this.H=b&(b^a);return a&65535}function Ff(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.H=b&(b^c);return a&255}function Gf(a,b){this.I=this.L=a=b+a;this.H=a&(b^a);return a&65535}function Hf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.H=c&(b<<8^c);return a&255} function If(a,b){a=-b;this.kb(a,a&b&32768);return a&65535}function Jf(a,b){a=-b;this.kb(a<<8,(a&b&128)<<8);return a&255}function Kf(a,b){a=b<<1|this.F>>16&1;Ce(this,a);return a&65535}function Lf(a,b){a=b<<1|this.F>>16&1;Ce(this,a<<8);return a&255}function Mf(a,b){a=(this.F&65536|b)>>1|b<<16;Ce(this,a);return a&65535}function Nf(a,b){a=((this.F&65536)>>8|b)>>1|b<<8;Ce(this,a<<8);return a&255}function Of(a,b){var c=b-a;De(this,c,a,b);return c&65535} -function Pf(a,b){var c=b-a;De(this,c<<8,a<<8,b<<8);return c&255}function Qf(a,b){this.I=this.L=b&65280;this.H=this.F=0;return(b<<8|b>>8)&65535}function Rf(a,b){a^=b;this.Da(a);return a&65535}function Sf(a){T(this,a,Oe(this,a),sf);this.b-=this.u?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function Pf(a,b){var c=b-a;De(this,c<<8,a<<8,b<<8);return c&255}function Qf(a,b){this.I=this.L=b&65280;this.H=this.F=0;return(b<<8|b>>8)&65535}function Rf(a,b){a^=b;this.Da(a);return a&65535}function Sf(a){T(this,a,Oe(this,a),sf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} function Tf(a){var b=mf(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.F=this.H=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.H=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.u?6:7)+b} function Uf(a){var b=mf(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&=63;if(b&32){b=64-b;32>b-1;this.F=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.u?6:7)+b}function Vf(a){S(this,a,!ve(this))}function Wf(a){S(this,a,ve(this))} -function Xf(a){T(this,a,Oe(this,a),yf);this.b-=this.u?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Yf(a){nf(this,a,Ne(this,a),zf);this.b-=this.u?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Zf(a){T(this,a,Oe(this,a),Af);this.b-=this.u?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function $f(a){nf(this,a,Ne(this,a),Bf);this.b-=this.u?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} -function ag(a){var b=Oe(this,a);a=mf(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.u?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function bg(a){var b=Ne(this,a);a=lf(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.u?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function cg(a){S(this,a,xe(this))}function dg(a){S(this,a,!ye(this)==!we(this))}function eg(a){S(this,a,!xe(this)&&!ye(this)==!we(this))}function fg(a){S(this,a,!ve(this)&&!xe(this))} +function Xf(a){T(this,a,Oe(this,a),yf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Yf(a){nf(this,a,Ne(this,a),zf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Zf(a){T(this,a,Oe(this,a),Af);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function $f(a){nf(this,a,Ne(this,a),Bf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function ag(a){var b=Oe(this,a);a=mf(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function bg(a){var b=Ne(this,a);a=lf(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function cg(a){S(this,a,xe(this))}function dg(a){S(this,a,!ye(this)==!we(this))}function eg(a){S(this,a,!xe(this)&&!ye(this)==!we(this))}function fg(a){S(this,a,!ve(this)&&!xe(this))} function gg(a){S(this,a,xe(this)||!ye(this)!=!we(this))}function hg(a){S(this,a,ve(this)||xe(this))}function ig(a){S(this,a,!ye(this)!=!we(this))}function jg(a){S(this,a,ye(this))}function kg(a){S(this,a,!xe(this))}function lg(a){S(this,a,!ye(this))}function mg(){this.ta(12,0,-9)}function ng(a){S(this,a,!0)}function og(a){S(this,a,!we(this))}function pg(a){S(this,a,we(this))}function qg(a){a&1&&(this.F=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} -function rg(a){var b=Oe(this,a);a=mf(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;De(this,c,a,b);this.b-=this.u?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function sg(a){var b=Ne(this,a);a=lf(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);De(this,c,a,b);this.b-=this.u?4+(this.aa&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} +function rg(a){var b=Oe(this,a);a=mf(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;De(this,c,a,b);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function sg(a){var b=Ne(this,a);a=lf(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);De(this,c,a,b);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} function tg(a){var b=mf(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.H=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.H=32768,this.F=65536,this.b-=7}function ug(){this.ta(24,0,-9);this.b-=20} -function vg(){this.w&49152?(this.R|=128,this.ta(4,0,-8)):(this.ua&&1120==this.ka&&this.ua.setData(this.g[0],!0),this.G?wg(this.G):this.Z());this.b-=7}function xg(){this.ta(16,0,-9);this.b-=20}var yg=[0,7,7,10,7,11,9,13];function zg(a){this.la=this.b;te(this,kf(this,a));this.b=this.la-yg[this.u]}var Ag=[0,14,14,17,14,18,16,20];function Bg(a){this.la=this.b;var b=kf(this,a);a=a>>6&7;Ee(this,this.g[a]);this.g[a]=this.g[7];te(this,b);this.b=this.la-Ag[this.u]} -var Cg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Dg(a){var b=Oe(this,a);this.la=this.b;pf(this,a,b,this.Da);this.b=this.la-Cg[(this.X?8:0)+this.u]+(7!=this.j||this.u?0:2)}function Eg(a){var b=Ne(this,a);of(this,a,b,65535,this.Da);this.b-=this.u?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Fg=[7,13,13,17,14,18,17,21]; +function vg(){this.w&49152?(this.R|=128,this.ta(4,0,-8)):(this.ua&&1120==this.ka&&this.ua.setData(this.g[0],!0),this.G?wg(this.G):this.ba());this.b-=7}function xg(){this.ta(16,0,-9);this.b-=20}var yg=[0,7,7,10,7,11,9,13];function zg(a){this.la=this.b;te(this,kf(this,a));this.b=this.la-yg[this.u]}var Ag=[0,14,14,17,14,18,16,20];function Bg(a){this.la=this.b;var b=kf(this,a);a=a>>6&7;Ee(this,this.g[a]);this.g[a]=this.g[7];te(this,b);this.b=this.la-Ag[this.u]} +var Cg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Dg(a){var b=Oe(this,a);this.la=this.b;pf(this,a,b,this.Da);this.b=this.la-Cg[(this.X?8:0)+this.u]+(7!=this.j||this.u?0:2)}function Eg(a){var b=Ne(this,a);of(this,a,b,65535,this.Da);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Fg=[7,13,13,17,14,18,17,21]; function Gg(a){var b=mf(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.H=0;this.F=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)te(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Ng(a){T(this,a,Oe(this,a),Of);this.b-=this.u?9+(this.aa&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Og(a){T(this,a,0,Qf);this.b-=this.u?9:3+(7==this.j?2:0)}function Pg(){this.ta(28,0,-9)} +function Lg(a){a&1&&(this.F=65536);a&2&&(this.H=32768);a&4&&(this.L=0);a&8&&(this.I=32768);this.b-=5}function Mg(a){var b=(a&448)>>6;if(this.g[b]=this.g[b]-1&65535)te(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Ng(a){T(this,a,Oe(this,a),Of);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Og(a){T(this,a,0,Qf);this.b-=this.u?9:3+(7==this.j?2:0)}function Pg(){this.ta(28,0,-9)} function Qg(){this.ua&&(this.ua.Gc(this.g[7],!0),this.ua.setData(this.g[0],!0));this.i|=8;ze(this,-2);this.b-=3}function Rg(a){T(this,a,this.g[(a>>6&7)+this.bc],Rf);this.b-=this.u?9:3+(7==this.j?2:0)}function U(a){var b;if(b=this.G)b=this.G,B(b,1)?(C(b,"undefined opcode "+O(b,a),!0,!0),b=wg(b)):b=!1;b||this.ta(8,0,-9)}function pe(a){Sg[a>>12].call(this,a)}function Tg(a){Ug[a>>6&3].call(this,a)}function Vg(a){Wg[a>>6&3].call(this,a)}function Xg(a){Yg[a>>6&3].call(this,a)} function Zg(a){$g[a&15].call(this,a)}function ah(a){bh[a&15].call(this,a)}function ch(a){dh[a>>6&3].call(this,a)}function eh(a){fh[a>>6&3].call(this,a)}function gh(a){hh[a>>6&3].call(this,a)} var Sg=[function(a){ih[a>>8&15].call(this,a)},Dg,rg,ag,Xf,Zf,Sf,U,function(a){jh[a>>8&15].call(this,a)},Eg,sg,bg,Yf,$f,Ng,U],ih=[function(a){kh[a>>4&15].call(this,a)},ng,kg,cg,dg,ig,eg,gg,Bg,Bg,Tg,Vg,Xg,U,U,U],Ug=[function(a){pf(this,a,0,this.kb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,0,Cf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,1,Gf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,1,Ef);this.b-=this.u?9:3+(7==this.j?2:0)}],Wg=[function(a){T(this,a,0,If); @@ -182,19 +182,19 @@ a);this.kb(a<<8);this.b-=this.u?4:3+(7==this.j?2:0)}],hh=[function(a){nf(this,a, var mh=[function(a){nh[a>>8&15].call(this,a)},Dg,rg,ag,Xf,Zf,Sf,function(a){oh[a>>8&15].call(this,a)},function(a){ph[a>>8&15].call(this,a)},Eg,sg,bg,Yf,$f,Ng,U],nh=[function(a){qh[a>>4&15].call(this,a)},ng,kg,cg,dg,ig,eg,gg,Bg,Bg,Tg,Vg,Xg,function(a){rh[a>>6&3].call(this,a)},U,U],rh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.na(a|this.Ha);te(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Le(this,a,0);this.Da(a);Ee(this,a);this.b-=11},function(a){var b=Ge(this); this.la=this.b;this.Da(b);Me(this,a,0,b);this.b=this.la-Fg[this.u]},function(a){pf(this,a,ye(this)?65535:0,this.Da);this.b-=this.u?9:3+(7==this.j?2:0)}],qh=[function(a){sh[a&15].call(this,a)},U,U,U,zg,zg,zg,zg,Jg,function(a){!(a&8)||1145>this.ka?U.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},Zg,ah,Og,Og,Og,Og],sh=[vg,Qg,function(){Fe(this);this.i|=this.w&16;this.b-=13},mg,xg,Ig,Kg,function(a){U.call(this,a)},U,U,U,U,U,U,U,U],oh=[Gg,Gg,tg,tg,Tf,Tf,Uf,Uf, Rg,Rg,U,U,U,U,Mg,Mg],ph=[lg,jg,fg,hg,og,pg,Vf,Wf,ug,Pg,ch,eh,gh,function(a){1145>this.ka?U.call(this,a):th[a>>6&3].call(this,a)},U,U],th=[function(a){U.call(this,a)},function(a){a=Le(this,a,65536);this.Da(a);Ee(this,a);this.b-=11},function(a){var b=Ge(this);this.la=this.b;this.Da(b);Me(this,a,65536,b);this.b=this.la-Fg[this.u]},function(a){U.call(this,a)}]; -function uh(a){q.call(this,"ROM",a,0,128);this.ga=this.g=null;this.u=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Qa(this.j);if(this.j){a=this.j;var b=Ra(this.B);"json"!=b&&"hex"!=b&&(a=eb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;cb(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(va(c.ob,a,b),(a=db(a,b))?(c.g=a.ca,c.ga=a.ga):c.j=null);vh(c)})}}p(uh,q); -h=uh.prototype;h.wa=function(a,b,c,d){this.D=b;this.f=c;this.G=d;vh(this)};h.ya=function(){this.ga&&(this.G&&wh(this.G,this.id,this.u,this.b,this.ga),delete this.ga);return!0};h.xa=function(){return!0}; +function uh(a){q.call(this,"ROM",a,0,128);this.ha=this.g=null;this.u=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Qa(this.j);if(this.j){a=this.j;var b=Ra(this.B);"json"!=b&&"hex"!=b&&(a=eb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;cb(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(va(c.ob,a,b),(a=db(a,b))?(c.g=a.ca,c.ha=a.ha):c.j=null);vh(c)})}}p(uh,q); +h=uh.prototype;h.wa=function(a,b,c,d){this.D=b;this.f=c;this.G=d;vh(this)};h.ya=function(){this.ha&&(this.G&&wh(this.G,this.id,this.u,this.b,this.ha),delete this.ha);return!0};h.xa=function(){return!0}; function vh(a){if(!Ka(a)){if(a.j){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Ea(a,"ROM size ("+I(a.g.length,8,!0)+") does not match specified size ("+I(a.b,8,!0)+")");else{var b;a:{b=a.u;if(57344<=b&&b<57344+Nc){var c={},c=(c[b]=[uh.prototype.Me,uh.prototype.Xf,null,null,null,a.b>>1],c);if(Yb(a.D,a,c)){a.status("Added "+a.b+"-byte ROM at "+H(b));b=a.w=!0;break a}}else if(Tc(a.D,b,a.b,Jd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){C(a,"invalid block at offset "+Pa(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,E=r-=6;0=b.length){C(a,"insufficient data for block at offset "+Pa(n),4096); -break}m+=b[l++]&255;if(m&255){C(a,"invalid checksum ("+I(m,2,!0)+") for block at offset "+Pa(n),4096);break}if(E)for(C(a,"loading "+Pa(E)+" bytes at "+Pa(u)+"-"+Pa(u+E),4096);E--;)bd(a.D,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&C(a,"starting address: "+Pa(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=ta.Jc&&c<=ta.Gd&&(b=c-(ta.Jc-ta.ud));b&&(a.preventDefault&&a.preventDefault(),d.ic(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ta.wd&&(b=ta.vd);d.ic(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ic(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;var e=this;this.R=kd(this.f,this.M?-1:48,4,262144);this.S=hd(this.f,function(){var a;a=-1;e.i.length&&(a=e.i.shift()&255,C(e,"receiveByte("+I(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),jd(e.f,e.S,1E3/Math.round(e.T/10)));0<=a&&(e.F=a,e.b&128?e.F|=49152:e.b|=128,e.b&64&&id(c,e.R))});this.O=kd(this.f,this.M?-1:52,4,262144);this.X=hd(this.f,function(){e.g|=128;e.g&64&&id(c,e.O)});Yb(b,this,Dh,this.M?64832+8*(this.M-1)-65392:0);$b(b,this.reset.bind(this)); @@ -203,7 +203,7 @@ h.ya=function(a,b){if(!b)if(this.md(this.I),!a)this.reset();else if(!this.restor h.ic=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Ya("",c)));this.V&&!this.B&&c&&(b=String.fromCharCode(this.V)+b);this.u.value+=b;this.u.scrollTop=this.u.scrollHeight;this.B+=c}}else if(null!=this.w){if(10== -a||1024<=this.w.length)this.v(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}jd(this.f,this.X,1E3/Math.round(this.aa/10));this.g&=-129};var Ch="buffer",Fh={},Dh=(Fh[65392]=[null,null,Bh.prototype.ze,Bh.prototype.Kf,"RCSR"],Fh[65394]=[null,null,Bh.prototype.ye,Bh.prototype.Jf,"RBUF"],Fh[65396]=[null,null,Bh.prototype.ef,Bh.prototype.pg,"XCSR"],Fh[65398]=[null,null,Bh.prototype.df,Bh.prototype.og,"XBUF"],Fh); +a||1024<=this.w.length)this.v(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}jd(this.f,this.X,1E3/Math.round(this.Z/10));this.g&=-129};var Ch="buffer",Fh={},Dh=(Fh[65392]=[null,null,Bh.prototype.ze,Bh.prototype.Kf,"RCSR"],Fh[65394]=[null,null,Bh.prototype.ye,Bh.prototype.Jf,"RBUF"],Fh[65396]=[null,null,Bh.prototype.ef,Bh.prototype.pg,"XCSR"],Fh[65398]=[null,null,Bh.prototype.df,Bh.prototype.og,"XBUF"],Fh); wb(function(){for(var a=y(document,x,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.C[b]=c,!0;case "readTape":e=Jh;case "loadTape":return e||(e=Kh),this.C[b]=c,c.onclick= @@ -212,23 +212,23 @@ h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;this.I=Nh(a);var e=th h.ya=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.F=0};function Th(a){a.g=0;var b=a.M.PTR;if(b){var c=b.path||"";if(!(b=b.name))a:{if((b=a.C.listTapes)&&b.options)for(var d=0;dc.indexOf("/api/v1/dump")&&(e=Ra(c),f="json"==e||"gz"==e?encodeURI(c):eb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!cb(f,null,!0,function(e,f,g){var k=0>g&&!!a.J&&!a.J.A.ha;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(va(a.ob,e,f),(e=db(e,f))&&Yh(a,b,c,d,e.ca,e.Ba, +function Xh(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),Yh(a,b,c,d,e),a.u=Rh);Vh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=Ra(c),f="json"==e||"gz"==e?encodeURI(c):eb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!cb(f,null,!0,function(e,f,g){var k=0>g&&!!a.J&&!a.J.A.fa;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(va(a.ob,e,f),(e=db(e,f))&&Yh(a,b,c,d,e.ca,e.Ba, e.Aa));a.A.gb=!1;a.g&&(a.g--,a.g||A(a));Vh(a)})}function Qh(a,b,c,d){if((a=a.C.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.Y);for(d=0;d>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.Y);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ra(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Sa(c,"/")&&(d="dir"),f=eb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.gc?"":e)+"&format=json"));return!!cb(f, null,!0,function(b,c,d){fi(a,b,c,d)})} -function fi(a,b,c,d){var e=null,f=0>d&&!!a.J&&!a.J.A.ha;a.j=!1;if(d)a.controller.N('Unable to load disk "'+a.Na+'" (error '+d+": "+b+")",f);else{va(a.controller.ob,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.Y=k.length;a.ea=k[0].length;a.ba=k[0][0].length;var l=k[0][0][0];a.qa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;Ed&&!!a.J&&!a.J.A.fa;a.j=!1;if(d)a.controller.N('Unable to load disk "'+a.Na+'" (error '+d+": "+b+")",f);else{va(a.controller.ob,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)v(k[0]);else{a.Y=k.length;a.ea=k[0].length;a.aa=k[0][0].length;var l=k[0][0][0];a.qa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;E>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ja?f=a.Ra+a.Ja&&(a.Ja+=f-(a.Ra+a.Ja)+1):(a.Ra=f,a.Ja=1);d[f]=d[f]&~(255<g)break;e|=g<g)break;e|=g<=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.N("Unable to restore disk '"+this.Na+": "+c);return b}; h.toJSON=function(){var a;a=0;for(var b;b=hi(this,a++);)ki(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; @@ -240,7 +240,7 @@ break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.i&&( h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=li(this,$d(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.L[e]=a[e]);Ii(this);this.ib=kd(this.f,144,5,65536);Yb(b,this,Ji);$b(b,this.reset.bind(this));Ki(this,"None",Li,!0);this.M&&Ki(this,"Local Disk",Mi);Ki(this,"Remote Disk",Ni);Oi(this)||A(this)}; h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){this.u=[];for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Fi(this,0)}}return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Ii(this)}; h.save=function(){var a=new J(this);a.set(0,[this.I,this.g,this.b,this.B,this.w,this.j,this.H,Qi(this)]);return a.data()};h.restore=function(a){return Ii(this,a[0])}; -function Ii(a,b){b||(b=[2368,0,128,0,0,0,0]);var c=ja(b);a.I=c.next().value;a.g=c.next().value;a.b=c.next().value;a.B=c.next().value;a.w=c.next().value;a.j=c.next().value;a.H=c.next().value;b[7]&&(a.u=b[7]);for(b=0;bg||9e||e>=a.i.length)a.N("Unable to load the selected drive");else if(c)if(c==Mi)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Ni){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Qa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Si(a,e,b,c,!1,d)}else Pi(a,e)} @@ -248,11 +248,11 @@ function Si(a,b,c,d,e,f){var g=-1,k=a.i[b];k.ra.toLowerCase()!=d.toLowerCase()&& h.Ad=function(a,b,c,d,e){a.vb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.hb)),b=null);if(b){a.da=b;a.Na=c;a.ra=d;a:{var f;for(f=0;f=a.Y){m=64;break}n=a.seek(b,c,d+1);if(!n){m=4096;break}r=0;++d>=a.ba&&(d=0,++c>=a.ea&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=32;break}if(!k&&(Ec(this.D,He(this.f,f),u|t<<8),gd(this.D))){m=1024;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Bd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var n=null,r;a||(m=128,e=0);for(;e;){var u=Gc(this.D,He(this.f,f));if(gd(this.D)){m=1024;break}if(!n){if(b>=a.Y){m=64;break}n=a.seek(b,c,d+1,!0);if(!n){m=4096;break}r=0;++d>=a.ba&&(d=0,++c>=a.ea&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=32;break}if(u!=(t|E<<8)){m=1;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=32;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +function Ri(a,b,c){var d;for(d=0;d=a.Y){m=64;break}n=a.seek(b,c,d+1);if(!n){m=4096;break}r=0;++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=32;break}if(!k&&(Ec(this.D,He(this.f,f),u|t<<8),gd(this.D))){m=1024;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Bd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var n=null,r;a||(m=128,e=0);for(;e;){var u=Gc(this.D,He(this.f,f));if(gd(this.D)){m=1024;break}if(!n){if(b>=a.Y){m=64;break}n=a.seek(b,c,d+1,!0);if(!n){m=4096;break}r=0;++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=32;break}if(u!=(t|E<<8)){m=1;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=32;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; h.zd=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&-49|f>>12&48;this.B=65536-e&65535;this.j=this.j&-16|d&15;this.g|=a;Ti(this);return!0};function Ti(a){a.b&=-32769;a.g&&(a.g|=32768,a.b|=32768,a.g&32736&&(a.b|=16384),B(a)&&C(a,a.type+": ERROR: "+H(a.g)))}h.Ee=function(){return this.I};h.Pf=function(){};h.Fe=function(){return this.g};h.Qf=function(){};h.Be=function(){return this.b&61438}; h.Mf=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){a=!0;var b,c,d="",e=(this.j&57344)>>13,f=this.i[e],g,k,l,m,n,r;this.b&=-8321;this.g&=-4;switch(c=this.b&14){case 0:B(this)&&C(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=128;break;case 10:d="RCHK";case 4:d||(d="READ"),b=this.Vc;case 6:d||(d="WCHK");case 2:d||(d="WRITE");b||(b=this.Bd);g=(this.j&8160)>>5;k=(this.j&16)>>4;l=this.j&15;m=65536-this.B&65535;n=(this.b&48)<<12|this.w;r=this.b&2048?0:2;B(this)&&C(this,this.type+": "+ -d+"("+g+":"+k+":"+l+") "+H(n)+"--"+H(n+(m<<1)),!0,!0);if(g>=f.Y){this.g|=64;break}if(l>=f.ba){this.g|=32;break}a=b.call(this,f,g,k,l,m,n,r,6<=c,this.zd.bind(this));break;case 8:g=(this.j&8160)>>5;B(this)&&C(this,this.type+": SEEK("+g+")",!0);g=f.Y){this.g|=64;break}if(l>=f.aa){this.g|=32;break}a=b.call(this,f,g,k,l,m,n,r,6<=c,this.zd.bind(this));break;case 8:g=(this.j&8160)>>5;B(this)&&C(this,this.type+": SEEK("+g+")",!0);ga.Y||b.ea>a.ea)&&(this.N('Disk "'+c+'" function $i(a,b,c,d){if((a=a.C.listDisks)&&a.options){for(var e=0;e(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}Ec(this.D,He(this.f,f),n|r<<8);if(gd(this.D)){k=8192;break}f+=2;e--;if(m>=a.qa&&(l=null,++d>=a.ba&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Ed=function(a,b,c,d,e,f,g){var k=0;a=a.da;var l=null,m;a||(k=5120,e=0);for(;e;){var n=Gc(this.D,He(this.f,f));if(gd(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.qa&&(l=null,++d>=a.ba&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +function Yi(a,b){var c=0;b||(b=[]);a.b=b[c++]||129;a.B=b[c++]||0;a.i=b[c++]||0;a.j=b[c++]||0;a.w=b[c++]||0;a.u=b[c]||0;for(b=0;b(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}Ec(this.D,He(this.f,f),n|r<<8);if(gd(this.D)){k=8192;break}f+=2;e--;if(m>=a.qa&&(l=null,++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +h.Ed=function(a,b,c,d,e,f,g){var k=0;a=a.da;var l=null,m;a||(k=5120,e=0);for(;e;){var n=Gc(this.D,He(this.f,f));if(gd(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.qa&&(l=null,++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; h.Cd=function(a,b,c,d,e,f){this.B=f&65535;this.b=this.b&-49|f>>12&48;this.u=f>>16&63;this.j=this.i=b<<7|(c?64:0)|d&63;this.w=65536-e&65535;a&&(this.b=this.b|a|32768);return!0};h.Je=function(){return this.b&65535}; h.Uf=function(a){this.b=this.b&-1023|a&1022;this.u=this.u&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c="",d=this.g[(this.b&768)>>8],e=d.da,f,g,k;this.b&=-2;switch(this.b&14){case 4:this.w&8&&(this.b&=63);this.w=d.status|this.j&64|(e&&512==e.Y?128:0);break;case 6:1==(this.i&3)&&(b=this.i&65408,c=(this.i&16)<<2,this.j=this.i&4?this.j+b:this.j-b,this.i=this.j=this.j&65408|c);break;case 8:this.w=this.j;break;case 12:c="READ",b=this.Wc;case 10:c||(c="WRITE"),b||(b=this.Ed),f=this.i>>7,g=this.i&64?1:0,k= -this.i&63,!e||f>=e.Y||k>=e.ba?this.b|=37888:(a=65536-this.w&65535,e=(this.u&63)<<16|this.B,B(this)&&C(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+H(e)+"--"+H(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.Cd.bind(this)))}a&&(this.b|=129,this.b&64&&id(this.f,this.ib))}};h.He=function(){return this.B};h.Sf=function(a){this.B=a&65534};h.Ke=function(){return this.i};h.Vf=function(a){this.i=a};h.Le=function(){return this.w};h.Wf=function(a){this.w=a};h.Ie=function(){return this.u}; +this.i&63,!e||f>=e.Y||k>=e.aa?this.b|=37888:(a=65536-this.w&65535,e=(this.u&63)<<16|this.B,B(this)&&C(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+H(e)+"--"+H(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.Cd.bind(this)))}a&&(this.b|=129,this.b&64&&id(this.f,this.ib))}};h.He=function(){return this.B};h.Sf=function(a){this.B=a&65534};h.Ke=function(){return this.i};h.Vf=function(a){this.i=a};h.Le=function(){return this.w};h.Wf=function(a){this.w=a};h.Ie=function(){return this.u}; h.Tf=function(a){this.u=a&63;this.b=this.b&-49|(this.u&3)<<4};var aj="",bj="?",cj="??",gj={},Zi=(gj[63744]=[null,null,Gd.prototype.Je,Gd.prototype.Uf,"RLCS"],gj[63746]=[null,null,Gd.prototype.He,Gd.prototype.Sf,"RLBA"],gj[63748]=[null,null,Gd.prototype.Ke,Gd.prototype.Vf,"RLDA"],gj[63750]=[null,null,Gd.prototype.Le,Gd.prototype.Wf,"RLMP"],gj[63752]=[null,null,Gd.prototype.Ie,Gd.prototype.Tf,"RLBE"],gj); function hj(a){q.call(this,"Debugger",a);this.Ca=+a.base||16;this.ia=!1;this.w=0;this.P=!1;this.u=-1;this.j=[];this.T={}}p(hj,q);hj.prototype.hd=function(){return-1};hj.prototype.jd=function(){}; function ij(a,b,c,d){if(c)if(b){0>a.u&&a.j.length&&(a.u=0);if(0>a.u||b!=a.j[a.u])a.j.splice(0,0,b),a.u=0;a.u--}else a.P?b="end":b=a.j[a.u+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(Za(b.substring(c,f))),c=f+1}}return a} @@ -283,26 +283,26 @@ function kj(a,b,c){var d;if(b){b=lj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.spli d))}return d}function lj(a,b){for(var c,d=a.ia?"(":"{",e=a.ia?")":"}",f=new RegExp(a.ia?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=kj(a,c[1]);b=b.replace(d+c[1]+e,null!=g?O(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a} function mj(a,b,c,d){var e;null!=b?(e=a.hd(b),0<=e?e=a.jd(e):(e=a.T[b],null==e&&(e=G(b,a.Ca))),null!=e||d||a.v("invalid "+(c?c:"value")+": "+b)):d||a.v("missing "+(c||"value"));return e}function oj(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=4,g="";if(!f||4>=8;d=I(c,0,!0)+" "+c+". "+H(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.v((null!=b?b+": ":"")+d);return e} function pj(a,b){if(b)return oj(a,b,a.T[b]);var c=0;for(b in a.T)oj(a,b,a.T[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function qj(a){hj.call(this,a);this.Ea=!1;this.ia=!0;this.H=V();this.za=V();this.O=V();this.B=[];this.g=this.L=this.F=[];rj(this);this.R=this.W=0;this.i=[];this.oa=void 0;sj(this);this.G=this;this.ka={};this.ja=this.cd=0;this.S=null;this.M=[];tj(this,a.messages);this.ua=a.commands;this.Ha=uj;this.X=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.aa=this.la=0;this.b=this.V=null;var b=this;window?void 0===window[x]&&(window[x]=function(a){return ee(b,a)}):void 0===global[x]&&(global[x]= +function qj(a){hj.call(this,a);this.Ea=!1;this.ia=!0;this.H=V();this.za=V();this.O=V();this.B=[];this.g=this.L=this.F=[];rj(this);this.R=this.W=0;this.i=[];this.oa=void 0;sj(this);this.G=this;this.ka={};this.ja=this.cd=0;this.S=null;this.M=[];tj(this,a.messages);this.ua=a.commands;this.Ha=uj;this.X=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.Z=this.la=0;this.b=this.V=null;var b=this;window?void 0===window[x]&&(window[x]=function(a){return ee(b,a)}):void 0===global[x]&&(global[x]= function(a){return ee(b,a)})}p(qj,hj);function vj(a){a=a&&a.K;null==a&&(a=-1);return a}function V(a,b,c){return{K:void 0===a?null:a,Ka:void 0===b?!1:b,Qa:!1,Ca:c}}h=qj.prototype;h.Gc=function(a,b){a.K=b;a.Qa=!1;a.Ca=void 0;return a};function wj(a){return[a.K,a.Ka,a.Ca,a.Qa,a.jc]}function xj(a,b){var c=V(b[0],b[1],b[2]);c.Qa=b[3];b[4]&&(c.$c=ij(a,c.jc=b[4]));return c} h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.b=a.i;(a=$d(a,"messages"))&&tj(this,a);1140>this.f.ka&&(this.X=this.X.concat(yj));1145>this.f.ka&&(this.X=this.X.concat(zj));md(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=vj(Aj(d,c));if(-1===a){d.v("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.v("blockid physical blockaddr used size type");d.v("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.v("..."): (c=n.type,m=Zc[c],n&&d.v(I(n.id,8)+" %"+I(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -h.jd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Gj:b=vd(this.f);break;case Hj:b=c.Xa;break;case Ij:b=c.R;break;case Jj:b=c.za&65280;break;case Kj:b=pd(c);break;case Lj:b=rd(c);break;case Mj:b=sd(c);break;case Nj:b=c.T;break;case Oj:d&&(b=d.fa);break;case Pj:d&&(b=d.Sa);break;case Qj:d&&Jc(d)&&(b=d.Ta)}}return b}; -h.message=function(a,b){b&&(a+=" @"+Dj(this,V(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.ja&1073741824)this.M.push(a);else{var c;if(this.ja&-2147483648&&this.f&&(c=this.f.A.U)||La(this,!0))this.Z(),c&&(a+=" (cpu halted)");this.v(a);this.f&&(a=this.f,ke(a),a.tb=0,a.J&&L(a.J,void 0))}}; +h.jd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Gj:b=vd(this.f);break;case Hj:b=c.Xa;break;case Ij:b=c.R;break;case Jj:b=c.za&65280;break;case Kj:b=pd(c);break;case Lj:b=rd(c);break;case Mj:b=sd(c);break;case Nj:b=c.T;break;case Oj:d&&(b=d.ga);break;case Pj:d&&(b=d.Sa);break;case Qj:d&&Jc(d)&&(b=d.Ta)}}return b}; +h.message=function(a,b){b&&(a+=" @"+Dj(this,V(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.ja&1073741824)this.M.push(a);else{var c;if(this.ja&-2147483648&&this.f&&(c=this.f.A.U)||La(this,!0))this.ba(),c&&(a+=" (cpu halted)");this.v(a);this.f&&(a=this.f,ke(a),a.tb=0,a.J&&L(a.J,void 0))}}; function sj(a){var b;if(!qf(a))a.i&&a.i.length&&a.v("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Rj);for(b=0;b>8;a.v("trapped to "+O(a,c&255,1)+" ("+(0>d?Qb[-d]:O(a,d))+")")}a.H=V(a.f.g[7]);b&&1!=a.I?Vj(a):Wj(a)}}function Tj(a,b){var c;(c=!a.f||!Ka(a.f))||(c=a.f,c.A.ha?c=!0:(c.v(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.U?(b||a.v("cpu busy or unavailable, command ignored"),!1):!Ja(a.f)}h.ya=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; -h.xa=function(a,b){b&&this.v(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){sj(this);this.aa=0;this.S=null;this.w=0;this.H=V(this.f.g[7]);this.A.U=!1;Xj(this);a||ce(this)};h.save=function(){var a=new J(this);a.set(0,wj(this.H));a.set(1,wj(this.O));a.set(2,[this.j,this.P,this.ja]);a.set(3,this.B);return a.data()}; +function oc(a,b,c,d){if(!Tj(a))return!1;var e="";null===c&&(e=(c=!a.pa||"tr"==a.pa)?"tr":"t");a.w=0;b||qf(a)&&rf(a,a.f.g[7],0);try{b=le(a.f,b);var f=a.f.ec(b);0>8;a.v("trapped to "+O(a,c&255,1)+" ("+(0>d?Qb[-d]:O(a,d))+")")}a.H=V(a.f.g[7]);b&&1!=a.I?Vj(a):Wj(a)}}function Tj(a,b){var c;(c=!a.f||!Ka(a.f))||(c=a.f,c.A.fa?c=!0:(c.v(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.U?(b||a.v("cpu busy or unavailable, command ignored"),!1):!Ja(a.f)}h.ya=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; +h.xa=function(a,b){b&&this.v(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){sj(this);this.Z=0;this.S=null;this.w=0;this.H=V(this.f.g[7]);this.A.U=!1;Xj(this);a||ce(this)};h.save=function(){var a=new J(this);a.set(0,wj(this.H));a.set(1,wj(this.O));a.set(2,[this.j,this.P,this.ja]);a.set(3,this.B);return a.data()}; h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=xj(this,a[b++]),this.O=xj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.ja|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.v("running");this.A.U=!0;this.Fa=a;this.Ga=b}; -h.stop=function(a,b){if(this.A.U){this.A.U=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Hc(a.f,b)),65535!=(d&65535)&&(a.Gc(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function wg(a){var b=a.f;if(b.A.U)throw te(b,a.f.P&65535),a.Z(),-1;return!1}function Ud(a,b,c){Yj(a,b,c||1,a.L)&&a.Z(!1)}function Vd(a,b,c){Yj(a,b,c||1,a.F)&&a.Z(!1)} +h.stop=function(a,b){if(this.A.U){this.A.U=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Hc(a.f,b)),65535!=(d&65535)&&(a.Gc(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function wg(a){var b=a.f;if(b.A.U)throw te(b,a.f.P&65535),a.ba(),-1;return!1}function Ud(a,b,c){Yj(a,b,c||1,a.L)&&a.ba(!1)}function Vd(a,b,c){Yj(a,b,c||1,a.F)&&a.ba(!1)} function rj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Ke(a.f,!1);a.L=["br"];if(a.F)for(b=1;b>>c.g],!0)):Ke(a.f,!0);a.F=["bw"];a.la=0} h.sb=function(a,b,c){var d=!0;c||Zj(this,a,b,!1,!0);if(a!=this.g){var e=vj(b);if(-1===e)this.v("invalid address: "+Dj(this,b)),d=!1;else{var f=a==this.F;65535>>g.g].sb(e&g.i,f)}else e=this.f,(f?e.Zb++:e.Yb++)||re(e)}}d&&(a.push(b),c?b.Qa=!0:(ak(this,a,a.length-1,"set"),sj(this)));return d}; function Zj(a,b,c,d,e){var f=!1;c=vj(c);for(var g=1;g>>d.g],b)):Ke(a.f,b));k.Qa||sj(a);break}}return f}function bk(a,b){for(var c=1;cF?z="("+Fj(F)+")+":(D=t.Oa(u,2),z="#"+O(t,D,0,!0));break;case 24:7>F?z="@("+Fj(F)+")+":(D=t.Oa(u,2),z="@#"+O(t,D,0,!0),E=ok(t,D));break;case 32:z="-("+Fj(F)+")";break;case 40:z="@-("+Fj(F)+")";break;case 48:D=t.Oa(u,2);z=O(t,D,0,!0)+"("+Fj(F)+")";7==F&&(z=O(t,D=D+u.K&65535),E=ok(t,D));break;case 56:D=t.Oa(u,2),z="@"+O(t,D)+"("+Fj(F)+")",7==F&&(z="@"+O(t,D=D+u.K&65535),E=ok(t,Hc(t.f,D)))}E&&(z=[z,E])}t=z;if(!t|| !t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.mb&&b=c.B&&(b=c.Ma[b&fd])&&(a=b[4]);return a}function pk(a,b){switch(b){case "N":a=ye(a.f);break;case "Z":a=xe(a.f);break;case "V":a=we(a.f);break;case "C":a=ve(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} -function Z(a,b){var c="",d=a.f;if(8>b)c=Fj(b),c+="="+O(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+O(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+O(a,d.W[b-16]);else switch(b){case Gj:c="PS="+O(a,vd(d));break;case Hj:c="PI="+O(a,d.Xa);break;case Ij:c="ER="+O(a,d.R);break;case Jj:c="SL="+O(a,d.za&65280);break;case Kj:c="M0="+O(a,pd(d));break;case Lj:c="M1="+O(a,rd(d));break;case Mj:c="M2="+O(a,sd(d));break;case Nj:c="M3="+O(a,d.T);break;case Oj:a.b&&(c="AR="+O(a,a.b.fa,3));break;case Pj:a.b&&(c="DR="+ +function Z(a,b){var c="",d=a.f;if(8>b)c=Fj(b),c+="="+O(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+O(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+O(a,d.W[b-16]);else switch(b){case Gj:c="PS="+O(a,vd(d));break;case Hj:c="PI="+O(a,d.Xa);break;case Ij:c="ER="+O(a,d.R);break;case Jj:c="SL="+O(a,d.za&65280);break;case Kj:c="M0="+O(a,pd(d));break;case Lj:c="M1="+O(a,rd(d));break;case Mj:c="M2="+O(a,sd(d));break;case Nj:c="M3="+O(a,d.T);break;case Oj:a.b&&(c="AR="+O(a,a.b.ga,3));break;case Pj:a.b&&(c="DR="+ O(a,a.b.Sa));break;case Qj:a.b&&Jc(a.b)&&(c="SR="+O(a,a.b.Ta,3))}c&&(c+=" ");return c}function qk(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Gj)+Z(a,Hj)+Z(a,Jj);d+=pk(a,"T")+pk(a,"N")+pk(a,"Z")+pk(a,"V")+pk(a,"C");b&&(b=d,c=""+(Z(a,Kj)+Z(a,Lj)),c+=Z(a,Mj)+Z(a,Nj)+Z(a,Ij),c=c+"\n"+(Z(a,Qj)+Z(a,Oj)+Z(a,Pj)),d=b+("\n"+c));return d}h.dd=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=ab(n,l,a.dd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({xh:b,K:c,Qd:d,ga:e,ad:f})}function rk(a,b,c){var d=[],e=vj(b)>>>0;for(b=0;b>>0,k=f.Qd;if(e>=g&&e>>0,g],r=ab(n,l,a.dd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({xh:b,K:c,Qd:d,ha:e,ad:f})}function rk(a,b,c){var d=[],e=vj(b)>>>0;for(b=0;b>>0,k=f.Qd;if(e>=g&&eb)){e.g[b]= +g);a.H=V(e.g[7]);break;case "N":e.I=g?32768:0;break;case "Z":e.L=g?0:1;break;case "V":e.H=g?32768:0;break;case "C":e.F=g?65536:0;break;case "PS":wd(e,g);break;case "PI":ud(e,g);break;case "ER":e.R=g;d=!0;break;case "SL":e.za=g|255;break;case "M0":qd(e,g);d=!0;break;case "M3":td(e,g);d=!0;break;case "AR":a.b&&(d=a.b,dc(d,d.ga=g));d=!0;break;case "DR":a.b&&(d=a.b,Vb(d,d.Sa=g));d=!0;break;case "SR":if(a.b&&Jc(a.b)){ec(a.b,g);d=!0;break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){e.g[b]= g&65535;break}a.v("unknown register: "+f);return}L(a.J);a.v("updated registers:")}}a.v(qk(a,d));c&&(a.H=V(e.g[7]),Wj(a,Dj(a,a.H)))}}function vk(a,b){b=Za(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.v(m)}k[3]&&(g=k[3],f=null);f=dk(a,b,g,f);a.v(f);a.H=b;e-=b.K-l;c++}}} @@ -326,18 +326,18 @@ function ck(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.v(Uj+b):(a.P&&(a.v("ende Aj(a,g[1],!0);if(r)if(a.O=r,void 0===g[2])a.v("begin assemble at "+Dj(a,r)),a.P=!0,L(a.J);else{var u;a.v("not supported yet");u=[];if(u.length){for(var t=0;tGa.length&&(a.v("note: only "+Ga.length+" available"),qa=Ga.length);wa-=qa;0>wa&&(null==Ga[Ga.length-1].K?(qa=wa+qa,wa=0):wa+=Ga.length);var Se=[];"call"==qi&&(tc=1E5,Se=["CALL"]);for(void 0!==pi&&a.v(qa+" instructions earlier:");0=Ga.length&&(wa=0);a.oa=qa;si++;tc--}}si||(a.v("no "+ri+"history available"),a.oa=void 0)}else{var ga=Aj(a,Fa);if(ga)if("da"==Ta){var Te=ga.Ka||65535K.length?(2Ga.length&&(a.v("note: only "+Ga.length+" available"),qa=Ga.length);wa-=qa;0>wa&&(null==Ga[Ga.length-1].K?(qa=wa+qa,wa=0):wa+=Ga.length);var Se=[];"call"==qi&&(sc=1E5,Se=["CALL"]);for(void 0!==pi&&a.v(qa+" instructions earlier:");0=Ga.length&&(wa=0);a.oa=qa;si++;sc--}}si||(a.v("no "+ri+"history available"),a.oa=void 0)}else{var ga=Aj(a,Fa);if(ga)if("da"==Ta){var Te=ga.Ka||65535K.length?(2ib&&(ib=0);65536Xe?String.fromCharCode(Xe):"."),zd=zd>>8}kb&&(kb+="\n");kb=Ue?kb+(lb+","):kb+(Fa+": "+lb+(yd?"":" "+We))}kb&&a.v(kb);a.za=ga;a.Ca=Zk}}}}break;case "e":if("else"== -g[0])break;var Nb,Ye,Ze,$e,af=g[0],bf=g[1];"eb"==af?(Nb=1,Ye=255,Ze=a.Nc,$e=a.Oc):"e"==af||"ew"==af?(Nb=2,Ye=65535,Ze=a.Oa,$e=a.yd):bf=null;if(null==bf)a.v("edit memory commands:"),a.v("\teb [a] [...] edit bytes at address a"),a.v("\tew [a] [...] edit words at address a");else{var Ad=Aj(a,bf);if(Ad)for(var Bd=2;Bdef;){for(var mb=null,cl=256;65536>zc.K>>>0;){ff.K=a.Oa(zc,2);if(null==zc.K||!cl--)break;if(!(ff.K&1)){for(var dl=a,Cd=ff,xi=null,Ac=Cd.K,yi=Ac,gf=1;6>=gf&&Ac;gf++){if(2Xe?String.fromCharCode(Xe):"."),zd=zd>>8}kb&&(kb+="\n");kb=Ue?kb+(lb+","):kb+(Fa+": "+lb+(yd?"":" "+We))}kb&&a.v(kb);a.za=ga;a.Ca=Zk}}}}break;case "e":if("else"== +g[0])break;var Nb,Ye,Ze,$e,af=g[0],bf=g[1];"eb"==af?(Nb=1,Ye=255,Ze=a.Nc,$e=a.Oc):"e"==af||"ew"==af?(Nb=2,Ye=65535,Ze=a.Oa,$e=a.yd):bf=null;if(null==bf)a.v("edit memory commands:"),a.v("\teb [a] [...] edit bytes at address a"),a.v("\tew [a] [...] edit words at address a");else{var Ad=Aj(a,bf);if(Ad)for(var Bd=2;Bdef;){for(var mb=null,cl=256;65536>yc.K>>>0;){ff.K=a.Oa(yc,2);if(null==yc.K||!cl--)break;if(!(ff.K&1)){for(var dl=a,Cd=ff,xi=null,zc=Cd.K,yi=zc,gf=1;6>=gf&&zc;gf++){if(2> ";wb(function(){for(var a=y(document,x,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.v("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bDk){if(Ek(d,this.I)){this.u=new J(this,"1.32.2",Nk);Ek(this.u)&&(Ok(this,d),a=Pk,Qk(this.u));this.u.set(Kk,bb());Rk(this.u);var e=this.b&&!this.F;if(a==Lk||za("Click OK to restore the previous "+Fb+" machine state, or CANCEL to reset the machine.")){if(c=Jk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ek(d,g):("error"==f&&"no machine state"!= g?(this.N("Error: "+g),"unable to verify user"==g&&(ob(Sk,""),this.g=null)):this.v(f+": "+g),Qk(d),Ek(d)?(c=Jk(d),e=!0):c=!1))}e&&Hk(this,c?d:null)}else a==Pk&&d.clear()}else Hk(this);delete this.I;delete this.w}e=Aa(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.A.ha=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.f&&(Tk(this,this.f,b,c,a),L(this,-2),this.f.va());this.O&&(Ok(this,b),b.clear());!c&&this.u&&(this.u.clear(),delete this.u);this.j=0}; +function Tk(a,b,c,d,e){if(!b.A.fa){b.A.fa=!0;var f=null;try{if(e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,".")))),"string"===typeof f&&(f=null),!b.ya(f,d)&&f&&(v("Unable to restore state for "+b.type),a.L&&!a.S?(c.clear(),a.b=Dk,window&&window.location.reload()):a.O=!0,b.ya(null),e=!1),!d&&b.Sc){var g=b.Sc.split("|");for(a=0;aa[1];a=a[2];this.R=!0;this.A.fa=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.f&&(Tk(this,this.f,b,c,a),L(this,-2),this.f.va());this.O&&(Ok(this,b),b.clear());!c&&this.u&&(this.u.clear(),delete this.u);this.j=0}; function Ok(a,b){if(za("There may be a problem with your "+Fb+" machine.\n\nTo help us diagnose it, click OK to send this "+Fb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Fb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;cb("http://www.pcjs.org/api/v1/report",d,!0)}} -function xk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new J(a,"1.32.2"),g=new J(a,"1.32.2",Ik),k=bb();g.set(Kk,k);f.set(Kk,k);f.set(Uk,"1.32.2");f.set(Vk,window?window.location.href:null);f.set(Yk,window?window.navigator.userAgent:"");a.f&&a.f.xa&&(c&&(b&&(a.f.A.va=a.f.A.U),a.f.Z()),d=a.f.xa(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.ha=!1,!1===d&&(e=null)));for(var k=Aa(a.id),l=0;l=d||30<=(c.rc+=d))&&(e.textContent=c.A.U?c.pb.toFixed(2)+"Mhz":"Stopped",c.rc=0)}if(a.i&&(a=a.i,b=b||0,a.u)){c=a.f.A.U;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;eb?a.fa=a.f.g[7]:0=d||30<=(c.rc+=d))&&(e.textContent=c.A.U?c.pb.toFixed(2)+"Mhz":"Stopped",c.rc=0)}if(a.i&&(a=a.i,b=b||0,a.u)){c=a.f.A.U;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;eb?a.ga=a.f.g[7]:0":62,"?":63,"@":64,jc:65,Gf:66,If:67,eg:68,E:69,fg:70,gg:71,hg:72,ig:73,jg:74,kg:75,lg:76,mg:77,ng:78,og:79,pg:80,Q:81,qg:82,rg:83,sg:84,tg:85,ug:86,vg:87,wg:88,xg:89,Uc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,yg:97,zg:98,Ag:99,d:100,e:101,Bg:102,Cg:103,Dg:104,Eg:105,Hg:106,k:107,Ig:108,Jg:109,n:110,Kg:111,p:112,q:113,r:114,Lg:115,t:116,Mg:117,Ng:118,Og:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Kc:127};function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.oc=b.comment;this.Tc=b;this.exports={};this.j=this.bindings={};a=this.id.indexOf(".");0>a?this.Ma=this.id:(this.Na=this.id.substr(0,a),this.Ma=this.id.substr(a+1));this.l={ready:!1,Ua:!1,ac:!1,T:!1,error:!1};this.Db=null;this.l.error=!1;this.Rc=d||0;this.D=this.c=this.v=this.A=this.bb=null;u.push(this)}function ra(a,b,c){sa[a]&&b&&(sa[a][b]=c)} +"|":124,"}":125,"~":126,Kc:127};function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.oc=b.comment;this.Tc=b;this.exports={};this.l=this.bindings={};a=this.id.indexOf(".");0>a?this.Ma=this.id:(this.Na=this.id.substr(0,a),this.Ma=this.id.substr(a+1));this.j={ready:!1,Ua:!1,ac:!1,S:!1,error:!1};this.Db=null;this.j.error=!1;this.Rc=d||0;this.D=this.c=this.v=this.A=this.bb=null;u.push(this)}function ra(a,b,c){sa[a]&&b&&(sa[a][b]=c)} function ta(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=3;return""+c}function Ba(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} -function F(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Ga[a]})}function Ha(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} -var Ga={"&":"&","<":"<",">":">",'"':""","'":"'"},Ia={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; -function Ja(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function za(a,b){var c="";b?11>=3;return""+c}function Aa(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} +function F(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Fa[a]})}function Ga(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} +var Fa={"&":"&","<":"<",">":">",'"':""","'":"'"},Ha={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function Ia(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function G(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function Ka(a,b){var c,d={O:null,ka:null,ca:null,ba:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ca=g.load;d.ba=g.exec;if(e=g.bytes)d.O=e;else if(e=g.words)for(d.O=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.O=Array(4*e.length),f=c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ca=g.load;d.ba=g.exec;if(e=g.bytes)d.O=e;else if(e=g.words)for(d.O=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.O=Array(4*e.length),f=c=0;c>8&255,d.O[f++]=e[c]>>16&255,d.O[f++]=e[c]>>24&255;else d.O=g;d.ka=g.symbols;d.O.length?1==d.O.length&&(v(d.O[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.a["S"+a]=[0,0,!1,!1,this.od,a];this.D=this.c=this.v=this.A=null;D(this)}n(hb,r);h=hb.prototype; -h.reset=function(){this.stop();jb(this,this.f=0)}; -h.ha=function(a,b,c,d){if(this.A&&this.A.ha(a,b,c,d)||this.c&&this.c.ha(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.h[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.j[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){kb(a, -b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){lb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){kb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){lb(a,b)}}(this,b),!0):r.prototype.ha.call(this,a,b,c,d)}};h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;mb(b,this,nb);ob(b,this.reset.bind(this));pb(this);qb(this)};h.ga=function(a,b){if(!b)if(this.G&&rb(),!a)this.reset();else if(!this.restore(a))return!1;return!0}; -h.fa=function(a){return a?this.save():!0};h.save=function(){var a=new H(this);a.set(0,[this.U,this.f,this.b]);return a.data()};h.restore=function(a){if(a=a[0])sb(this,this.U=a[0]),jb(this,this.f=a[1]),tb(this,a[2]);return!0};function ub(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function pb(a,b){for(var c in a.h)ub(a,c,null!=b?b:a.h[c])}function vb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} -function qb(a){for(var b in a.a)vb(a,b,a.a[b][1])}function wb(a,b,c,d){a.j[b]&&(void 0===c&&(xa(a,"Value for "+b+" is invalid"),I(a.c)),c=8==(a.D&&a.D.h||8)?Aa(c,d):Ba(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))}function kb(a,b){var c=a.a[b];vb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=xb&&(a.w=b==yb,a.C=b==zb)}function lb(a,b){var c=a.a[b];c[2]&&c[3]&&(vb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1} -h.md=function(a){a||this.c.l.N||(a=this.c,a.v.reset(),Ab(a),this.a[Bb]&&this.a[Bb][1]&&Cb(this.c))};h.nd=function(){};h.hd=function(a){a||I(this.c)};h.fd=function(a){if(!a&&!this.c.l.N)if(this.a[Bb]&&this.a[Bb][1])Cb(this.c);else{a=this.D;var b;if(b=a)a.l.Ua&&(a.l.ac=!0),b=!a.l.Ua;if(b)za(a,!0),a.f(0,null),za(a,!1);else try{var c=this.c.Sb(1);0=a.c.qa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.v.u;a.a[xb]&&a.a[xb][1]||(b=-b);sb(a,a.U&~c|a.U+b&c)}function sb(a,b){a.U=b&a.v.u;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Lb(a,"A"+c,b&1<c;c++)Lb(a,"D"+c,b&1<c;c++)a.a["S"+c][1]=b&1<>2;this.f=this.g-1;this.s=this.F/this.g|0;this.L=this.s-1;this.Ia=[];this.m=0;this.o=!1;this.G=[];this.Vc=[Qb,Rb,Sb,Tb];this.a=this.b=[];this.C=this.w=this.i=this.H=this.I=0;a=new J(this);Ub(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.u;D(this)}n(Ob,r);function Xb(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Ob.prototype;h.reset=function(){for(var a=0;aa;a++)this.a["S"+a]=[0,0,!1,!1,this.od,a];this.D=this.c=this.v=this.A=null;D(this)}n(gb,r);h=gb.prototype; +h.reset=function(){this.stop();ib(this,this.f=0)}; +h.ha=function(a,b,c,d){if(this.A&&this.A.ha(a,b,c,d)||this.c&&this.c.ha(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.l[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.l[b]=c,this.h[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.l[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){jb(a, +b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){kb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){jb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){kb(a,b)}}(this,b),!0):r.prototype.ha.call(this,a,b,c,d)}};h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;lb(b,this,mb);nb(b,this.reset.bind(this));ob(this);pb(this)};h.ga=function(a,b){if(!b)if(this.G&&qb(),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +h.fa=function(a){return a?this.save():!0};h.save=function(){var a=new H(this);a.set(0,[this.U,this.f,this.b]);return a.data()};h.restore=function(a){if(a=a[0])rb(this,this.U=a[0]),ib(this,this.f=a[1]),sb(this,a[2]);return!0};function tb(a,b,c){if(a=a.l[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ob(a,b){for(var c in a.h)tb(a,c,null!=b?b:a.h[c])}function ub(a,b,c){if(a=a.l[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} +function pb(a){for(var b in a.a)ub(a,b,a.a[b][1])}function vb(a,b,c,d){if(a.l[b]){var e=a.D&&a.D.h||8;c=c||0;c=8==e?za(c,d):Aa(c,d);a.l[b].textContent!=c&&(a.l[b].textContent=c)}}function jb(a,b){var c=a.a[b];ub(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=wb&&(a.w=b==xb,a.C=b==yb)}function kb(a,b){var c=a.a[b];c[2]&&c[3]&&(ub(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.md=function(a){a||this.c.j.N||(a=this.c,a.v.reset(),zb(a),this.a[Ab]&&this.a[Ab][1]&&Bb(this.c))};h.nd=function(){}; +h.hd=function(a){a||I(this.c)};h.fd=function(a){if(!a&&!this.c.j.N)if(this.a[Ab]&&this.a[Ab][1])Bb(this.c);else{a=this.D;var b;if(b=a)a.j.Ua&&(a.j.ac=!0),b=!a.j.Ua;if(b)ya(a,!0),a.f(0,null),ya(a,!1);else try{var c=this.c.Sb(1);0=a.c.qa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.v.u;a.a[wb]&&a.a[wb][1]||(b=-b);rb(a,a.U&~c|a.U+b&c)}function rb(a,b){a.U=b&a.v.u;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Kb(a,"A"+c,b&1<c;c++)Kb(a,"D"+c,b&1<c;c++)a.a["S"+c][1]=b&1<>2;this.f=this.g-1;this.s=this.F/this.g|0;this.L=this.s-1;this.Ia=[];this.m=0;this.o=!1;this.G=[];this.Vc=[Pb,Qb,Rb,Sb];this.a=this.b=[];this.C=this.w=this.i=this.H=this.I=0;a=new J(this);Tb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.u;D(this)}n(Nb,r);function Wb(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Nb.prototype;h.reset=function(){for(var a=0;a>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ta)return l.wb+=l.Ta-f,l.Ta=f,!0;if(f>=l.Ta+l.wb){p=l.size-(f-m);p>g&&(p=g);l.wb=f-l.Ta+p;f=m+a.g;g-=p;k++;continue}}return Zb($b,f,g)}f=new J(a,f,p,a.g,d,e);Ub(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+ac[d]+" at "+Aa(b)),!0):Zb(bc,b,c)}h.Fc=function(a){return this.b[(a&this.i)>>>this.h].hb(a&this.f,a)}; -h.zb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return fb||b!=this.f?this.b[c].W(b,a):this.b[c++].hb(b,a)|this.b[c&this.L].hb(0,a+1)<<8};h.Gc=function(a,b){this.b[(a&this.i)>>>this.h].kb(a&this.f,b,a)};h.Ab=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;fb||c!=this.f?this.b[d].nb(c,b,a):(this.b[d++].kb(c,b&255,a),this.b[d&this.L].kb(0,b>>8&255,a+1))};function cc(a,b){return a.a[(b&a.u)>>>a.h]} -function Kb(a,b){var c;a.o=!1;a.m++;var d=b&a.f,e=cc(a,b);fb||d!=a.f?c=e.D(d,b):c=e.i(d,b)|cc(a,b+1).i(0,b+1)<<8;a.m--;return c}function dc(a,b,c){a.o=!1;a.m++;cc(a,b).j(b&a.f,c&255,b);a.m--}function Ib(a,b,c){a.o=!1;a.m++;var d=b&a.f,e=cc(a,b);fb||d!=a.f?e.m(d,c&65535,b):(e.j(d,c&255,b),cc(a,b+1).j(0,c>>8&255,b+1));a.m--} -function Yb(a){for(var b=0,c=[],d=0;da.c.qa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],x=g[5]||1,w=0;w>8:e[2](f)&255):f&1&&(e=d.Ia[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;K(d,b,16);return 255} -function Rb(a,b,c){var d=!1,e=this.controller,f=e.Ia[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ia[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||K(e,c,16)}function Sb(a,b){var c=-1,d=this.controller;a=d.Ia[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;K(d,b,16);return 65535} -function Tb(a,b,c){var d=!1,e=this.controller;a=e.Ia[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||K(e,c,16)}function M(a){r.call(this,"Device",a,0,256);this.a={za:128,fc:-1}}n(M,r);h=M.prototype;h.ea=function(a,b,c,d){this.v=b;this.A=a;this.c=c;this.D=d;var e=this;this.a.fc=kc(c,function(){e.a.za|=128;e.a.za&64&&N(e.c,e.a.Ka);e.A&&Gb(e.A,1);lc(e.c,e.a.fc,1E3/60)});this.a.Ka=mc(c,64,6,524288);mb(b,this,nc);ob(b,this.reset.bind(this));D(this)}; -h.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){this.a.za=128;lc(this.c,this.a.fc,1E3/60,!0)};h.save=function(){var a=new H(this);a.set(0,[this.a.za]);return a.data()};h.restore=function(a){a=ia(a[0]);this.a.za=a.next().value;return!0};h.Ad=function(){return this.a.za};h.Me=function(a){this.a.za=a&192;this.a.za&64||(a=this.a.Ka)&&oc(this.c,a)}; -h.Cd=function(){var a=this.c,b=a.H;b&57344||(b=b&-3199|a.Pa<<5|a.Qa<<1);return b};h.Oe=function(a){pc(this.c,a&-129|this.c.H&128)};h.Dd=function(){var a=this.c;a.H&57344||(a.eb=a.F>>16&65535);a=a.eb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ed=function(){var a=this.c;a.H&57344||(a.fb=a.F&65535);return a.fb};h.Fd=function(){return this.c.na};h.Pe=function(a){var b=this.c;1170>b.qa&&(a&=-49);b.na!=a&&(b.na=a,b.Ca=a&16?4194303:262143,qc(b))}; +function Ub(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ta)return l.wb+=l.Ta-f,l.Ta=f,!0;if(f>=l.Ta+l.wb){p=l.size-(f-m);p>g&&(p=g);l.wb=f-l.Ta+p;f=m+a.g;g-=p;k++;continue}}return Yb(Zb,f,g)}f=new J(a,f,p,a.g,d,e);Tb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+$b[d]+" at "+za(b)),!0):Yb(ac,b,c)}h.Fc=function(a){return this.b[(a&this.i)>>>this.h].hb(a&this.f,a)}; +h.zb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return eb||b!=this.f?this.b[c].W(b,a):this.b[c++].hb(b,a)|this.b[c&this.L].hb(0,a+1)<<8};h.Gc=function(a,b){this.b[(a&this.i)>>>this.h].kb(a&this.f,b,a)};h.Ab=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;eb||c!=this.f?this.b[d].nb(c,b,a):(this.b[d++].kb(c,b&255,a),this.b[d&this.L].kb(0,b>>8&255,a+1))};function bc(a,b){return a.a[(b&a.u)>>>a.h]} +function Jb(a,b){var c;a.o=!1;a.m++;var d=b&a.f,e=bc(a,b);eb||d!=a.f?c=e.D(d,b):c=e.i(d,b)|bc(a,b+1).i(0,b+1)<<8;a.m--;return c}function cc(a,b,c){a.o=!1;a.m++;bc(a,b).l(b&a.f,c&255,b);a.m--}function Hb(a,b,c){a.o=!1;a.m++;var d=b&a.f,e=bc(a,b);eb||d!=a.f?e.m(d,c&65535,b):(e.l(d,c&255,b),bc(a,b+1).l(0,c>>8&255,b+1));a.m--} +function Xb(a){for(var b=0,c=[],d=0;da.c.qa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],x=g[5]||1,w=0;w>8:e[2](f)&255):f&1&&(e=d.Ia[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;K(d,b,16);return 255} +function Qb(a,b,c){var d=!1,e=this.controller,f=e.Ia[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ia[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||K(e,c,16)}function Rb(a,b){var c=-1,d=this.controller;a=d.Ia[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;K(d,b,16);return 65535} +function Sb(a,b,c){var d=!1,e=this.controller;a=e.Ia[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||K(e,c,16)}function M(a){r.call(this,"Device",a,0,256);this.a={za:128,fc:-1}}n(M,r);h=M.prototype;h.ea=function(a,b,c,d){this.v=b;this.A=a;this.c=c;this.D=d;var e=this;this.a.fc=jc(c,function(){e.a.za|=128;e.a.za&64&&N(e.c,e.a.Ka);e.A&&Fb(e.A,1);kc(e.c,e.a.fc,1E3/60)});this.a.Ka=lc(c,64,6,524288);lb(b,this,mc);nb(b,this.reset.bind(this));D(this)}; +h.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){this.a.za=128;kc(this.c,this.a.fc,1E3/60,!0)};h.save=function(){var a=new H(this);a.set(0,[this.a.za]);return a.data()};h.restore=function(a){a=ia(a[0]);this.a.za=a.next().value;return!0};h.Ad=function(){return this.a.za};h.Me=function(a){this.a.za=a&192;this.a.za&64||(a=this.a.Ka)&&nc(this.c,a)}; +h.Cd=function(){var a=this.c,b=a.H;b&57344||(b=b&-3199|a.Pa<<5|a.Qa<<1);return b};h.Oe=function(a){oc(this.c,a&-129|this.c.H&128)};h.Dd=function(){var a=this.c;a.H&57344||(a.eb=a.F>>16&65535);a=a.eb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ed=function(){var a=this.c;a.H&57344||(a.fb=a.F&65535);return a.fb};h.Fd=function(){return this.c.na};h.Pe=function(a){var b=this.c;1170>b.qa&&(a&=-49);b.na!=a&&(b.na=a,b.Ca=a&16?4194303:262143,pc(b))}; h.me=function(a){a=a>>1&63;var b=this.c.Ha[a>>1];return a&1?b>>16:b&65535};h.yf=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ha[c]=b&1?this.c.Ha[c]&65535|(a&63)<<16:this.c.Ha[c]&-65536|a&65534};h.fe=function(a){return this.c.s[1][a>>1&7]};h.rf=function(a,b){this.c.s[1][b>>1&7]=a&65295};h.de=function(a){return this.c.s[1][(a>>1&7)+8]};h.pf=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.ee=function(a){return this.c.I[1][a>>1&7]};h.qf=function(a,b){b=b>>1&7;this.c.I[1][b]=a;this.c.s[1][b]&=65295}; h.ce=function(a){return this.c.I[1][(a>>1&7)+8]};h.nf=function(a,b){b=(b>>1&7)+8;this.c.I[1][b]=a;this.c.s[1][b]&=65295};h.zd=function(a){return this.c.s[0][a>>1&7]};h.Le=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.xd=function(a){return this.c.s[0][(a>>1&7)+8]};h.Je=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.yd=function(a){return this.c.I[0][a>>1&7]};h.Ke=function(a,b){b=b>>1&7;this.c.I[0][b]=a;this.c.s[0][b]&=65295};h.wd=function(a){return this.c.I[0][(a>>1&7)+8]}; h.Ie=function(a,b){b=(b>>1&7)+8;this.c.I[0][b]=a;this.c.s[0][b]&=65295};h.le=function(a){return this.c.s[3][a>>1&7]};h.xf=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.je=function(a){return this.c.s[3][(a>>1&7)+8]};h.vf=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295};h.ke=function(a){return this.c.I[3][a>>1&7]};h.wf=function(a,b){b=b>>1&7;this.c.I[3][b]=a;this.c.s[3][b]&=65295};h.ie=function(a){return this.c.I[3][(a>>1&7)+8]};h.uf=function(a,b){b=(b>>1&7)+8;this.c.I[3][b]=a;this.c.s[3][b]&=65295}; h.ib=function(a){a&=7;return this.c.i&2048?this.c.ra[a]:this.c.b[a]};h.lb=function(a,b){b&=7;this.c.i&2048?this.c.ra[b]=a:this.c.b[b]=a};h.Kd=function(){return this.c.i&49152?this.c.ja[0]:this.c.b[6]};h.Ue=function(a){this.c.i&49152?this.c.ja[0]=a:this.c.b[6]=a};h.Nd=function(){return this.c.b[7]};h.Xe=function(a){this.c.b[7]=a};h.jb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.ra[a]};h.mb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.ra[b]=a}; -h.Ld=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[1]};h.Ve=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[1]=a};h.Md=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[3]};h.We=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[3]=a};h.vd=function(a){return this.c.ub[a-65504>>1]};h.He=function(a,b){this.c.ub[b-65504>>1]=a};h.Ac=function(a){return 65520==a?(ec(this.v)>>6)-1:0};h.Dc=function(){};h.he=function(){return 1};h.tf=function(){};h.ud=function(){return this.c.G}; -h.Ge=function(){this.c.G=0};h.Bd=function(){return this.c.tb};h.Ne=function(a,b){b&1||(a&=255);this.c.tb=a};h.Gd=function(a,b){return b?0:this.c.Sa};h.Qe=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Sa=a};h.ge=function(a,b){return b?0:this.c.Ga&65280};h.sf=function(a){this.c.Ga=a|255};h.Jd=function(){return rc(this.c)};h.Te=function(a){sc(this.c,a)};h.Cc=function(){}; -var O={},nc=(O[61568]=[null,null,M.prototype.me,M.prototype.yf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.fe,M.prototype.rf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.de,M.prototype.pf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.ee,M.prototype.qf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.ce,M.prototype.nf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.zd,M.prototype.Le,"KIPDR",8,1140,64],O[62672]=[null,null,M.prototype.xd,M.prototype.Je,"KDPDR",8,1145,64],O[62688]= +h.Ld=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[1]};h.Ve=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[1]=a};h.Md=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[3]};h.We=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[3]=a};h.vd=function(a){return this.c.ub[a-65504>>1]};h.He=function(a,b){this.c.ub[b-65504>>1]=a};h.Ac=function(a){return 65520==a?(dc(this.v)>>6)-1:0};h.Dc=function(){};h.he=function(){return 1};h.tf=function(){};h.ud=function(){return this.c.G}; +h.Ge=function(){this.c.G=0};h.Bd=function(){return this.c.tb};h.Ne=function(a,b){b&1||(a&=255);this.c.tb=a};h.Gd=function(a,b){return b?0:this.c.Sa};h.Qe=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Sa=a};h.ge=function(a,b){return b?0:this.c.Ga&65280};h.sf=function(a){this.c.Ga=a|255};h.Jd=function(){return qc(this.c)};h.Te=function(a){rc(this.c,a)};h.Cc=function(){}; +var O={},mc=(O[61568]=[null,null,M.prototype.me,M.prototype.yf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.fe,M.prototype.rf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.de,M.prototype.pf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.ee,M.prototype.qf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.ce,M.prototype.nf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.zd,M.prototype.Le,"KIPDR",8,1140,64],O[62672]=[null,null,M.prototype.xd,M.prototype.Je,"KDPDR",8,1145,64],O[62688]= [null,null,M.prototype.yd,M.prototype.Ke,"KIPAR",8,1140,64],O[62704]=[null,null,M.prototype.wd,M.prototype.Ie,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Fd,M.prototype.Pe,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Ad,M.prototype.Me,"LKS"],O[65402]=[null,null,M.prototype.Cd,M.prototype.Oe,"MMR0",1,1140,64],O[65404]=[null,null,M.prototype.Dd,M.prototype.Cc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Ed,M.prototype.Cc,"MMR2",1,1140,64],O[65408]=[null,null,M.prototype.le,M.prototype.xf, "UIPDR",8,1140,64],O[65424]=[null,null,M.prototype.je,M.prototype.vf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.ke,M.prototype.wf,"UIPAR",8,1140,64],O[65456]=[null,null,M.prototype.ie,M.prototype.uf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.ib,M.prototype.lb,"R0SET0"],O[65473]=[null,null,M.prototype.ib,M.prototype.lb,"R1SET0"],O[65474]=[null,null,M.prototype.ib,M.prototype.lb,"R2SET0"],O[65475]=[null,null,M.prototype.ib,M.prototype.lb,"R3SET0"],O[65476]=[null,null,M.prototype.ib, M.prototype.lb,"R4SET0"],O[65477]=[null,null,M.prototype.ib,M.prototype.lb,"R5SET0"],O[65478]=[null,null,M.prototype.Kd,M.prototype.Ue,"R6KERNEL"],O[65479]=[null,null,M.prototype.Nd,M.prototype.Xe,"R7KERNEL"],O[65480]=[null,null,M.prototype.jb,M.prototype.mb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.jb,M.prototype.mb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.jb,M.prototype.mb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.jb,M.prototype.mb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.jb, M.prototype.mb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.jb,M.prototype.mb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Ld,M.prototype.Ve,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.Md,M.prototype.We,"R6USER",1,1145],O[65504]=[null,null,M.prototype.vd,M.prototype.He,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Ac,M.prototype.Dc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Ac,M.prototype.Dc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.he,M.prototype.tf,"SYSID",1,1170],O[65526]= [null,null,M.prototype.ud,M.prototype.Ge,"ERR",1,1170],O[65528]=[null,null,M.prototype.Bd,M.prototype.Ne,"MBR",1,1170],O[65530]=[null,null,M.prototype.Gd,M.prototype.Qe,"PIR"],O[65532]=[null,null,M.prototype.ge,M.prototype.sf,"SLR"],O[65534]=[null,null,M.prototype.Jd,M.prototype.Te,"PSW"],O); -Va(function(){for(var a=C(document,B,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),xc(this,yc?zc:Bc);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.sd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.re=function(a,b){eb&&a&1&&K(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; -h.Ee=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.xa=!0};h.qd=function(a,b){return this.i(a,b)};h.oe=function(a,b){return this.D(a,b)};h.Ce=function(a,b,c){this.A?this.yb(0,0,c):this.j(a,b,c)};h.Af=function(a,b,c){this.A?this.yb(0,0,c):this.m(a,b,c)};h.pd=function(a){return this.a[a]}; -h.rd=function(a){return this.a[a]};h.ne=function(a,b){eb&&a&1&&K(this.b,b,64);return this.v.getUint16(a,!0)};h.qe=function(a,b){eb&&a&1&&K(this.b,b,64);return!fb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Be=function(a,b){this.a[a]=b;this.xa=!0};h.De=function(a,b){this.a[a]=b;this.xa=!0};h.zf=function(a,b,c){eb&&a&1&&K(this.b,c,64);this.v.setUint16(a,b,!0);this.xa=!0};h.Bf=function(a,b,c){eb&&a&1&&K(this.b,c,64);!fb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.xa=!0}; -var vc=0,fc=1,wc=2,Wb=4,ac=["NONE","RAM","ROM","VID","H/W"],uc=0,Dc=[],Cc=[J.prototype.sd,J.prototype.Ee,J.prototype.re,J.prototype.Cf],Gc=[J.prototype.qd,J.prototype.Ce,J.prototype.oe,J.prototype.Af];if(cb)var Bc=[J.prototype.pd,J.prototype.Be,J.prototype.ne,J.prototype.zf],zc=[J.prototype.rd,J.prototype.De,J.prototype.qe,J.prototype.Bf];var Hc;if(cb){var Ic=new ArrayBuffer(2);(new DataView(Ic)).setUint16(0,256,!0);Hc=256===(new Uint16Array(Ic))[0]}else Hc=!1;var yc=Hc; -function Jc(a,b){r.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.hc=0;this.Nb=b;this.Ra=c;this.Vb=Math.round(this.Nb/1E4)/100;this.Xa=this.Vb*this.Ra;this.Wb=this.sb=this.$a=this.Ob=0;this.l.N=this.l.ec=!1;this.l.da=a.autoStart;"string"==typeof this.l.da&&(this.l.da="true"==this.l.da);this.l.Bb=!1;this.Lb=this.Za=0;this.Mb=+a.csStart;this.qb=+a.csInterval;this.rb=+a.csStop;this.Y=[];this.qc=this.ve.bind(this);this.Fa=this.va=this.Ea=this.a=this.aa=this.ua=this.pb=this.Da=this.ab= -this.Xb=this.Oa=0;this.ma=null;D(this)}n(Jc,r);h=Jc.prototype;h.ea=function(a,b,c,d){this.A=a;this.v=b;this.D=d;this.ma=a.f;for(a=0;a=a.Za&&(a.Za+=a.qb,c=!0);0<=a.rb&&a.rb<=Oc(a)&&(a.qb=a.rb=-1,Nc(a),I(a),c=!0);c&&a.Z(Oc(a)+" cycles: checksum="+Ba(a.Lb))}} -h.ha=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.l.T)a=!0;else{var b=null,c,k=y(a.id);for(c=0;ca.Oa/a.Xa&&(b=1);a.Ra=b;b=a.Vb*a.Ra;if(a.Xa!=b){a.Xa=b;b=a.Xa.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.Z("target speed: "+b)}c&&a.A&&Sc(a.A)}Eb(a,a.va);a.va=0;a.ua=ta();a.Da=0;Qc(a)}function kc(a,b){var c=a.Y.length;a.Y.push([-1,b]);return c}function lc(a,b,c,d){0<=b&&ba.Y[b][0])&&(c=a.Nb*a.Ra/1E3*c|0,a.l.N&&(c+=Tc(a)),a.Y[b][0]=c)}function Uc(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Tc(a,b){var c=a.Ea-=a.a;a.a=a.aa=0;b&&(a.Ea=0);return c} -h.ve=function(){if(this.l.N){this.Ob>=this.Nb&&Qc(this,!0);this.ab=0;this.pb=ta();if(this.Da){var a=this.pb-this.Da;a>this.Wb&&(this.ua+=a,this.ua>this.pb&&(this.ua=this.pb))}try{do{for(var b,c=this.l.Bb?1:this.sb,d=this.Y.length-1;0<=d;d--){var e=this.Y[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Sb(b)}catch(f){if("number"!=typeof f)throw f;}b=Tc(this,!0);this.ab+=b;this.va+=b;Fb(this,b);Db(this,b);this.$a-=b;if(0>=this.$a){this.$a+=this.sb;++this.Xb>=Vc&&(this.A&&Gb(this.A,void 0),this.Xb=0);break}}while(this.l.N)}catch(f){I(this); -this.A&&this.A.stop(ta(),Oc(this));xa(this,f.stack||f.message);return}if(this.l.N){a=setTimeout;b=this.qc;this.Da=ta();c=this.Wb;this.ab&&(c=Math.round(c*this.ab/this.sb));c-=this.Da-this.pb;if(d=this.Da-this.ua)this.Oa=Math.round(this.va/(10*d))/100,864E5<=d&&(this.Fa=0,Pc(this));if(0>c||this.Oac&&(this.ua-=c),c=0;this.Ob+=this.ab;this.Da+=c;a(b,c)}}}; -function Cb(a){var b;a.l.error?(a.Z(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.N)a.Z(a.toString()+" busy");else{Pc(a);a.l.N=!0;a.l.ec=!0;if(b=a.j.run)b.textContent="Halt";a.A&&a.A.start(a.ua,Oc(a));a.D||a.status("Started");setTimeout(a.qc,0)}}h.Sb=function(){return 0};function I(a){var b=!1;if(a.l.N){Tc(a);Eb(a,a.va);a.va=0;a.l.N=!1;if(b=a.j.run)b.textContent="Run";a.A&&a.A.stop(ta(),Oc(a));b=!0;a.D||a.status("Stopped")}a.l.complete=void 0;return b}var Rc=30,Vc=15,Kc=["power","reset"]; -function Wc(a){var b=+a.model||1170;Jc.call(this,a,6666667);this.qa=b;this.nc=+a.addrReset||0;this.wa=this.i=this.C=this.u=this.m=this.o=this.w=0;this.b=this.ra=this.ja=[];this.I=this.s=this.Ha=this.ub=[];this.Aa=this.F=this.mc=this.Ba=this.Pa=this.Qa=this.Ca=this.G=this.tb=this.Sa=this.Ga=this.H=this.eb=this.fb=this.na=this.g=0;this.Sc=[4,2,0,1];this.Pb=0;this.pc=255;1120>=this.qa?(this.lc=Xc.bind(this),this.Ya=this.Zc,this.Pb=8,this.pc=-1,this.sc=255,this.rc=0):(this.lc=Yc.bind(this),this.Ya=this.$c, -this.sc=~(1792|(1140>=this.qa?2048:0))&65535,this.rc=1140e.xb&&(e.xb=c,c+=4)}return Jc.prototype.ga.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.qa);this.l.N&&I(this);this.u=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.nc,-1,-2,-3,-4,-5,-6,-7,-8];this.ra=[0,0,0,0,0,0];this.ja=[0,0,0,0];this.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, -65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ha=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ub=[0,0,0,0,0,0,0,0];this.C=0;this.wa=-1;this.h=this.f=this.Kb=this.L=this.S=this.g=this.tb=0;Ab(this);Mc(this);this.l.error=!1;Jc.prototype.reset.call(this)};function Ab(a){a.H=0;a.eb=0;a.fb=0;a.na=0;a.G=0;a.Sa=0;a.Ga=255;a.Ba=0;a.Pa=0;a.Qa=0;a.Ca=262143;a.Aa=a.b[7];a.F=0;a.K=null;a.v&&(qc(a),a.mc=ec(a.v))} -function qc(a){a.Fb=a.ic;a.Gb=a.Qb;a.Rb=a.Tb;a.Hb=a.Ub;a.Ba?(a.ta=65536,a.Eb=a.na&16?4186112:253952,a.pa=a.yc,a.W=a.Bc,a.nb=a.Ec,Xb(a.v,a.na&16?22:18)):(a.ta=0,a.Eb=57344,a.pa=a.cd,a.W=a.pe,a.nb=a.Df,Xb(a.v,16))}function pc(a,b){b&=-3073;if(a.H!=b){b&57344&&!(a.H&57344)&&(a.eb=a.F>>16&65535,a.fb=a.F&65535);a.H=b;a.Pa=(b&96)>>5;a.Qa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ba!=c&&(a.Ba=c,qc(a))}} -function Zc(a,b,c){a.nc=b;R(a,b);sc(a,0);a.v.reset();Ab(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.l.N||Cb(a)}else a.D?I(a)||a.D.g():!1===c&&I(a);!a.l.N&&a.ma&&a.ma.stop()}h.xc=function(){return 0}; -h.save=function(){var a=new H(this);a.set(0,[this.b,this.ra,this.ja,this.I,this.s,this.Ha,this.ub,this.G,this.tb,this.Sa,this.Ga,this.H,this.eb,this.fb,this.na,this.Ba,this.Pa,this.Qa,this.Ca,this.Aa,this.g,this.F,this.wa,this.Yb,this.Zb]);a.set(1,[rc(this)]);a.set(2,[this.Fa,this.Ra,this.l.da]);a.set(3,$c(this));a.set(4,Uc(this));return a.data()}; +Ua(function(){for(var a=C(document,B,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),wc(this,xc?yc:Ac);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.sd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.re=function(a,b){db&&a&1&&K(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; +h.Ee=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.xa=!0};h.qd=function(a,b){return this.i(a,b)};h.oe=function(a,b){return this.D(a,b)};h.Ce=function(a,b,c){this.A?this.yb(0,0,c):this.l(a,b,c)};h.Af=function(a,b,c){this.A?this.yb(0,0,c):this.m(a,b,c)};h.pd=function(a){return this.a[a]}; +h.rd=function(a){return this.a[a]};h.ne=function(a,b){db&&a&1&&K(this.b,b,64);return this.v.getUint16(a,!0)};h.qe=function(a,b){db&&a&1&&K(this.b,b,64);return!eb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Be=function(a,b){this.a[a]=b;this.xa=!0};h.De=function(a,b){this.a[a]=b;this.xa=!0};h.zf=function(a,b,c){db&&a&1&&K(this.b,c,64);this.v.setUint16(a,b,!0);this.xa=!0};h.Bf=function(a,b,c){db&&a&1&&K(this.b,c,64);!eb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.xa=!0}; +var uc=0,ec=1,vc=2,Vb=4,$b=["NONE","RAM","ROM","VID","H/W"],tc=0,Cc=[],Bc=[J.prototype.sd,J.prototype.Ee,J.prototype.re,J.prototype.Cf],Fc=[J.prototype.qd,J.prototype.Ce,J.prototype.oe,J.prototype.Af];if(bb)var Ac=[J.prototype.pd,J.prototype.Be,J.prototype.ne,J.prototype.zf],yc=[J.prototype.rd,J.prototype.De,J.prototype.qe,J.prototype.Bf];var Gc;if(bb){var Hc=new ArrayBuffer(2);(new DataView(Hc)).setUint16(0,256,!0);Gc=256===(new Uint16Array(Hc))[0]}else Gc=!1;var xc=Gc; +function Ic(a,b){r.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.hc=0;this.Nb=b;this.Ra=c;this.Vb=Math.round(this.Nb/1E4)/100;this.Xa=this.Vb*this.Ra;this.Wb=this.sb=this.$a=this.Ob=0;this.j.N=this.j.ec=!1;this.j.da=a.autoStart;"string"==typeof this.j.da&&(this.j.da="true"==this.j.da);this.j.Bb=!1;this.Lb=this.Za=0;this.Mb=+a.csStart;this.qb=+a.csInterval;this.rb=+a.csStop;this.Y=[];this.qc=this.ve.bind(this);this.Fa=this.va=this.Ea=this.a=this.aa=this.ua=this.pb=this.Da=this.ab= +this.Xb=this.Oa=0;this.ma=null;D(this)}n(Ic,r);h=Ic.prototype;h.ea=function(a,b,c,d){this.A=a;this.v=b;this.D=d;this.ma=a.f;for(a=0;a=a.Za&&(a.Za+=a.qb,c=!0);0<=a.rb&&a.rb<=Nc(a)&&(a.qb=a.rb=-1,Mc(a),I(a),c=!0);c&&a.Z(Nc(a)+" cycles: checksum="+Aa(a.Lb))}} +h.ha=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.l[b]=c,!0;case "run":return this.l[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.S)a=!0;else{var b=null,c,k=y(a.id);for(c=0;ca.Oa/a.Xa&&(b=1);a.Ra=b;b=a.Vb*a.Ra;if(a.Xa!=b){a.Xa=b;b=a.Xa.toFixed(2)+"Mhz";var d=a.l.setSpeed;d&&(d.textContent=b);a.Z("target speed: "+b)}c&&a.A&&Rc(a.A)}Db(a,a.va);a.va=0;a.ua=ta();a.Da=0;Pc(a)}function jc(a,b){var c=a.Y.length;a.Y.push([-1,b]);return c}function kc(a,b,c,d){0<=b&&ba.Y[b][0])&&(c=a.Nb*a.Ra/1E3*c|0,a.j.N&&(c+=Sc(a)),a.Y[b][0]=c)}function Tc(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Sc(a,b){var c=a.Ea-=a.a;a.a=a.aa=0;b&&(a.Ea=0);return c} +h.ve=function(){if(this.j.N){this.Ob>=this.Nb&&Pc(this,!0);this.ab=0;this.pb=ta();if(this.Da){var a=this.pb-this.Da;a>this.Wb&&(this.ua+=a,this.ua>this.pb&&(this.ua=this.pb))}try{do{for(var b,c=this.j.Bb?1:this.sb,d=this.Y.length-1;0<=d;d--){var e=this.Y[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Sb(b)}catch(f){if("number"!=typeof f)throw f;}b=Sc(this,!0);this.ab+=b;this.va+=b;Eb(this,b);Cb(this,b);this.$a-=b;if(0>=this.$a){this.$a+=this.sb;++this.Xb>=Uc&&(this.A&&Fb(this.A,void 0),this.Xb=0);break}}while(this.j.N)}catch(f){I(this); +this.A&&this.A.stop(ta(),Nc(this));a=f.stack||f.message;this.j.error=!0;this.B(a);return}if(this.j.N){a=setTimeout;b=this.qc;this.Da=ta();c=this.Wb;this.ab&&(c=Math.round(c*this.ab/this.sb));c-=this.Da-this.pb;if(d=this.Da-this.ua)this.Oa=Math.round(this.va/(10*d))/100,864E5<=d&&(this.Fa=0,Oc(this));if(0>c||this.Oac&&(this.ua-=c),c=0;this.Ob+=this.ab;this.Da+=c;a(b,c)}}}; +function Bb(a){var b;a.j.error?(a.Z(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.N)a.Z(a.toString()+" busy");else{Oc(a);a.j.N=!0;a.j.ec=!0;if(b=a.l.run)b.textContent="Halt";a.A&&a.A.start(a.ua,Nc(a));a.D||a.status("Started");setTimeout(a.qc,0)}}h.Sb=function(){return 0};function I(a){var b=!1;if(a.j.N){Sc(a);Db(a,a.va);a.va=0;a.j.N=!1;if(b=a.l.run)b.textContent="Run";a.A&&a.A.stop(ta(),Nc(a));b=!0;a.D||a.status("Stopped")}a.j.complete=void 0;return b}var Qc=30,Uc=15,Jc=["power","reset"]; +function Vc(a){var b=+a.model||1170;Ic.call(this,a,6666667);this.qa=b;this.nc=+a.addrReset||0;this.wa=this.i=this.C=this.u=this.m=this.o=this.w=0;this.b=this.ra=this.ja=[];this.I=this.s=this.Ha=this.ub=[];this.Aa=this.F=this.mc=this.Ba=this.Pa=this.Qa=this.Ca=this.G=this.tb=this.Sa=this.Ga=this.H=this.eb=this.fb=this.na=this.g=0;this.Sc=[4,2,0,1];this.Pb=0;this.pc=255;1120>=this.qa?(this.lc=Wc.bind(this),this.Ya=this.Zc,this.Pb=8,this.pc=-1,this.sc=255,this.rc=0):(this.lc=Xc.bind(this),this.Ya=this.$c, +this.sc=~(1792|(1140>=this.qa?2048:0))&65535,this.rc=1140e.xb&&(e.xb=c,c+=4)}return Ic.prototype.ga.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.qa);this.j.N&&I(this);this.u=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.nc,-1,-2,-3,-4,-5,-6,-7,-8];this.ra=[0,0,0,0,0,0];this.ja=[0,0,0,0];this.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, +65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ha=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ub=[0,0,0,0,0,0,0,0];this.C=0;this.wa=-1;this.h=this.f=this.Kb=this.L=this.T=this.g=this.tb=0;zb(this);Lc(this);this.j.error=!1;Ic.prototype.reset.call(this)};function zb(a){a.H=0;a.eb=0;a.fb=0;a.na=0;a.G=0;a.Sa=0;a.Ga=255;a.Ba=0;a.Pa=0;a.Qa=0;a.Ca=262143;a.Aa=a.b[7];a.F=0;a.K=null;a.v&&(pc(a),a.mc=dc(a.v))} +function pc(a){a.Fb=a.ic;a.Gb=a.Qb;a.Rb=a.Tb;a.Hb=a.Ub;a.Ba?(a.ta=65536,a.Eb=a.na&16?4186112:253952,a.pa=a.yc,a.W=a.Bc,a.nb=a.Ec,Wb(a.v,a.na&16?22:18)):(a.ta=0,a.Eb=57344,a.pa=a.cd,a.W=a.pe,a.nb=a.Df,Wb(a.v,16))}function oc(a,b){b&=-3073;if(a.H!=b){b&57344&&!(a.H&57344)&&(a.eb=a.F>>16&65535,a.fb=a.F&65535);a.H=b;a.Pa=(b&96)>>5;a.Qa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ba!=c&&(a.Ba=c,pc(a))}} +function Yc(a,b,c){a.nc=b;R(a,b);rc(a,0);a.v.reset();zb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.N||Bb(a)}else a.D&&a.j.S?I(a)||(a.D.g(),Fb(a.A,-1)):!1===c&&I(a);!a.j.N&&a.ma&&a.ma.stop()}h.xc=function(){return 0}; +h.save=function(){var a=new H(this);a.set(0,[this.b,this.ra,this.ja,this.I,this.s,this.Ha,this.ub,this.G,this.tb,this.Sa,this.Ga,this.H,this.eb,this.fb,this.na,this.Ba,this.Pa,this.Qa,this.Ca,this.Aa,this.g,this.F,this.wa,this.Yb,this.Zb]);a.set(1,[qc(this)]);a.set(2,[this.Fa,this.Ra,this.j.da]);a.set(3,Zc(this));a.set(4,Tc(this));return a.data()}; h.restore=function(a){var b=ia(a[0]);this.b=b.next().value;this.ra=b.next().value;this.ja=b.next().value;this.I=b.next().value;this.s=b.next().value;this.Ha=b.next().value;this.ub=b.next().value;this.G=b.next().value;this.tb=b.next().value;this.Sa=b.next().value;this.Ga=b.next().value;this.H=b.next().value;this.eb=b.next().value;this.fb=b.next().value;this.na=b.next().value;this.Ba=b.next().value;this.Pa=b.next().value;this.Qa=b.next().value;this.Ca=b.next().value;this.Aa=b.next().value;this.g=b.next().value; -this.F=b.next().value;this.wa=b.next().value;this.Yb=b.next().value;this.Zb=b.next().value;b=a[1];sc(this,b[0]);b=a[2];this.Fa=b[0];Pc(this,b[1]);this.l.da=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function R(a,b){a.b[7]=b&65535}function mc(a,b,c,d){b={xb:b,gb:c,message:d||0,name:gb[b],next:null};a.ob.push(b);return b}function oc(a,b){var c=a.K;if(c==b)a.K=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.K&&(a.g|=1)} -function N(a,b){if(b){if(b!=a.K){var c=a.K;if(!c||c.gb<=b.gb)b.next=c,a.K=b;else{do{var d=c.next;if(!d||d.gb<=b.gb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}function $c(a){var b=[];for(a=a.K;a;)b.push(a.xb),a=a.next;return b}function dd(a){return a.g&64?(L(a,168,64,-6),!0):a.g&32?(L(a,4,32,-5),!0):a.g&16?(L(a,12,16,-7),!0):!1}function rc(a){return a.i=a.i&63728|bd(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|ad(a)} -function sc(a,b){b&=a.sc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.u=b<<16;if((b^a.i)&a.rc)for(var c=a.ra.length;0<=--c;){var d=a.b[c];a.b[c]=a.ra[c];a.ra[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.ja[c]=a.b[6],a.b[6]=a.ja[a.C]);a.i=b;a.g&=-3;a.g|=a.K?2:1}h.ia=function(a){this.w=this.o=a;this.m=0};h.La=function(a,b){this.w=this.o=this.u=a;this.m=b||0};function ed(a,b){a.w=a.o=a.u=b;a.m=a.w^a.u>>1}function fd(a,b,c,d){a.w=a.o=a.u=b;a.m=(c^d)&(d^b)} -function L(a,b,c,d){if(!a.cb){0>a.wa?a.wa=rc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.C=0;var e=a.W(b|a.ta),f=a.W(b+2&65535|a.ta);sc(a,f&-12289|a.wa>>2&12288);gd(a,a.wa);gd(a,a.b[7]);R(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.Yb=d;a.Zb=b;-1==d&&I(a);if(-4<=d)throw b;}}function hd(a){var b=id(a),c=id(a);a.i&49152&&(c=c&-225|a.i&63712);R(a,b);sc(a,c);a.g&=-17} -function jd(a,b){var c=b>>13&31;31>c&&(b=a.na&32?a.Ha[c]+(b&8191)&4194303:b&-3932161);return b} -function Jb(a,b,c){var d,e,f;if(!(c&a.Ba))return f=b&65535,57344<=f&&(f|=a.Eb),f;d=b>>13;a.na&a.Sc[a.C]||(d&=7);e=a.s[a.C][d];f=(a.I[a.C][d]<<6)+(b&8191)&a.Ca;3932160<=f&&(f=jd(a,f));if(a.cb)return f;f>=a.mc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.s[a.C][d]=e;if(f!=(4194170&a.Ca)||a.C)a.Pa=a.C,a.Qa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.H&57344||(g|=a.H&4096|a.Pa<<5|a.Qa<<1,pc(a,a.H&-61695|g&61694)),L(a,168,64,-2)),a.H&61440||!(f<(4191360&a.Ca)||f>(4194239&a.Ca))||(a.H|=4096,a.H&512&&(a.g|=64)));return f}function id(a){var b=a.W(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function gd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Ya(4,-2,c);a.nb(c,b)} -function kd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return L(a,4,0,-3),0;case 1:return 6==c&&a.Ya(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Ya(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Ya(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.W(e)|g;a.a-=8;break;case 6:return e=a.W(cd(a,2)),e=e+a.b[c]&65535,6==c&&a.Ya(d,0, -e),a.a-=6,e|g;case 7:return e=a.W(cd(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.ta),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.Zc=function(a,b,c){!this.C&&0>=b&&c<=this.Ga&&(this.g|=32)};h.$c=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Ga&&(c<=this.Ga-32?L(this,4,0,-4):(this.G|=8,this.g|=32)))};h.bd=function(a){return this.ic(a)};h.dd=function(a){return this.Qb(a)};h.ye=function(a,b){this.Tb(a,b)};h.Ae=function(a,b){this.Ub(a,b)}; -h.cd=function(a,b,c){return kd(this,a,b,c)};h.yc=function(a,b,c){return Jb(this,kd(this,a,b,c),c)};h.pe=function(a){return this.v.zb(this.Aa=a)};h.Bc=function(a){return this.v.zb(this.Aa=Jb(this,a,2))};h.Df=function(a,b){this.v.Ab(this.Aa=a,b)};h.Ec=function(a,b){this.v.Ab(this.Aa=Jb(this,a,4),b)}; -function ld(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=kd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.W(d|c&a.ta),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.ja[a.i>>12&3];return c}function md(a,b,c,d){a.F=a.F&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=kd(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=Jb(a,e|c&65536,4),a.C=a.i>>14&3,a.Hb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.ja[a.i>>12&3]=d} -function nd(a,b){b>>=6;var c=a.S=b&7;return(b=a.L=(b&56)>>3)?a.Fb(a.pa(b,c,3)):a.b[c+a.Pb]&a.pc}function od(a,b){var c;b>>=6;var d=a.S=b&7;(b=a.L=(b&56)>>3)?c=a.Gb(a.pa(b,d,2)):c=a.b[d+a.Pb];return c}function pd(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return kd(a,b,c,8)}function qd(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Fb(a.pa(b,c,3)):a.b[c]&255}function rd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Gb(a.pa(b,d,2)):c=a.b[d];return c} +this.F=b.next().value;this.wa=b.next().value;this.Yb=b.next().value;this.Zb=b.next().value;b=a[1];rc(this,b[0]);b=a[2];this.Fa=b[0];Oc(this,b[1]);this.j.da=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function R(a,b){a.b[7]=b&65535}function lc(a,b,c,d){b={xb:b,gb:c,message:d||0,name:fb[b],next:null};a.ob.push(b);return b}function nc(a,b){var c=a.K;if(c==b)a.K=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.K&&(a.g|=1)} +function N(a,b){if(b){if(b!=a.K){var c=a.K;if(!c||c.gb<=b.gb)b.next=c,a.K=b;else{do{var d=c.next;if(!d||d.gb<=b.gb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}function Zc(a){var b=[];for(a=a.K;a;)b.push(a.xb),a=a.next;return b}function cd(a){return a.g&64?(L(a,168,64,-6),!0):a.g&32?(L(a,4,32,-5),!0):a.g&16?(L(a,12,16,-7),!0):!1}function qc(a){return a.i=a.i&63728|ad(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|$c(a)} +function rc(a,b){b&=a.sc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.u=b<<16;if((b^a.i)&a.rc)for(var c=a.ra.length;0<=--c;){var d=a.b[c];a.b[c]=a.ra[c];a.ra[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.ja[c]=a.b[6],a.b[6]=a.ja[a.C]);a.i=b;a.g&=-3;a.g|=a.K?2:1}h.ia=function(a){this.w=this.o=a;this.m=0};h.La=function(a,b){this.w=this.o=this.u=a;this.m=b||0};function dd(a,b){a.w=a.o=a.u=b;a.m=a.w^a.u>>1}function ed(a,b,c,d){a.w=a.o=a.u=b;a.m=(c^d)&(d^b)} +function L(a,b,c,d){if(!a.cb){0>a.wa?a.wa=qc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.C=0;var e=a.W(b|a.ta),f=a.W(b+2&65535|a.ta);rc(a,f&-12289|a.wa>>2&12288);fd(a,a.wa);fd(a,a.b[7]);R(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.Yb=d;a.Zb=b;-1==d&&I(a);if(-4<=d)throw b;}}function gd(a){var b=hd(a),c=hd(a);a.i&49152&&(c=c&-225|a.i&63712);R(a,b);rc(a,c);a.g&=-17} +function id(a,b){var c=b>>13&31;31>c&&(b=a.na&32?a.Ha[c]+(b&8191)&4194303:b&-3932161);return b} +function Ib(a,b,c){var d,e,f;if(!(c&a.Ba))return f=b&65535,57344<=f&&(f|=a.Eb),f;d=b>>13;a.na&a.Sc[a.C]||(d&=7);e=a.s[a.C][d];f=(a.I[a.C][d]<<6)+(b&8191)&a.Ca;3932160<=f&&(f=id(a,f));if(a.cb)return f;f>=a.mc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.s[a.C][d]=e;if(f!=(4194170&a.Ca)||a.C)a.Pa=a.C,a.Qa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.H&57344||(g|=a.H&4096|a.Pa<<5|a.Qa<<1,oc(a,a.H&-61695|g&61694)),L(a,168,64,-2)),a.H&61440||!(f<(4191360&a.Ca)||f>(4194239&a.Ca))||(a.H|=4096,a.H&512&&(a.g|=64)));return f}function hd(a){var b=a.W(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function fd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Ya(4,-2,c);a.nb(c,b)} +function jd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return L(a,4,0,-3),0;case 1:return 6==c&&a.Ya(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Ya(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Ya(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.W(e)|g;a.a-=8;break;case 6:return e=a.W(bd(a,2)),e=e+a.b[c]&65535,6==c&&a.Ya(d,0, +e),a.a-=6,e|g;case 7:return e=a.W(bd(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.ta),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.Zc=function(a,b,c){!this.C&&0>=b&&c<=this.Ga&&(this.g|=32)};h.$c=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Ga&&(c<=this.Ga-32?L(this,4,0,-4):(this.G|=8,this.g|=32)))};h.bd=function(a){return this.ic(a)};h.dd=function(a){return this.Qb(a)};h.ye=function(a,b){this.Tb(a,b)};h.Ae=function(a,b){this.Ub(a,b)}; +h.cd=function(a,b,c){return jd(this,a,b,c)};h.yc=function(a,b,c){return Ib(this,jd(this,a,b,c),c)};h.pe=function(a){return this.v.zb(this.Aa=a)};h.Bc=function(a){return this.v.zb(this.Aa=Ib(this,a,2))};h.Df=function(a,b){this.v.Ab(this.Aa=a,b)};h.Ec=function(a,b){this.v.Ab(this.Aa=Ib(this,a,4),b)}; +function kd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=jd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.W(d|c&a.ta),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.ja[a.i>>12&3];return c}function ld(a,b,c,d){a.F=a.F&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=jd(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=Ib(a,e|c&65536,4),a.C=a.i>>14&3,a.Hb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.ja[a.i>>12&3]=d} +function md(a,b){b>>=6;var c=a.T=b&7;return(b=a.L=(b&56)>>3)?a.Fb(a.pa(b,c,3)):a.b[c+a.Pb]&a.pc}function nd(a,b){var c;b>>=6;var d=a.T=b&7;(b=a.L=(b&56)>>3)?c=a.Gb(a.pa(b,d,2)):c=a.b[d+a.Pb];return c}function od(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return jd(a,b,c,8)}function pd(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Fb(a.pa(b,c,3)):a.b[c]&255}function qd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Gb(a.pa(b,d,2)):c=a.b[d];return c} function T(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Kb=a.pa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.Rb(e,d.call(a,c,a.Fb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function U(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.pa(b,e,6),a.Hb(e,d.call(a,0>c?a.b[-c-1]:c,a.Gb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} -function sd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.pa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.Rb(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function td(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.pa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Hb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} -h.Sb=function(a){this.l.complete=!0;var b=a?this.l.ec?0:1:-1;this.l.ec=!1;this.Ea=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Sa&224)>>5,e=this.K&&this.K.gb>d?this.K:null;e&&(c=e.xb,d=e.gb);d>(this.i&224)>>5?(this.g&8&&(cd(this,2),this.g&=-9),L(this,c,0,-10),d=!0):d=!1;d&&(e&&oc(this,e),a=!0);this.K||this.Sa||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){I(this);break}if(0>b)break}if(this.g&112&&dd(this)){if(this.g& -4&&this.D.b(this.b[7],b)){I(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.lc(e)}while(0>1|b<<16;ed(this,a);return a&65535}function zd(a,b){a=b&128|b>>1|b<<8;ed(this,a<<8);return a&255}function Ad(a,b){a=b&~a;this.ia(a);return a}function Bd(a,b){a=b&~a;this.ia(a<<8);return a}function Cd(a,b){a|=b;this.ia(a);return a}function Dd(a,b){a|=b;this.ia(a<<8);return a} -function Ed(a,b){a=~b|65536;this.La(a);return a&65535}function Fd(a,b){a=~b|256;this.La(a<<8);return a&255}function Gd(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function Hd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function Id(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function Jd(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function Kd(a,b){a=-b;this.La(a,a&b&32768);return a&65535} -function Ld(a,b){a=-b;this.La(a<<8,(a&b&128)<<8);return a&255}function Md(a,b){a=b<<1|this.u>>16&1;ed(this,a);return a&65535}function Nd(a,b){a=b<<1|this.u>>16&1;ed(this,a<<8);return a&255}function Od(a,b){a=(this.u&65536|b)>>1|b<<16;ed(this,a);return a&65535}function Pd(a,b){a=((this.u&65536)>>8|b)>>1|b<<8;ed(this,a<<8);return a&255}function Qd(a,b){var c=b-a;fd(this,c,a,b);return c&65535}function Rd(a,b){var c=b-a;fd(this,c<<8,a<<8,b<<8);return c&255} -function Sd(a,b){this.w=this.o=b&65280;this.m=this.u=0;return(b<<8|b>>8)&65535}function Td(a,b){a^=b;this.ia(a);return a&65535}function Ud(a){U(this,a,od(this,a),ud);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} -function Vd(a){var b=rd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.u=this.m=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} -function Wd(a){var b=rd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&=63;if(b&32){b=64-b;32>b-1;this.u=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function Xd(a){S(this,a,!ad(this))}function Yd(a){S(this,a,ad(this))} -function Zd(a){U(this,a,od(this,a),Ad);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function $d(a){T(this,a,nd(this,a),Bd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ae(a){U(this,a,od(this,a),Cd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function be(a){T(this,a,nd(this,a),Dd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} -function ce(a){var b=od(this,a);a=rd(this,a);this.ia((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function de(a){var b=nd(this,a);a=qd(this,a);this.ia(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function ee(a){S(this,a,this.o&65535?0:4)}function fe(a){S(this,a,!bd(this)==!(this.m&32768))}function ge(a){S(this,a,!!(this.o&65535)&&!bd(this)==!(this.m&32768))} -function he(a){S(this,a,!ad(this)&&!!(this.o&65535))}function ie(a){S(this,a,(this.o&65535?0:4)||!bd(this)!=!(this.m&32768))}function je(a){S(this,a,ad(this)||(this.o&65535?0:4))}function ke(a){S(this,a,!bd(this)!=!(this.m&32768))}function le(a){S(this,a,bd(this))}function me(a){S(this,a,!!(this.o&65535))}function ne(a){S(this,a,!bd(this))}function oe(){L(this,12,0,-9)}function pe(a){S(this,a,!0)}function qe(a){S(this,a,!(this.m&32768))}function re(a){S(this,a,this.m&32768?2:0)} -function V(a){a&1&&(this.u=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function se(a){var b=od(this,a);a=rd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;fd(this,c,a,b);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function te(a){var b=nd(this,a);a=qd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);fd(this,c,a,b);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)} -function ue(a){var b=rd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.u=65536,this.a-=7}function ve(){L(this,24,0,-9);this.a-=20} -function we(){this.i&49152?(this.G|=128,L(this,4,0,-8)):(this.ma&&1120==this.qa&&this.ma.setData(this.b[0],!0),this.D?this.D.i():I(this));this.a-=7}function xe(){L(this,16,0,-9);this.a-=20}var ye=[0,7,7,10,7,11,9,13];function ze(a){this.aa=this.a;R(this,pd(this,a));this.a=this.aa-ye[this.h]}var Ae=[0,14,14,17,14,18,16,20];function Be(a){this.aa=this.a;var b=pd(this,a);a=a>>6&7;gd(this,this.b[a]);this.b[a]=this.b[7];R(this,b);this.a=this.aa-Ae[this.h]} -var Ce=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function De(a){var b=od(this,a);this.aa=this.a;td(this,a,b,this.ia);this.a=this.aa-Ce[(this.L?8:0)+this.h]+(7!=this.f||this.h?0:2)}function Ee(a){var b=nd(this,a);sd(this,a,b,65535,this.ia);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}var Fe=[7,13,13,17,14,18,17,21]; -function Ge(a){var b=rd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.m=0;this.u=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)R(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Me(a){U(this,a,od(this,a),Qd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Ne(a){U(this,a,0,Sd);this.a-=this.h?9:3+(7==this.f?2:0)}function Oe(){L(this,28,0,-9)} -function Pe(){this.ma&&(this.ma.U=this.b[7],this.ma.setData(this.b[0],!0));this.g|=8;cd(this,-2);this.a-=3}function Qe(a){U(this,a,this.b[(a>>6&7)+this.Pb],Td);this.a-=this.h?9:3+(7==this.f?2:0)}function X(){L(this,8,0,-9)}function Xc(a){Re[a>>12].call(this,a)}function Se(a){Te[a>>6&3].call(this,a)}function Ue(a){Ve[a>>6&3].call(this,a)}function We(a){Xe[a>>6&3].call(this,a)}function Ye(a){Ze[a&15].call(this,a)}function $e(a){af[a&15].call(this,a)}function bf(a){cf[a>>6&3].call(this,a)} -function df(a){ef[a>>6&3].call(this,a)}function ff(a){gf[a>>6&3].call(this,a)} -var Re=[function(a){hf[a>>8&15].call(this,a)},De,se,ce,Zd,ae,Ud,X,function(a){jf[a>>8&15].call(this,a)},Ee,te,de,$d,be,Me,X],hf=[function(a){kf[a>>4&15].call(this,a)},pe,me,ee,fe,ke,ge,ie,Be,Be,Se,Ue,We,X,X,X],Te=[function(a){td(this,a,0,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Gd);this.a-=this.h?9:3+(7==this.f?2:0)}],Ve=[function(a){U(this,a,0,Kd); -this.a-=this.h?11:6},function(a){U(this,a,ad(this)?1:0,ud);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,ad(this)?1:0,Qd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=rd(this,a);this.La(a);this.a-=this.h?4:3+(7==this.f?2:0)}],Xe=[function(a){U(this,a,0,Od);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Md);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,yd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,wd);this.a-=this.h?9:3+(7==this.f?2:0)}],kf= -[function(a){lf[a&15].call(this,a)},X,X,X,ze,ze,ze,ze,Je,X,Ye,$e,Ne,Ne,Ne,Ne],lf=[we,Pe,Ke,oe,xe,Ie,X,X,X,X,X,X,X,X,X,X],Ze=[He,function(){this.u=0;this.a-=5},function(){this.m=0;this.a-=5},V,function(){this.o=1;this.a-=5},V,V,V,function(){this.w=0;this.a-=5},V,V,V,V,V,V,V],af=[He,function(){this.u=65536;this.a-=5},function(){this.m=32768;this.a-=5},W,function(){this.o=0;this.a-=5},W,W,W,function(){this.w=32768;this.a-=5},W,W,W,W,W,W,W],jf=[ne,le,he,je,qe,re,Xd,Yd,ve,Oe,bf,df,ff,X,X,X],cf=[function(a){sd(this, -a,0,255,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Fd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Jd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Hd);this.a-=this.h?9:3+(7==this.f?2:0)}],ef=[function(a){T(this,a,0,Ld);this.a-=this.h?11:6},function(a){T(this,a,ad(this)?1:0,vd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,ad(this)?1:0,Rd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=qd(this,a);this.La(a<<8);this.a-=this.h?4:3+ -(7==this.f?2:0)}],gf=[function(a){T(this,a,0,Pd);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Nd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,zd);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,xd);this.a-=this.h?9:3+(7==this.f?2:0)}];function Yc(a){mf[a>>12].call(this,a)} -var mf=[function(a){nf[a>>8&15].call(this,a)},De,se,ce,Zd,ae,Ud,function(a){of[a>>8&15].call(this,a)},function(a){pf[a>>8&15].call(this,a)},Ee,te,de,$d,be,Me,X],nf=[function(a){qf[a>>4&15].call(this,a)},pe,me,ee,fe,ke,ge,ie,Be,Be,Se,Ue,We,function(a){rf[a>>6&3].call(this,a)},X,X],rf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.ta);R(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=ld(this,a,0);this.ia(a);gd(this,a);this.a-=11},function(a){var b=id(this);this.aa= -this.a;this.ia(b);md(this,a,0,b);this.a=this.aa-Fe[this.h]},function(a){td(this,a,bd(this)?65535:0,this.ia);this.a-=this.h?9:3+(7==this.f?2:0)}],qf=[function(a){sf[a&15].call(this,a)},X,X,X,ze,ze,ze,ze,Je,function(a){!(a&8)||1145>this.qa?L(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},Ye,$e,Ne,Ne,Ne,Ne],sf=[we,Pe,function(){hd(this);this.g|=this.i&16;this.a-=13},oe,xe,Ie,Ke,function(){L(this,8,0,-9)},X,X,X,X,X,X,X,X],of=[Ge,Ge,ue,ue,Vd,Vd,Wd,Wd,Qe,Qe,X, -X,X,X,Le,Le],pf=[ne,le,he,je,qe,re,Xd,Yd,ve,Oe,bf,df,ff,function(a){1145>this.qa?L(this,8,0,-9):tf[a>>6&3].call(this,a)},X,X],tf=[function(){L(this,8,0,-9)},function(a){a=ld(this,a,65536);this.ia(a);gd(this,a);this.a-=11},function(a){var b=id(this);this.aa=this.a;this.ia(b);md(this,a,65536,b);this.a=this.aa-Fe[this.h]},function(){L(this,8,0,-9)}]; -function uf(a){r.call(this,"ROM",a,0,128);this.ka=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=F(this.g);if(this.g){a=this.g;var b=Ca(this.m);"json"!=b&&"hex"!=b&&(a=La()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;G(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ra(c.Na,a,b),(a=Ka(a,b))?(c.b=a.O,c.ka=a.ka):c.g=null);vf(c)})}}n(uf,r); -h=uf.prototype;h.ea=function(a,b,c,d){this.v=b;this.c=c;this.D=d;vf(this)};h.ga=function(){this.ka&&(this.D&&this.D.a(this.id,this.h,this.a,this.ka),delete this.ka);return!0};h.fa=function(){return!0}; -function vf(a){if(!ya(a)){if(a.g){if(!a.b||!a.v)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a)xa(a,"ROM size ("+Ba(a.b.length,8,!0)+") does not match specified size ("+Ba(a.a,8,!0)+")");else{var b;a:{b=a.h;if(57344<=b&&b<57344+Pb){var c={},c=(c[b]=[uf.prototype.be,uf.prototype.mf,null,null,null,a.a>>1],c);if(mb(a.v,a,c)){a.status("Added "+a.a+"-byte ROM at "+Aa(b));b=a.i=!0;break a}}else if(Vb(a.v,b,a.a,wc)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),x=l,w=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(w)for(;w--;)dc(a.v,t++,b[x++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< -b.length;e++)dc(a.v,c+e,b[e]);k=!0}if(k){if(null==d||g)I(a.c),f=!1;null!=d&&Zc(a.c,d,f)}return k}Va(function(){for(var a=C(document,B,"ram"),b=0;b>3)?(d=a.pa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.Rb(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function sd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.pa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Hb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} +h.Sb=function(a){this.j.complete=!0;var b=a?this.j.ec?0:1:-1;this.j.ec=!1;this.Ea=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Sa&224)>>5,e=this.K&&this.K.gb>d?this.K:null;e&&(c=e.xb,d=e.gb);d>(this.i&224)>>5?(this.g&8&&(bd(this,2),this.g&=-9),L(this,c,0,-10),d=!0):d=!1;d&&(e&&nc(this,e),a=!0);this.K||this.Sa||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){I(this);break}if(0>b)break}if(this.g&112&&cd(this)){if(this.g& +4&&this.D.b(this.b[7],b)){I(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.lc(e)}while(0>1|b<<16;dd(this,a);return a&65535}function yd(a,b){a=b&128|b>>1|b<<8;dd(this,a<<8);return a&255}function zd(a,b){a=b&~a;this.ia(a);return a}function Ad(a,b){a=b&~a;this.ia(a<<8);return a}function Bd(a,b){a|=b;this.ia(a);return a}function Cd(a,b){a|=b;this.ia(a<<8);return a} +function Dd(a,b){a=~b|65536;this.La(a);return a&65535}function Ed(a,b){a=~b|256;this.La(a<<8);return a&255}function Fd(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function Gd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function Hd(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function Id(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function Jd(a,b){a=-b;this.La(a,a&b&32768);return a&65535} +function Kd(a,b){a=-b;this.La(a<<8,(a&b&128)<<8);return a&255}function Ld(a,b){a=b<<1|this.u>>16&1;dd(this,a);return a&65535}function Md(a,b){a=b<<1|this.u>>16&1;dd(this,a<<8);return a&255}function Nd(a,b){a=(this.u&65536|b)>>1|b<<16;dd(this,a);return a&65535}function Od(a,b){a=((this.u&65536)>>8|b)>>1|b<<8;dd(this,a<<8);return a&255}function Pd(a,b){var c=b-a;ed(this,c,a,b);return c&65535}function Qd(a,b){var c=b-a;ed(this,c<<8,a<<8,b<<8);return c&255} +function Rd(a,b){this.w=this.o=b&65280;this.m=this.u=0;return(b<<8|b>>8)&65535}function Sd(a,b){a^=b;this.ia(a);return a&65535}function Td(a){U(this,a,nd(this,a),td);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} +function Ud(a){var b=qd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.u=this.m=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} +function Vd(a){var b=qd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&=63;if(b&32){b=64-b;32>b-1;this.u=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function Wd(a){S(this,a,!$c(this))}function Xd(a){S(this,a,$c(this))} +function Yd(a){U(this,a,nd(this,a),zd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Zd(a){T(this,a,md(this,a),Ad);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function $d(a){U(this,a,nd(this,a),Bd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ae(a){T(this,a,md(this,a),Cd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} +function be(a){var b=nd(this,a);a=qd(this,a);this.ia((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function ce(a){var b=md(this,a);a=pd(this,a);this.ia(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function de(a){S(this,a,this.o&65535?0:4)}function ee(a){S(this,a,!ad(this)==!(this.m&32768))}function fe(a){S(this,a,!!(this.o&65535)&&!ad(this)==!(this.m&32768))} +function ge(a){S(this,a,!$c(this)&&!!(this.o&65535))}function he(a){S(this,a,(this.o&65535?0:4)||!ad(this)!=!(this.m&32768))}function ie(a){S(this,a,$c(this)||(this.o&65535?0:4))}function je(a){S(this,a,!ad(this)!=!(this.m&32768))}function ke(a){S(this,a,ad(this))}function le(a){S(this,a,!!(this.o&65535))}function me(a){S(this,a,!ad(this))}function ne(){L(this,12,0,-9)}function oe(a){S(this,a,!0)}function pe(a){S(this,a,!(this.m&32768))}function qe(a){S(this,a,this.m&32768?2:0)} +function V(a){a&1&&(this.u=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function re(a){var b=nd(this,a);a=qd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;ed(this,c,a,b);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function se(a){var b=md(this,a);a=pd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);ed(this,c,a,b);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)} +function te(a){var b=qd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.u=65536,this.a-=7}function ue(){L(this,24,0,-9);this.a-=20} +function ve(){this.i&49152?(this.G|=128,L(this,4,0,-8)):(this.ma&&1120==this.qa&&this.ma.setData(this.b[0],!0),this.D?this.D.i():I(this));this.a-=7}function we(){L(this,16,0,-9);this.a-=20}var xe=[0,7,7,10,7,11,9,13];function ye(a){this.aa=this.a;R(this,od(this,a));this.a=this.aa-xe[this.h]}var ze=[0,14,14,17,14,18,16,20];function Ae(a){this.aa=this.a;var b=od(this,a);a=a>>6&7;fd(this,this.b[a]);this.b[a]=this.b[7];R(this,b);this.a=this.aa-ze[this.h]} +var Be=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ce(a){var b=nd(this,a);this.aa=this.a;sd(this,a,b,this.ia);this.a=this.aa-Be[(this.L?8:0)+this.h]+(7!=this.f||this.h?0:2)}function De(a){var b=md(this,a);rd(this,a,b,65535,this.ia);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}var Ee=[7,13,13,17,14,18,17,21]; +function Fe(a){var b=qd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.m=0;this.u=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)R(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Le(a){U(this,a,nd(this,a),Pd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Me(a){U(this,a,0,Rd);this.a-=this.h?9:3+(7==this.f?2:0)}function Ne(){L(this,28,0,-9)} +function Oe(){this.ma&&(this.ma.U=this.b[7],this.ma.setData(this.b[0],!0));this.g|=8;bd(this,-2);this.a-=3}function Pe(a){U(this,a,this.b[(a>>6&7)+this.Pb],Sd);this.a-=this.h?9:3+(7==this.f?2:0)}function X(){L(this,8,0,-9)}function Wc(a){Qe[a>>12].call(this,a)}function Re(a){Se[a>>6&3].call(this,a)}function Te(a){Ue[a>>6&3].call(this,a)}function Ve(a){We[a>>6&3].call(this,a)}function Xe(a){Ye[a&15].call(this,a)}function Ze(a){$e[a&15].call(this,a)}function af(a){bf[a>>6&3].call(this,a)} +function cf(a){df[a>>6&3].call(this,a)}function ef(a){ff[a>>6&3].call(this,a)} +var Qe=[function(a){gf[a>>8&15].call(this,a)},Ce,re,be,Yd,$d,Td,X,function(a){hf[a>>8&15].call(this,a)},De,se,ce,Zd,ae,Le,X],gf=[function(a){jf[a>>4&15].call(this,a)},oe,le,de,ee,je,fe,he,Ae,Ae,Re,Te,Ve,X,X,X],Se=[function(a){sd(this,a,0,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Dd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Hd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Fd);this.a-=this.h?9:3+(7==this.f?2:0)}],Ue=[function(a){U(this,a,0,Jd); +this.a-=this.h?11:6},function(a){U(this,a,$c(this)?1:0,td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,$c(this)?1:0,Pd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=qd(this,a);this.La(a);this.a-=this.h?4:3+(7==this.f?2:0)}],We=[function(a){U(this,a,0,Nd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Ld);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,xd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,vd);this.a-=this.h?9:3+(7==this.f?2:0)}],jf= +[function(a){kf[a&15].call(this,a)},X,X,X,ye,ye,ye,ye,Ie,X,Xe,Ze,Me,Me,Me,Me],kf=[ve,Oe,Je,ne,we,He,X,X,X,X,X,X,X,X,X,X],Ye=[Ge,function(){this.u=0;this.a-=5},function(){this.m=0;this.a-=5},V,function(){this.o=1;this.a-=5},V,V,V,function(){this.w=0;this.a-=5},V,V,V,V,V,V,V],$e=[Ge,function(){this.u=65536;this.a-=5},function(){this.m=32768;this.a-=5},W,function(){this.o=0;this.a-=5},W,W,W,function(){this.w=32768;this.a-=5},W,W,W,W,W,W,W],hf=[me,ke,ge,ie,pe,qe,Wd,Xd,ue,Ne,af,cf,ef,X,X,X],bf=[function(a){rd(this, +a,0,255,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Gd);this.a-=this.h?9:3+(7==this.f?2:0)}],df=[function(a){T(this,a,0,Kd);this.a-=this.h?11:6},function(a){T(this,a,$c(this)?1:0,ud);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,$c(this)?1:0,Qd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=pd(this,a);this.La(a<<8);this.a-=this.h?4:3+ +(7==this.f?2:0)}],ff=[function(a){T(this,a,0,Od);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Md);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,yd);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,wd);this.a-=this.h?9:3+(7==this.f?2:0)}];function Xc(a){lf[a>>12].call(this,a)} +var lf=[function(a){mf[a>>8&15].call(this,a)},Ce,re,be,Yd,$d,Td,function(a){nf[a>>8&15].call(this,a)},function(a){of[a>>8&15].call(this,a)},De,se,ce,Zd,ae,Le,X],mf=[function(a){pf[a>>4&15].call(this,a)},oe,le,de,ee,je,fe,he,Ae,Ae,Re,Te,Ve,function(a){qf[a>>6&3].call(this,a)},X,X],qf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.ta);R(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=kd(this,a,0);this.ia(a);fd(this,a);this.a-=11},function(a){var b=hd(this);this.aa= +this.a;this.ia(b);ld(this,a,0,b);this.a=this.aa-Ee[this.h]},function(a){sd(this,a,ad(this)?65535:0,this.ia);this.a-=this.h?9:3+(7==this.f?2:0)}],pf=[function(a){rf[a&15].call(this,a)},X,X,X,ye,ye,ye,ye,Ie,function(a){!(a&8)||1145>this.qa?L(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},Xe,Ze,Me,Me,Me,Me],rf=[ve,Oe,function(){gd(this);this.g|=this.i&16;this.a-=13},ne,we,He,Je,function(){L(this,8,0,-9)},X,X,X,X,X,X,X,X],nf=[Fe,Fe,te,te,Ud,Ud,Vd,Vd,Pe,Pe,X, +X,X,X,Ke,Ke],of=[me,ke,ge,ie,pe,qe,Wd,Xd,ue,Ne,af,cf,ef,function(a){1145>this.qa?L(this,8,0,-9):sf[a>>6&3].call(this,a)},X,X],sf=[function(){L(this,8,0,-9)},function(a){a=kd(this,a,65536);this.ia(a);fd(this,a);this.a-=11},function(a){var b=hd(this);this.aa=this.a;this.ia(b);ld(this,a,65536,b);this.a=this.aa-Ee[this.h]},function(){L(this,8,0,-9)}]; +function tf(a){r.call(this,"ROM",a,0,128);this.ka=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=F(this.g);if(this.g){a=this.g;var b=Ba(this.m);"json"!=b&&"hex"!=b&&(a=Ka()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;G(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ra(c.Na,a,b),(a=Ja(a,b))?(c.b=a.O,c.ka=a.ka):c.g=null);uf(c)})}}n(tf,r); +h=tf.prototype;h.ea=function(a,b,c,d){this.v=b;this.c=c;this.D=d;uf(this)};h.ga=function(){this.ka&&(this.D&&this.D.a(this.id,this.h,this.a,this.ka),delete this.ka);return!0};h.fa=function(){return!0}; +function uf(a){if(!xa(a)){if(a.g){if(!a.b||!a.v)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+Aa(a.b.length,8,!0)+") does not match specified size ("+Aa(a.a,8,!0)+")";a.j.error=!0;a.B(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Ob){var c={},c=(c[b]=[tf.prototype.be,tf.prototype.mf,null,null,null,a.a>>1],c);if(lb(a.v,a,c)){a.status("Added "+a.a+"-byte ROM at "+za(b));b=a.i=!0;break a}}else if(Ub(a.v,b,a.a,vc)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),x=l,w=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(w)for(;w--;)cc(a.v,t++,b[x++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< +b.length;e++)cc(a.v,c+e,b[e]);k=!0}if(k){if(null==d||g)I(a.c),f=!1;null!=d&&Yc(a.c,d,f)}return k}Ua(function(){for(var a=C(document,B,"ram"),b=0;b=q.jc&&c<=q.Uc&&(b=c-(q.jc-q.Hc));b&&(a.preventDefault&&a.preventDefault(),d.Ib(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Jc&&(b=q.Ic);d.Ib(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +h.ha=function(a,b,c){var d=this;switch(b){case zf:return this.l[b]=this.h=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?q.kc:q.Kc:46==c?b=q.kc:a.ctrlKey&&c>=q.jc&&c<=q.Uc&&(b=c-(q.jc-q.Hc));b&&(a.preventDefault&&a.preventDefault(),d.Ib(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Jc&&(b=q.Ic);d.Ib(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Ib(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;var e=this;this.H=mc(this.c,this.C?-1:48,4,262144);this.I=kc(this.c,function(){var a;a=-1;e.f.length&&(a=e.f.shift()&255,e.w&&97<=a&&122>a&&(a-=32),lc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&N(c,e.H))});this.F=mc(this.c,this.C?-1:52,4,262144);this.Y=kc(this.c,function(){e.b|=128;e.b&64&&N(c,e.F)});mb(b,this,Bf,this.C?64832+8*(this.C-1)-65392:0);ob(b,this.reset.bind(this));D(this)}; -h.zc=function(a){if(!this.g){var b=Lc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ha(c[0]);if(d!=this.Ma)return;c=Ha(c[1]);if(this.g=va(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.u);if(this.s=e.receiveData){this.u=a;this.G=e.receiveStatus;this.status("Connected "+this.Na+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ga=function(a,b){if(!b)if(this.zc(this.u),!a)this.reset();else if(!this.restore(a))return!1;return!0}; -h.fa=function(a){return a?this.save():!0};h.reset=function(){Cf(this)};h.save=function(){var a=new H(this);a.set(0,[this.o,this.a,this.b,this.f]);return a.data()};h.restore=function(a){return Cf(this,a[0])};function Cf(a,b){b||(b=[0,8192,128,a.f]);b=ia(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.f=b.next().value;return!0} -h.Ib=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.m%a,this.S&&(b=" ".slice(0,c)));this.L&&!this.m&&c&&(b=String.fromCharCode(this.L)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.m+=c}}else if(null!= -this.i){if(10==a||1024<=this.i.length)this.Z(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}lc(this.c,this.Y,1E3/Math.round(this.aa/10));this.b&=-129};var Af="buffer",Df={},Bf=(Df[65392]=[null,null,Z.prototype.Pd,Z.prototype.Ze,"RCSR"],Df[65394]=[null,null,Z.prototype.Od,Z.prototype.Ye,"RBUF"],Df[65396]=[null,null,Z.prototype.te,Z.prototype.Ff,"XCSR"],Df[65398]=[null,null,Z.prototype.se,Z.prototype.Ef,"XBUF"],Df); -Va(function(){for(var a=C(document,B,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "readTape":e=Hf;case "loadTape":return e||(e=If),this.j[b]=c,c.onclick= -function(){var a=d.j.listTapes;a&&Jf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Jf(d,F(b,!0),b,If,a)}return!1};return!0;case Kf:return this.j[b]=c,!0}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;this.u=Lf(a);var e=this;if(a=Ef(this,Lc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.s=mc(this.c,56,4,4096);this.H=kc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.mc.indexOf("/api/v1/dump")&&(e=Ca(c),f="json"==e||"gz"==e?encodeURI(c):La()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!G(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.l.T;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ra(a.Na,e,f),(e=Ka(e,f))&&Wf(a,b,c,d,e.O,e.ca,e.ba)); -a.l.Ua=!1;a.b&&(a.b--,a.b||D(a));Tf(a)})}function Of(a,b,c,d){if((a=a.j.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ca(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ea(c,"/")&&(d="dir"),f=La()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Cb?"":e)+"&format=json"));return!!G(f, -null,!0,function(b,c,d){dg(a,b,c,d)})} -function dg(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.l.T;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.oa+'" (error '+d+": "+b+")",f);else{ra(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.J=k.length;a.R=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.V=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var x=l.bytes;if(void 0!==x&&x.length){for(var w=m<<2,Y=x.length;Y>2,e=Array(d),f=0;fa&&(a-=32),kc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&N(c,e.H))});this.F=lc(this.c,this.C?-1:52,4,262144);this.Y=jc(this.c,function(){e.b|=128;e.b&64&&N(c,e.F)});lb(b,this,Af,this.C?64832+8*(this.C-1)-65392:0);nb(b,this.reset.bind(this));D(this)}; +h.zc=function(a){if(!this.g){var b=Kc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ga(c[0]);if(d!=this.Ma)return;c=Ga(c[1]);if(this.g=va(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.u);if(this.s=e.receiveData){this.u=a;this.G=e.receiveStatus;this.status("Connected "+this.Na+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ga=function(a,b){if(!b)if(this.zc(this.u),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +h.fa=function(a){return a?this.save():!0};h.reset=function(){Bf(this)};h.save=function(){var a=new H(this);a.set(0,[this.o,this.a,this.b,this.f]);return a.data()};h.restore=function(a){return Bf(this,a[0])};function Bf(a,b){b||(b=[0,8192,128,a.f]);b=ia(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.f=b.next().value;return!0} +h.Ib=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.m%a,this.T&&(b=" ".slice(0,c)));this.L&&!this.m&&c&&(b=String.fromCharCode(this.L)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.m+=c}}else if(null!= +this.i){if(10==a||1024<=this.i.length)this.Z(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}kc(this.c,this.Y,1E3/Math.round(this.aa/10));this.b&=-129};var zf="buffer",Cf={},Af=(Cf[65392]=[null,null,Z.prototype.Pd,Z.prototype.Ze,"RCSR"],Cf[65394]=[null,null,Z.prototype.Od,Z.prototype.Ye,"RBUF"],Cf[65396]=[null,null,Z.prototype.te,Z.prototype.Ff,"XCSR"],Cf[65398]=[null,null,Z.prototype.se,Z.prototype.Ef,"XBUF"],Cf); +Ua(function(){for(var a=C(document,B,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.l[b]=c,!0;case "readTape":e=Gf;case "loadTape":return e||(e=Hf),this.l[b]=c,c.onclick= +function(){var a=d.l.listTapes;a&&If(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.l[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;If(d,F(b,!0),b,Hf,a)}return!1};return!0;case Jf:return this.l[b]=c,!0}return!1}; +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;this.u=Kf(a);var e=this;if(a=Df(this,Kc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.s=lc(this.c,56,4,4096);this.H=jc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.mc.indexOf("/api/v1/dump")&&(e=Ba(c),f="json"==e||"gz"==e?encodeURI(c):Ka()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!G(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.S;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ra(a.Na,e,f),(e=Ja(e,f))&&Vf(a,b,c,d,e.O,e.ca,e.ba)); +a.j.Ua=!1;a.b&&(a.b--,a.b||D(a));Sf(a)})}function Nf(a,b,c,d){if((a=a.l.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ba(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ca(c,"/")&&(d="dir"),f=Ka()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Cb?"":e)+"&format=json"));return!!G(f, +null,!0,function(b,c,d){cg(a,b,c,d)})} +function cg(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.S;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.oa+'" (error '+d+": "+b+")",f);else{ra(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)v(k[0]);else{a.J=k.length;a.R=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.V=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var x=l.bytes;if(void 0!==x&&x.length){for(var w=m<<2,Y=x.length;Y>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.la?f=a.sa+a.la&&(a.la+=f-(a.sa+a.la)+1):(a.sa=f,a.la=1);d[f]=d[f]&~(255<g)break;e|=g<g)break;e|=g<=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ +h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.B("Unable to restore disk '"+this.oa+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=fg(this,a++);)ig(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function ig(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var $f=0;function Q(a){r.call(this,"RK11",a,0,65536);this.w=jg(this,a.autoMount);this.o=0;this.f=Array(8);this.C=!Qa("Mobi")&&window&&"FileReader"in window;this.h=[];this.Ka=null;this.u=this.b=this.a=this.m=this.i=this.g=this.s=0}n(Q,r); -function jg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Q.prototype; -h.ha=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.j[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&kg(d,a)}, -!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&lg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.f.length||!(a=d.f[b])?d.B("Unable to boot the selected drive"):a.P?(Zc(d.c,0,!0),(a=d.tc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.C){c.parentNode.removeChild(c); -break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.f&&((a=d.f[E(a.value)||0])?(a=a.P)?(a=Ta(hg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.C)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;lg(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;if(a=jg(this,Lc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);mg(this);this.Ka=mc(this.c,144,5,65536);mb(b,this,ng);ob(b,this.reset.bind(this));og(this,"None",pg,!0);this.C&&og(this,"Local Disk",qg);og(this,"Remote Disk",rg);sg(this)||D(this)}; -h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){this.h=[];for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";kg(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){mg(this)}; -h.save=function(){var a=new H(this);a.set(0,[this.u,this.b,this.a,this.m,this.i,this.g,this.s,ug(this)]);return a.data()};h.restore=function(a){return mg(this,a[0])}; -function mg(a,b){b||(b=[2368,0,128,0,0,0,0]);var c=ia(b);a.u=c.next().value;a.b=c.next().value;a.a=c.next().value;a.m=c.next().value;a.i=c.next().value;a.g=c.next().value;a.s=c.next().value;b[7]&&(a.h=b[7]);for(b=0;bg||9e||e>=a.f.length)a.B("Unable to load the selected drive");else if(c)if(c==qg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==rg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}wg(a,e,b,c,!1,d)}else tg(a,e)} -function wg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,tg(a,b,!0),k.Wa?a.B("RK11 busy"):(k.Wa=!0,e&&(k.Va=!0,a.o++),k.ya=!!f,cg(new Zf(a,k,"preload"),c,d,f,a.Mc)&&g++));return g} -h.Mc=function(a,b,c,d,e){a.Wa=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Ja)),b=null);if(b){a.P=b;a.oa=c;a.X=d;a:{var f;for(f=0;f=a.J){m=64;break}p=a.seek(b,c,d+1);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}var x,w;if(0>(x=a.read(p,t++))||0>(w=a.read(p,t++))){m=32;break}if(!k&&(Ib(this.v,jd(this.c,f),x|w<<8),jc(this.v))){m=1024;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Nc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.P;var p=null,t;a||(m=128,e=0);for(;e;){var x=Kb(this.v,jd(this.c,f));if(jc(this.v)){m=1024;break}if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1,!0);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}if(k){var w,Y;if(0>(w=a.read(p,t++))||0>(Y=a.read(p,t++))){m=32;break}if(x!=(w|Y<<8)){m=1;break}}else if(!a.write(p,t++,x&255)||!a.write(p,t++,x>>8)){m=32;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Lc=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&-49|f>>12&48;this.m=65536-e&65535;this.g=this.g&-16|d&15;this.b|=a;xg(this);return!0};function xg(a){a.a&=-32769;a.b&&(a.b|=32768,a.a|=32768,a.b&32736&&(a.a|=16384))}h.Ud=function(){return this.u};h.df=function(){};h.Vd=function(){return this.b};h.ef=function(){};h.Rd=function(){return this.a&61438}; +h.toJSON=function(){var a;a=0;for(var b;b=eg(this,a++);)hg(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function hg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var Zf=0;function Q(a){r.call(this,"RK11",a,0,65536);this.w=ig(this,a.autoMount);this.o=0;this.f=Array(8);this.C=!Pa("Mobi")&&window&&"FileReader"in window;this.h=[];this.Ka=null;this.u=this.b=this.a=this.m=this.i=this.g=this.s=0}n(Q,r); +function ig(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Q.prototype; +h.ha=function(a,b,c){var d=this;switch(b){case "listDisks":return this.l[b]=c,c.onchange=function(){var a=d.l.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.l[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&jg(d,a)}, +!0;case "loadDisk":return this.l[b]=c,c.onclick=function(){var a=d.l.listDisks;a&&a.options&&kg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.l[b]=c,c.onclick=function(){var a,b=d.l.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.f.length||!(a=d.f[b])?d.B("Unable to boot the selected drive"):a.P?(Yc(d.c,0,!0),(a=d.tc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.C){c.parentNode.removeChild(c); +break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.f&&((a=d.f[E(a.value)||0])?(a=a.P)?(a=Sa(gg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.C)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;kg(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;if(a=ig(this,Kc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);lg(this);this.Ka=lc(this.c,144,5,65536);lb(b,this,mg);nb(b,this.reset.bind(this));ng(this,"None",og,!0);this.C&&ng(this,"Local Disk",pg);ng(this,"Remote Disk",qg);rg(this)||D(this)}; +h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){this.h=[];for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";jg(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){lg(this)}; +h.save=function(){var a=new H(this);a.set(0,[this.u,this.b,this.a,this.m,this.i,this.g,this.s,tg(this)]);return a.data()};h.restore=function(a){return lg(this,a[0])}; +function lg(a,b){b||(b=[2368,0,128,0,0,0,0]);var c=ia(b);a.u=c.next().value;a.b=c.next().value;a.a=c.next().value;a.m=c.next().value;a.i=c.next().value;a.g=c.next().value;a.s=c.next().value;b[7]&&(a.h=b[7]);for(b=0;bg||9e||e>=a.f.length)a.B("Unable to load the selected drive");else if(c)if(c==pg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==qg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}vg(a,e,b,c,!1,d)}else sg(a,e)} +function vg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,sg(a,b,!0),k.Wa?a.B("RK11 busy"):(k.Wa=!0,e&&(k.Va=!0,a.o++),k.ya=!!f,bg(new Yf(a,k,"preload"),c,d,f,a.Mc)&&g++));return g} +h.Mc=function(a,b,c,d,e){a.Wa=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Ja)),b=null);if(b){a.P=b;a.oa=c;a.X=d;a:{var f;for(f=0;f=a.J){m=64;break}p=a.seek(b,c,d+1);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}var x,w;if(0>(x=a.read(p,t++))||0>(w=a.read(p,t++))){m=32;break}if(!k&&(Hb(this.v,id(this.c,f),x|w<<8),ic(this.v))){m=1024;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Nc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.P;var p=null,t;a||(m=128,e=0);for(;e;){var x=Jb(this.v,id(this.c,f));if(ic(this.v)){m=1024;break}if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1,!0);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}if(k){var w,Y;if(0>(w=a.read(p,t++))||0>(Y=a.read(p,t++))){m=32;break}if(x!=(w|Y<<8)){m=1;break}}else if(!a.write(p,t++,x&255)||!a.write(p,t++,x>>8)){m=32;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Lc=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&-49|f>>12&48;this.m=65536-e&65535;this.g=this.g&-16|d&15;this.b|=a;wg(this);return!0};function wg(a){a.a&=-32769;a.b&&(a.b|=32768,a.a|=32768,a.b&32736&&(a.a|=16384))}h.Ud=function(){return this.u};h.df=function(){};h.Vd=function(){return this.b};h.ef=function(){};h.Rd=function(){return this.a&61438}; h.af=function(a){this.a=this.a&-3968|a&3967;if(this.a&1){a=!0;var b,c,d=(this.g&57344)>>13,e=this.f[d],f,g,k,l,m,p;this.a&=-8321;this.b&=-4;switch(c=this.a&14){case 0:this.b=this.g=0;this.a=128;break;case 10:case 4:b=this.tc;case 6:case 2:b||(b=this.Nc);f=(this.g&8160)>>5;g=(this.g&16)>>4;k=this.g&15;l=65536-this.m&65535;m=(this.a&48)<<12|this.i;p=this.a&2048?0:2;if(f>=e.J){this.b|=64;break}if(k>=e.M){this.b|=32;break}a=b.call(this,e,f,g,k,l,m,p,6<=c,this.Lc.bind(this));break;case 8:f=(this.g&8160)>> -5;f'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&Ag(d,a)}, -!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&Bg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.P?(Zc(d.c,0,!0),(a=d.uc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.u){c.parentNode.removeChild(c); -break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.b&&((a=d.b[E(a.value)||0])?(a=a.P)?(a=Ta(hg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.u)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Bg(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;if(a=zg(this,Lc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.s[e]=a[e]);Cg(this);this.Ka=mc(this.c,112,5,131072);mb(b,this,Dg);ob(b,this.reset.bind(this));Eg(this,"None",Fg,!0);this.u&&Eg(this,"Local Disk",Gg);Eg(this,"Remote Disk",Hg);Ig(this)||D(this)}; -h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Ag(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){Cg(this)};h.save=function(){return(new H(this)).data()}; -h.restore=function(a){return Cg(this,a[0])};function Ig(a,b){b||(a.o=0);for(var c in a.s){var d=a.s[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==Gg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Hg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}Kg(a,e,b,c,!1,d)}else Jg(a,e)} -function Kg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,Jg(a,b,!0),k.Wa?a.B("RL11 busy"):(k.Wa=!0,e&&(k.Va=!0,a.o++),k.ya=!!f,cg(new Zf(a,k,"preload"),c,d,f,a.Pc)&&g++));return g}h.Pc=function(a,b,c,d,e){a.Wa=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Ja)),b=null);b?(a.P=b,a.oa=c,a.X=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Ja),a.Va||e),this.A&&Sc(this.A)):a.ya=!1;a.Va&&(a.Va=!1,--this.o||D(this));Ag(this,a.Ja)}; -function Eg(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}Ib(this.v,jd(this.c,f),p|t<<8);if(jc(this.v)){k=8192;break}f+=2;e--;if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Qc=function(a,b,c,d,e,f,g){var k=0;a=a.P;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Kb(this.v,jd(this.c,f));if(jc(this.v)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +5;f'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&zg(d,a)}, +!0;case "loadDisk":return this.l[b]=c,c.onclick=function(){var a=d.l.listDisks;a&&a.options&&Ag(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.l[b]=c,c.onclick=function(){var a,b=d.l.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.P?(Yc(d.c,0,!0),(a=d.uc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.u){c.parentNode.removeChild(c); +break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.b&&((a=d.b[E(a.value)||0])?(a=a.P)?(a=Sa(gg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.u)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ag(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;if(a=yg(this,Kc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.s[e]=a[e]);Bg(this);this.Ka=lc(this.c,112,5,131072);lb(b,this,Cg);nb(b,this.reset.bind(this));Dg(this,"None",Eg,!0);this.u&&Dg(this,"Local Disk",Fg);Dg(this,"Remote Disk",Gg);Hg(this)||D(this)}; +h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";zg(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){Bg(this)};h.save=function(){return(new H(this)).data()}; +h.restore=function(a){return Bg(this,a[0])};function Hg(a,b){b||(a.o=0);for(var c in a.s){var d=a.s[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.l.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==Fg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Gg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}Jg(a,e,b,c,!1,d)}else Ig(a,e)} +function Jg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,Ig(a,b,!0),k.Wa?a.B("RL11 busy"):(k.Wa=!0,e&&(k.Va=!0,a.o++),k.ya=!!f,bg(new Yf(a,k,"preload"),c,d,f,a.Pc)&&g++));return g}h.Pc=function(a,b,c,d,e){a.Wa=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Ja)),b=null);b?(a.P=b,a.oa=c,a.X=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Ja),a.Va||e),this.A&&Rc(this.A)):a.ya=!1;a.Va&&(a.Va=!1,--this.o||D(this));zg(this,a.Ja)}; +function Dg(a,b,c,d){if((a=a.l.listDisks)&&a.options){for(var e=0;e(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}Hb(this.v,id(this.c,f),p|t<<8);if(ic(this.v)){k=8192;break}f+=2;e--;if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +h.Qc=function(a,b,c,d,e,f,g){var k=0;a=a.P;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Jb(this.v,id(this.c,f));if(ic(this.v)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; h.Oc=function(a,b,c,d,e,f){this.m=f&65535;this.a=this.a&-49|f>>12&48;this.h=f>>16&63;this.g=this.f=b<<7|(c?64:0)|d&63;this.i=65536-e&65535;a&&(this.a=this.a|a|32768);return!0};h.Zd=function(){return this.a&65535}; h.jf=function(a){this.a=this.a&-1023|a&1022;this.h=this.h&60|(a&48)>>4;if(!(this.a&128)){a=!0;var b,c=this.b[(this.a&768)>>8],d=c.P,e,f,g;this.a&=-2;switch(this.a&14){case 4:this.i&8&&(this.a&=63);this.i=c.status|this.g&64|(d&&512==d.J?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.g=this.f&4?this.g+b:this.g-b,this.f=this.g=this.g&65408|c);break;case 8:this.i=this.g;break;case 12:b=this.uc;case 10:b||(b=this.Qc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.J||g>=d.M? this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Oc.bind(this)))}a&&(this.a|=129,this.a&64&&N(this.c,this.Ka))}};h.Xd=function(){return this.m};h.gf=function(a){this.m=a&65534};h.$d=function(){return this.f};h.kf=function(a){this.f=a};h.ae=function(){return this.i};h.lf=function(a){this.i=a};h.Yd=function(){return this.h};h.hf=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4}; -var Fg="",Gg="?",Hg="??",Lg={},Dg=(Lg[63744]=[null,null,P.prototype.Zd,P.prototype.jf,"RLCS"],Lg[63746]=[null,null,P.prototype.Xd,P.prototype.gf,"RLBA"],Lg[63748]=[null,null,P.prototype.$d,P.prototype.kf,"RLDA"],Lg[63750]=[null,null,P.prototype.ae,P.prototype.lf,"RLMP"],Lg[63752]=[null,null,P.prototype.Yd,P.prototype.hf,"RLBE"],Lg); -function Mg(a,b,c){r.call(this,"Computer",a,0,33554432);this.l.T=!1;this.G=null;Ng(this,b);this.C=Lc(this,"autoPower",a,6);this.g=0;this.K=+a.busWidth||+a.buswidth;this.u=this.s=this.w=null;this.o=this.I=!1;this.i=this.h=null;this.H=this.m=this.F=!1;this.L=Lc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Og(this);if(this.c=wa("CPU",this.id)){this.D=wa("Debugger",this.id);this.v=new Ob({id:this.Na+".bus",busWidth:this.K},this.c,this.D);var d,e=y(this.id);if((this.f=wa("Panel",this.id))&&this.f.bb)for(b= -0;b\nLicense: GPL version 3 or later ");this.Z("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bPg){if(Qg(d,this.u)){this.h=new H(this,"1.32.2",Zg);Qg(this.h)&&($g(this,d),a=ch,dh(this.h));this.h.set(Wg,Ja());eh(this.h);var e=this.a&&!this.o;if(a==Xg||ua("Click OK to restore the previous "+db+" machine state, or CANCEL to reset the machine.")){if(c=Vg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Qg(d,g):("error"==f&&"no machine state"!= -g?(this.B("Error: "+g),"unable to verify user"==g&&(Pa(fh,""),this.b=null)):this.Z(f+": "+g),dh(d),Qg(d)?(c=Vg(d),e=!0):c=!1))}e&&Tg(this,c?d:null)}else a==ch&&d.clear()}else Tg(this);delete this.u;delete this.i}e=y(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.l.T=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.c&&(gh(this,this.c,b,c,a),Gb(this,-2),this.c.da());this.F&&($g(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; -function $g(a,b){if(ua("There may be a problem with your "+db+" machine.\n\nTo help us diagnose it, click OK to send this "+db+" machine state to http://www.pcjs.org.")){var c=a.L;a=a.b||"";b=b.toString();var d={};d.app=db;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;G("http://www.pcjs.org/api/v1/report",d,!0)}} -function hh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new H(a,"1.32.2"),g=new H(a,"1.32.2",Ug),k=Ja();g.set(Wg,k);f.set(Wg,k);f.set(ih,"1.32.2");f.set(jh,window?window.location.href:null);f.set(kh,window?window.navigator.userAgent:"");a.c&&a.c.fa&&(c&&(b&&(a.c.l.da=a.c.l.N),I(a.c)),d=a.c.fa(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.l.T=!1,!1===d&&(e=null)));for(var k=y(a.id),l=0;l=d||30<=(c.hc+=d))&&(e.textContent=c.l.N?c.Oa.toFixed(2)+"Mhz":"Stopped",c.hc=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.l.N;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]:0\nLicense: GPL version 3 or later ");this.Z("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bOg){if(Pg(d,this.u)){this.h=new H(this,"1.32.2",Yg);Pg(this.h)&&(Zg(this,d),a=bh,ch(this.h));this.h.set(Vg,Ia());dh(this.h);var e=this.a&&!this.o;if(a==Wg||ua("Click OK to restore the previous "+cb+" machine state, or CANCEL to reset the machine.")){if(c=Ug(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Pg(d,g):("error"==f&&"no machine state"!= +g?(this.B("Error: "+g),"unable to verify user"==g&&(Oa(eh,""),this.b=null)):this.Z(f+": "+g),ch(d),Pg(d)?(c=Ug(d),e=!0):c=!1))}e&&Sg(this,c?d:null)}else a==bh&&d.clear()}else Sg(this);delete this.u;delete this.i}e=y(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.S=!0;var d=this.l.power;d&&(d.textContent="Shutdown");this.c&&(fh(this,this.c,b,c,a),Fb(this,-2),this.c.da());this.F&&(Zg(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; +function Zg(a,b){if(ua("There may be a problem with your "+cb+" machine.\n\nTo help us diagnose it, click OK to send this "+cb+" machine state to http://www.pcjs.org.")){var c=a.L;a=a.b||"";b=b.toString();var d={};d.app=cb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;G("http://www.pcjs.org/api/v1/report",d,!0)}} +function gh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new H(a,"1.32.2"),g=new H(a,"1.32.2",Tg),k=Ia();g.set(Vg,k);f.set(Vg,k);f.set(hh,"1.32.2");f.set(ih,window?window.location.href:null);f.set(jh,window?window.navigator.userAgent:"");a.c&&a.c.fa&&(c&&(b&&(a.c.j.da=a.c.j.N),I(a.c)),d=a.c.fa(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.S=!1,!1===d&&(e=null)));for(var k=y(a.id),l=0;l=d||30<=(c.hc+=d))&&(e.textContent=c.j.N?c.Oa.toFixed(2)+"Mhz":"Stopped",c.hc=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.j.N;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");G(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);sh(a,b,c)}})}else c(a,null)} -function th(a,b,c,d){function e(a){if(void 0===k){var b=g&&C(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Fa(a))}function f(a){e("Error: "+a);l&&(--ph||Za(!0));l=!1}var g,k,l=!0;ph++;sa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?qh(c,null,null,!1,e,function(d,l){l?(ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--ph||Za(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--ph||Za(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?qh(b,a,d,!0,e,m):rh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(x){f(x.message)}return l}window.embedPDP11=function(a,b,c,d){Za(!1);return th(a,b,c,d)};window.findMachineComponent=function(a,b){return wa(b,a+".machine")};window.enableEvents=Za;window.sendEvent=ab;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map +h.ha=function(a,b,c){var d=this;switch(b){case "power":return this.l[b]=c,c.onclick=function(){d.g||(d.j.S?gh(d,!1,!0):Rg(d,d.vb))},!0;case "reset":return this.l[b]=c,c.onclick=function(){if(d.j.S&&!d.g)if(d.a&&!d.s){var a=ua("Click OK to save changes to this "+cb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");gh(d,a,!0);!a&&d.w?window&&window.location.reload():(a||(d.m=!0),d.vb(Og),d.m=!1)}else d.reset(),d.c&&d.c.da()},!0;case "save":if(Ca(Ka(),"pcjs.org"))c.parentNode.removeChild(c);else return this.l[b]= +c,c.onclick=function(){var a=Ng(d,!0);if(a){var b=!!(d.a&&!d.s||d.w),c=gh(d,b);b?kh(d,a,c):d.B("Resume disabled, machine state not saved")}},!0}return!1};function Ng(a,b){var c=a.b;c||((c=Na(eh),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=mh(a,c))||a.B("The user ID is invalid.")):b&&a.B("Browser local storage is not available"));return c} +function mh(a,b){a.b=null;b=G(Ka()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Oa(eh,b.data),a.b=b.data)}catch(d){v(d.message+" ("+c+")")}return a.b}function Qg(a){var b=null;a.b&&(b=Ka()+"/api/v1/user?req=load&user="+a.b+"&state="+nh(a,"1.32.2"));return b} +function kh(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=nh(a,"1.32.2");d.data=c;b=G(Ka()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");G(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);rh(a,b,c)}})}else c(a,null)} +function sh(a,b,c,d){function e(a){if(void 0===k){var b=g&&C(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ea(a))}function f(a){e("Error: "+a);l&&(--oh||Ya(!0));l=!1}var g,k,l=!0;oh++;sa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?ph(c,null,null,!1,e,function(d,l){l?(ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--oh||Ya(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--oh||Ya(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ph(b,a,d,!0,e,m):qh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(x){f(x.message)}return l}window.embedPDP11=function(a,b,c,d){Ya(!1);return sh(a,b,c,d)};window.findMachineComponent=function(a,b){return wa(b,a+".machine")};window.enableEvents=Ya;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map From 367d466fe137a8a65680ac527397b3ea7419b668 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Thu, 26 Jan 2017 15:09:08 -0800 Subject: [PATCH 08/15] Save/restore of PDP-11 diagnostic works even when the MMU is enabled --- modules/pdp11/lib/cpustate.js | 19 +- modules/pdp11/lib/debugger.js | 43 +- modules/pdp11/lib/panel.js | 9 +- versions/pdpjs/1.32.2/pdp11-dbg.js | 614 ++++++++++++++--------------- versions/pdpjs/1.32.2/pdp11.js | 404 +++++++++---------- 5 files changed, 537 insertions(+), 552 deletions(-) diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index dd939c6bb..be28a3671 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -649,14 +649,8 @@ class CPUStatePDP11 extends CPUPDP11 { this.regMBR, this.regPIR, this.regSLR, - this.regMMR0, - this.regMMR1, - this.regMMR2, - this.regMMR3, - this.mmuEnable, this.mmuLastMode, this.mmuLastPage, - this.mmuMask, this.addrLast, this.opFlags, this.opLast, @@ -664,7 +658,7 @@ class CPUStatePDP11 extends CPUPDP11 { this.trapReason, this.trapVector ]); - state.set(1, [this.getPSW()]); + state.set(1, [this.getPSW(),this.getMMR0(),this.getMMR1(),this.getMMR2(),this.getMMR3()]); state.set(2, [this.nTotalCycles, this.getSpeed(), this.flags.autoStart]); state.set(3, this.saveIRQs()); state.set(4, this.saveTimers()); @@ -696,14 +690,8 @@ class CPUStatePDP11 extends CPUPDP11 { this.regMBR, this.regPIR, this.regSLR, - this.regMMR0, - this.regMMR1, - this.regMMR2, - this.regMMR3, - this.mmuEnable, this.mmuLastMode, this.mmuLastPage, - this.mmuMask, this.addrLast, this.opFlags, this.opLast, @@ -714,6 +702,10 @@ class CPUStatePDP11 extends CPUPDP11 { var a = data[1]; this.setPSW(a[0]); + this.setMMR0(a[1]); + this.regMMR1 = a[2]; + this.regMMR2 = a[3]; + this.setMMR3(a[4]); a = data[2]; this.nTotalCycles = a[0]; @@ -2876,6 +2868,7 @@ class CPUStatePDP11 extends CPUPDP11 { fnFlags.call(this, data << 8); } else { var addr = this.getAddr(mode, reg, PDP11.ACCESS.WRITE_BYTE); + //noinspection JSUnresolvedFunction fnFlags.call(this, (data = data < 0? (this.regsGen[-data-1] & 0xff) : data) << 8); this.setByte(addr, data); if (addr & 1) this.nStepCycles--; diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index f200c2a9c..d786ef587 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -1658,6 +1658,7 @@ class DebuggerPDP11 extends Debugger { * requires reading memory that triggers more memory reads, which triggers more breakpoint checks. */ this.nSuppressBreaks = 0; + this.nBreakInstructions = 0; } /** @@ -2702,25 +2703,16 @@ class DebuggerPDP11 extends Debugger { * * As the "help" output below indicates, the following breakpoint commands are supported: * - * bp [a] set exec breakpoint on linear addr [a] - * br [a] set read breakpoint on linear addr [a] - * bw [a] set write breakpoint on linear addr [a] - * bc [a] clear breakpoint on linear addr [a] (use "*" for all breakpoints) - * bl list breakpoints + * bp # set exec breakpoint + * br # set read breakpoint + * bw # set write breakpoint + * bc # clear breakpoint (* to clear all) + * bl list all breakpoints + * bn [#] break after # instruction(s) * - * to which we have recently added the following I/O breakpoint commands: - * - * bi [p] toggle input breakpoint on port [p] (use "*" for all input ports) - * bo [p] toggle output breakpoint on port [p] (use "*" for all output ports) - * - * These two new commands operate as toggles so that if "*" is used to trap all input (or output), - * you can also use these commands to NOT trap specific ports. - * - * bn [n] break after [n] instructions - * - * TODO: Update the "bl" command to include any/all I/O breakpoints, and the "bc" command to - * clear them. Because "bi" and "bo" commands are piggy-backing on Bus functions, those breakpoints - * are currently outside the realm of what the "bl" and "bc" commands are aware of. + * The "bn" command, like the "dh" command and all other commands that use an instruction count, + * assumes a decimal value, regardless of the current base. Use "bn" without an argument to display + * the break count, and use "bn 0" to clear the break count. * * @this {DebuggerPDP11} * @param {string} sCmd @@ -2731,10 +2723,10 @@ class DebuggerPDP11 extends Debugger { { if (sAddr == '?') { this.println("breakpoint commands:"); - this.println("\tbp [#]\tset exec breakpoint at addr #"); - this.println("\tbr [#]\tset read breakpoint at addr #"); - this.println("\tbw [#]\tset write breakpoint at addr #"); - this.println("\tbc [#]\tclear breakpoint at addr #"); + this.println("\tbp #\tset exec breakpoint"); + this.println("\tbr #\tset read breakpoint"); + this.println("\tbw #\tset write breakpoint"); + this.println("\tbc #\tclear breakpoint (* to clear all)"); this.println("\tbl\tlist all breakpoints"); this.println("\tbn [#]\tbreak after # instruction(s)"); return; @@ -2751,10 +2743,9 @@ class DebuggerPDP11 extends Debugger { } if (sParm == 'n') { - this.nBreakInstructions = this.parseValue(sAddr); - if (this.nBreakInstructions != null) { - this.println("break after " + this.nBreakInstructions + " instruction(s)"); - } + var n = +sAddr || 0; + if (sAddr) this.nBreakInstructions = n; + this.println("break after " + n + " instruction(s)"); return; } diff --git a/modules/pdp11/lib/panel.js b/modules/pdp11/lib/panel.js index 464788513..73fbe46b7 100644 --- a/modules/pdp11/lib/panel.js +++ b/modules/pdp11/lib/panel.js @@ -234,21 +234,22 @@ class PanelPDP11 extends Component { } /** - * reset() + * reset(fPowerUp) * * NOTE: Since we've registered our handler with the Bus component, we will be called twice whenever * the entire machine is reset: once when the Computer's reset() handler calls the Bus's reset() handler, * and again when the Computer's reset() handler calls us directly. Multiple resets should be harmless. * * @this {PanelPDP11} + * @param {boolean} [fPowerUp] */ - reset() + reset(fPowerUp) { /* * Simulate a call to our stop() handler, to update the panel's ADDRESS register with the current PC. */ this.stop(); - this.setDR(0); + if (fPowerUp) this.setDR(0); } /** @@ -400,7 +401,7 @@ class PanelPDP11 extends Component { if (this.fBindings) PanelPDP11.init(); if (!data) { - this.reset(); + this.reset(true); } else { if (!this.restore(data)) return false; } diff --git a/versions/pdpjs/1.32.2/pdp11-dbg.js b/versions/pdpjs/1.32.2/pdp11-dbg.js index e37b8beb7..4ad95db6e 100644 --- a/versions/pdpjs/1.32.2/pdp11-dbg.js +++ b/versions/pdpjs/1.32.2/pdp11-dbg.js @@ -33,23 +33,23 @@ http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2017 */ var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var ea=0;function da(a){return"jscomp_symbol_"+(a||"")+ea++} -function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ha(this)}});fa=function(){}}function ha(a){var b=0;return ia(function(){return b":62,"?":63,"@":64,Jc:65,qg:66,sg:67,Pg:68,E:69,Qg:70,Rg:71,Sg:72,Tg:73,Ug:74,Vg:75,Wg:76,Xg:77,Yg:78,Zg:79,$g:80,Q:81,ah:82,bh:83,dh:84,eh:85,fh:86,gh:87,hh:88,ih:89,Gd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,jh:97,kh:98,lh:99,d:100,e:101,mh:102,nh:103,oh:104,ph:105,sh:106,k:107,th:108,uh:109,n:110,vh:111,p:112,q:113,r:114,wh:115,t:116,yh:117,zh:118,Ah:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,xd:127};function q(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Sc=b.comment;this.Fd=b;this.exports={};this.C=this.bindings={};a=this.id.indexOf(".");0>a?this.nb=this.id:(this.ob=this.id.substr(0,a),this.nb=this.id.substr(a+1));this.A={ready:!1,gb:!1,Ac:!1,fa:!1,error:!1};this.hc=null;this.A.error=!1;this.ja=d||0;this.G=this.f=this.D=this.J=this.Pa=null;ua.push(this)}function va(a,b,c){xa[a]&&b&&(xa[a][b]=c)} -function ya(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function za(a){var b=!1;window&&(b=window.confirm(a));return b}function Aa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba?this.mb=this.id:(this.nb=this.id.substr(0,a),this.mb=this.id.substr(a+1));this.A={ready:!1,fb:!1,Ac:!1,fa:!1,error:!1};this.hc=null;this.A.error=!1;this.ja=d||0;this.G=this.f=this.D=this.J=this.Pa=null;va.push(this)}function xa(a,b,c){ya[a]&&b&&(ya[a][b]=c)} +function za(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function Aa(a){var b=!1;window&&(b=window.confirm(a));return b}function Ba(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=1,f--;return d}function H(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d} -function Oa(a){var b=2,c="";b?10=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function Pa(a){return I(a,4,!0)} +d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function Oa(a,b,c){var d="";b?32>=1,f--;return d}function H(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d} +function Pa(a){var b=2,c="";b?10=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function J(a){return I(a,4,!0)} function Qa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Xa[a]})}function Ya(a,b){return(a+" ").slice(0,b)} function Za(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Xa={"&":"&","<":"<",">":">",'"':""","'":"'"},$a={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; function ab(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} @@ -66,316 +66,316 @@ function yb(a){if(zb)try{for(var b=0;ba;a++)this.b["S"+a]=[0,0,!1,!1,this.Zd,a];this.G=this.f=this.D=this.J=null;A(this)}p(Tb,q);h=Tb.prototype; -h.reset=function(){this.stop();Vb(this,this.Sa=0)}; +h.reset=function(a){this.stop();a&&Vb(this,this.Sa=0)}; h.sa=function(a,b,c,d){if(this.J&&this.J.sa(a,b,c,d)||this.f&&this.f.sa(a,b,c,d)||this.G&&this.G.sa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.C[b]=c,this.u++,!0;default:return"led"==a||"rled"==a?(this.C[b]=c,this.i[b]=d?1:0,this.u++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.C[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, b){return function(){Wb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Xb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Wb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Xb(a,b)}}(this,b),!0):q.prototype.sa.call(this,a,b,c,d)}};h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;Yb(b,this,Zb);$b(b,this.reset.bind(this));ac(this);bc(this)}; -h.ya=function(a,b){if(!b)if(this.M&&cc(),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.save=function(){var a=new J(this);a.set(0,[this.ga,this.Sa,this.Ta]);return a.data()};h.restore=function(a){if(a=a[0])dc(this,this.ga=a[0]),Vb(this,this.Sa=a[1]),ec(this,a[2]);return!0};function fc(a,b,c){if(a=a.C[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ac(a,b){for(var c in a.i)fc(a,c,null!=b?b:a.i[c])} +h.ya=function(a,b){if(!b)if(this.M&&cc(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.save=function(){var a=new L(this);a.set(0,[this.ga,this.Sa,this.Ta]);return a.data()};h.restore=function(a){if(a=a[0])dc(this,this.ga=a[0]),Vb(this,this.Sa=a[1]),ec(this,a[2]);return!0};function fc(a,b,c){if(a=a.C[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ac(a,b){for(var c in a.i)fc(a,c,null!=b?b:a.i[c])} function gc(a,b,c){if(a=a.C[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function bc(a){for(var b in a.b)gc(a,b,a.b[b][1])}function hc(a,b,c,d){if(a.C[b]){var e=a.G&&a.G.Ca||8;c=c||0;c=8==e?H(c,d):I(c,d);a.C[b].textContent!=c&&(a.C[b].textContent=c)}}function Wb(a,b){var c=a.b[b];gc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=ic&&(a.H=b==jc,a.I=b==kc)} -function Xb(a,b){var c=a.b[b];c[2]&&c[3]&&(gc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Xd=function(a){a||this.f.A.U||(a=this.f,a.D.reset(),lc(a),this.b[mc]&&this.b[mc][1]&&nc(this.f))};h.Yd=function(){};h.Td=function(a){a||this.f.ba()}; -h.Rd=function(a){if(!a&&!this.f.A.U)if(this.b[mc]&&this.b[mc][1])nc(this.f);else{if((a=this.G)&&!La(a,!0))Ma(a,!0),oc(a,0,null),Ma(a,!1);else try{var b=this.f.ec(1);0=a.f.ka?8:16,c=65472<=a.ga&&a.ga<65472+b,b=c?1:2,c=c?15:a.D.I;a.b[ic]&&a.b[ic][1]||(b=-b);dc(a,a.ga&~c|a.ga+b&c)} +function Xb(a,b){var c=a.b[b];c[2]&&c[3]&&(gc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Xd=function(a){a||this.f.A.T||(a=this.f,a.D.reset(),lc(a),this.b[mc]&&this.b[mc][1]&&nc(this.f))};h.Yd=function(){};h.Td=function(a){a||this.f.ba()}; +h.Rd=function(a){if(!a&&!this.f.A.T)if(this.b[mc]&&this.b[mc][1])nc(this.f);else{if((a=this.G)&&!Ma(a,!0))Na(a,!0),oc(a,0,null),Na(a,!1);else try{var b=this.f.ec(1);0=a.f.ka?8:16,c=65472<=a.ga&&a.ga<65472+b,b=c?1:2,c=c?15:a.D.I;a.b[ic]&&a.b[ic][1]||(b=-b);dc(a,a.ga&~c|a.ga+b&c)} function dc(a,b){a.ga=b&a.D.I;if(a.B!==a.ga){a.B=a.ga;b=a.B;for(var c=0;22>c;c++)Ic(a,"A"+c,b&1<c;c++)Ic(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.H=this.M/this.j|0;this.T=this.H-1;this.Ma=[];this.ma=0;this.F=!1;this.O=[];this.Hd=[Oc,Pc,Qc,Rc];this.b=this.u=[];this.B=this.L=this.w=this.P=this.R=0;a=new M(this);Sc(a,this.G);this.b=Array(this.H);this.u=Array(this.H);for(b=0;b>>this.g;this.L=0;this.w=this.I;A(this)}p(Mc,q);function Vc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.u[a.R]=a.b[a.P])}}h=Mc.prototype;h.reset=function(){for(var a=0;a>2;this.i=this.j-1;this.H=this.M/this.j|0;this.U=this.H-1;this.Ma=[];this.ma=0;this.F=!1;this.O=[];this.Hd=[Oc,Pc,Qc,Rc];this.b=this.u=[];this.B=this.L=this.w=this.P=this.R=0;a=new O(this);Sc(a,this.G);this.b=Array(this.H);this.u=Array(this.H);for(b=0;b>>this.g;this.L=0;this.w=this.I;A(this)}p(Mc,q);function Vc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.u[a.R]=a.b[a.P])}}h=Mc.prototype;h.reset=function(){for(var a=0;a>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.K)return l.Kb+=l.K-f,l.K=f,!0;if(f>=l.K+l.Kb){n=l.size-(f-m);n>g&&(n=g);l.Kb=f-l.K+n;f=m+a.j;g-=n;k++;continue}}return Xc(Yc,f,g)}f=new M(a,f,n,a.j,d,e);Sc(f,a.G,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Zc[d]+" at "+H(b)),!0):Xc($c,b,c)}h.Kc=function(a){return this.u[(a&this.w)>>>this.g].wb(a&this.i,a)}; -h.dc=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Pb||b!=this.i?this.u[c].na(b,a):this.u[c++].wb(b,a)|this.u[c&this.T].wb(0,a+1)<<8};h.Lc=function(a,b){this.u[(a&this.w)>>>this.g].yb(a&this.i,b,a)};h.Ob=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Pb||c!=this.i?this.u[d].zb(c,b,a):(this.u[d++].yb(c,b&255,a),this.u[d&this.T].yb(0,b>>8&255,a+1))};function ad(a,b){return a.b[(b&a.I)>>>a.g]} +function Tc(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.K)return l.Ib+=l.K-f,l.K=f,!0;if(f>=l.K+l.Ib){n=l.size-(f-m);n>g&&(n=g);l.Ib=f-l.K+n;f=m+a.j;g-=n;k++;continue}}return Xc(Yc,f,g)}f=new O(a,f,n,a.j,d,e);Sc(f,a.G,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Zc[d]+" at "+H(b)),!0):Xc($c,b,c)}h.Kc=function(a){return this.u[(a&this.w)>>>this.g].wb(a&this.i,a)}; +h.dc=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Pb||b!=this.i?this.u[c].na(b,a):this.u[c++].wb(b,a)|this.u[c&this.U].wb(0,a+1)<<8};h.Lc=function(a,b){this.u[(a&this.w)>>>this.g].yb(a&this.i,b,a)};h.Mb=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Pb||c!=this.i?this.u[d].zb(c,b,a):(this.u[d++].yb(c,b&255,a),this.u[d&this.U].yb(0,b>>8&255,a+1))};function ad(a,b){return a.b[(b&a.I)>>>a.g]} function Gc(a,b){var c;a.F=!1;a.ma++;var d=b&a.i,e=ad(a,b);Pb||d!=a.i?c=e.B(d,b):c=e.j(d,b)|ad(a,b+1).j(0,b+1)<<8;a.ma--;return c}function bd(a,b,c){a.F=!1;a.ma++;ad(a,b).D(b&a.i,c&255,b);a.ma--}function Ec(a,b,c){a.F=!1;a.ma++;var d=b&a.i,e=ad(a,b);Pb||d!=a.i?e.F(d,c&65535,b):(e.D(d,c&255,b),ad(a,b+1).D(0,c>>8&255,b+1));a.ma--} -function Wc(a){for(var b=0,c=[],d=0;da.f.ka)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Ma[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&B(this.f,16|e[5])&&C(this.f,e[4]+".readByte("+O(this.f,b)+"): "+O(this.f,c),!0,!d.ma),c;d.La(b,16,3);c=255;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to byte @"+O(this.f,b)+": "+O(this.f,c),!0,!d.ma);return c} -function Pc(a,b,c){var d=!1,e=this.controller,f=e.Ma[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ma[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&B(this.f,16|f[5])&&C(this.f,f[4]+".writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.ma):(e.La(c,16,5),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to byte @"+O(this.f,c)+": "+O(this.f, -b),!0,!e.ma))}function Qc(a,b){var c=-1,d=this.controller;a=d.Ma[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".readWord("+O(this.f,b)+"): "+O(this.f,c),!0,!d.ma),c;d.La(b,16,2);c=65535;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to word @"+O(this.f,b)+": "+O(this.f,c),!0,!d.ma);return c} -function Rc(a,b,c){var d=!1,e=this.controller;a=e.Ma[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".writeWord("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.ma):(e.La(c,16,4),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to word @"+O(this.f,c)+": "+O(this.f,b),!0,!e.ma))}function P(a){q.call(this,"Device",a,0,256);this.b={$a:128,Hc:-1}}p(P,q);h=P.prototype; -h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.G=d;var e=this;this.b.Hc=hd(c,function(){e.b.$a|=128;e.b.$a&64&&id(e.f,e.b.ib);e.J&&L(e.J,1);jd(e.f,e.b.Hc,1E3/60)});this.b.ib=kd(c,64,6,524288);Yb(b,this,ld);$b(b,this.reset.bind(this));d&&md(d,64,function(a){var b=e.f;nd(e,"KIPDR",b.B[0],0,a[0]);nd(e,"KDPDR",b.B[0],8,a[0]);nd(e,"KIPAR",b.M[0],0,a[0]);nd(e,"KDPAR",b.M[0],8,a[0],!0);nd(e,"SIPDR",b.B[1],0,a[0]);nd(e,"SDPDR",b.B[1],8,a[0]);nd(e,"SIPAR",b.M[1],0,a[0]);nd(e,"SDPAR",b.M[1],8,a[0], -!0);nd(e,"UIPDR",b.B[3],0,a[0]);nd(e,"UDPDR",b.B[3],8,a[0]);nd(e,"UIPAR",b.M[3],0,a[0]);nd(e,"UDPAR",b.M[3],8,a[0],!0);b.T&32&&nd(e,"UNIMAP",b.Ga,-1,a[0])});A(this)};function nd(a,b,c,d,e,f){a=a.G;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Ga[a>>1];return a&1?b>>16:b&65535};h.hg=function(a,b){b=b>>1&63;var c=b>>1;this.f.Ga[c]=b&1?this.f.Ga[c]&65535|(a&63)<<16:this.f.Ga[c]&-65536|a&65534};h.Qe=function(a){return this.f.B[1][a>>1&7]};h.ag=function(a,b){this.f.B[1][b>>1&7]=a&65295};h.Oe=function(a){return this.f.B[1][(a>>1&7)+8]};h.Zf=function(a,b){this.f.B[1][(b>>1&7)+8]=a&65295};h.Pe=function(a){return this.f.M[1][a>>1&7]}; +function Yb(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.f.ka)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Ma[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&B(this.f,16|e[5])&&C(this.f,e[4]+".readByte("+P(this.f,b)+"): "+P(this.f,c),!0,!d.ma),c;d.La(b,16,3);c=255;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to byte @"+P(this.f,b)+": "+P(this.f,c),!0,!d.ma);return c} +function Pc(a,b,c){var d=!1,e=this.controller,f=e.Ma[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ma[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&B(this.f,16|f[5])&&C(this.f,f[4]+".writeByte("+P(this.f,c)+","+P(this.f,b)+")",!0,!e.ma):(e.La(c,16,5),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to byte @"+P(this.f,c)+": "+P(this.f, +b),!0,!e.ma))}function Qc(a,b){var c=-1,d=this.controller;a=d.Ma[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".readWord("+P(this.f,b)+"): "+P(this.f,c),!0,!d.ma),c;d.La(b,16,2);c=65535;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to word @"+P(this.f,b)+": "+P(this.f,c),!0,!d.ma);return c} +function Rc(a,b,c){var d=!1,e=this.controller;a=e.Ma[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".writeWord("+P(this.f,c)+","+P(this.f,b)+")",!0,!e.ma):(e.La(c,16,4),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to word @"+P(this.f,c)+": "+P(this.f,b),!0,!e.ma))}function Q(a){q.call(this,"Device",a,0,256);this.b={Ya:128,Hc:-1}}p(Q,q);h=Q.prototype; +h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.G=d;var e=this;this.b.Hc=hd(c,function(){e.b.Ya|=128;e.b.Ya&64&&id(e.f,e.b.hb);e.J&&M(e.J,1);kd(e.f,e.b.Hc,1E3/60)});this.b.hb=ld(c,64,6,524288);Yb(b,this,md);$b(b,this.reset.bind(this));d&&nd(d,64,function(a){var b=e.f;od(e,"KIPDR",b.B[0],0,a[0]);od(e,"KDPDR",b.B[0],8,a[0]);od(e,"KIPAR",b.M[0],0,a[0]);od(e,"KDPAR",b.M[0],8,a[0],!0);od(e,"SIPDR",b.B[1],0,a[0]);od(e,"SDPDR",b.B[1],8,a[0]);od(e,"SIPAR",b.M[1],0,a[0]);od(e,"SDPAR",b.M[1],8,a[0], +!0);od(e,"UIPDR",b.B[3],0,a[0]);od(e,"UDPDR",b.B[3],8,a[0]);od(e,"UIPAR",b.M[3],0,a[0]);od(e,"UDPAR",b.M[3],8,a[0],!0);b.V&32&&od(e,"UNIMAP",b.Fa,-1,a[0])});A(this)};function od(a,b,c,d,e,f){a=a.G;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Fa[a>>1];return a&1?b>>16:b&65535};h.hg=function(a,b){b=b>>1&63;var c=b>>1;this.f.Fa[c]=b&1?this.f.Fa[c]&65535|(a&63)<<16:this.f.Fa[c]&-65536|a&65534};h.Qe=function(a){return this.f.B[1][a>>1&7]};h.ag=function(a,b){this.f.B[1][b>>1&7]=a&65295};h.Oe=function(a){return this.f.B[1][(a>>1&7)+8]};h.Zf=function(a,b){this.f.B[1][(b>>1&7)+8]=a&65295};h.Pe=function(a){return this.f.M[1][a>>1&7]}; h.$f=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.Ne=function(a){return this.f.M[1][(a>>1&7)+8]};h.Yf=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.je=function(a){return this.f.B[0][a>>1&7]};h.wf=function(a,b){this.f.B[0][b>>1&7]=a&65295};h.he=function(a){return this.f.B[0][(a>>1&7)+8]};h.uf=function(a,b){this.f.B[0][(b>>1&7)+8]=a&65295};h.ie=function(a){return this.f.M[0][a>>1&7]};h.vf=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.B[0][b]&=65295}; h.ge=function(a){return this.f.M[0][(a>>1&7)+8]};h.tf=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.B[0][b]&=65295};h.We=function(a){return this.f.B[3][a>>1&7]};h.gg=function(a,b){this.f.B[3][b>>1&7]=a&65295};h.Ue=function(a){return this.f.B[3][(a>>1&7)+8]};h.eg=function(a,b){this.f.B[3][(b>>1&7)+8]=a&65295};h.Ve=function(a){return this.f.M[3][a>>1&7]};h.fg=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Te=function(a){return this.f.M[3][(a>>1&7)+8]}; -h.dg=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Ib=function(a){a&=7;return this.f.w&2048?this.f.pa[a]:this.f.g[a]};h.Mb=function(a,b){b&=7;this.f.w&2048?this.f.pa[b]=a:this.f.g[b]=a};h.ue=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.Ff=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.xe=function(){return this.f.g[7]};h.If=function(a){this.f.g[7]=a};h.Jb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.pa[a]}; -h.Nb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.pa[b]=a};h.ve=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Gf=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.we=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Hf=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.fe=function(a){return this.f.ac[a-65504>>1]};h.sf=function(a,b){this.f.ac[b-65504>>1]=a};h.nd=function(a){return 65520==a?(cd(this.D)>>6)-1:0}; -h.sd=function(){};h.Se=function(){return 1};h.cg=function(){};h.ee=function(){return this.f.R};h.rf=function(){this.f.R=0};h.le=function(){return this.f.$b};h.yf=function(a,b){b&1||(a&=255);this.f.$b=a};h.qe=function(a,b){return b?0:this.f.Xa};h.Bf=function(a){ud(this.f,a)};h.Re=function(a,b){return b?0:this.f.za&65280};h.bg=function(a){this.f.za=a|255};h.te=function(){return vd(this.f)};h.Ef=function(a){wd(this.f,a)};h.rd=function(a,b){B(this)&&C(this,"writeIgnored("+H(b)+"): "+H(a),!0,!0)}; -var Q={},ld=(Q[61568]=[null,null,P.prototype.Xe,P.prototype.hg,"UNIMAP",64,1170],Q[62592]=[null,null,P.prototype.Qe,P.prototype.ag,"SIPDR",8,1145,64],Q[62608]=[null,null,P.prototype.Oe,P.prototype.Zf,"SDPDR",8,1145,64],Q[62624]=[null,null,P.prototype.Pe,P.prototype.$f,"SIPAR",8,1145,64],Q[62640]=[null,null,P.prototype.Ne,P.prototype.Yf,"SDPAR",8,1145,64],Q[62656]=[null,null,P.prototype.je,P.prototype.wf,"KIPDR",8,1140,64],Q[62672]=[null,null,P.prototype.he,P.prototype.uf,"KDPDR",8,1145,64],Q[62688]= -[null,null,P.prototype.ie,P.prototype.vf,"KIPAR",8,1140,64],Q[62704]=[null,null,P.prototype.ge,P.prototype.tf,"KDPAR",8,1145,64],Q[62798]=[null,null,P.prototype.pe,P.prototype.Af,"MMR3",1,1145,64],Q[65382]=[null,null,P.prototype.ke,P.prototype.xf,"LKS"],Q[65402]=[null,null,P.prototype.me,P.prototype.zf,"MMR0",1,1140,64],Q[65404]=[null,null,P.prototype.ne,P.prototype.rd,"MMR1",1,1145,64],Q[65406]=[null,null,P.prototype.oe,P.prototype.rd,"MMR2",1,1140,64],Q[65408]=[null,null,P.prototype.We,P.prototype.gg, -"UIPDR",8,1140,64],Q[65424]=[null,null,P.prototype.Ue,P.prototype.eg,"UDPDR",8,1145,64],Q[65440]=[null,null,P.prototype.Ve,P.prototype.fg,"UIPAR",8,1140,64],Q[65456]=[null,null,P.prototype.Te,P.prototype.dg,"UDPAR",8,1145,64],Q[65472]=[null,null,P.prototype.Ib,P.prototype.Mb,"R0SET0"],Q[65473]=[null,null,P.prototype.Ib,P.prototype.Mb,"R1SET0"],Q[65474]=[null,null,P.prototype.Ib,P.prototype.Mb,"R2SET0"],Q[65475]=[null,null,P.prototype.Ib,P.prototype.Mb,"R3SET0"],Q[65476]=[null,null,P.prototype.Ib, -P.prototype.Mb,"R4SET0"],Q[65477]=[null,null,P.prototype.Ib,P.prototype.Mb,"R5SET0"],Q[65478]=[null,null,P.prototype.ue,P.prototype.Ff,"R6KERNEL"],Q[65479]=[null,null,P.prototype.xe,P.prototype.If,"R7KERNEL"],Q[65480]=[null,null,P.prototype.Jb,P.prototype.Nb,"R0SET1",1,1145],Q[65481]=[null,null,P.prototype.Jb,P.prototype.Nb,"R1SET1",1,1145],Q[65482]=[null,null,P.prototype.Jb,P.prototype.Nb,"R2SET1",1,1145],Q[65483]=[null,null,P.prototype.Jb,P.prototype.Nb,"R3SET1",1,1145],Q[65484]=[null,null,P.prototype.Jb, -P.prototype.Nb,"R4SET1",1,1145],Q[65485]=[null,null,P.prototype.Jb,P.prototype.Nb,"R5SET1",1,1145],Q[65486]=[null,null,P.prototype.ve,P.prototype.Gf,"R6SUPER",1,1145],Q[65487]=[null,null,P.prototype.we,P.prototype.Hf,"R6USER",1,1145],Q[65504]=[null,null,P.prototype.fe,P.prototype.sf,"CTRL",8,1170],Q[65520]=[null,null,P.prototype.nd,P.prototype.sd,"LSIZE",1,1170],Q[65522]=[null,null,P.prototype.nd,P.prototype.sd,"HSIZE",1,1170],Q[65524]=[null,null,P.prototype.Se,P.prototype.cg,"SYSID",1,1170],Q[65526]= -[null,null,P.prototype.ee,P.prototype.rf,"ERR",1,1170],Q[65528]=[null,null,P.prototype.le,P.prototype.yf,"MBR",1,1170],Q[65530]=[null,null,P.prototype.qe,P.prototype.Bf,"PIR"],Q[65532]=[null,null,P.prototype.Re,P.prototype.bg,"SLR"],Q[65534]=[null,null,P.prototype.te,P.prototype.Ef,"PSW"],Q); -wb(function(){for(var a=y(document,x,"device"),b=0;b>1),this.b=new Int32Array(this.u,0,this.size>>2),Kd(this,Ld?Md:Nd);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.ce=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.cf=function(a,b){Ib&&a&1&&this.C.La(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8}; -h.pf=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Ya=!0};h.ae=function(a,b){this.f&&null!=this.K&&Ud(this.f,this.K+a);return this.j(a,b)};h.Ze=function(a,b){this.f&&null!=this.K&&Ud(this.f,this.K+a,2);return this.B(a,b)}; -h.mf=function(a,b,c){this.f&&null!=this.K&&Vd(this.f,this.K+a);this.J?this.Lb(0,b,c):this.D(a,b,c)};h.jg=function(a,b,c){this.f&&null!=this.K&&Vd(this.f,this.K+a,2);this.J?this.Lb(0,b,c):this.F(a,b,c)};h.$d=function(a){return this.g[a]};h.be=function(a,b){a=this.g[a];this.f&&B(this.f,32)&&C(this.f,"Memory.readByte("+O(this.f,b)+"): "+O(this.f,a),!0);return a};h.Ye=function(a,b){Ib&&a&1&&this.C.La(b,64,2);return this.w.getUint16(a,!0)}; -h.bf=function(a,b){Ib&&a&1&&this.C.La(b,64,2);a=!Pb&&a&1?this.g[a]|this.g[a+1]<<8:this.H[a>>1];this.f&&B(this.f,32)&&C(this.f,"Memory.readWord("+O(this.f,b)+"): "+O(this.f,a),!0);return a};h.lf=function(a,b){this.g[a]=b;this.Ya=!0};h.nf=function(a,b,c){this.g[a]=b;this.Ya=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0)};h.ig=function(a,b,c){Ib&&a&1&&this.C.La(c,64,4);this.w.setUint16(a,b,!0);this.Ya=!0}; -h.kg=function(a,b,c){Ib&&a&1&&this.C.La(c,64,4);!Pb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.H[a>>1]=b;this.Ya=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeWord("+O(this.f,c)+","+O(this.f,b)+")",!0)};var Id=0,dd=1,Jd=2,Uc=4,Zc=["NONE","RAM","ROM","VID","H/W"],Hd=0,Pd=[],Od=[M.prototype.ce,M.prototype.pf,M.prototype.cf,M.prototype.lg],Sd=[M.prototype.ae,M.prototype.mf,M.prototype.Ze,M.prototype.jg]; -if(Eb)var Nd=[M.prototype.$d,M.prototype.lf,M.prototype.Ye,M.prototype.ig],Md=[M.prototype.be,M.prototype.nf,M.prototype.bf,M.prototype.kg];var Wd;if(Eb){var Xd=new ArrayBuffer(2);(new DataView(Xd)).setUint16(0,256,!0);Wd=256===(new Uint16Array(Xd))[0]}else Wd=!1;var Ld=Wd; -function Yd(a,b){q.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.rc=0;this.pc=b;this.eb=c;this.wc=Math.round(this.pc/1E4)/100;this.qb=this.wc*this.eb;this.xc=this.Xb=this.tb=this.qc=0;this.A.U=this.A.lc=!1;this.A.va=a.autoStart;"string"==typeof this.A.va&&(this.A.va="true"==this.A.va);this.A.Bb=!1;this.Ub=this.Db=0;this.Wb=+a.csStart;this.Cb=+a.csInterval;this.Eb=+a.csStop;this.ia=[];this.Xc=this.gf.bind(this);this.fb=this.Va=this.cb=this.b=this.la=this.Ua=this.Tb=this.bb=this.Fb= -this.yc=this.pb=0;this.ua=null;A(this)}p(Yd,q);h=Yd.prototype;h.wa=function(a,b,c,d){this.J=a;this.D=b;this.G=d;this.ua=a.i;for(a=0;a=a.Db&&(a.Db+=a.Cb,c=!0);0<=a.Eb&&a.Eb<=fe(a)&&(a.Cb=a.Eb=-1,be(a),a.ba(),c=!0);c&&a.v(fe(a)+" cycles: checksum="+I(a.Ub))}} -h.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.C[b]=c,!0;case "run":return this.C[b]=c,c.onclick=function(){var a;if(a=d.J)if(a=d.J,a.A.fa)a=!0;else{var b=null,c,k=Aa(a.id);for(c=0;ca.pb/a.qb?b=1:d=!0;a.eb=b;b=a.wc*a.eb;if(a.qb!=b){a.qb=b;b=a.qb.toFixed(2)+"Mhz";var e=a.C.setSpeed;e&&(e.textContent=b);a.v("target speed: "+b)}c&&a.J&&je(a.J)}qc(a,a.Va);a.Va=0;a.Ua=ya();a.bb=0;he(a);return d}function hd(a,b){var c=a.ia.length;a.ia.push([-1,b]);return c}function jd(a,b,c,d){0<=b&&ba.ia[b][0])&&(c=a.pc*a.eb/1E3*c|0,a.A.U&&(c+=ke(a)),a.ia[b][0]=c)} -function le(a,b){for(var c=a.ia.length-1;0<=c;c--){var d=a.ia[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function me(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ke(a,b){var c=a.cb-=a.b;a.b=a.la=0;b&&(a.cb=0);return c} -h.gf=function(){if(this.A.U){this.qc>=this.pc&&he(this,!0);this.Fb=0;this.Tb=ya();if(this.bb){var a=this.Tb-this.bb;a>this.xc&&(this.Ua+=a,this.Ua>this.Tb&&(this.Ua=this.Tb))}try{do{var b=le(this,this.A.Bb?1:this.Xb);try{this.ec(b)}catch(e){if("number"!=typeof e)throw e;}b=ke(this,!0);this.Fb+=b;this.Va+=b;rc(this,b);pc(this,b);this.tb-=b;if(0>=this.tb){this.tb+=this.Xb;++this.yc>=ne&&(this.J&&L(this.J,void 0),this.yc=0);break}}while(this.A.U)}catch(e){this.ba();this.J&&this.J.stop(ya(),fe(this)); -Ea(this,e.stack||e.message);return}if(this.A.U){a=setTimeout;b=this.Xc;this.bb=ya();var c=this.xc;this.Fb&&(c=Math.round(c*this.Fb/this.Xb));var c=c-(this.bb-this.Tb),d=this.bb-this.Ua;d&&(this.pb=Math.round(this.Va/(10*d))/100,864E5<=d&&(this.fb=0,ge(this)));if(0>c||this.pbc&&(this.Ua-=c),c=0;this.qc+=this.Fb;this.bb+=c;a(b,c)}}}; -function nc(a,b){if(!Ja(a))if(a.A.U)a.v(a.toString()+" busy");else{ge(a);a.A.U=!0;a.A.lc=!0;var c=a.C.run;c&&(c.textContent="Halt");a.J&&(b&&je(a.J,!0),a.J.start(a.Ua,fe(a)));a.G||a.status("Started");setTimeout(a.Xc,0)}}h.ec=function(){return 0};h.ba=function(a){var b=!1;if(this.A.U){ke(this);qc(this,this.Va);this.Va=0;this.A.U=!1;if(b=this.C.run)b.textContent="Run";this.J&&this.J.stop(ya(),fe(this));b=!0;this.G||this.status("Stopped")}this.A.complete=a;return b};var ie=30,ne=15,Zd=["power","reset"]; -function oe(a){var b=+a.model||1170;Yd.call(this,a,6666667);this.ka=b;this.Rc=+a.addrReset||0;this.Wa=this.w=this.O=this.F=this.H=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Ga=this.ac=[];this.ab=this.P=this.Qc=this.Ia=this.lb=this.rb=this.Fa=this.R=this.$b=this.Xa=this.za=this.S=this.Gb=this.Hb=this.T=this.i=0;this.Tc=[4,2,0,1];this.bc=0;this.Uc=255;1120>=this.ka?(this.Pc=pe.bind(this),this.Ab=this.Ld,this.bc=8,this.Uc=-1,this.Zc=255,this.Yc=0):(this.Pc=qe.bind(this),this.Ab=this.Md, -this.Zc=~(1792|(1140>=this.ka?2048:0))&65535,this.Yc=1140e.xb&&(e.xb=c,c+=4)}return Yd.prototype.ya.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.ka);this.A.U&&this.ba();this.F=65536;this.H=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Rc,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535, -65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ga=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ac=[0,0,0,0,0,0,0,0];this.O=0;this.Wa=-1;this.u=this.j=this.oc=this.X=this.Z=this.i=this.$b=0;lc(this);ae(this);this.A.error=!1;Yd.prototype.reset.call(this)};function lc(a){a.S=0;a.Gb=0;a.Hb=0;a.T=0;a.R=0;a.Xa=0;a.za=255;a.Ia=0;a.lb=0;a.rb=0;a.Fa=262143;a.ab=a.g[7];a.P=0;a.V=null;a.D&&(re(a),a.Qc=cd(a.D))} -function re(a){a.Pb=a.sc;a.Qb=a.tc;a.mc=a.uc;a.Rb=a.vc;a.Yb&&(a.Pb=a.fd,a.Qb=a.ld);a.Zb&&(a.mc=a.pd,a.Rb=a.qd);a.Ia?(a.Ha=65536,a.mb=a.T&16?4186112:253952,a.Ea=a.kd,a.na=a.Yb?a.af:a.Fc,a.zb=a.Zb?a.ng:a.Ic,Vc(a.D,a.T&16?22:18)):(a.Ha=0,a.mb=57344,a.Ea=a.Od,a.na=a.Yb?a.$e:a.od,a.zb=a.Zb?a.mg:a.td,Vc(a.D,16))}function pd(a){var b=a.S;b&57344||(b=b&-3199|a.lb<<5|a.rb<<1);return b} -function qd(a,b){b&=-3073;if(a.S!=b){b&57344&&!(a.S&57344)&&(a.Gb=a.P>>16&65535,a.Hb=a.P&65535);a.S=b;a.lb=(b&96)>>5;a.rb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ia!=c&&(a.Ia=c,re(a))}}function rd(a){a.S&57344||(a.Gb=a.P>>16&65535);a=a.Gb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function sd(a){a.S&57344||(a.Hb=a.P&65535);return a.Hb}function td(a,b){1170>a.ka&&(b&=-49);a.T!=b&&(a.T=b,a.Fa=b&16?4194303:262143,re(a))} -function se(a,b,c){a.Rc=b;te(a,b);wd(a,0);a.D.reset();lc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.U||nc(a)}else a.G&&a.A.fa?a.ba()||(ce(a.G),L(a.J,-1)):!1===c&&a.ba();!a.A.U&&a.ua&&a.ua.stop()}h.gd=function(){return 0}; -h.save=function(){var a=new J(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Ga,this.ac,this.R,this.$b,this.Xa,this.za,this.S,this.Gb,this.Hb,this.T,this.Ia,this.lb,this.rb,this.Fa,this.ab,this.i,this.P,this.Wa,this.cc,this.fc]);a.set(1,[vd(this)]);a.set(2,[this.fb,this.eb,this.A.va]);a.set(3,ue(this));a.set(4,me(this));return a.data()}; -h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Ga=b.next().value;this.ac=b.next().value;this.R=b.next().value;this.$b=b.next().value;this.Xa=b.next().value;this.za=b.next().value;this.S=b.next().value;this.Gb=b.next().value;this.Hb=b.next().value;this.T=b.next().value;this.Ia=b.next().value;this.lb=b.next().value;this.rb=b.next().value;this.Fa=b.next().value;this.ab=b.next().value;this.i=b.next().value; -this.P=b.next().value;this.Wa=b.next().value;this.cc=b.next().value;this.fc=b.next().value;b=a[1];wd(this,b[0]);b=a[2];this.fb=b[0];ge(this,b[1]);this.A.va=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function te(a,b){a.g[7]=b&65535}function kd(a,b,c,d){b={xb:b,jb:c,message:d||0,name:Rb[b],next:null};a.Sb.push(b);return b}function Ae(a,b){var c=a.V;if(c==b)a.V=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.V&&(a.i|=1)} -function id(a,b){if(b){if(b!=a.V){var c=a.V;if(!c||c.jb<=b.jb)b.next=c,a.V=b;else{do{var d=c.next;if(!d||d.jb<=b.jb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&B(a,b.message|8)&&C(a,"setIRQ(vector="+H(b.xb)+",priority="+b.jb+")",!0,!0)}}function od(a,b){b&&(Ae(a,b),b.message&&B(a,b.message|8)&&C(a,"clearIRQ(vector="+H(b.xb)+",priority="+b.jb+")",!0,!0))}function ue(a){var b=[];for(a=a.V;a;)b.push(a.xb),a=a.next;return b} -function Be(a){return a.i&64?(a.ta(168,64,-6),!0):a.i&32?(a.ta(4,32,-5),!0):a.i&16?(a.ta(12,16,-7),!0):!1}function vd(a){return a.w=a.w&63728|ye(a)|xe(a)|we(a)|ve(a)}function wd(a,b){b&=a.Zc;a.I=b<<12;a.L=~b&4;a.H=b<<14;a.F=b<<16;if((b^a.w)&a.Yc)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.O=b>>14&3;c=a.w>>14&3;a.O!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.O]);a.w=b;a.i&=-3;a.i|=a.V?2:1}function ud(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.Xa=b} -h.Da=function(a){this.I=this.L=a;this.H=0};h.kb=function(a,b){this.I=this.L=this.F=a;this.H=b||0};function Ce(a,b){a.I=a.L=a.F=b;a.H=a.I^a.F>>1}function De(a,b,c,d){a.I=a.L=a.F=b;a.H=(c^d)&(d^b)} -h.ta=function(a,b,c){if(!this.oa){0>this.Wa?this.Wa=vd(this):this.O||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.R|=4,this.g[6]=a=4);if(-1!=c){this.P=a|4143316992;this.O=0;var d=this.na(a|this.Ha),e=this.na(a+2&65535|this.Ha);wd(this,e&-12289|this.Wa>>2&12288);Ee(this,this.Wa);Ee(this,this.g[7]);te(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Wa=-1;this.cc=c;this.fc=a;-1==c&&this.ba();if(-4<=c)throw a;}}; -function Fe(a){var b=Ge(a),c=Ge(a);a.w&49152&&(c=c&-225|a.w&63712);te(a,b);wd(a,c);a.i&=-17}function He(a,b){var c=b>>13&31;31>c&&(b=a.T&32?a.Ga[c]+(b&8191)&4194303:b&-3932161);return b} -function Ie(a,b,c){var d=[];if(c){c=He(a,b);var e=b>>13&31;d.push(c);d.push(e);a.T&32&&(d.push(a.Ga[e]),d.push(b&8191))}else if(a.Ia){var e=a.O<<1,f=b>>13;7>13;a.T&a.Tc[a.O]||(d&=7);e=a.B[a.O][d];f=(a.M[a.O][d]<<6)+(b&8191)&a.Fa;3932160<=f&&(f=He(a,f));if(a.oa)return f;f>=a.Qc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.B[a.O][d]=e;if(f!=(4194170&a.Fa)||a.O)a.lb=a.O,a.rb=d;g&&(g&57344&&(0<=a.Wa&&(g|=128),a.S&57344||(g|=a.S&4096|a.lb<<5|a.rb<<1,qd(a,a.S&-61695|g&61694)),a.ta(168,64,-2)),a.S&61440||!(f<(4191360&a.Fa)||f>(4194239&a.Fa))||(a.S|=4096,a.S&512&&(a.i|=64)));return f}function Ge(a){var b=a.na(a.g[6]|a.Ha);a.g[6]=a.g[6]+2&65535;return b}function Ee(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.P=a.P&65535|(a.P&-65536)<<8|16121856;a.i&256||a.Ab(4,-2,c);a.zb(c,b)} -function Je(a,b,c,d){var e,f,g=d&8?0:a.Ha;switch(b){case 0:return a.ta(4,0,-3),0;case 1:return 6==c&&a.Ab(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Ab(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Ab(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(ze(a,2)),e=e+a.g[c]&65535,6==c&&a.Ab(d, -0,e),a.b-=6,e|g;case 7:return e=a.na(ze(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ha),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.P=a.P&65535|(a.P&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ld=function(a,b,c){!this.O&&0>=b&&c<=this.za&&(this.i|=32)};h.Md=function(a,b,c){this.O||(65534<=c&&(c|=-65536),a&4&&c<=this.za&&(c<=this.za-32?this.ta(4,0,-4):(this.R|=8,this.i|=32)))};h.fd=function(a){this.G&&Ud(this.G,a,1);return this.sc(a)};h.ld=function(a){this.G&&Ud(this.G,a,2);return this.tc(a)}; -h.pd=function(a,b){this.G&&Vd(this.G,a,1);this.uc(a,b)};h.qd=function(a,b){this.G&&Vd(this.G,a,2);this.vc(a,b)};function Hc(a,b){a.oa++;b=a.D.dc(Fc(a,b,2));a.oa--;return b}function Ke(a,b){(b?--a.Zb:--a.Yb)||re(a)}h.Od=function(a,b,c){return Je(this,a,b,c)};h.kd=function(a,b,c){return Fc(this,Je(this,a,b,c),c)};h.od=function(a){return this.D.dc(this.ab=a)};h.$e=function(a){this.G&&Ud(this.G,a,2);return this.od(a)};h.Fc=function(a){return this.D.dc(this.ab=Fc(this,a,2))}; -h.af=function(a){this.G&&Ud(this.G,a,2);return this.Fc(a)};h.td=function(a,b){this.D.Ob(this.ab=a,b)};h.mg=function(a,b){this.G&&Vd(this.G,a,2);this.td(a,b)};h.Ic=function(a,b){this.D.Ob(this.ab=Fc(this,a,4),b)};h.ng=function(a,b){this.G&&Vd(this.G,a,2);this.Ic(a,b)};function Le(a,b,c){var d=a.j=b&7;(b=a.u=(b&56)>>3)?(d=Je(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.O=a.w>>12&3,c=a.na(d|c&a.Ha),a.O=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} -function Me(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=Je(a,b,e,4),c&65536||(e&=65535),a.O=a.w>>12&3,e=Fc(a,e|c&65536,4),a.O=a.w>>14&3,a.Rb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Ne(a,b){b>>=6;var c=a.Z=b&7;return(b=a.X=(b&56)>>3)?a.Pb(a.Ea(b,c,3)):a.g[c+a.bc]&a.Uc}function Oe(a,b){var c;b>>=6;var d=a.Z=b&7;(b=a.X=(b&56)>>3)?c=a.Qb(a.Ea(b,d,2)):c=a.g[d+a.bc];return c}function kf(a,b){var c=a.j=b&7;b=a.u=(b&56)>>3;return Je(a,b,c,8)} -function lf(a,b){var c=a.j=b&7;return(b=a.u=(b&56)>>3)?a.Pb(a.Ea(b,c,3)):a.g[c]&255}function mf(a,b){var c,d=a.j=b&7;(b=a.u=(b&56)>>3)?c=a.Qb(a.Ea(b,d,2)):c=a.g[d];return c}function nf(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.oc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.mc(e,d.call(a,c,a.Pb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} -function T(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,6),a.Rb(e,d.call(a,0>c?a.g[-c-1]:c,a.Qb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function of(a,b,c,d,e){var f=a.j=b&7;(b=a.u=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.mc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} -function pf(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Rb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} -h.ec=function(a){this.A.complete=!0;var b=this.G?qf(this.G)?1:this.A.lc?-1:0:0,c=a?this.A.lc?0:1:-1;this.A.lc=!1;this.cb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(rf(this.G,this.g[7],c)){this.ba();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.Xa&224)>>5,f=this.V&&this.V.jb>e?this.V:null;f&&(d=f.xb,e=f.jb);e>(this.w&224)>>5?(this.i&8&&(ze(this,2),this.i&=-9),this.ta(d,0,-10),e=!0):e=!1;e&&(f&&Ae(this,f),a=!0);this.V||this.Xa||(this.i&=-3)}else this.i& -1&&this.i++;if(a){if(this.i&4&&rf(this.G,this.g[7],c)){this.ba();break}if(0>c)break}if(this.i&112&&Be(this)){if(this.i&4&&rf(this.G,this.g[7],c)){this.ba();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.Pc(f)}while(0>1|b<<16;Ce(this,a);return a&65535}function xf(a,b){a=b&128|b>>1|b<<8;Ce(this,a<<8);return a&255}function yf(a,b){a=b&~a;this.Da(a);return a}function zf(a,b){a=b&~a;this.Da(a<<8);return a} -function Af(a,b){a|=b;this.Da(a);return a}function Bf(a,b){a|=b;this.Da(a<<8);return a}function Cf(a,b){a=~b|65536;this.kb(a);return a&65535}function Df(a,b){a=~b|256;this.kb(a<<8);return a&255}function Ef(a,b){this.I=this.L=a=b-a;this.H=b&(b^a);return a&65535}function Ff(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.H=b&(b^c);return a&255}function Gf(a,b){this.I=this.L=a=b+a;this.H=a&(b^a);return a&65535}function Hf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.H=c&(b<<8^c);return a&255} -function If(a,b){a=-b;this.kb(a,a&b&32768);return a&65535}function Jf(a,b){a=-b;this.kb(a<<8,(a&b&128)<<8);return a&255}function Kf(a,b){a=b<<1|this.F>>16&1;Ce(this,a);return a&65535}function Lf(a,b){a=b<<1|this.F>>16&1;Ce(this,a<<8);return a&255}function Mf(a,b){a=(this.F&65536|b)>>1|b<<16;Ce(this,a);return a&65535}function Nf(a,b){a=((this.F&65536)>>8|b)>>1|b<<8;Ce(this,a<<8);return a&255}function Of(a,b){var c=b-a;De(this,c,a,b);return c&65535} -function Pf(a,b){var c=b-a;De(this,c<<8,a<<8,b<<8);return c&255}function Qf(a,b){this.I=this.L=b&65280;this.H=this.F=0;return(b<<8|b>>8)&65535}function Rf(a,b){a^=b;this.Da(a);return a&65535}function Sf(a){T(this,a,Oe(this,a),sf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} -function Tf(a){var b=mf(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.F=this.H=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.H=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.u?6:7)+b} -function Uf(a){var b=mf(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&=63;if(b&32){b=64-b;32>b-1;this.F=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.u?6:7)+b}function Vf(a){S(this,a,!ve(this))}function Wf(a){S(this,a,ve(this))} -function Xf(a){T(this,a,Oe(this,a),yf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Yf(a){nf(this,a,Ne(this,a),zf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Zf(a){T(this,a,Oe(this,a),Af);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function $f(a){nf(this,a,Ne(this,a),Bf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} -function ag(a){var b=Oe(this,a);a=mf(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function bg(a){var b=Ne(this,a);a=lf(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function cg(a){S(this,a,xe(this))}function dg(a){S(this,a,!ye(this)==!we(this))}function eg(a){S(this,a,!xe(this)&&!ye(this)==!we(this))}function fg(a){S(this,a,!ve(this)&&!xe(this))} -function gg(a){S(this,a,xe(this)||!ye(this)!=!we(this))}function hg(a){S(this,a,ve(this)||xe(this))}function ig(a){S(this,a,!ye(this)!=!we(this))}function jg(a){S(this,a,ye(this))}function kg(a){S(this,a,!xe(this))}function lg(a){S(this,a,!ye(this))}function mg(){this.ta(12,0,-9)}function ng(a){S(this,a,!0)}function og(a){S(this,a,!we(this))}function pg(a){S(this,a,we(this))}function qg(a){a&1&&(this.F=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} -function rg(a){var b=Oe(this,a);a=mf(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;De(this,c,a,b);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function sg(a){var b=Ne(this,a);a=lf(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);De(this,c,a,b);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} -function tg(a){var b=mf(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.H=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.H=32768,this.F=65536,this.b-=7}function ug(){this.ta(24,0,-9);this.b-=20} -function vg(){this.w&49152?(this.R|=128,this.ta(4,0,-8)):(this.ua&&1120==this.ka&&this.ua.setData(this.g[0],!0),this.G?wg(this.G):this.ba());this.b-=7}function xg(){this.ta(16,0,-9);this.b-=20}var yg=[0,7,7,10,7,11,9,13];function zg(a){this.la=this.b;te(this,kf(this,a));this.b=this.la-yg[this.u]}var Ag=[0,14,14,17,14,18,16,20];function Bg(a){this.la=this.b;var b=kf(this,a);a=a>>6&7;Ee(this,this.g[a]);this.g[a]=this.g[7];te(this,b);this.b=this.la-Ag[this.u]} -var Cg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Dg(a){var b=Oe(this,a);this.la=this.b;pf(this,a,b,this.Da);this.b=this.la-Cg[(this.X?8:0)+this.u]+(7!=this.j||this.u?0:2)}function Eg(a){var b=Ne(this,a);of(this,a,b,65535,this.Da);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Fg=[7,13,13,17,14,18,17,21]; -function Gg(a){var b=mf(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.H=0;this.F=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)te(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Ng(a){T(this,a,Oe(this,a),Of);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Og(a){T(this,a,0,Qf);this.b-=this.u?9:3+(7==this.j?2:0)}function Pg(){this.ta(28,0,-9)} -function Qg(){this.ua&&(this.ua.Gc(this.g[7],!0),this.ua.setData(this.g[0],!0));this.i|=8;ze(this,-2);this.b-=3}function Rg(a){T(this,a,this.g[(a>>6&7)+this.bc],Rf);this.b-=this.u?9:3+(7==this.j?2:0)}function U(a){var b;if(b=this.G)b=this.G,B(b,1)?(C(b,"undefined opcode "+O(b,a),!0,!0),b=wg(b)):b=!1;b||this.ta(8,0,-9)}function pe(a){Sg[a>>12].call(this,a)}function Tg(a){Ug[a>>6&3].call(this,a)}function Vg(a){Wg[a>>6&3].call(this,a)}function Xg(a){Yg[a>>6&3].call(this,a)} -function Zg(a){$g[a&15].call(this,a)}function ah(a){bh[a&15].call(this,a)}function ch(a){dh[a>>6&3].call(this,a)}function eh(a){fh[a>>6&3].call(this,a)}function gh(a){hh[a>>6&3].call(this,a)} -var Sg=[function(a){ih[a>>8&15].call(this,a)},Dg,rg,ag,Xf,Zf,Sf,U,function(a){jh[a>>8&15].call(this,a)},Eg,sg,bg,Yf,$f,Ng,U],ih=[function(a){kh[a>>4&15].call(this,a)},ng,kg,cg,dg,ig,eg,gg,Bg,Bg,Tg,Vg,Xg,U,U,U],Ug=[function(a){pf(this,a,0,this.kb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,0,Cf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,1,Gf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,1,Ef);this.b-=this.u?9:3+(7==this.j?2:0)}],Wg=[function(a){T(this,a,0,If); -this.b-=this.u?11:6},function(a){T(this,a,ve(this)?1:0,sf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,ve(this)?1:0,Of);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=mf(this,a);this.kb(a);this.b-=this.u?4:3+(7==this.j?2:0)}],Yg=[function(a){T(this,a,0,Mf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,0,Kf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,0,wf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){T(this,a,0,uf);this.b-=this.u?9:3+(7==this.j?2:0)}],kh= -[function(a){lh[a&15].call(this,a)},U,U,U,zg,zg,zg,zg,Jg,U,Zg,ah,Og,Og,Og,Og],lh=[vg,Qg,Kg,mg,xg,Ig,U,U,U,U,U,U,U,U,U,U],$g=[Hg,function(){this.F=0;this.b-=5},function(){this.H=0;this.b-=5},qg,function(){this.L=1;this.b-=5},qg,qg,qg,function(){this.I=0;this.b-=5},qg,qg,qg,qg,qg,qg,qg],bh=[Hg,function(){this.F=65536;this.b-=5},function(){this.H=32768;this.b-=5},Lg,function(){this.L=0;this.b-=5},Lg,Lg,Lg,function(){this.I=32768;this.b-=5},Lg,Lg,Lg,Lg,Lg,Lg,Lg],jh=[lg,jg,fg,hg,og,pg,Vf,Wf,ug,Pg,ch,eh, -gh,U,U,U],dh=[function(a){of(this,a,0,255,this.kb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){nf(this,a,0,Df);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){nf(this,a,1,Hf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){nf(this,a,1,Ff);this.b-=this.u?9:3+(7==this.j?2:0)}],fh=[function(a){nf(this,a,0,Jf);this.b-=this.u?11:6},function(a){nf(this,a,ve(this)?1:0,tf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){nf(this,a,ve(this)?1:0,Pf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=lf(this, -a);this.kb(a<<8);this.b-=this.u?4:3+(7==this.j?2:0)}],hh=[function(a){nf(this,a,0,Nf);this.b-=this.u?9+(this.oc&1):3+(7==this.j?2:0)},function(a){nf(this,a,0,Lf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){nf(this,a,0,xf);this.b-=this.u?9+(this.oc&1):3+(7==this.j?2:0)},function(a){nf(this,a,0,vf);this.b-=this.u?9:3+(7==this.j?2:0)}];function qe(a){mh[a>>12].call(this,a)} -var mh=[function(a){nh[a>>8&15].call(this,a)},Dg,rg,ag,Xf,Zf,Sf,function(a){oh[a>>8&15].call(this,a)},function(a){ph[a>>8&15].call(this,a)},Eg,sg,bg,Yf,$f,Ng,U],nh=[function(a){qh[a>>4&15].call(this,a)},ng,kg,cg,dg,ig,eg,gg,Bg,Bg,Tg,Vg,Xg,function(a){rh[a>>6&3].call(this,a)},U,U],rh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.na(a|this.Ha);te(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Le(this,a,0);this.Da(a);Ee(this,a);this.b-=11},function(a){var b=Ge(this); -this.la=this.b;this.Da(b);Me(this,a,0,b);this.b=this.la-Fg[this.u]},function(a){pf(this,a,ye(this)?65535:0,this.Da);this.b-=this.u?9:3+(7==this.j?2:0)}],qh=[function(a){sh[a&15].call(this,a)},U,U,U,zg,zg,zg,zg,Jg,function(a){!(a&8)||1145>this.ka?U.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},Zg,ah,Og,Og,Og,Og],sh=[vg,Qg,function(){Fe(this);this.i|=this.w&16;this.b-=13},mg,xg,Ig,Kg,function(a){U.call(this,a)},U,U,U,U,U,U,U,U],oh=[Gg,Gg,tg,tg,Tf,Tf,Uf,Uf, -Rg,Rg,U,U,U,U,Mg,Mg],ph=[lg,jg,fg,hg,og,pg,Vf,Wf,ug,Pg,ch,eh,gh,function(a){1145>this.ka?U.call(this,a):th[a>>6&3].call(this,a)},U,U],th=[function(a){U.call(this,a)},function(a){a=Le(this,a,65536);this.Da(a);Ee(this,a);this.b-=11},function(a){var b=Ge(this);this.la=this.b;this.Da(b);Me(this,a,65536,b);this.b=this.la-Fg[this.u]},function(a){U.call(this,a)}]; -function uh(a){q.call(this,"ROM",a,0,128);this.ha=this.g=null;this.u=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Qa(this.j);if(this.j){a=this.j;var b=Ra(this.B);"json"!=b&&"hex"!=b&&(a=eb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;cb(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(va(c.ob,a,b),(a=db(a,b))?(c.g=a.ca,c.ha=a.ha):c.j=null);vh(c)})}}p(uh,q); -h=uh.prototype;h.wa=function(a,b,c,d){this.D=b;this.f=c;this.G=d;vh(this)};h.ya=function(){this.ha&&(this.G&&wh(this.G,this.id,this.u,this.b,this.ha),delete this.ha);return!0};h.xa=function(){return!0}; -function vh(a){if(!Ka(a)){if(a.j){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Ea(a,"ROM size ("+I(a.g.length,8,!0)+") does not match specified size ("+I(a.b,8,!0)+")");else{var b;a:{b=a.u;if(57344<=b&&b<57344+Nc){var c={},c=(c[b]=[uh.prototype.Me,uh.prototype.Xf,null,null,null,a.b>>1],c);if(Yb(a.D,a,c)){a.status("Added "+a.b+"-byte ROM at "+H(b));b=a.w=!0;break a}}else if(Tc(a.D,b,a.b,Jd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){C(a,"invalid block at offset "+Pa(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,E=r-=6;0=b.length){C(a,"insufficient data for block at offset "+Pa(n),4096); -break}m+=b[l++]&255;if(m&255){C(a,"invalid checksum ("+I(m,2,!0)+") for block at offset "+Pa(n),4096);break}if(E)for(C(a,"loading "+Pa(E)+" bytes at "+Pa(u)+"-"+Pa(u+E),4096);E--;)bd(a.D,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&C(a,"starting address: "+Pa(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=ta.Jc&&c<=ta.Gd&&(b=c-(ta.Jc-ta.ud));b&&(a.preventDefault&&a.preventDefault(),d.ic(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ta.wd&&(b=ta.vd);d.ic(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +h.dg=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Gb=function(a){a&=7;return this.f.w&2048?this.f.pa[a]:this.f.g[a]};h.Kb=function(a,b){b&=7;this.f.w&2048?this.f.pa[b]=a:this.f.g[b]=a};h.ue=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.Ff=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.xe=function(){return this.f.g[7]};h.If=function(a){this.f.g[7]=a};h.Hb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.pa[a]}; +h.Lb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.pa[b]=a};h.ve=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Gf=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.we=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Hf=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.fe=function(a){return this.f.ac[a-65504>>1]};h.sf=function(a,b){this.f.ac[b-65504>>1]=a};h.nd=function(a){return 65520==a?(cd(this.D)>>6)-1:0}; +h.sd=function(){};h.Se=function(){return 1};h.cg=function(){};h.ee=function(){return this.f.R};h.rf=function(){this.f.R=0};h.le=function(){return this.f.Yb};h.yf=function(a,b){b&1||(a&=255);this.f.Yb=a};h.qe=function(a,b){return b?0:this.f.Va};h.Bf=function(a){vd(this.f,a)};h.Re=function(a,b){return b?0:this.f.za&65280};h.bg=function(a){this.f.za=a|255};h.te=function(){return wd(this.f)};h.Ef=function(a){xd(this.f,a)};h.rd=function(a,b){B(this)&&C(this,"writeIgnored("+H(b)+"): "+H(a),!0,!0)}; +var R={},md=(R[61568]=[null,null,Q.prototype.Xe,Q.prototype.hg,"UNIMAP",64,1170],R[62592]=[null,null,Q.prototype.Qe,Q.prototype.ag,"SIPDR",8,1145,64],R[62608]=[null,null,Q.prototype.Oe,Q.prototype.Zf,"SDPDR",8,1145,64],R[62624]=[null,null,Q.prototype.Pe,Q.prototype.$f,"SIPAR",8,1145,64],R[62640]=[null,null,Q.prototype.Ne,Q.prototype.Yf,"SDPAR",8,1145,64],R[62656]=[null,null,Q.prototype.je,Q.prototype.wf,"KIPDR",8,1140,64],R[62672]=[null,null,Q.prototype.he,Q.prototype.uf,"KDPDR",8,1145,64],R[62688]= +[null,null,Q.prototype.ie,Q.prototype.vf,"KIPAR",8,1140,64],R[62704]=[null,null,Q.prototype.ge,Q.prototype.tf,"KDPAR",8,1145,64],R[62798]=[null,null,Q.prototype.pe,Q.prototype.Af,"MMR3",1,1145,64],R[65382]=[null,null,Q.prototype.ke,Q.prototype.xf,"LKS"],R[65402]=[null,null,Q.prototype.me,Q.prototype.zf,"MMR0",1,1140,64],R[65404]=[null,null,Q.prototype.ne,Q.prototype.rd,"MMR1",1,1145,64],R[65406]=[null,null,Q.prototype.oe,Q.prototype.rd,"MMR2",1,1140,64],R[65408]=[null,null,Q.prototype.We,Q.prototype.gg, +"UIPDR",8,1140,64],R[65424]=[null,null,Q.prototype.Ue,Q.prototype.eg,"UDPDR",8,1145,64],R[65440]=[null,null,Q.prototype.Ve,Q.prototype.fg,"UIPAR",8,1140,64],R[65456]=[null,null,Q.prototype.Te,Q.prototype.dg,"UDPAR",8,1145,64],R[65472]=[null,null,Q.prototype.Gb,Q.prototype.Kb,"R0SET0"],R[65473]=[null,null,Q.prototype.Gb,Q.prototype.Kb,"R1SET0"],R[65474]=[null,null,Q.prototype.Gb,Q.prototype.Kb,"R2SET0"],R[65475]=[null,null,Q.prototype.Gb,Q.prototype.Kb,"R3SET0"],R[65476]=[null,null,Q.prototype.Gb, +Q.prototype.Kb,"R4SET0"],R[65477]=[null,null,Q.prototype.Gb,Q.prototype.Kb,"R5SET0"],R[65478]=[null,null,Q.prototype.ue,Q.prototype.Ff,"R6KERNEL"],R[65479]=[null,null,Q.prototype.xe,Q.prototype.If,"R7KERNEL"],R[65480]=[null,null,Q.prototype.Hb,Q.prototype.Lb,"R0SET1",1,1145],R[65481]=[null,null,Q.prototype.Hb,Q.prototype.Lb,"R1SET1",1,1145],R[65482]=[null,null,Q.prototype.Hb,Q.prototype.Lb,"R2SET1",1,1145],R[65483]=[null,null,Q.prototype.Hb,Q.prototype.Lb,"R3SET1",1,1145],R[65484]=[null,null,Q.prototype.Hb, +Q.prototype.Lb,"R4SET1",1,1145],R[65485]=[null,null,Q.prototype.Hb,Q.prototype.Lb,"R5SET1",1,1145],R[65486]=[null,null,Q.prototype.ve,Q.prototype.Gf,"R6SUPER",1,1145],R[65487]=[null,null,Q.prototype.we,Q.prototype.Hf,"R6USER",1,1145],R[65504]=[null,null,Q.prototype.fe,Q.prototype.sf,"CTRL",8,1170],R[65520]=[null,null,Q.prototype.nd,Q.prototype.sd,"LSIZE",1,1170],R[65522]=[null,null,Q.prototype.nd,Q.prototype.sd,"HSIZE",1,1170],R[65524]=[null,null,Q.prototype.Se,Q.prototype.cg,"SYSID",1,1170],R[65526]= +[null,null,Q.prototype.ee,Q.prototype.rf,"ERR",1,1170],R[65528]=[null,null,Q.prototype.le,Q.prototype.yf,"MBR",1,1170],R[65530]=[null,null,Q.prototype.qe,Q.prototype.Bf,"PIR"],R[65532]=[null,null,Q.prototype.Re,Q.prototype.bg,"SLR"],R[65534]=[null,null,Q.prototype.te,Q.prototype.Ef,"PSW"],R); +wb(function(){for(var a=y(document,x,"device"),b=0;b>1),this.b=new Int32Array(this.u,0,this.size>>2),Ld(this,Md?Nd:Od);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.ce=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.cf=function(a,b){Ib&&a&1&&this.C.La(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8}; +h.pf=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Wa=!0};h.ae=function(a,b){this.f&&null!=this.K&&Vd(this.f,this.K+a);return this.j(a,b)};h.Ze=function(a,b){this.f&&null!=this.K&&Vd(this.f,this.K+a,2);return this.B(a,b)}; +h.mf=function(a,b,c){this.f&&null!=this.K&&Wd(this.f,this.K+a);this.J?this.Jb(0,b,c):this.D(a,b,c)};h.jg=function(a,b,c){this.f&&null!=this.K&&Wd(this.f,this.K+a,2);this.J?this.Jb(0,b,c):this.F(a,b,c)};h.$d=function(a){return this.g[a]};h.be=function(a,b){a=this.g[a];this.f&&B(this.f,32)&&C(this.f,"Memory.readByte("+P(this.f,b)+"): "+P(this.f,a),!0);return a};h.Ye=function(a,b){Ib&&a&1&&this.C.La(b,64,2);return this.w.getUint16(a,!0)}; +h.bf=function(a,b){Ib&&a&1&&this.C.La(b,64,2);a=!Pb&&a&1?this.g[a]|this.g[a+1]<<8:this.H[a>>1];this.f&&B(this.f,32)&&C(this.f,"Memory.readWord("+P(this.f,b)+"): "+P(this.f,a),!0);return a};h.lf=function(a,b){this.g[a]=b;this.Wa=!0};h.nf=function(a,b,c){this.g[a]=b;this.Wa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeByte("+P(this.f,c)+","+P(this.f,b)+")",!0)};h.ig=function(a,b,c){Ib&&a&1&&this.C.La(c,64,4);this.w.setUint16(a,b,!0);this.Wa=!0}; +h.kg=function(a,b,c){Ib&&a&1&&this.C.La(c,64,4);!Pb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.H[a>>1]=b;this.Wa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeWord("+P(this.f,c)+","+P(this.f,b)+")",!0)};var Bd=0,dd=1,Kd=2,Uc=4,Zc=["NONE","RAM","ROM","VID","H/W"],Ad=0,Qd=[],Pd=[O.prototype.ce,O.prototype.pf,O.prototype.cf,O.prototype.lg],Td=[O.prototype.ae,O.prototype.mf,O.prototype.Ze,O.prototype.jg]; +if(Eb)var Od=[O.prototype.$d,O.prototype.lf,O.prototype.Ye,O.prototype.ig],Nd=[O.prototype.be,O.prototype.nf,O.prototype.bf,O.prototype.kg];var Xd;if(Eb){var Yd=new ArrayBuffer(2);(new DataView(Yd)).setUint16(0,256,!0);Xd=256===(new Uint16Array(Yd))[0]}else Xd=!1;var Md=Xd; +function Zd(a,b){q.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.rc=0;this.pc=b;this.cb=c;this.wc=Math.round(this.pc/1E4)/100;this.pb=this.wc*this.cb;this.xc=this.Ub=this.tb=this.qc=0;this.A.T=this.A.lc=!1;this.A.va=a.autoStart;"string"==typeof this.A.va&&(this.A.va="true"==this.A.va);this.A.Bb=!1;this.Sb=this.Db=0;this.Tb=+a.csStart;this.Cb=+a.csInterval;this.Eb=+a.csStop;this.ia=[];this.Xc=this.gf.bind(this);this.eb=this.Ia=this.bb=this.b=this.la=this.Ha=this.Rb=this.ab=this.Fb= +this.yc=this.ob=0;this.ua=null;A(this)}p(Zd,q);h=Zd.prototype;h.wa=function(a,b,c,d){this.J=a;this.D=b;this.G=d;this.ua=a.i;for(a=0;a<$d.length;a++)(b=this.C[$d[a]])&&this.J.sa(null,$d[a],b);A(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1}; +h.ya=function(a,b){var c=ae(this.J,"autoStart");null!=c?this.A.va="true"==c?!0:"false"==c?!1:!!c:null==this.A.va&&(this.A.va=!this.G&&void 0===this.C.run);if(!b){if(a){be(this);if(!this.restore(a))return!1;ce(this)}else this.reset();this.G?(a=this.G,b=this.A.va,a.Ea=!0,a.v("Type ? for help with PDPjs Debugger commands"),de(a),b||ee(a),a.ua&&(b=a.ua,a.ua=null,fe(a,b))):this.status("No debugger detected");this.A.va||this.v("CPU will not be auto-started "+(this.ua?"(click Run to start)":"(type 'go' to start)"))}return!0}; +h.xa=function(a){return a?this.save():!0};h.va=function(){return this.A.T?!0:this.A.va?(nc(this),!0):!1};h.gd=function(){return 0};function ce(a){void 0===a.Tb&&(a.Tb=0);void 0===a.Cb&&(a.Cb=-1);void 0===a.Eb&&(a.Eb=-1);a.A.Bb=0<=a.Tb&&0=a.Db&&(a.Db+=a.Cb,c=!0);0<=a.Eb&&a.Eb<=ge(a)&&(a.Cb=a.Eb=-1,ce(a),a.ba(),c=!0);c&&a.v(ge(a)+" cycles: checksum="+I(a.Sb))}} +h.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.C[b]=c,!0;case "run":return this.C[b]=c,c.onclick=function(){var a;if(a=d.J)if(a=d.J,a.A.fa)a=!0;else{var b=null,c,k=Ba(a.id);for(c=0;ca.ob/a.pb?b=1:d=!0;a.cb=b;b=a.wc*a.cb;if(a.pb!=b){a.pb=b;b=a.pb.toFixed(2)+"Mhz";var e=a.C.setSpeed;e&&(e.textContent=b);a.v("target speed: "+b)}c&&a.J&&ke(a.J)}qc(a,a.Ia);a.Ia=0;a.Ha=za();a.ab=0;ie(a);return d}function hd(a,b){var c=a.ia.length;a.ia.push([-1,b]);return c}function kd(a,b,c,d){0<=b&&ba.ia[b][0])&&(c=a.pc*a.cb/1E3*c|0,a.A.T&&(c+=le(a)),a.ia[b][0]=c)} +function me(a,b){for(var c=a.ia.length-1;0<=c;c--){var d=a.ia[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function ne(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function le(a,b){var c=a.bb-=a.b;a.b=a.la=0;b&&(a.bb=0);return c} +h.gf=function(){if(this.A.T){this.qc>=this.pc&&ie(this,!0);this.Fb=0;this.Rb=za();if(this.ab){var a=this.Rb-this.ab;a>this.xc&&(this.Ha+=a,this.Ha>this.Rb&&(this.Ha=this.Rb))}try{do{var b=me(this,this.A.Bb?1:this.Ub);try{this.ec(b)}catch(e){if("number"!=typeof e)throw e;}b=le(this,!0);this.Fb+=b;this.Ia+=b;Cc(this,b);pc(this,b);this.tb-=b;if(0>=this.tb){this.tb+=this.Ub;++this.yc>=oe&&(this.J&&M(this.J,void 0),this.yc=0);break}}while(this.A.T)}catch(e){this.ba();this.J&&this.J.stop(za(),ge(this)); +Ja(this,e.stack||e.message);return}if(this.A.T){a=setTimeout;b=this.Xc;this.ab=za();var c=this.xc;this.Fb&&(c=Math.round(c*this.Fb/this.Ub));var c=c-(this.ab-this.Rb),d=this.ab-this.Ha;d&&(this.ob=Math.round(this.Ia/(10*d))/100,864E5<=d&&(this.eb=0,he(this)));if(0>c||this.obc&&(this.Ha-=c),c=0;this.qc+=this.Fb;this.ab+=c;a(b,c)}}}; +function nc(a,b){if(!Ka(a))if(a.A.T)a.v(a.toString()+" busy");else{he(a);a.A.T=!0;a.A.lc=!0;var c=a.C.run;c&&(c.textContent="Halt");a.J&&(b&&ke(a.J,!0),a.J.start(a.Ha,ge(a)));a.G||a.status("Started");setTimeout(a.Xc,0)}}h.ec=function(){return 0};h.ba=function(a){var b=!1;if(this.A.T){le(this);qc(this,this.Ia);this.Ia=0;this.A.T=!1;if(b=this.C.run)b.textContent="Run";this.J&&this.J.stop(za(),ge(this));b=!0;this.G||this.status("Stopped")}this.A.complete=a;return b};var je=30,oe=15,$d=["power","reset"]; +function pe(a){var b=+a.model||1170;Zd.call(this,a,6666667);this.ka=b;this.Rc=+a.addrReset||0;this.Ua=this.w=this.O=this.F=this.H=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Fa=this.ac=[];this.Za=this.P=this.Qc=this.qb=this.kb=this.rb=this.$a=this.R=this.Yb=this.Va=this.za=this.U=this.Zb=this.$b=this.V=this.i=0;this.Tc=[4,2,0,1];this.bc=0;this.Uc=255;1120>=this.ka?(this.Pc=qe.bind(this),this.Ab=this.Ld,this.bc=8,this.Uc=-1,this.Zc=255,this.Yc=0):(this.Pc=re.bind(this),this.Ab=this.Md, +this.Zc=~(1792|(1140>=this.ka?2048:0))&65535,this.Yc=1140e.xb&&(e.xb=c,c+=4)}return Zd.prototype.ya.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.ka);this.A.T&&this.ba();this.F=65536;this.H=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Rc,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535, +65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ac=[0,0,0,0,0,0,0,0];this.O=0;this.Ua=-1;this.u=this.j=this.oc=this.X=this.Z=this.i=this.Yb=0;lc(this);be(this);this.A.error=!1;Zd.prototype.reset.call(this)};function lc(a){a.U=0;a.Zb=0;a.$b=0;a.V=0;a.R=0;a.Va=0;a.za=255;a.qb=0;a.kb=0;a.rb=0;a.$a=262143;a.Za=a.g[7];a.P=0;a.S=null;a.D&&(se(a),a.Qc=cd(a.D))} +function se(a){a.Nb=a.sc;a.Ob=a.tc;a.mc=a.uc;a.Pb=a.vc;a.Wb&&(a.Nb=a.fd,a.Ob=a.ld);a.Xb&&(a.mc=a.pd,a.Pb=a.qd);a.qb?(a.Ga=65536,a.lb=a.V&16?4186112:253952,a.Ea=a.kd,a.na=a.Wb?a.af:a.Fc,a.zb=a.Xb?a.ng:a.Ic,Vc(a.D,a.V&16?22:18)):(a.Ga=0,a.lb=57344,a.Ea=a.Od,a.na=a.Wb?a.$e:a.od,a.zb=a.Xb?a.mg:a.td,Vc(a.D,16))}function qd(a){var b=a.U;b&57344||(b=b&-3199|a.kb<<5|a.rb<<1);return b} +function rd(a,b){b&=-3073;if(a.U!=b){b&57344&&!(a.U&57344)&&(a.Zb=a.P>>16&65535,a.$b=a.P&65535);a.U=b;a.kb=(b&96)>>5;a.rb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.qb!=c&&(a.qb=c,se(a))}}function sd(a){a.U&57344||(a.Zb=a.P>>16&65535);a=a.Zb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function td(a){a.U&57344||(a.$b=a.P&65535);return a.$b}function ud(a,b){1170>a.ka&&(b&=-49);a.V!=b&&(a.V=b,a.$a=b&16?4194303:262143,se(a))} +function te(a,b,c){a.Rc=b;ue(a,b);xd(a,0);a.D.reset();lc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.T||nc(a)}else a.G&&a.A.fa?a.ba()||(de(a.G),M(a.J,-1)):!1===c&&a.ba();!a.A.T&&a.ua&&a.ua.stop()}h.gd=function(){return 0}; +h.save=function(){var a=new L(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Fa,this.ac,this.R,this.Yb,this.Va,this.za,this.kb,this.rb,this.Za,this.i,this.P,this.Ua,this.cc,this.fc]);a.set(1,[wd(this),qd(this),sd(this),td(this),this.V]);a.set(2,[this.eb,this.cb,this.A.va]);a.set(3,ve(this));a.set(4,ne(this));return a.data()}; +h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Fa=b.next().value;this.ac=b.next().value;this.R=b.next().value;this.Yb=b.next().value;this.Va=b.next().value;this.za=b.next().value;this.kb=b.next().value;this.rb=b.next().value;this.Za=b.next().value;this.i=b.next().value;this.P=b.next().value;this.Ua=b.next().value;this.cc=b.next().value;this.fc=b.next().value;b=a[1];xd(this,b[0]);rd(this,b[1]); +this.Zb=b[2];this.$b=b[3];ud(this,b[4]);b=a[2];this.eb=b[0];he(this,b[1]);this.A.va=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function ue(a,b){a.g[7]=b&65535}function ld(a,b,c,d){b={xb:b,ib:c,message:d||0,name:Rb[b],next:null};a.Qb.push(b);return b}function Be(a,b){var c=a.S;if(c==b)a.S=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.S&&(a.i|=1)} +function id(a,b){if(b){if(b!=a.S){var c=a.S;if(!c||c.ib<=b.ib)b.next=c,a.S=b;else{do{var d=c.next;if(!d||d.ib<=b.ib){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&B(a,b.message|8)&&C(a,"setIRQ(vector="+H(b.xb)+",priority="+b.ib+")",!0,!0)}}function pd(a,b){b&&(Be(a,b),b.message&&B(a,b.message|8)&&C(a,"clearIRQ(vector="+H(b.xb)+",priority="+b.ib+")",!0,!0))}function ve(a){var b=[];for(a=a.S;a;)b.push(a.xb),a=a.next;return b} +function Ce(a){return a.i&64?(a.ta(168,64,-6),!0):a.i&32?(a.ta(4,32,-5),!0):a.i&16?(a.ta(12,16,-7),!0):!1}function wd(a){return a.w=a.w&63728|ze(a)|ye(a)|xe(a)|we(a)}function xd(a,b){b&=a.Zc;a.I=b<<12;a.L=~b&4;a.H=b<<14;a.F=b<<16;if((b^a.w)&a.Yc)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.O=b>>14&3;c=a.w>>14&3;a.O!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.O]);a.w=b;a.i&=-3;a.i|=a.S?2:1}function vd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.Va=b} +h.Da=function(a){this.I=this.L=a;this.H=0};h.jb=function(a,b){this.I=this.L=this.F=a;this.H=b||0};function De(a,b){a.I=a.L=a.F=b;a.H=a.I^a.F>>1}function Ee(a,b,c,d){a.I=a.L=a.F=b;a.H=(c^d)&(d^b)} +h.ta=function(a,b,c){if(!this.oa){0>this.Ua?this.Ua=wd(this):this.O||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.R|=4,this.g[6]=a=4);if(-1!=c){this.P=a|4143316992;this.O=0;var d=this.na(a|this.Ga),e=this.na(a+2&65535|this.Ga);xd(this,e&-12289|this.Ua>>2&12288);Fe(this,this.Ua);Fe(this,this.g[7]);ue(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Ua=-1;this.cc=c;this.fc=a;-1==c&&this.ba();if(-4<=c)throw a;}}; +function Ge(a){var b=He(a),c=He(a);a.w&49152&&(c=c&-225|a.w&63712);ue(a,b);xd(a,c);a.i&=-17}function Ie(a,b){var c=b>>13&31;31>c&&(b=a.V&32?a.Fa[c]+(b&8191)&4194303:b&-3932161);return b} +function Je(a,b,c){var d=[];if(c){c=Ie(a,b);var e=b>>13&31;d.push(c);d.push(e);a.V&32&&(d.push(a.Fa[e]),d.push(b&8191))}else if(a.qb){var e=a.O<<1,f=b>>13;7>13;a.V&a.Tc[a.O]||(d&=7);e=a.B[a.O][d];f=(a.M[a.O][d]<<6)+(b&8191)&a.$a;3932160<=f&&(f=Ie(a,f));if(a.oa)return f;f>=a.Qc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.B[a.O][d]=e;if(f!=(4194170&a.$a)||a.O)a.kb=a.O,a.rb=d;g&&(g&57344&&(0<=a.Ua&&(g|=128),a.U&57344||(g|=a.U&4096|a.kb<<5|a.rb<<1,rd(a,a.U&-61695|g&61694)),a.ta(168,64,-2)),a.U&61440||!(f<(4191360&a.$a)||f>(4194239&a.$a))||(a.U|=4096,a.U&512&&(a.i|=64)));return f}function He(a){var b=a.na(a.g[6]|a.Ga);a.g[6]=a.g[6]+2&65535;return b}function Fe(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.P=a.P&65535|(a.P&-65536)<<8|16121856;a.i&256||a.Ab(4,-2,c);a.zb(c,b)} +function Ke(a,b,c,d){var e,f,g=d&8?0:a.Ga;switch(b){case 0:return a.ta(4,0,-3),0;case 1:return 6==c&&a.Ab(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Ab(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Ab(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(Ae(a,2)),e=e+a.g[c]&65535,6==c&&a.Ab(d, +0,e),a.b-=6,e|g;case 7:return e=a.na(Ae(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ga),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.P=a.P&65535|(a.P&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ld=function(a,b,c){!this.O&&0>=b&&c<=this.za&&(this.i|=32)};h.Md=function(a,b,c){this.O||(65534<=c&&(c|=-65536),a&4&&c<=this.za&&(c<=this.za-32?this.ta(4,0,-4):(this.R|=8,this.i|=32)))};h.fd=function(a){this.G&&Vd(this.G,a,1);return this.sc(a)};h.ld=function(a){this.G&&Vd(this.G,a,2);return this.tc(a)}; +h.pd=function(a,b){this.G&&Wd(this.G,a,1);this.uc(a,b)};h.qd=function(a,b){this.G&&Wd(this.G,a,2);this.vc(a,b)};function Hc(a,b){a.oa++;b=a.D.dc(Fc(a,b,2));a.oa--;return b}function Le(a,b){(b?--a.Xb:--a.Wb)||se(a)}h.Od=function(a,b,c){return Ke(this,a,b,c)};h.kd=function(a,b,c){return Fc(this,Ke(this,a,b,c),c)};h.od=function(a){return this.D.dc(this.Za=a)};h.$e=function(a){this.G&&Vd(this.G,a,2);return this.od(a)};h.Fc=function(a){return this.D.dc(this.Za=Fc(this,a,2))}; +h.af=function(a){this.G&&Vd(this.G,a,2);return this.Fc(a)};h.td=function(a,b){this.D.Mb(this.Za=a,b)};h.mg=function(a,b){this.G&&Wd(this.G,a,2);this.td(a,b)};h.Ic=function(a,b){this.D.Mb(this.Za=Fc(this,a,4),b)};h.ng=function(a,b){this.G&&Wd(this.G,a,2);this.Ic(a,b)};function Me(a,b,c){var d=a.j=b&7;(b=a.u=(b&56)>>3)?(d=Ke(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.O=a.w>>12&3,c=a.na(d|c&a.Ga),a.O=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} +function Ne(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=Ke(a,b,e,4),c&65536||(e&=65535),a.O=a.w>>12&3,e=Fc(a,e|c&65536,4),a.O=a.w>>14&3,a.Pb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Oe(a,b){b>>=6;var c=a.Z=b&7;return(b=a.X=(b&56)>>3)?a.Nb(a.Ea(b,c,3)):a.g[c+a.bc]&a.Uc}function Pe(a,b){var c;b>>=6;var d=a.Z=b&7;(b=a.X=(b&56)>>3)?c=a.Ob(a.Ea(b,d,2)):c=a.g[d+a.bc];return c}function Qe(a,b){var c=a.j=b&7;b=a.u=(b&56)>>3;return Ke(a,b,c,8)} +function mf(a,b){var c=a.j=b&7;return(b=a.u=(b&56)>>3)?a.Nb(a.Ea(b,c,3)):a.g[c]&255}function nf(a,b){var c,d=a.j=b&7;(b=a.u=(b&56)>>3)?c=a.Ob(a.Ea(b,d,2)):c=a.g[d];return c}function of(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.oc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.mc(e,d.call(a,c,a.Nb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} +function U(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,6),a.Pb(e,d.call(a,0>c?a.g[-c-1]:c,a.Ob(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function pf(a,b,c,d,e){var f=a.j=b&7;(b=a.u=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.mc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} +function qf(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Pb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} +h.ec=function(a){this.A.complete=!0;var b=this.G?rf(this.G)?1:this.A.lc?-1:0:0,c=a?this.A.lc?0:1:-1;this.A.lc=!1;this.bb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(sf(this.G,this.g[7],c)){this.ba();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.Va&224)>>5,f=this.S&&this.S.ib>e?this.S:null;f&&(d=f.xb,e=f.ib);e>(this.w&224)>>5?(this.i&8&&(Ae(this,2),this.i&=-9),this.ta(d,0,-10),e=!0):e=!1;e&&(f&&Be(this,f),a=!0);this.S||this.Va||(this.i&=-3)}else this.i& +1&&this.i++;if(a){if(this.i&4&&sf(this.G,this.g[7],c)){this.ba();break}if(0>c)break}if(this.i&112&&Ce(this)){if(this.i&4&&sf(this.G,this.g[7],c)){this.ba();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.Pc(f)}while(0>1|b<<16;De(this,a);return a&65535}function yf(a,b){a=b&128|b>>1|b<<8;De(this,a<<8);return a&255}function zf(a,b){a=b&~a;this.Da(a);return a}function Af(a,b){a=b&~a;this.Da(a<<8);return a} +function Bf(a,b){a|=b;this.Da(a);return a}function Cf(a,b){a|=b;this.Da(a<<8);return a}function Df(a,b){a=~b|65536;this.jb(a);return a&65535}function Ef(a,b){a=~b|256;this.jb(a<<8);return a&255}function Ff(a,b){this.I=this.L=a=b-a;this.H=b&(b^a);return a&65535}function Gf(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.H=b&(b^c);return a&255}function Hf(a,b){this.I=this.L=a=b+a;this.H=a&(b^a);return a&65535}function If(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.H=c&(b<<8^c);return a&255} +function Jf(a,b){a=-b;this.jb(a,a&b&32768);return a&65535}function Kf(a,b){a=-b;this.jb(a<<8,(a&b&128)<<8);return a&255}function Lf(a,b){a=b<<1|this.F>>16&1;De(this,a);return a&65535}function Mf(a,b){a=b<<1|this.F>>16&1;De(this,a<<8);return a&255}function Nf(a,b){a=(this.F&65536|b)>>1|b<<16;De(this,a);return a&65535}function Of(a,b){a=((this.F&65536)>>8|b)>>1|b<<8;De(this,a<<8);return a&255}function Pf(a,b){var c=b-a;Ee(this,c,a,b);return c&65535} +function Qf(a,b){var c=b-a;Ee(this,c<<8,a<<8,b<<8);return c&255}function Rf(a,b){this.I=this.L=b&65280;this.H=this.F=0;return(b<<8|b>>8)&65535}function Sf(a,b){a^=b;this.Da(a);return a&65535}function Tf(a){U(this,a,Pe(this,a),tf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function Uf(a){var b=nf(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.F=this.H=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.H=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.u?6:7)+b} +function Vf(a){var b=nf(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&=63;if(b&32){b=64-b;32>b-1;this.F=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.u?6:7)+b}function Wf(a){T(this,a,!we(this))}function Xf(a){T(this,a,we(this))} +function Yf(a){U(this,a,Pe(this,a),zf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Zf(a){of(this,a,Oe(this,a),Af);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function $f(a){U(this,a,Pe(this,a),Bf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function ag(a){of(this,a,Oe(this,a),Cf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function bg(a){var b=Pe(this,a);a=nf(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function cg(a){var b=Oe(this,a);a=mf(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function dg(a){T(this,a,ye(this))}function eg(a){T(this,a,!ze(this)==!xe(this))}function fg(a){T(this,a,!ye(this)&&!ze(this)==!xe(this))}function gg(a){T(this,a,!we(this)&&!ye(this))} +function hg(a){T(this,a,ye(this)||!ze(this)!=!xe(this))}function ig(a){T(this,a,we(this)||ye(this))}function jg(a){T(this,a,!ze(this)!=!xe(this))}function kg(a){T(this,a,ze(this))}function lg(a){T(this,a,!ye(this))}function mg(a){T(this,a,!ze(this))}function ng(){this.ta(12,0,-9)}function og(a){T(this,a,!0)}function pg(a){T(this,a,!xe(this))}function qg(a){T(this,a,xe(this))}function rg(a){a&1&&(this.F=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} +function sg(a){var b=Pe(this,a);a=nf(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Ee(this,c,a,b);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function tg(a){var b=Oe(this,a);a=mf(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Ee(this,c,a,b);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} +function ug(a){var b=nf(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.H=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.H=32768,this.F=65536,this.b-=7}function vg(){this.ta(24,0,-9);this.b-=20} +function wg(){this.w&49152?(this.R|=128,this.ta(4,0,-8)):(this.ua&&1120==this.ka&&this.ua.setData(this.g[0],!0),this.G?xg(this.G):this.ba());this.b-=7}function yg(){this.ta(16,0,-9);this.b-=20}var zg=[0,7,7,10,7,11,9,13];function Ag(a){this.la=this.b;ue(this,Qe(this,a));this.b=this.la-zg[this.u]}var Bg=[0,14,14,17,14,18,16,20];function Cg(a){this.la=this.b;var b=Qe(this,a);a=a>>6&7;Fe(this,this.g[a]);this.g[a]=this.g[7];ue(this,b);this.b=this.la-Bg[this.u]} +var Dg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Eg(a){var b=Pe(this,a);this.la=this.b;qf(this,a,b,this.Da);this.b=this.la-Dg[(this.X?8:0)+this.u]+(7!=this.j||this.u?0:2)}function Fg(a){var b=Oe(this,a);pf(this,a,b,65535,this.Da);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Gg=[7,13,13,17,14,18,17,21]; +function Hg(a){var b=nf(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.H=0;this.F=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)ue(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Og(a){U(this,a,Pe(this,a),Pf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Pg(a){U(this,a,0,Rf);this.b-=this.u?9:3+(7==this.j?2:0)}function Qg(){this.ta(28,0,-9)} +function Rg(){this.ua&&(this.ua.Gc(this.g[7],!0),this.ua.setData(this.g[0],!0));this.i|=8;Ae(this,-2);this.b-=3}function Sg(a){U(this,a,this.g[(a>>6&7)+this.bc],Sf);this.b-=this.u?9:3+(7==this.j?2:0)}function V(a){var b;if(b=this.G)b=this.G,B(b,1)?(C(b,"undefined opcode "+P(b,a),!0,!0),b=xg(b)):b=!1;b||this.ta(8,0,-9)}function qe(a){Tg[a>>12].call(this,a)}function Ug(a){Vg[a>>6&3].call(this,a)}function Wg(a){Xg[a>>6&3].call(this,a)}function Yg(a){Zg[a>>6&3].call(this,a)} +function $g(a){ah[a&15].call(this,a)}function bh(a){ch[a&15].call(this,a)}function dh(a){eh[a>>6&3].call(this,a)}function fh(a){gh[a>>6&3].call(this,a)}function hh(a){ih[a>>6&3].call(this,a)} +var Tg=[function(a){jh[a>>8&15].call(this,a)},Eg,sg,bg,Yf,$f,Tf,V,function(a){kh[a>>8&15].call(this,a)},Fg,tg,cg,Zf,ag,Og,V],jh=[function(a){lh[a>>4&15].call(this,a)},og,lg,dg,eg,jg,fg,hg,Cg,Cg,Ug,Wg,Yg,V,V,V],Vg=[function(a){qf(this,a,0,this.jb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){U(this,a,0,Df);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){U(this,a,1,Hf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){U(this,a,1,Ff);this.b-=this.u?9:3+(7==this.j?2:0)}],Xg=[function(a){U(this,a,0,Jf); +this.b-=this.u?11:6},function(a){U(this,a,we(this)?1:0,tf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){U(this,a,we(this)?1:0,Pf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=nf(this,a);this.jb(a);this.b-=this.u?4:3+(7==this.j?2:0)}],Zg=[function(a){U(this,a,0,Nf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){U(this,a,0,Lf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){U(this,a,0,xf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){U(this,a,0,vf);this.b-=this.u?9:3+(7==this.j?2:0)}],lh= +[function(a){mh[a&15].call(this,a)},V,V,V,Ag,Ag,Ag,Ag,Kg,V,$g,bh,Pg,Pg,Pg,Pg],mh=[wg,Rg,Lg,ng,yg,Jg,V,V,V,V,V,V,V,V,V,V],ah=[Ig,function(){this.F=0;this.b-=5},function(){this.H=0;this.b-=5},rg,function(){this.L=1;this.b-=5},rg,rg,rg,function(){this.I=0;this.b-=5},rg,rg,rg,rg,rg,rg,rg],ch=[Ig,function(){this.F=65536;this.b-=5},function(){this.H=32768;this.b-=5},Mg,function(){this.L=0;this.b-=5},Mg,Mg,Mg,function(){this.I=32768;this.b-=5},Mg,Mg,Mg,Mg,Mg,Mg,Mg],kh=[mg,kg,gg,ig,pg,qg,Wf,Xf,vg,Qg,dh,fh, +hh,V,V,V],eh=[function(a){pf(this,a,0,255,this.jb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){of(this,a,0,Ef);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){of(this,a,1,If);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){of(this,a,1,Gf);this.b-=this.u?9:3+(7==this.j?2:0)}],gh=[function(a){of(this,a,0,Kf);this.b-=this.u?11:6},function(a){of(this,a,we(this)?1:0,uf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){of(this,a,we(this)?1:0,Qf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=mf(this, +a);this.jb(a<<8);this.b-=this.u?4:3+(7==this.j?2:0)}],ih=[function(a){of(this,a,0,Of);this.b-=this.u?9+(this.oc&1):3+(7==this.j?2:0)},function(a){of(this,a,0,Mf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){of(this,a,0,yf);this.b-=this.u?9+(this.oc&1):3+(7==this.j?2:0)},function(a){of(this,a,0,wf);this.b-=this.u?9:3+(7==this.j?2:0)}];function re(a){nh[a>>12].call(this,a)} +var nh=[function(a){oh[a>>8&15].call(this,a)},Eg,sg,bg,Yf,$f,Tf,function(a){ph[a>>8&15].call(this,a)},function(a){qh[a>>8&15].call(this,a)},Fg,tg,cg,Zf,ag,Og,V],oh=[function(a){rh[a>>4&15].call(this,a)},og,lg,dg,eg,jg,fg,hg,Cg,Cg,Ug,Wg,Yg,function(a){sh[a>>6&3].call(this,a)},V,V],sh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.na(a|this.Ga);ue(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Me(this,a,0);this.Da(a);Fe(this,a);this.b-=11},function(a){var b=He(this); +this.la=this.b;this.Da(b);Ne(this,a,0,b);this.b=this.la-Gg[this.u]},function(a){qf(this,a,ze(this)?65535:0,this.Da);this.b-=this.u?9:3+(7==this.j?2:0)}],rh=[function(a){th[a&15].call(this,a)},V,V,V,Ag,Ag,Ag,Ag,Kg,function(a){!(a&8)||1145>this.ka?V.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},$g,bh,Pg,Pg,Pg,Pg],th=[wg,Rg,function(){Ge(this);this.i|=this.w&16;this.b-=13},ng,yg,Jg,Lg,function(a){V.call(this,a)},V,V,V,V,V,V,V,V],ph=[Hg,Hg,ug,ug,Uf,Uf,Vf,Vf, +Sg,Sg,V,V,V,V,Ng,Ng],qh=[mg,kg,gg,ig,pg,qg,Wf,Xf,vg,Qg,dh,fh,hh,function(a){1145>this.ka?V.call(this,a):uh[a>>6&3].call(this,a)},V,V],uh=[function(a){V.call(this,a)},function(a){a=Me(this,a,65536);this.Da(a);Fe(this,a);this.b-=11},function(a){var b=He(this);this.la=this.b;this.Da(b);Ne(this,a,65536,b);this.b=this.la-Gg[this.u]},function(a){V.call(this,a)}]; +function vh(a){q.call(this,"ROM",a,0,128);this.ha=this.g=null;this.u=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Qa(this.j);if(this.j){a=this.j;var b=Ra(this.B);"json"!=b&&"hex"!=b&&(a=eb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;cb(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(xa(c.nb,a,b),(a=db(a,b))?(c.g=a.ca,c.ha=a.ha):c.j=null);wh(c)})}}p(vh,q); +h=vh.prototype;h.wa=function(a,b,c,d){this.D=b;this.f=c;this.G=d;wh(this)};h.ya=function(){this.ha&&(this.G&&xh(this.G,this.id,this.u,this.b,this.ha),delete this.ha);return!0};h.xa=function(){return!0}; +function wh(a){if(!La(a)){if(a.j){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Ja(a,"ROM size ("+I(a.g.length,8,!0)+") does not match specified size ("+I(a.b,8,!0)+")");else{var b;a:{b=a.u;if(57344<=b&&b<57344+Nc){var c={},c=(c[b]=[vh.prototype.Me,vh.prototype.Xf,null,null,null,a.b>>1],c);if(Yb(a.D,a,c)){a.status("Added "+a.b+"-byte ROM at "+H(b));b=a.w=!0;break a}}else if(Tc(a.D,b,a.b,Kd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){C(a,"invalid block at offset "+J(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,E=r-=6;0=b.length){C(a,"insufficient data for block at offset "+J(n),4096);break}m+= +b[l++]&255;if(m&255){C(a,"invalid checksum ("+I(m,2,!0)+") for block at offset "+J(n),4096);break}if(E)for(C(a,"loading "+J(E)+" bytes at "+J(u)+"-"+J(u+E),4096);E--;)bd(a.D,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&C(a,"starting address: "+J(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=ua.Jc&&c<=ua.Gd&&(b=c-(ua.Jc-ua.ud));b&&(a.preventDefault&&a.preventDefault(),d.ic(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ua.wd&&(b=ua.vd);d.ic(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ic(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;var e=this;this.R=kd(this.f,this.M?-1:48,4,262144);this.S=hd(this.f,function(){var a;a=-1;e.i.length&&(a=e.i.shift()&255,C(e,"receiveByte("+I(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),jd(e.f,e.S,1E3/Math.round(e.T/10)));0<=a&&(e.F=a,e.b&128?e.F|=49152:e.b|=128,e.b&64&&id(c,e.R))});this.O=kd(this.f,this.M?-1:52,4,262144);this.X=hd(this.f,function(){e.g|=128;e.g&64&&id(c,e.O)});Yb(b,this,Dh,this.M?64832+8*(this.M-1)-65392:0);$b(b,this.reset.bind(this)); -A(this)};h.md=function(a){if(!this.j){var b=$d(this.J,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Za(c[0]);if(d!=this.nb)return;c=Za(c[1]);if(this.j=Ba(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.H=e.receiveData){this.I=a;this.P=e.receiveStatus;this.status("Connected "+this.ob+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -h.ya=function(a,b){if(!b)if(this.md(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Eh(this)};h.save=function(){var a=new J(this);a.set(0,[this.F,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Eh(this,a[0])};function Eh(a,b){b||(b=[0,8192,128,a.i]);b=ja(b);a.F=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0} -h.ic=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;da&&(a-=32),kd(e.f,e.S,1E3/Math.round(e.U/10)));0<=a&&(e.F=a,e.b&128?e.F|=49152:e.b|=128,e.b&64&&id(c,e.R))});this.O=ld(this.f,this.M?-1:52,4,262144);this.X=hd(this.f,function(){e.g|=128;e.g&64&&id(c,e.O)});Yb(b,this,Eh,this.M?64832+8*(this.M-1)-65392:0);$b(b,this.reset.bind(this)); +A(this)};h.md=function(a){if(!this.j){var b=ae(this.J,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Za(c[0]);if(d!=this.mb)return;c=Za(c[1]);if(this.j=Ca(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.H=e.receiveData){this.I=a;this.P=e.receiveStatus;this.status("Connected "+this.nb+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +h.ya=function(a,b){if(!b)if(this.md(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Fh(this)};h.save=function(){var a=new L(this);a.set(0,[this.F,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Fh(this,a[0])};function Fh(a,b){b||(b=[0,8192,128,a.i]);b=ja(b);a.F=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0} +h.ic=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Ya("",c)));this.V&&!this.B&&c&&(b=String.fromCharCode(this.V)+b);this.u.value+=b;this.u.scrollTop=this.u.scrollHeight;this.B+=c}}else if(null!=this.w){if(10== -a||1024<=this.w.length)this.v(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}jd(this.f,this.X,1E3/Math.round(this.Z/10));this.g&=-129};var Ch="buffer",Fh={},Dh=(Fh[65392]=[null,null,Bh.prototype.ze,Bh.prototype.Kf,"RCSR"],Fh[65394]=[null,null,Bh.prototype.ye,Bh.prototype.Jf,"RBUF"],Fh[65396]=[null,null,Bh.prototype.ef,Bh.prototype.pg,"XCSR"],Fh[65398]=[null,null,Bh.prototype.df,Bh.prototype.og,"XBUF"],Fh); -wb(function(){for(var a=y(document,x,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.C[b]=c,!0;case "readTape":e=Jh;case "loadTape":return e||(e=Kh),this.C[b]=c,c.onclick= -function(){var a=d.C.listTapes;a&&Lh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.C[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Lh(d,Qa(b,!0),b,Kh,a)}return!1};return!0;case Mh:return this.C[b]=c,!0}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;this.I=Nh(a);var e=this;if(a=Gh(this,$d(this.J,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.H=kd(this.f,56,4,4096);this.R=hd(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=Ra(c),f="json"==e||"gz"==e?encodeURI(c):eb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!cb(f,null,!0,function(e,f,g){var k=0>g&&!!a.J&&!a.J.A.fa;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(va(a.ob,e,f),(e=db(e,f))&&Yh(a,b,c,d,e.ca,e.Ba, -e.Aa));a.A.gb=!1;a.g&&(a.g--,a.g||A(a));Vh(a)})}function Qh(a,b,c,d){if((a=a.C.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.Y);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ra(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Sa(c,"/")&&(d="dir"),f=eb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.gc?"":e)+"&format=json"));return!!cb(f, -null,!0,function(b,c,d){fi(a,b,c,d)})} -function fi(a,b,c,d){var e=null,f=0>d&&!!a.J&&!a.J.A.fa;a.j=!1;if(d)a.controller.N('Unable to load disk "'+a.Na+'" (error '+d+": "+b+")",f);else{va(a.controller.ob,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.Y=k.length;a.ea=k[0].length;a.aa=k[0][0].length;var l=k[0][0][0];a.qa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;E>2,e=Array(d),f=0;f'+b+"");a.innerHTML=b}},!0;case "descTape":return this.C[b]=c,!0;case "readTape":e=Kh;case "loadTape":return e||(e=Lh),this.C[b]=c,c.onclick= +function(){var a=d.C.listTapes;a&&Mh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.C[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Mh(d,Qa(b,!0),b,Lh,a)}return!1};return!0;case Nh:return this.C[b]=c,!0}return!1}; +h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;this.I=Oh(a);var e=this;if(a=Hh(this,ae(this.J,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.H=ld(this.f,56,4,4096);this.R=hd(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=Ra(c),f="json"==e||"gz"==e?encodeURI(c):eb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!cb(f,null,!0,function(e,f,g){var k=0>g&&!!a.J&&!a.J.A.fa;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(xa(a.nb,e,f),(e=db(e,f))&&Zh(a,b,c,d,e.ca,e.Ba, +e.Aa));a.A.fb=!1;a.g&&(a.g--,a.g||A(a));Wh(a)})}function Rh(a,b,c,d){if((a=a.C.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.Y);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ra(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Sa(c,"/")&&(d="dir"),f=eb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.gc?"":e)+"&format=json"));return!!cb(f, +null,!0,function(b,c,d){gi(a,b,c,d)})} +function gi(a,b,c,d){var e=null,f=0>d&&!!a.J&&!a.J.A.fa;a.j=!1;if(d)a.controller.N('Unable to load disk "'+a.Na+'" (error '+d+": "+b+")",f);else{xa(a.controller.nb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)v(k[0]);else{a.Y=k.length;a.ea=k[0].length;a.aa=k[0][0].length;var l=k[0][0][0];a.qa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;E>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ja?f=a.Ra+a.Ja&&(a.Ja+=f-(a.Ra+a.Ja)+1):(a.Ra=f,a.Ja=1);d[f]=d[f]&~(255<g)break;e|=g<g)break;e|=g<=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ +h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.N("Unable to restore disk '"+this.Na+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=hi(this,a++);)ki(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function ki(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var bi=0;function R(a){q.call(this,"RK11",a,0,65536);this.L=li(this,a.autoMount);this.F=0;this.i=Array(8);this.M=!pb("Mobi")&&window&&"FileReader"in window;this.u=[];this.ib=null;this.I=this.g=this.b=this.B=this.w=this.j=this.H=0}p(R,q); -function li(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=R.prototype; -h.sa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.C[b]=c,c.onchange=function(){var a=d.C.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.C[b]=c,c.onchange=function(){var a=G(c.value,10);null!=a&&Fi(d, -a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&Hi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&G(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.N("Unable to boot the selected drive"):a.da?(se(d.f,0,!0),(a=d.Vc(a,0,0,0,512,0,2))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c); -break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.i&&((a=d.i[G(a.value,10)||0])?(a=a.da)?(a=sb(ji(a),a.kc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.M)return this.C[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Hi(d,Qa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=li(this,$d(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.L[e]=a[e]);Ii(this);this.ib=kd(this.f,144,5,65536);Yb(b,this,Ji);$b(b,this.reset.bind(this));Ki(this,"None",Li,!0);this.M&&Ki(this,"Local Disk",Mi);Ki(this,"Remote Disk",Ni);Oi(this)||A(this)}; -h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){this.u=[];for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Fi(this,0)}}return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Ii(this)}; -h.save=function(){var a=new J(this);a.set(0,[this.I,this.g,this.b,this.B,this.w,this.j,this.H,Qi(this)]);return a.data()};h.restore=function(a){return Ii(this,a[0])}; -function Ii(a,b){b||(b=[2368,0,128,0,0,0,0]);var c=ja(b);a.I=c.next().value;a.g=c.next().value;a.b=c.next().value;a.B=c.next().value;a.w=c.next().value;a.j=c.next().value;a.H=c.next().value;b[7]&&(a.u=b[7]);for(b=0;bg||9e||e>=a.i.length)a.N("Unable to load the selected drive");else if(c)if(c==Mi)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Ni){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Qa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Si(a,e,b,c,!1,d)}else Pi(a,e)} -function Si(a,b,c,d,e,f){var g=-1,k=a.i[b];k.ra.toLowerCase()!=d.toLowerCase()&&(g++,Pi(a,b,!0),k.vb?a.N("RK11 busy"):(k.vb=!0,e&&(k.ub=!0,a.F++,B(a)&&C(a,"auto-loading disk: "+c)),k.Za=!!f,ei(new ai(a,k,"preload"),c,d,f,a.Ad)&&g++));return g} -h.Ad=function(a,b,c,d,e){a.vb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.hb)),b=null);if(b){a.da=b;a.Na=c;a.ra=d;a:{var f;for(f=0;f=a.Y){m=64;break}n=a.seek(b,c,d+1);if(!n){m=4096;break}r=0;++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=32;break}if(!k&&(Ec(this.D,He(this.f,f),u|t<<8),gd(this.D))){m=1024;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Bd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var n=null,r;a||(m=128,e=0);for(;e;){var u=Gc(this.D,He(this.f,f));if(gd(this.D)){m=1024;break}if(!n){if(b>=a.Y){m=64;break}n=a.seek(b,c,d+1,!0);if(!n){m=4096;break}r=0;++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=32;break}if(u!=(t|E<<8)){m=1;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=32;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.zd=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&-49|f>>12&48;this.B=65536-e&65535;this.j=this.j&-16|d&15;this.g|=a;Ti(this);return!0};function Ti(a){a.b&=-32769;a.g&&(a.g|=32768,a.b|=32768,a.g&32736&&(a.b|=16384),B(a)&&C(a,a.type+": ERROR: "+H(a.g)))}h.Ee=function(){return this.I};h.Pf=function(){};h.Fe=function(){return this.g};h.Qf=function(){};h.Be=function(){return this.b&61438}; +h.toJSON=function(){var a;a=0;for(var b;b=ii(this,a++);)li(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function li(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var ci=0;function S(a){q.call(this,"RK11",a,0,65536);this.L=mi(this,a.autoMount);this.F=0;this.i=Array(8);this.M=!pb("Mobi")&&window&&"FileReader"in window;this.u=[];this.hb=null;this.I=this.g=this.b=this.B=this.w=this.j=this.H=0}p(S,q); +function mi(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=S.prototype; +h.sa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.C[b]=c,c.onchange=function(){var a=d.C.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.C[b]=c,c.onchange=function(){var a=G(c.value,10);null!=a&&Gi(d, +a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&Ii(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&G(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.N("Unable to boot the selected drive"):a.da?(te(d.f,0,!0),(a=d.Vc(a,0,0,0,512,0,2))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c); +break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.i&&((a=d.i[G(a.value,10)||0])?(a=a.da)?(a=sb(ki(a),a.kc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.M)return this.C[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ii(d,Qa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=mi(this,ae(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.L[e]=a[e]);Ji(this);this.hb=ld(this.f,144,5,65536);Yb(b,this,Ki);$b(b,this.reset.bind(this));Li(this,"None",Mi,!0);this.M&&Li(this,"Local Disk",Ni);Li(this,"Remote Disk",Oi);Pi(this)||A(this)}; +h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){this.u=[];for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Gi(this,0)}}return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Ji(this)}; +h.save=function(){var a=new L(this);a.set(0,[this.I,this.g,this.b,this.B,this.w,this.j,this.H,Ri(this)]);return a.data()};h.restore=function(a){return Ji(this,a[0])}; +function Ji(a,b){b||(b=[2368,0,128,0,0,0,0]);var c=ja(b);a.I=c.next().value;a.g=c.next().value;a.b=c.next().value;a.B=c.next().value;a.w=c.next().value;a.j=c.next().value;a.H=c.next().value;b[7]&&(a.u=b[7]);for(b=0;bg||9e||e>=a.i.length)a.N("Unable to load the selected drive");else if(c)if(c==Ni)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Oi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Qa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ti(a,e,b,c,!1,d)}else Qi(a,e)} +function Ti(a,b,c,d,e,f){var g=-1,k=a.i[b];k.ra.toLowerCase()!=d.toLowerCase()&&(g++,Qi(a,b,!0),k.vb?a.N("RK11 busy"):(k.vb=!0,e&&(k.ub=!0,a.F++,B(a)&&C(a,"auto-loading disk: "+c)),k.Xa=!!f,fi(new bi(a,k,"preload"),c,d,f,a.Ad)&&g++));return g} +h.Ad=function(a,b,c,d,e){a.vb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.gb)),b=null);if(b){a.da=b;a.Na=c;a.ra=d;a:{var f;for(f=0;f=a.Y){m=64;break}n=a.seek(b,c,d+1);if(!n){m=4096;break}r=0;++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=32;break}if(!k&&(Ec(this.D,Ie(this.f,f),u|t<<8),gd(this.D))){m=1024;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Bd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var n=null,r;a||(m=128,e=0);for(;e;){var u=Gc(this.D,Ie(this.f,f));if(gd(this.D)){m=1024;break}if(!n){if(b>=a.Y){m=64;break}n=a.seek(b,c,d+1,!0);if(!n){m=4096;break}r=0;++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=32;break}if(u!=(t|E<<8)){m=1;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=32;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.zd=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&-49|f>>12&48;this.B=65536-e&65535;this.j=this.j&-16|d&15;this.g|=a;Ui(this);return!0};function Ui(a){a.b&=-32769;a.g&&(a.g|=32768,a.b|=32768,a.g&32736&&(a.b|=16384),B(a)&&C(a,a.type+": ERROR: "+H(a.g)))}h.Ee=function(){return this.I};h.Pf=function(){};h.Fe=function(){return this.g};h.Qf=function(){};h.Be=function(){return this.b&61438}; h.Mf=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){a=!0;var b,c,d="",e=(this.j&57344)>>13,f=this.i[e],g,k,l,m,n,r;this.b&=-8321;this.g&=-4;switch(c=this.b&14){case 0:B(this)&&C(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=128;break;case 10:d="RCHK";case 4:d||(d="READ"),b=this.Vc;case 6:d||(d="WCHK");case 2:d||(d="WRITE");b||(b=this.Bd);g=(this.j&8160)>>5;k=(this.j&16)>>4;l=this.j&15;m=65536-this.B&65535;n=(this.b&48)<<12|this.w;r=this.b&2048?0:2;B(this)&&C(this,this.type+": "+ -d+"("+g+":"+k+":"+l+") "+H(n)+"--"+H(n+(m<<1)),!0,!0);if(g>=f.Y){this.g|=64;break}if(l>=f.aa){this.g|=32;break}a=b.call(this,f,g,k,l,m,n,r,6<=c,this.zd.bind(this));break;case 8:g=(this.j&8160)>>5;B(this)&&C(this,this.type+": SEEK("+g+")",!0);g'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.C[b]=c,c.onchange=function(){var a=G(c.value,10);null!=a&&Wi(d, -a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&Xi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&G(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.N("Unable to boot the selected drive"):a.da?(se(d.f,0,!0),(a=d.Wc(a,0,0,0,512,0))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.I){c.parentNode.removeChild(c); -break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.g&&((a=d.g[G(a.value,10)||0])?(a=a.da)?(a=sb(ji(a),a.kc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.I)return this.C[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Xi(d,Qa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=Vi(this,$d(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.H[e]=a[e]);Yi(this);this.ib=kd(this.f,112,5,131072);Yb(b,this,Zi);$b(b,this.reset.bind(this));$i(this,"None",aj,!0);this.I&&$i(this,"Local Disk",bj);$i(this,"Remote Disk",cj);dj(this)||A(this)}; -h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Wi(this,0)}}return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Yi(this)};h.save=function(){return(new J(this)).data()}; -h.restore=function(a){return Yi(this,a[0])};function dj(a,b){b||(a.F=0);for(var c in a.H){var d=a.H[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.C.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if(c==bj)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==cj){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Qa(c);a.status("Attempting to load "+c+' as "'+b+'"')}fj(a,e,b,c,!1,d)}else ej(a,e)} -function fj(a,b,c,d,e,f){var g=-1,k=a.g[b];k.ra.toLowerCase()!=d.toLowerCase()&&(g++,ej(a,b,!0),k.vb?a.N("RL11 busy"):(k.vb=!0,e&&(k.ub=!0,a.F++,B(a)&&C(a,"auto-loading disk: "+c)),k.Za=!!f,ei(new ai(a,k,"preload"),c,d,f,a.Dd)&&g++));return g} -h.Dd=function(a,b,c,d,e){a.vb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.hb)),b=null);b?(a.da=b,a.Na=c,a.ra=d,this.N('Loaded disk "'+c+'" in drive '+("RL"+a.hb),a.ub||e),this.J&&je(this.J)):a.Za=!1;a.ub&&(a.ub=!1,--this.F||A(this));Wi(this,a.hb)}; -function $i(a,b,c,d){if((a=a.C.listDisks)&&a.options){for(var e=0;e(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}Ec(this.D,He(this.f,f),n|r<<8);if(gd(this.D)){k=8192;break}f+=2;e--;if(m>=a.qa&&(l=null,++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Ed=function(a,b,c,d,e,f,g){var k=0;a=a.da;var l=null,m;a||(k=5120,e=0);for(;e;){var n=Gc(this.D,He(this.f,f));if(gd(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.qa&&(l=null,++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +d+"("+g+":"+k+":"+l+") "+H(n)+"--"+H(n+(m<<1)),!0,!0);if(g>=f.Y){this.g|=64;break}if(l>=f.aa){this.g|=32;break}a=b.call(this,f,g,k,l,m,n,r,6<=c,this.zd.bind(this));break;case 8:g=(this.j&8160)>>5;B(this)&&C(this,this.type+": SEEK("+g+")",!0);g'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.C[b]=c,c.onchange=function(){var a=G(c.value,10);null!=a&&Xi(d, +a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&Yi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&G(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.N("Unable to boot the selected drive"):a.da?(te(d.f,0,!0),(a=d.Wc(a,0,0,0,512,0))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.I){c.parentNode.removeChild(c); +break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.g&&((a=d.g[G(a.value,10)||0])?(a=a.da)?(a=sb(ki(a),a.kc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.I)return this.C[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Yi(d,Qa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=Wi(this,ae(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.H[e]=a[e]);Zi(this);this.hb=ld(this.f,112,5,131072);Yb(b,this,$i);$b(b,this.reset.bind(this));aj(this,"None",bj,!0);this.I&&aj(this,"Local Disk",cj);aj(this,"Remote Disk",dj);ej(this)||A(this)}; +h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Xi(this,0)}}return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Zi(this)};h.save=function(){return(new L(this)).data()}; +h.restore=function(a){return Zi(this,a[0])};function ej(a,b){b||(a.F=0);for(var c in a.H){var d=a.H[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.C.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if(c==cj)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==dj){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Qa(c);a.status("Attempting to load "+c+' as "'+b+'"')}gj(a,e,b,c,!1,d)}else fj(a,e)} +function gj(a,b,c,d,e,f){var g=-1,k=a.g[b];k.ra.toLowerCase()!=d.toLowerCase()&&(g++,fj(a,b,!0),k.vb?a.N("RL11 busy"):(k.vb=!0,e&&(k.ub=!0,a.F++,B(a)&&C(a,"auto-loading disk: "+c)),k.Xa=!!f,fi(new bi(a,k,"preload"),c,d,f,a.Dd)&&g++));return g} +h.Dd=function(a,b,c,d,e){a.vb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.gb)),b=null);b?(a.da=b,a.Na=c,a.ra=d,this.N('Loaded disk "'+c+'" in drive '+("RL"+a.gb),a.ub||e),this.J&&ke(this.J)):a.Xa=!1;a.ub&&(a.ub=!1,--this.F||A(this));Xi(this,a.gb)}; +function aj(a,b,c,d){if((a=a.C.listDisks)&&a.options){for(var e=0;e(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}Ec(this.D,Ie(this.f,f),n|r<<8);if(gd(this.D)){k=8192;break}f+=2;e--;if(m>=a.qa&&(l=null,++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +h.Ed=function(a,b,c,d,e,f,g){var k=0;a=a.da;var l=null,m;a||(k=5120,e=0);for(;e;){var n=Gc(this.D,Ie(this.f,f));if(gd(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.qa&&(l=null,++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; h.Cd=function(a,b,c,d,e,f){this.B=f&65535;this.b=this.b&-49|f>>12&48;this.u=f>>16&63;this.j=this.i=b<<7|(c?64:0)|d&63;this.w=65536-e&65535;a&&(this.b=this.b|a|32768);return!0};h.Je=function(){return this.b&65535}; h.Uf=function(a){this.b=this.b&-1023|a&1022;this.u=this.u&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c="",d=this.g[(this.b&768)>>8],e=d.da,f,g,k;this.b&=-2;switch(this.b&14){case 4:this.w&8&&(this.b&=63);this.w=d.status|this.j&64|(e&&512==e.Y?128:0);break;case 6:1==(this.i&3)&&(b=this.i&65408,c=(this.i&16)<<2,this.j=this.i&4?this.j+b:this.j-b,this.i=this.j=this.j&65408|c);break;case 8:this.w=this.j;break;case 12:c="READ",b=this.Wc;case 10:c||(c="WRITE"),b||(b=this.Ed),f=this.i>>7,g=this.i&64?1:0,k= -this.i&63,!e||f>=e.Y||k>=e.aa?this.b|=37888:(a=65536-this.w&65535,e=(this.u&63)<<16|this.B,B(this)&&C(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+H(e)+"--"+H(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.Cd.bind(this)))}a&&(this.b|=129,this.b&64&&id(this.f,this.ib))}};h.He=function(){return this.B};h.Sf=function(a){this.B=a&65534};h.Ke=function(){return this.i};h.Vf=function(a){this.i=a};h.Le=function(){return this.w};h.Wf=function(a){this.w=a};h.Ie=function(){return this.u}; -h.Tf=function(a){this.u=a&63;this.b=this.b&-49|(this.u&3)<<4};var aj="",bj="?",cj="??",gj={},Zi=(gj[63744]=[null,null,Gd.prototype.Je,Gd.prototype.Uf,"RLCS"],gj[63746]=[null,null,Gd.prototype.He,Gd.prototype.Sf,"RLBA"],gj[63748]=[null,null,Gd.prototype.Ke,Gd.prototype.Vf,"RLDA"],gj[63750]=[null,null,Gd.prototype.Le,Gd.prototype.Wf,"RLMP"],gj[63752]=[null,null,Gd.prototype.Ie,Gd.prototype.Tf,"RLBE"],gj); -function hj(a){q.call(this,"Debugger",a);this.Ca=+a.base||16;this.ia=!1;this.w=0;this.P=!1;this.u=-1;this.j=[];this.T={}}p(hj,q);hj.prototype.hd=function(){return-1};hj.prototype.jd=function(){}; -function ij(a,b,c,d){if(c)if(b){0>a.u&&a.j.length&&(a.u=0);if(0>a.u||b!=a.j[a.u])a.j.splice(0,0,b),a.u=0;a.u--}else a.P?b="end":b=a.j[a.u+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(Za(b.substring(c,f))),c=f+1}}return a} -function jj(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +this.i&63,!e||f>=e.Y||k>=e.aa?this.b|=37888:(a=65536-this.w&65535,e=(this.u&63)<<16|this.B,B(this)&&C(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+H(e)+"--"+H(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.Cd.bind(this)))}a&&(this.b|=129,this.b&64&&id(this.f,this.hb))}};h.He=function(){return this.B};h.Sf=function(a){this.B=a&65534};h.Ke=function(){return this.i};h.Vf=function(a){this.i=a};h.Le=function(){return this.w};h.Wf=function(a){this.w=a};h.Ie=function(){return this.u}; +h.Tf=function(a){this.u=a&63;this.b=this.b&-49|(this.u&3)<<4};var bj="",cj="?",dj="??",hj={},$i=(hj[63744]=[null,null,zd.prototype.Je,zd.prototype.Uf,"RLCS"],hj[63746]=[null,null,zd.prototype.He,zd.prototype.Sf,"RLBA"],hj[63748]=[null,null,zd.prototype.Ke,zd.prototype.Vf,"RLDA"],hj[63750]=[null,null,zd.prototype.Le,zd.prototype.Wf,"RLMP"],hj[63752]=[null,null,zd.prototype.Ie,zd.prototype.Tf,"RLBE"],hj); +function ij(a){q.call(this,"Debugger",a);this.Ca=+a.base||16;this.ia=!1;this.w=0;this.P=!1;this.u=-1;this.j=[];this.U={}}p(ij,q);ij.prototype.hd=function(){return-1};ij.prototype.jd=function(){}; +function jj(a,b,c,d){if(c)if(b){0>a.u&&a.j.length&&(a.u=0);if(0>a.u||b!=a.j[a.u])a.j.splice(0,0,b),a.u=0;a.u--}else a.P?b="end":b=a.j[a.u+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(Za(b.substring(c,f))),c=f+1}}return a} +function kj(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function kj(a,b,c){var d;if(b){b=lj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=I(c,0,!0)+" "+c+". "+H(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.v((null!=b?b+": ":"")+d);return e} -function pj(a,b){if(b)return oj(a,b,a.T[b]);var c=0;for(b in a.T)oj(a,b,a.T[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function qj(a){hj.call(this,a);this.Ea=!1;this.ia=!0;this.H=V();this.za=V();this.O=V();this.B=[];this.g=this.L=this.F=[];rj(this);this.R=this.W=0;this.i=[];this.oa=void 0;sj(this);this.G=this;this.ka={};this.ja=this.cd=0;this.S=null;this.M=[];tj(this,a.messages);this.ua=a.commands;this.Ha=uj;this.X=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.Z=this.la=0;this.b=this.V=null;var b=this;window?void 0===window[x]&&(window[x]=function(a){return ee(b,a)}):void 0===global[x]&&(global[x]= -function(a){return ee(b,a)})}p(qj,hj);function vj(a){a=a&&a.K;null==a&&(a=-1);return a}function V(a,b,c){return{K:void 0===a?null:a,Ka:void 0===b?!1:b,Qa:!1,Ca:c}}h=qj.prototype;h.Gc=function(a,b){a.K=b;a.Qa=!1;a.Ca=void 0;return a};function wj(a){return[a.K,a.Ka,a.Ca,a.Qa,a.jc]}function xj(a,b){var c=V(b[0],b[1],b[2]);c.Qa=b[3];b[4]&&(c.$c=ij(a,c.jc=b[4]));return c} -h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.b=a.i;(a=$d(a,"messages"))&&tj(this,a);1140>this.f.ka&&(this.X=this.X.concat(yj));1145>this.f.ka&&(this.X=this.X.concat(zj));md(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=vj(Aj(d,c));if(-1===a){d.v("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.v("blockid physical blockaddr used size type");d.v("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.v("..."): -(c=n.type,m=Zc[c],n&&d.v(I(n.id,8)+" %"+I(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -h.jd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Gj:b=vd(this.f);break;case Hj:b=c.Xa;break;case Ij:b=c.R;break;case Jj:b=c.za&65280;break;case Kj:b=pd(c);break;case Lj:b=rd(c);break;case Mj:b=sd(c);break;case Nj:b=c.T;break;case Oj:d&&(b=d.ga);break;case Pj:d&&(b=d.Sa);break;case Qj:d&&Jc(d)&&(b=d.Ta)}}return b}; -h.message=function(a,b){b&&(a+=" @"+Dj(this,V(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.ja&1073741824)this.M.push(a);else{var c;if(this.ja&-2147483648&&this.f&&(c=this.f.A.U)||La(this,!0))this.ba(),c&&(a+=" (cpu halted)");this.v(a);this.f&&(a=this.f,ke(a),a.tb=0,a.J&&L(a.J,void 0))}}; -function sj(a){var b;if(!qf(a))a.i&&a.i.length&&a.v("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Rj);for(b=0;b>8;a.v("trapped to "+O(a,c&255,1)+" ("+(0>d?Qb[-d]:O(a,d))+")")}a.H=V(a.f.g[7]);b&&1!=a.I?Vj(a):Wj(a)}}function Tj(a,b){var c;(c=!a.f||!Ka(a.f))||(c=a.f,c.A.fa?c=!0:(c.v(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.U?(b||a.v("cpu busy or unavailable, command ignored"),!1):!Ja(a.f)}h.ya=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; -h.xa=function(a,b){b&&this.v(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){sj(this);this.Z=0;this.S=null;this.w=0;this.H=V(this.f.g[7]);this.A.U=!1;Xj(this);a||ce(this)};h.save=function(){var a=new J(this);a.set(0,wj(this.H));a.set(1,wj(this.O));a.set(2,[this.j,this.P,this.ja]);a.set(3,this.B);return a.data()}; -h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=xj(this,a[b++]),this.O=xj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.ja|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.v("running");this.A.U=!0;this.Fa=a;this.Ga=b}; -h.stop=function(a,b){if(this.A.U){this.A.U=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Hc(a.f,b)),65535!=(d&65535)&&(a.Gc(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function wg(a){var b=a.f;if(b.A.U)throw te(b,a.f.P&65535),a.ba(),-1;return!1}function Ud(a,b,c){Yj(a,b,c||1,a.L)&&a.ba(!1)}function Vd(a,b,c){Yj(a,b,c||1,a.F)&&a.ba(!1)} -function rj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Ke(a.f,!1);a.L=["br"];if(a.F)for(b=1;b>>c.g],!0)):Ke(a.f,!0);a.F=["bw"];a.la=0} -h.sb=function(a,b,c){var d=!0;c||Zj(this,a,b,!1,!0);if(a!=this.g){var e=vj(b);if(-1===e)this.v("invalid address: "+Dj(this,b)),d=!1;else{var f=a==this.F;65535>>g.g].sb(e&g.i,f)}else e=this.f,(f?e.Zb++:e.Yb++)||re(e)}}d&&(a.push(b),c?b.Qa=!0:(ak(this,a,a.length-1,"set"),sj(this)));return d}; -function Zj(a,b,c,d,e){var f=!1;c=vj(c);for(var g=1;g>>d.g],b)):Ke(a.f,b));k.Qa||sj(a);break}}return f}function bk(a,b){for(var c=1;c>23)&65535,z=O(t,u);else if(D==hk)u=u.K-((f&63)<<1)&65535,z=O(t,u);else if(D==ik)z=O(t,f&7,1);else if(D==jk)z=O(t,f&63,1);else if(D==kk)z=O(t,f&255,1);else if(D=f&E,E&lk&&(D>>=6,E>>=6),E&Y){var E=null,F=D& -mk;switch(D&nk){case 0:z=Fj(F);break;case 8:z="@"+Fj(F);E=ok(t,t.f.g[F]);break;case 16:7>F?z="("+Fj(F)+")+":(D=t.Oa(u,2),z="#"+O(t,D,0,!0));break;case 24:7>F?z="@("+Fj(F)+")+":(D=t.Oa(u,2),z="@#"+O(t,D,0,!0),E=ok(t,D));break;case 32:z="-("+Fj(F)+")";break;case 40:z="@-("+Fj(F)+")";break;case 48:D=t.Oa(u,2);z=O(t,D,0,!0)+"("+Fj(F)+")";7==F&&(z=O(t,D=D+u.K&65535),E=ok(t,D));break;case 56:D=t.Oa(u,2),z="@"+O(t,D)+"("+Fj(F)+")",7==F&&(z="@"+O(t,D=D+u.K&65535),E=ok(t,Hc(t.f,D)))}E&&(z=[z,E])}t=z;if(!t|| -!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.mb&&b=c.B&&(b=c.Ma[b&fd])&&(a=b[4]);return a}function pk(a,b){switch(b){case "N":a=ye(a.f);break;case "Z":a=xe(a.f);break;case "V":a=we(a.f);break;case "C":a=ve(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} -function Z(a,b){var c="",d=a.f;if(8>b)c=Fj(b),c+="="+O(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+O(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+O(a,d.W[b-16]);else switch(b){case Gj:c="PS="+O(a,vd(d));break;case Hj:c="PI="+O(a,d.Xa);break;case Ij:c="ER="+O(a,d.R);break;case Jj:c="SL="+O(a,d.za&65280);break;case Kj:c="M0="+O(a,pd(d));break;case Lj:c="M1="+O(a,rd(d));break;case Mj:c="M2="+O(a,sd(d));break;case Nj:c="M3="+O(a,d.T);break;case Oj:a.b&&(c="AR="+O(a,a.b.ga,3));break;case Pj:a.b&&(c="DR="+ -O(a,a.b.Sa));break;case Qj:a.b&&Jc(a.b)&&(c="SR="+O(a,a.b.Ta,3))}c&&(c+=" ");return c}function qk(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Gj)+Z(a,Hj)+Z(a,Jj);d+=pk(a,"T")+pk(a,"N")+pk(a,"Z")+pk(a,"V")+pk(a,"C");b&&(b=d,c=""+(Z(a,Kj)+Z(a,Lj)),c+=Z(a,Mj)+Z(a,Nj)+Z(a,Ij),c=c+"\n"+(Z(a,Qj)+Z(a,Oj)+Z(a,Pj)),d=b+("\n"+c));return d}h.dd=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=ab(n,l,a.dd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({xh:b,K:c,Qd:d,ha:e,ad:f})}function rk(a,b,c){var d=[],e=vj(b)>>>0;for(b=0;b>>0,k=f.Qd;if(e>=g&&eb)){e.g[b]= -g&65535;break}a.v("unknown register: "+f);return}L(a.J);a.v("updated registers:")}}a.v(qk(a,d));c&&(a.H=V(e.g[7]),Wj(a,Dj(a,a.H)))}}function vk(a,b){b=Za(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.v(m)}k[3]&&(g=k[3],f=null);f=dk(a,b,g,f);a.v(f);a.H=b;e-=b.K-l;c++}}} -function ck(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.v(Uj+b):(a.P&&(a.v("ended assemble at "+Dj(a,a.O)),a.H=a.O,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(Ka(a)&&0n||"z"Ga.length&&(a.v("note: only "+Ga.length+" available"),qa=Ga.length);wa-=qa;0>wa&&(null==Ga[Ga.length-1].K?(qa=wa+qa,wa=0):wa+=Ga.length);var Se=[];"call"==qi&&(sc=1E5,Se=["CALL"]);for(void 0!==pi&&a.v(qa+" instructions earlier:");0=Ga.length&&(wa=0);a.oa=qa;si++;sc--}}si||(a.v("no "+ri+"history available"),a.oa=void 0)}else{var ga=Aj(a,Fa);if(ga)if("da"==Ta){var Te=ga.Ka||65535K.length?(2ib&&(ib=0);65536Xe?String.fromCharCode(Xe):"."),zd=zd>>8}kb&&(kb+="\n");kb=Ue?kb+(lb+","):kb+(Fa+": "+lb+(yd?"":" "+We))}kb&&a.v(kb);a.za=ga;a.Ca=Zk}}}}break;case "e":if("else"== -g[0])break;var Nb,Ye,Ze,$e,af=g[0],bf=g[1];"eb"==af?(Nb=1,Ye=255,Ze=a.Nc,$e=a.Oc):"e"==af||"ew"==af?(Nb=2,Ye=65535,Ze=a.Oa,$e=a.yd):bf=null;if(null==bf)a.v("edit memory commands:"),a.v("\teb [a] [...] edit bytes at address a"),a.v("\tew [a] [...] edit words at address a");else{var Ad=Aj(a,bf);if(Ad)for(var Bd=2;Bdef;){for(var mb=null,cl=256;65536>yc.K>>>0;){ff.K=a.Oa(yc,2);if(null==yc.K||!cl--)break;if(!(ff.K&1)){for(var dl=a,Cd=ff,xi=null,zc=Cd.K,yi=zc,gf=1;6>=gf&&zc;gf++){if(2> ";wb(function(){for(var a=y(document,x,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.v("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bDk){if(Ek(d,this.I)){this.u=new J(this,"1.32.2",Nk);Ek(this.u)&&(Ok(this,d),a=Pk,Qk(this.u));this.u.set(Kk,bb());Rk(this.u);var e=this.b&&!this.F;if(a==Lk||za("Click OK to restore the previous "+Fb+" machine state, or CANCEL to reset the machine.")){if(c=Jk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ek(d,g):("error"==f&&"no machine state"!= -g?(this.N("Error: "+g),"unable to verify user"==g&&(ob(Sk,""),this.g=null)):this.v(f+": "+g),Qk(d),Ek(d)?(c=Jk(d),e=!0):c=!1))}e&&Hk(this,c?d:null)}else a==Pk&&d.clear()}else Hk(this);delete this.I;delete this.w}e=Aa(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.A.fa=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.f&&(Tk(this,this.f,b,c,a),L(this,-2),this.f.va());this.O&&(Ok(this,b),b.clear());!c&&this.u&&(this.u.clear(),delete this.u);this.j=0}; -function Ok(a,b){if(za("There may be a problem with your "+Fb+" machine.\n\nTo help us diagnose it, click OK to send this "+Fb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Fb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;cb("http://www.pcjs.org/api/v1/report",d,!0)}} -function xk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new J(a,"1.32.2"),g=new J(a,"1.32.2",Ik),k=bb();g.set(Kk,k);f.set(Kk,k);f.set(Uk,"1.32.2");f.set(Vk,window?window.location.href:null);f.set(Yk,window?window.navigator.userAgent:"");a.f&&a.f.xa&&(c&&(b&&(a.f.A.va=a.f.A.U),a.f.ba()),d=a.f.xa(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.fa=!1,!1===d&&(e=null)));for(var k=Aa(a.id),l=0;l=d||30<=(c.rc+=d))&&(e.textContent=c.A.U?c.pb.toFixed(2)+"Mhz":"Stopped",c.rc=0)}if(a.i&&(a=a.i,b=b||0,a.u)){c=a.f.A.U;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;eb?a.ga=a.f.g[7]:0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=I(c,0,!0)+" "+c+". "+H(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.v((null!=b?b+": ":"")+d);return e} +function qj(a,b){if(b)return pj(a,b,a.U[b]);var c=0;for(b in a.U)pj(a,b,a.U[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; +function rj(a){ij.call(this,a);this.Ea=!1;this.ia=!0;this.H=W();this.za=W();this.O=W();this.B=[];this.g=this.L=this.F=[];sj(this);this.R=this.Z=0;this.i=[];this.oa=void 0;tj(this);this.G=this;this.ka={};this.ja=this.cd=0;this.S=null;this.M=[];uj(this,a.messages);this.ua=a.commands;this.Ha=vj;this.W=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.X=this.la=0;this.b=this.V=null;var b=this;window?void 0===window[x]&&(window[x]=function(a){return fe(b,a)}):void 0===global[x]&&(global[x]= +function(a){return fe(b,a)})}p(rj,ij);function wj(a){a=a&&a.K;null==a&&(a=-1);return a}function W(a,b,c){return{K:void 0===a?null:a,Ka:void 0===b?!1:b,Qa:!1,Ca:c}}h=rj.prototype;h.Gc=function(a,b){a.K=b;a.Qa=!1;a.Ca=void 0;return a};function xj(a){return[a.K,a.Ka,a.Ca,a.Qa,a.jc]}function yj(a,b){var c=W(b[0],b[1],b[2]);c.Qa=b[3];b[4]&&(c.$c=jj(a,c.jc=b[4]));return c} +h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.b=a.i;(a=ae(a,"messages"))&&uj(this,a);1140>this.f.ka&&(this.W=this.W.concat(zj));1145>this.f.ka&&(this.W=this.W.concat(Aj));nd(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=wj(Bj(d,c));if(-1===a){d.v("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.v("blockid physical blockaddr used size type");d.v("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.v("..."): +(c=n.type,m=Zc[c],n&&d.v(I(n.id,8)+" %"+I(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} +h.jd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Hj:b=wd(this.f);break;case Ij:b=c.Va;break;case Jj:b=c.R;break;case Kj:b=c.za&65280;break;case Lj:b=qd(c);break;case Mj:b=sd(c);break;case Nj:b=td(c);break;case Oj:b=c.V;break;case Pj:d&&(b=d.ga);break;case Qj:d&&(b=d.Sa);break;case Rj:d&&Jc(d)&&(b=d.Ta)}}return b}; +h.message=function(a,b){b&&(a+=" @"+Ej(this,W(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.ja&1073741824)this.M.push(a);else{var c;if(this.ja&-2147483648&&this.f&&(c=this.f.A.T)||Ma(this,!0))this.ba(),c&&(a+=" (cpu halted)");this.v(a);this.f&&(a=this.f,le(a),a.tb=0,a.J&&M(a.J,void 0))}}; +function tj(a){var b;if(!rf(a))a.i&&a.i.length&&a.v("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Sj);for(b=0;b>8;a.v("trapped to "+P(a,c&255,1)+" ("+(0>d?Qb[-d]:P(a,d))+")")}a.H=W(a.f.g[7]);b&&1!=a.I?Wj(a):Xj(a)}}function Uj(a,b){var c;(c=!a.f||!La(a.f))||(c=a.f,c.A.fa?c=!0:(c.v(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.T?(b||a.v("cpu busy or unavailable, command ignored"),!1):!Ka(a.f)}h.ya=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; +h.xa=function(a,b){b&&this.v(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){tj(this);this.X=0;this.S=null;this.w=0;this.H=W(this.f.g[7]);this.A.T=!1;Yj(this);a||de(this)};h.save=function(){var a=new L(this);a.set(0,xj(this.H));a.set(1,xj(this.O));a.set(2,[this.j,this.P,this.ja]);a.set(3,this.B);return a.data()}; +h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=yj(this,a[b++]),this.O=yj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.ja|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.v("running");this.A.T=!0;this.Fa=a;this.Ga=b}; +h.stop=function(a,b){if(this.A.T){this.A.T=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Hc(a.f,b)),65535!=(d&65535)&&(a.Gc(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function xg(a){var b=a.f;if(b.A.T)throw ue(b,a.f.P&65535),a.ba(),-1;return!1}function Vd(a,b,c){Zj(a,b,c||1,a.L)&&a.ba(!1)}function Wd(a,b,c){Zj(a,b,c||1,a.F)&&a.ba(!1)} +function sj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Le(a.f,!1);a.L=["br"];if(a.F)for(b=1;b>>c.g],!0)):Le(a.f,!0);a.F=["bw"];a.la=0;a.Z=0} +h.sb=function(a,b,c){var d=!0;c||ak(this,a,b,!1,!0);if(a!=this.g){var e=wj(b);if(-1===e)this.v("invalid address: "+Ej(this,b)),d=!1;else{var f=a==this.F;65535>>g.g].sb(e&g.i,f)}else e=this.f,(f?e.Xb++:e.Wb++)||se(e)}}d&&(a.push(b),c?b.Qa=!0:(bk(this,a,a.length-1,"set"),tj(this)));return d}; +function ak(a,b,c,d,e){var f=!1;c=wj(c);for(var g=1;g>>d.g],b)):Le(a.f,b));k.Qa||tj(a);break}}return f}function ck(a,b){for(var c=1;c>23)&65535,z=P(t,u);else if(D==ik)u=u.K-((f&63)<<1)&65535,z=P(t,u);else if(D==jk)z=P(t,f&7,1);else if(D==kk)z=P(t,f&63,1);else if(D==lk)z=P(t,f&255,1);else if(D=f&E,E&mk&&(D>>=6,E>>=6),E&Y){var E=null,F=D& +nk;switch(D&ok){case 0:z=Gj(F);break;case 8:z="@"+Gj(F);E=pk(t,t.f.g[F]);break;case 16:7>F?z="("+Gj(F)+")+":(D=t.Oa(u,2),z="#"+P(t,D,0,!0));break;case 24:7>F?z="@("+Gj(F)+")+":(D=t.Oa(u,2),z="@#"+P(t,D,0,!0),E=pk(t,D));break;case 32:z="-("+Gj(F)+")";break;case 40:z="@-("+Gj(F)+")";break;case 48:D=t.Oa(u,2);z=P(t,D,0,!0)+"("+Gj(F)+")";7==F&&(z=P(t,D=D+u.K&65535),E=pk(t,D));break;case 56:D=t.Oa(u,2),z="@"+P(t,D)+"("+Gj(F)+")",7==F&&(z="@"+P(t,D=D+u.K&65535),E=pk(t,Hc(t.f,D)))}E&&(z=[z,E])}t=z;if(!t|| +!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.lb&&b=c.B&&(b=c.Ma[b&fd])&&(a=b[4]);return a}function qk(a,b){switch(b){case "N":a=ze(a.f);break;case "Z":a=ye(a.f);break;case "V":a=xe(a.f);break;case "C":a=we(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} +function Z(a,b){var c="",d=a.f;if(8>b)c=Gj(b),c+="="+P(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+P(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+P(a,d.W[b-16]);else switch(b){case Hj:c="PS="+P(a,wd(d));break;case Ij:c="PI="+P(a,d.Va);break;case Jj:c="ER="+P(a,d.R);break;case Kj:c="SL="+P(a,d.za&65280);break;case Lj:c="M0="+P(a,qd(d));break;case Mj:c="M1="+P(a,sd(d));break;case Nj:c="M2="+P(a,td(d));break;case Oj:c="M3="+P(a,d.V);break;case Pj:a.b&&(c="AR="+P(a,a.b.ga,3));break;case Qj:a.b&&(c="DR="+ +P(a,a.b.Sa));break;case Rj:a.b&&Jc(a.b)&&(c="SR="+P(a,a.b.Ta,3))}c&&(c+=" ");return c}function rk(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Hj)+Z(a,Ij)+Z(a,Kj);d+=qk(a,"T")+qk(a,"N")+qk(a,"Z")+qk(a,"V")+qk(a,"C");b&&(b=d,c=""+(Z(a,Lj)+Z(a,Mj)),c+=Z(a,Nj)+Z(a,Oj)+Z(a,Jj),c=c+"\n"+(Z(a,Rj)+Z(a,Pj)+Z(a,Qj)),d=b+("\n"+c));return d}h.dd=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=ab(n,l,a.dd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({xh:b,K:c,Qd:d,ha:e,ad:f})}function sk(a,b,c){var d=[],e=wj(b)>>>0;for(b=0;b>>0,k=f.Qd;if(e>=g&&eb)){e.g[b]= +g&65535;break}a.v("unknown register: "+f);return}M(a.J);a.v("updated registers:")}}a.v(rk(a,d));c&&(a.H=W(e.g[7]),Xj(a,Ej(a,a.H)))}}function wk(a,b){b=Za(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.v(m)}k[3]&&(g=k[3],f=null);f=ek(a,b,g,f);a.v(f);a.H=b;e-=b.K-l;c++}}} +function dk(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.v(Vj+b):(a.P&&(a.v("ended assemble at "+Ej(a,a.O)),a.H=a.O,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(La(a)&&0n||"z"Ga.length&&(a.v("note: only "+Ga.length+" available"),qa=Ga.length);wa-=qa;0>wa&&(null==Ga[Ga.length-1].K?(qa=wa+qa,wa=0):wa+=Ga.length);var Ue=[];"call"==ri&&(rc=1E5,Ue=["CALL"]);for(void 0!==qi&&a.v(qa+" instructions earlier:");0=Ga.length&&(wa=0);a.oa=qa;ti++;rc--}}ti||(a.v("no "+si+"history available"),a.oa=void 0)}else{var fa=Bj(a,Fa);if(fa)if("da"==Ta){var Ve=fa.Ka||65535K.length?(2ib&&(ib=0);65536Ze?String.fromCharCode(Ze):"."),Ed=Ed>>8}kb&&(kb+="\n");kb=We?kb+(lb+","):kb+(Fa+": "+lb+(Dd?"":" "+Ye))}kb&&a.v(kb);a.za=fa;a.Ca=$k}}}}break;case "e":if("else"== +g[0])break;var Nb,$e,af,bf,cf=g[0],df=g[1];"eb"==cf?(Nb=1,$e=255,af=a.Nc,bf=a.Oc):"e"==cf||"ew"==cf?(Nb=2,$e=65535,af=a.Oa,bf=a.yd):df=null;if(null==df)a.v("edit memory commands:"),a.v("\teb [a] [...] edit bytes at address a"),a.v("\tew [a] [...] edit words at address a");else{var Fd=Bj(a,df);if(Fd)for(var Gd=2;Gdgf;){for(var mb=null,dl=256;65536>xc.K>>>0;){hf.K=a.Oa(xc,2);if(null==xc.K||!dl--)break;if(!(hf.K&1)){for(var el=a,Hd=hf,yi=null,yc=Hd.K,zi=yc,jf=1;6>=jf&&yc;jf++){if(2> ";wb(function(){for(var a=y(document,x,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.v("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bEk){if(Fk(d,this.I)){this.u=new L(this,"1.32.2",Ok);Fk(this.u)&&(Pk(this,d),a=Qk,Rk(this.u));this.u.set(Lk,bb());Sk(this.u);var e=this.b&&!this.F;if(a==Mk||Aa("Click OK to restore the previous "+Fb+" machine state, or CANCEL to reset the machine.")){if(c=Kk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Fk(d,g):("error"==f&&"no machine state"!= +g?(this.N("Error: "+g),"unable to verify user"==g&&(ob(Tk,""),this.g=null)):this.v(f+": "+g),Rk(d),Fk(d)?(c=Kk(d),e=!0):c=!1))}e&&Ik(this,c?d:null)}else a==Qk&&d.clear()}else Ik(this);delete this.I;delete this.w}e=Ba(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.A.fa=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.f&&(Uk(this,this.f,b,c,a),M(this,-2),this.f.va());this.O&&(Pk(this,b),b.clear());!c&&this.u&&(this.u.clear(),delete this.u);this.j=0}; +function Pk(a,b){if(Aa("There may be a problem with your "+Fb+" machine.\n\nTo help us diagnose it, click OK to send this "+Fb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Fb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;cb("http://www.pcjs.org/api/v1/report",d,!0)}} +function yk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new L(a,"1.32.2"),g=new L(a,"1.32.2",Jk),k=bb();g.set(Lk,k);f.set(Lk,k);f.set(Vk,"1.32.2");f.set(Wk,window?window.location.href:null);f.set(Zk,window?window.navigator.userAgent:"");a.f&&a.f.xa&&(c&&(b&&(a.f.A.va=a.f.A.T),a.f.ba()),d=a.f.xa(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.fa=!1,!1===d&&(e=null)));for(var k=Ba(a.id),l=0;l=d||30<=(c.rc+=d))&&(e.textContent=c.A.T?c.ob.toFixed(2)+"Mhz":"Stopped",c.rc=0)}if(a.i&&(a=a.i,b=b||0,a.u)){c=a.f.A.T;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;eb?a.ga=a.f.g[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");cb(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);ol(a,b,c)}})}else c(a,null)} -function pl(a,b,c,d){function e(a){if(void 0===k){var b=g&&y(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Wa(a))}function f(a){e("Error: "+a);l&&(--ll||Ab(!0));l=!1}var g,k,l=!0;ll++;xa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?ml(c,null,null,!1,e,function(d,l){l?(va(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--ll||Ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--ll||Ab(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ml(b,a,d,!0,e,m):nl(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Ab(!1);return pl(a,b,c,d)};window.findMachineComponent=function(a,b){return Ca(b,a+".machine")};window.enableEvents=Ab;window.sendEvent=Cb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11-dbg.map +h.sa=function(a,b,c){var d=this;switch(b){case "power":return this.C[b]=c,c.onclick=function(){d.j||(d.A.fa?yk(d,!1,!0):Hk(d,d.Vb))},!0;case "reset":return this.C[b]=c,c.onclick=function(){if(d.A.fa&&!d.j)if(d.b&&!d.H){var a=Aa("Click OK to save changes to this "+Fb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");yk(d,a,!0);!a&&d.L?window&&window.location.reload():(a||(d.B=!0),d.Vb(Ek),d.B=!1)}else d.reset(),d.f&&d.f.va()},!0;case "save":if(Sa(eb(),"pcjs.org"))c.parentNode.removeChild(c);else return this.C[b]= +c,c.onclick=function(){var a=Dk(d,!0);if(a){var b=!!(d.b&&!d.H||d.L),c=yk(d,b);b?il(d,a,c):d.N("Resume disabled, machine state not saved")}},!0}return!1};function Dk(a,b){var c=a.g;c||((c=nb(Tk),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=kl(a,c))||a.N("The user ID is invalid.")):b&&a.N("Browser local storage is not available"));return c} +function kl(a,b){a.g=null;b=cb(eb()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(ob(Tk,b.data),a.g=b.data)}catch(d){v(d.message+" ("+c+")")}return a.g}function Gk(a){var b=null;a.g&&(b=eb()+"/api/v1/user?req=load&user="+a.g+"&state="+ll(a,"1.32.2"));return b} +function il(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=ll(a,"1.32.2");d.data=c;b=cb(eb()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");cb(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);pl(a,b,c)}})}else c(a,null)} +function ql(a,b,c,d){function e(a){if(void 0===k){var b=g&&y(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Wa(a))}function f(a){e("Error: "+a);l&&(--ml||Ab(!0));l=!1}var g,k,l=!0;ml++;ya[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?nl(c,null,null,!1,e,function(d,l){l?(xa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--ml||Ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--ml||Ab(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?nl(b,a,d,!0,e,m):ol(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Ab(!1);return ql(a,b,c,d)};window.findMachineComponent=function(a,b){return Da(b,a+".machine")};window.enableEvents=Ab;window.sendEvent=Cb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11-dbg.map diff --git a/versions/pdpjs/1.32.2/pdp11.js b/versions/pdpjs/1.32.2/pdp11.js index 3929656c1..02899c297 100644 --- a/versions/pdpjs/1.32.2/pdp11.js +++ b/versions/pdpjs/1.32.2/pdp11.js @@ -37,13 +37,13 @@ function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol(" function n(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}for(var ja=ba,ka=["Math","log2"],la=0;la":62,"?":63,"@":64,jc:65,Gf:66,If:67,eg:68,E:69,fg:70,gg:71,hg:72,ig:73,jg:74,kg:75,lg:76,mg:77,ng:78,og:79,pg:80,Q:81,qg:82,rg:83,sg:84,tg:85,ug:86,vg:87,wg:88,xg:89,Uc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,yg:97,zg:98,Ag:99,d:100,e:101,Bg:102,Cg:103,Dg:104,Eg:105,Hg:106,k:107,Ig:108,Jg:109,n:110,Kg:111,p:112,q:113,r:114,Lg:115,t:116,Mg:117,Ng:118,Og:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Kc:127};function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.oc=b.comment;this.Tc=b;this.exports={};this.l=this.bindings={};a=this.id.indexOf(".");0>a?this.Ma=this.id:(this.Na=this.id.substr(0,a),this.Ma=this.id.substr(a+1));this.j={ready:!1,Ua:!1,ac:!1,S:!1,error:!1};this.Db=null;this.j.error=!1;this.Rc=d||0;this.D=this.c=this.v=this.A=this.bb=null;u.push(this)}function ra(a,b,c){sa[a]&&b&&(sa[a][b]=c)} +"|":124,"}":125,"~":126,Kc:127};function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.oc=b.comment;this.Tc=b;this.exports={};this.l=this.bindings={};a=this.id.indexOf(".");0>a?this.Ka=this.id:(this.La=this.id.substr(0,a),this.Ka=this.id.substr(a+1));this.j={ready:!1,Sa:!1,ac:!1,S:!1,error:!1};this.Db=null;this.j.error=!1;this.Rc=d||0;this.D=this.c=this.v=this.A=this.bb=null;u.push(this)}function ra(a,b,c){sa[a]&&b&&(sa[a][b]=c)} function ta(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.a["S"+a]=[0,0,!1,!1,this.od,a];this.D=this.c=this.v=this.A=null;D(this)}n(gb,r);h=gb.prototype; -h.reset=function(){this.stop();ib(this,this.f=0)}; +h.reset=function(a){this.stop();a&&ib(this,this.f=0)}; h.ha=function(a,b,c,d){if(this.A&&this.A.ha(a,b,c,d)||this.c&&this.c.ha(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.l[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.l[b]=c,this.h[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.l[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){jb(a, -b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){kb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){jb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){kb(a,b)}}(this,b),!0):r.prototype.ha.call(this,a,b,c,d)}};h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;lb(b,this,mb);nb(b,this.reset.bind(this));ob(this);pb(this)};h.ga=function(a,b){if(!b)if(this.G&&qb(),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){kb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){jb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){kb(a,b)}}(this,b),!0):r.prototype.ha.call(this,a,b,c,d)}};h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;lb(b,this,mb);nb(b,this.reset.bind(this));ob(this);pb(this)};h.ga=function(a,b){if(!b)if(this.G&&qb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0}; h.fa=function(a){return a?this.save():!0};h.save=function(){var a=new H(this);a.set(0,[this.U,this.f,this.b]);return a.data()};h.restore=function(a){if(a=a[0])rb(this,this.U=a[0]),ib(this,this.f=a[1]),sb(this,a[2]);return!0};function tb(a,b,c){if(a=a.l[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ob(a,b){for(var c in a.h)tb(a,c,null!=b?b:a.h[c])}function ub(a,b,c){if(a=a.l[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} function pb(a){for(var b in a.a)ub(a,b,a.a[b][1])}function vb(a,b,c,d){if(a.l[b]){var e=a.D&&a.D.h||8;c=c||0;c=8==e?za(c,d):Aa(c,d);a.l[b].textContent!=c&&(a.l[b].textContent=c)}}function jb(a,b){var c=a.a[b];ub(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=wb&&(a.w=b==xb,a.C=b==yb)}function kb(a,b){var c=a.a[b];c[2]&&c[3]&&(ub(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.md=function(a){a||this.c.j.N||(a=this.c,a.v.reset(),zb(a),this.a[Ab]&&this.a[Ab][1]&&Bb(this.c))};h.nd=function(){}; -h.hd=function(a){a||I(this.c)};h.fd=function(a){if(!a&&!this.c.j.N)if(this.a[Ab]&&this.a[Ab][1])Bb(this.c);else{a=this.D;var b;if(b=a)a.j.Ua&&(a.j.ac=!0),b=!a.j.Ua;if(b)ya(a,!0),a.f(0,null),ya(a,!1);else try{var c=this.c.Sb(1);0=a.c.qa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.v.u;a.a[wb]&&a.a[wb][1]||(b=-b);rb(a,a.U&~c|a.U+b&c)}function rb(a,b){a.U=b&a.v.u;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Kb(a,"A"+c,b&1<c;c++)Kb(a,"D"+c,b&1<=a.c.pa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.v.u;a.a[wb]&&a.a[wb][1]||(b=-b);rb(a,a.U&~c|a.U+b&c)}function rb(a,b){a.U=b&a.v.u;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Kb(a,"A"+c,b&1<c;c++)Kb(a,"D"+c,b&1<c;c++)a.a["S"+c][1]=b&1<>2;this.f=this.g-1;this.s=this.F/this.g|0;this.L=this.s-1;this.Ia=[];this.m=0;this.o=!1;this.G=[];this.Vc=[Pb,Qb,Rb,Sb];this.a=this.b=[];this.C=this.w=this.i=this.H=this.I=0;a=new J(this);Tb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>2;this.f=this.g-1;this.s=this.F/this.g|0;this.L=this.s-1;this.Ga=[];this.m=0;this.o=!1;this.G=[];this.Vc=[Pb,Qb,Rb,Sb];this.a=this.b=[];this.C=this.w=this.i=this.H=this.I=0;a=new J(this);Tb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.u;D(this)}n(Nb,r);function Wb(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Nb.prototype;h.reset=function(){for(var a=0;a>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ta)return l.wb+=l.Ta-f,l.Ta=f,!0;if(f>=l.Ta+l.wb){p=l.size-(f-m);p>g&&(p=g);l.wb=f-l.Ta+p;f=m+a.g;g-=p;k++;continue}}return Yb(Zb,f,g)}f=new J(a,f,p,a.g,d,e);Tb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+$b[d]+" at "+za(b)),!0):Yb(ac,b,c)}h.Fc=function(a){return this.b[(a&this.i)>>>this.h].hb(a&this.f,a)}; -h.zb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return eb||b!=this.f?this.b[c].W(b,a):this.b[c++].hb(b,a)|this.b[c&this.L].hb(0,a+1)<<8};h.Gc=function(a,b){this.b[(a&this.i)>>>this.h].kb(a&this.f,b,a)};h.Ab=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;eb||c!=this.f?this.b[d].nb(c,b,a):(this.b[d++].kb(c,b&255,a),this.b[d&this.L].kb(0,b>>8&255,a+1))};function bc(a,b){return a.a[(b&a.u)>>>a.h]} +function Ub(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ra)return l.wb+=l.Ra-f,l.Ra=f,!0;if(f>=l.Ra+l.wb){p=l.size-(f-m);p>g&&(p=g);l.wb=f-l.Ra+p;f=m+a.g;g-=p;k++;continue}}return Yb(Zb,f,g)}f=new J(a,f,p,a.g,d,e);Tb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+$b[d]+" at "+za(b)),!0):Yb(ac,b,c)}h.Fc=function(a){return this.b[(a&this.i)>>>this.h].fb(a&this.f,a)}; +h.zb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return eb||b!=this.f?this.b[c].W(b,a):this.b[c++].fb(b,a)|this.b[c&this.L].fb(0,a+1)<<8};h.Gc=function(a,b){this.b[(a&this.i)>>>this.h].ib(a&this.f,b,a)};h.Ab=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;eb||c!=this.f?this.b[d].lb(c,b,a):(this.b[d++].ib(c,b&255,a),this.b[d&this.L].ib(0,b>>8&255,a+1))};function bc(a,b){return a.a[(b&a.u)>>>a.h]} function Jb(a,b){var c;a.o=!1;a.m++;var d=b&a.f,e=bc(a,b);eb||d!=a.f?c=e.D(d,b):c=e.i(d,b)|bc(a,b+1).i(0,b+1)<<8;a.m--;return c}function cc(a,b,c){a.o=!1;a.m++;bc(a,b).l(b&a.f,c&255,b);a.m--}function Hb(a,b,c){a.o=!1;a.m++;var d=b&a.f,e=bc(a,b);eb||d!=a.f?e.m(d,c&65535,b):(e.l(d,c&255,b),bc(a,b+1).l(0,c>>8&255,b+1));a.m--} -function Xb(a){for(var b=0,c=[],d=0;da.c.qa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],x=g[5]||1,w=0;w>8:e[2](f)&255):f&1&&(e=d.Ia[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;K(d,b,16);return 255} -function Qb(a,b,c){var d=!1,e=this.controller,f=e.Ia[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ia[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||K(e,c,16)}function Rb(a,b){var c=-1,d=this.controller;a=d.Ia[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;K(d,b,16);return 65535} -function Sb(a,b,c){var d=!1,e=this.controller;a=e.Ia[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||K(e,c,16)}function M(a){r.call(this,"Device",a,0,256);this.a={za:128,fc:-1}}n(M,r);h=M.prototype;h.ea=function(a,b,c,d){this.v=b;this.A=a;this.c=c;this.D=d;var e=this;this.a.fc=jc(c,function(){e.a.za|=128;e.a.za&64&&N(e.c,e.a.Ka);e.A&&Fb(e.A,1);kc(e.c,e.a.fc,1E3/60)});this.a.Ka=lc(c,64,6,524288);lb(b,this,mc);nb(b,this.reset.bind(this));D(this)}; -h.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){this.a.za=128;kc(this.c,this.a.fc,1E3/60,!0)};h.save=function(){var a=new H(this);a.set(0,[this.a.za]);return a.data()};h.restore=function(a){a=ia(a[0]);this.a.za=a.next().value;return!0};h.Ad=function(){return this.a.za};h.Me=function(a){this.a.za=a&192;this.a.za&64||(a=this.a.Ka)&&nc(this.c,a)}; -h.Cd=function(){var a=this.c,b=a.H;b&57344||(b=b&-3199|a.Pa<<5|a.Qa<<1);return b};h.Oe=function(a){oc(this.c,a&-129|this.c.H&128)};h.Dd=function(){var a=this.c;a.H&57344||(a.eb=a.F>>16&65535);a=a.eb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ed=function(){var a=this.c;a.H&57344||(a.fb=a.F&65535);return a.fb};h.Fd=function(){return this.c.na};h.Pe=function(a){var b=this.c;1170>b.qa&&(a&=-49);b.na!=a&&(b.na=a,b.Ca=a&16?4194303:262143,pc(b))}; -h.me=function(a){a=a>>1&63;var b=this.c.Ha[a>>1];return a&1?b>>16:b&65535};h.yf=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ha[c]=b&1?this.c.Ha[c]&65535|(a&63)<<16:this.c.Ha[c]&-65536|a&65534};h.fe=function(a){return this.c.s[1][a>>1&7]};h.rf=function(a,b){this.c.s[1][b>>1&7]=a&65295};h.de=function(a){return this.c.s[1][(a>>1&7)+8]};h.pf=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.ee=function(a){return this.c.I[1][a>>1&7]};h.qf=function(a,b){b=b>>1&7;this.c.I[1][b]=a;this.c.s[1][b]&=65295}; -h.ce=function(a){return this.c.I[1][(a>>1&7)+8]};h.nf=function(a,b){b=(b>>1&7)+8;this.c.I[1][b]=a;this.c.s[1][b]&=65295};h.zd=function(a){return this.c.s[0][a>>1&7]};h.Le=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.xd=function(a){return this.c.s[0][(a>>1&7)+8]};h.Je=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.yd=function(a){return this.c.I[0][a>>1&7]};h.Ke=function(a,b){b=b>>1&7;this.c.I[0][b]=a;this.c.s[0][b]&=65295};h.wd=function(a){return this.c.I[0][(a>>1&7)+8]}; -h.Ie=function(a,b){b=(b>>1&7)+8;this.c.I[0][b]=a;this.c.s[0][b]&=65295};h.le=function(a){return this.c.s[3][a>>1&7]};h.xf=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.je=function(a){return this.c.s[3][(a>>1&7)+8]};h.vf=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295};h.ke=function(a){return this.c.I[3][a>>1&7]};h.wf=function(a,b){b=b>>1&7;this.c.I[3][b]=a;this.c.s[3][b]&=65295};h.ie=function(a){return this.c.I[3][(a>>1&7)+8]};h.uf=function(a,b){b=(b>>1&7)+8;this.c.I[3][b]=a;this.c.s[3][b]&=65295}; -h.ib=function(a){a&=7;return this.c.i&2048?this.c.ra[a]:this.c.b[a]};h.lb=function(a,b){b&=7;this.c.i&2048?this.c.ra[b]=a:this.c.b[b]=a};h.Kd=function(){return this.c.i&49152?this.c.ja[0]:this.c.b[6]};h.Ue=function(a){this.c.i&49152?this.c.ja[0]=a:this.c.b[6]=a};h.Nd=function(){return this.c.b[7]};h.Xe=function(a){this.c.b[7]=a};h.jb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.ra[a]};h.mb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.ra[b]=a}; -h.Ld=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[1]};h.Ve=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[1]=a};h.Md=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[3]};h.We=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[3]=a};h.vd=function(a){return this.c.ub[a-65504>>1]};h.He=function(a,b){this.c.ub[b-65504>>1]=a};h.Ac=function(a){return 65520==a?(dc(this.v)>>6)-1:0};h.Dc=function(){};h.he=function(){return 1};h.tf=function(){};h.ud=function(){return this.c.G}; -h.Ge=function(){this.c.G=0};h.Bd=function(){return this.c.tb};h.Ne=function(a,b){b&1||(a&=255);this.c.tb=a};h.Gd=function(a,b){return b?0:this.c.Sa};h.Qe=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Sa=a};h.ge=function(a,b){return b?0:this.c.Ga&65280};h.sf=function(a){this.c.Ga=a|255};h.Jd=function(){return qc(this.c)};h.Te=function(a){rc(this.c,a)};h.Cc=function(){}; +function Xb(a){for(var b=0,c=[],d=0;da.c.pa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],x=g[5]||1,w=0;w>8:e[2](f)&255):f&1&&(e=d.Ga[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;K(d,b,16);return 255} +function Qb(a,b,c){var d=!1,e=this.controller,f=e.Ga[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ga[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||K(e,c,16)}function Rb(a,b){var c=-1,d=this.controller;a=d.Ga[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;K(d,b,16);return 65535} +function Sb(a,b,c){var d=!1,e=this.controller;a=e.Ga[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||K(e,c,16)}function M(a){r.call(this,"Device",a,0,256);this.a={za:128,fc:-1}}n(M,r);h=M.prototype;h.ea=function(a,b,c,d){this.v=b;this.A=a;this.c=c;this.D=d;var e=this;this.a.fc=jc(c,function(){e.a.za|=128;e.a.za&64&&N(e.c,e.a.Ia);e.A&&Fb(e.A,1);kc(e.c,e.a.fc,1E3/60)});this.a.Ia=lc(c,64,6,524288);lb(b,this,mc);nb(b,this.reset.bind(this));D(this)}; +h.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){this.a.za=128;kc(this.c,this.a.fc,1E3/60,!0)};h.save=function(){var a=new H(this);a.set(0,[this.a.za]);return a.data()};h.restore=function(a){a=ia(a[0]);this.a.za=a.next().value;return!0};h.Ad=function(){return this.a.za};h.Me=function(a){this.a.za=a&192;this.a.za&64||(a=this.a.Ia)&&nc(this.c,a)};h.Cd=function(){return oc(this.c)}; +h.Oe=function(a){pc(this.c,a&-129|this.c.K&128)};h.Dd=function(){return qc(this.c)};h.Ed=function(){return rc(this.c)};h.Fd=function(){return this.c.qa};h.Pe=function(a){sc(this.c,a)};h.me=function(a){a=a>>1&63;var b=this.c.Fa[a>>1];return a&1?b>>16:b&65535};h.yf=function(a,b){b=b>>1&63;var c=b>>1;this.c.Fa[c]=b&1?this.c.Fa[c]&65535|(a&63)<<16:this.c.Fa[c]&-65536|a&65534};h.fe=function(a){return this.c.s[1][a>>1&7]};h.rf=function(a,b){this.c.s[1][b>>1&7]=a&65295}; +h.de=function(a){return this.c.s[1][(a>>1&7)+8]};h.pf=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.ee=function(a){return this.c.H[1][a>>1&7]};h.qf=function(a,b){b=b>>1&7;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.ce=function(a){return this.c.H[1][(a>>1&7)+8]};h.nf=function(a,b){b=(b>>1&7)+8;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.zd=function(a){return this.c.s[0][a>>1&7]};h.Le=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.xd=function(a){return this.c.s[0][(a>>1&7)+8]}; +h.Je=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.yd=function(a){return this.c.H[0][a>>1&7]};h.Ke=function(a,b){b=b>>1&7;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.wd=function(a){return this.c.H[0][(a>>1&7)+8]};h.Ie=function(a,b){b=(b>>1&7)+8;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.le=function(a){return this.c.s[3][a>>1&7]};h.xf=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.je=function(a){return this.c.s[3][(a>>1&7)+8]};h.vf=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295}; +h.ke=function(a){return this.c.H[3][a>>1&7]};h.wf=function(a,b){b=b>>1&7;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.ie=function(a){return this.c.H[3][(a>>1&7)+8]};h.uf=function(a,b){b=(b>>1&7)+8;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.gb=function(a){a&=7;return this.c.i&2048?this.c.ra[a]:this.c.b[a]};h.jb=function(a,b){b&=7;this.c.i&2048?this.c.ra[b]=a:this.c.b[b]=a};h.Kd=function(){return this.c.i&49152?this.c.ja[0]:this.c.b[6]};h.Ue=function(a){this.c.i&49152?this.c.ja[0]=a:this.c.b[6]=a}; +h.Nd=function(){return this.c.b[7]};h.Xe=function(a){this.c.b[7]=a};h.hb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.ra[a]};h.kb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.ra[b]=a};h.Ld=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[1]};h.Ve=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[1]=a};h.Md=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[3]};h.We=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[3]=a}; +h.vd=function(a){return this.c.ub[a-65504>>1]};h.He=function(a,b){this.c.ub[b-65504>>1]=a};h.Ac=function(a){return 65520==a?(dc(this.v)>>6)-1:0};h.Dc=function(){};h.he=function(){return 1};h.tf=function(){};h.ud=function(){return this.c.G};h.Ge=function(){this.c.G=0};h.Bd=function(){return this.c.rb};h.Ne=function(a,b){b&1||(a&=255);this.c.rb=a};h.Gd=function(a,b){return b?0:this.c.Qa};h.Qe=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Qa=a}; +h.ge=function(a,b){return b?0:this.c.Ea&65280};h.sf=function(a){this.c.Ea=a|255};h.Jd=function(){return tc(this.c)};h.Te=function(a){uc(this.c,a)};h.Cc=function(){}; var O={},mc=(O[61568]=[null,null,M.prototype.me,M.prototype.yf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.fe,M.prototype.rf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.de,M.prototype.pf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.ee,M.prototype.qf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.ce,M.prototype.nf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.zd,M.prototype.Le,"KIPDR",8,1140,64],O[62672]=[null,null,M.prototype.xd,M.prototype.Je,"KDPDR",8,1145,64],O[62688]= [null,null,M.prototype.yd,M.prototype.Ke,"KIPAR",8,1140,64],O[62704]=[null,null,M.prototype.wd,M.prototype.Ie,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Fd,M.prototype.Pe,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Ad,M.prototype.Me,"LKS"],O[65402]=[null,null,M.prototype.Cd,M.prototype.Oe,"MMR0",1,1140,64],O[65404]=[null,null,M.prototype.Dd,M.prototype.Cc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Ed,M.prototype.Cc,"MMR2",1,1140,64],O[65408]=[null,null,M.prototype.le,M.prototype.xf, -"UIPDR",8,1140,64],O[65424]=[null,null,M.prototype.je,M.prototype.vf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.ke,M.prototype.wf,"UIPAR",8,1140,64],O[65456]=[null,null,M.prototype.ie,M.prototype.uf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.ib,M.prototype.lb,"R0SET0"],O[65473]=[null,null,M.prototype.ib,M.prototype.lb,"R1SET0"],O[65474]=[null,null,M.prototype.ib,M.prototype.lb,"R2SET0"],O[65475]=[null,null,M.prototype.ib,M.prototype.lb,"R3SET0"],O[65476]=[null,null,M.prototype.ib, -M.prototype.lb,"R4SET0"],O[65477]=[null,null,M.prototype.ib,M.prototype.lb,"R5SET0"],O[65478]=[null,null,M.prototype.Kd,M.prototype.Ue,"R6KERNEL"],O[65479]=[null,null,M.prototype.Nd,M.prototype.Xe,"R7KERNEL"],O[65480]=[null,null,M.prototype.jb,M.prototype.mb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.jb,M.prototype.mb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.jb,M.prototype.mb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.jb,M.prototype.mb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.jb, -M.prototype.mb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.jb,M.prototype.mb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Ld,M.prototype.Ve,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.Md,M.prototype.We,"R6USER",1,1145],O[65504]=[null,null,M.prototype.vd,M.prototype.He,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Ac,M.prototype.Dc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Ac,M.prototype.Dc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.he,M.prototype.tf,"SYSID",1,1170],O[65526]= +"UIPDR",8,1140,64],O[65424]=[null,null,M.prototype.je,M.prototype.vf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.ke,M.prototype.wf,"UIPAR",8,1140,64],O[65456]=[null,null,M.prototype.ie,M.prototype.uf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.gb,M.prototype.jb,"R0SET0"],O[65473]=[null,null,M.prototype.gb,M.prototype.jb,"R1SET0"],O[65474]=[null,null,M.prototype.gb,M.prototype.jb,"R2SET0"],O[65475]=[null,null,M.prototype.gb,M.prototype.jb,"R3SET0"],O[65476]=[null,null,M.prototype.gb, +M.prototype.jb,"R4SET0"],O[65477]=[null,null,M.prototype.gb,M.prototype.jb,"R5SET0"],O[65478]=[null,null,M.prototype.Kd,M.prototype.Ue,"R6KERNEL"],O[65479]=[null,null,M.prototype.Nd,M.prototype.Xe,"R7KERNEL"],O[65480]=[null,null,M.prototype.hb,M.prototype.kb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.hb,M.prototype.kb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.hb,M.prototype.kb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.hb,M.prototype.kb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.hb, +M.prototype.kb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.hb,M.prototype.kb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Ld,M.prototype.Ve,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.Md,M.prototype.We,"R6USER",1,1145],O[65504]=[null,null,M.prototype.vd,M.prototype.He,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Ac,M.prototype.Dc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Ac,M.prototype.Dc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.he,M.prototype.tf,"SYSID",1,1170],O[65526]= [null,null,M.prototype.ud,M.prototype.Ge,"ERR",1,1170],O[65528]=[null,null,M.prototype.Bd,M.prototype.Ne,"MBR",1,1170],O[65530]=[null,null,M.prototype.Gd,M.prototype.Qe,"PIR"],O[65532]=[null,null,M.prototype.ge,M.prototype.sf,"SLR"],O[65534]=[null,null,M.prototype.Jd,M.prototype.Te,"PSW"],O); -Ua(function(){for(var a=C(document,B,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),wc(this,xc?yc:Ac);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.sd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.re=function(a,b){db&&a&1&&K(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; +Ua(function(){for(var a=C(document,B,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),zc(this,Bc?Cc:Dc);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.sd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.re=function(a,b){db&&a&1&&K(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; h.Ee=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.xa=!0};h.qd=function(a,b){return this.i(a,b)};h.oe=function(a,b){return this.D(a,b)};h.Ce=function(a,b,c){this.A?this.yb(0,0,c):this.l(a,b,c)};h.Af=function(a,b,c){this.A?this.yb(0,0,c):this.m(a,b,c)};h.pd=function(a){return this.a[a]}; h.rd=function(a){return this.a[a]};h.ne=function(a,b){db&&a&1&&K(this.b,b,64);return this.v.getUint16(a,!0)};h.qe=function(a,b){db&&a&1&&K(this.b,b,64);return!eb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Be=function(a,b){this.a[a]=b;this.xa=!0};h.De=function(a,b){this.a[a]=b;this.xa=!0};h.zf=function(a,b,c){db&&a&1&&K(this.b,c,64);this.v.setUint16(a,b,!0);this.xa=!0};h.Bf=function(a,b,c){db&&a&1&&K(this.b,c,64);!eb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.xa=!0}; -var uc=0,ec=1,vc=2,Vb=4,$b=["NONE","RAM","ROM","VID","H/W"],tc=0,Cc=[],Bc=[J.prototype.sd,J.prototype.Ee,J.prototype.re,J.prototype.Cf],Fc=[J.prototype.qd,J.prototype.Ce,J.prototype.oe,J.prototype.Af];if(bb)var Ac=[J.prototype.pd,J.prototype.Be,J.prototype.ne,J.prototype.zf],yc=[J.prototype.rd,J.prototype.De,J.prototype.qe,J.prototype.Bf];var Gc;if(bb){var Hc=new ArrayBuffer(2);(new DataView(Hc)).setUint16(0,256,!0);Gc=256===(new Uint16Array(Hc))[0]}else Gc=!1;var xc=Gc; -function Ic(a,b){r.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.hc=0;this.Nb=b;this.Ra=c;this.Vb=Math.round(this.Nb/1E4)/100;this.Xa=this.Vb*this.Ra;this.Wb=this.sb=this.$a=this.Ob=0;this.j.N=this.j.ec=!1;this.j.da=a.autoStart;"string"==typeof this.j.da&&(this.j.da="true"==this.j.da);this.j.Bb=!1;this.Lb=this.Za=0;this.Mb=+a.csStart;this.qb=+a.csInterval;this.rb=+a.csStop;this.Y=[];this.qc=this.ve.bind(this);this.Fa=this.va=this.Ea=this.a=this.aa=this.ua=this.pb=this.Da=this.ab= -this.Xb=this.Oa=0;this.ma=null;D(this)}n(Ic,r);h=Ic.prototype;h.ea=function(a,b,c,d){this.A=a;this.v=b;this.D=d;this.ma=a.f;for(a=0;a=a.Za&&(a.Za+=a.qb,c=!0);0<=a.rb&&a.rb<=Nc(a)&&(a.qb=a.rb=-1,Mc(a),I(a),c=!0);c&&a.Z(Nc(a)+" cycles: checksum="+Aa(a.Lb))}} +var xc=0,ec=1,yc=2,Vb=4,$b=["NONE","RAM","ROM","VID","H/W"],wc=0,Fc=[],Ec=[J.prototype.sd,J.prototype.Ee,J.prototype.re,J.prototype.Cf],Ic=[J.prototype.qd,J.prototype.Ce,J.prototype.oe,J.prototype.Af];if(bb)var Dc=[J.prototype.pd,J.prototype.Be,J.prototype.ne,J.prototype.zf],Cc=[J.prototype.rd,J.prototype.De,J.prototype.qe,J.prototype.Bf];var Jc;if(bb){var Kc=new ArrayBuffer(2);(new DataView(Kc)).setUint16(0,256,!0);Jc=256===(new Uint16Array(Kc))[0]}else Jc=!1;var Bc=Jc; +function Lc(a,b){r.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.hc=0;this.Nb=b;this.Pa=c;this.Vb=Math.round(this.Nb/1E4)/100;this.Xa=this.Vb*this.Pa;this.Wb=this.qb=this.$a=this.Ob=0;this.j.N=this.j.ec=!1;this.j.da=a.autoStart;"string"==typeof this.j.da&&(this.j.da="true"==this.j.da);this.j.Bb=!1;this.Lb=this.Za=0;this.Mb=+a.csStart;this.ob=+a.csInterval;this.pb=+a.csStop;this.Y=[];this.qc=this.ve.bind(this);this.Da=this.va=this.Ca=this.a=this.aa=this.ua=this.nb=this.Ba=this.ab= +this.Xb=this.Ma=0;this.ma=null;D(this)}n(Lc,r);h=Lc.prototype;h.ea=function(a,b,c,d){this.A=a;this.v=b;this.D=d;this.ma=a.f;for(a=0;a=a.Za&&(a.Za+=a.ob,c=!0);0<=a.pb&&a.pb<=Qc(a)&&(a.ob=a.pb=-1,Pc(a),I(a),c=!0);c&&a.Z(Qc(a)+" cycles: checksum="+Aa(a.Lb))}} h.ha=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.l[b]=c,!0;case "run":return this.l[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.S)a=!0;else{var b=null,c,k=y(a.id);for(c=0;ca.Oa/a.Xa&&(b=1);a.Ra=b;b=a.Vb*a.Ra;if(a.Xa!=b){a.Xa=b;b=a.Xa.toFixed(2)+"Mhz";var d=a.l.setSpeed;d&&(d.textContent=b);a.Z("target speed: "+b)}c&&a.A&&Rc(a.A)}Db(a,a.va);a.va=0;a.ua=ta();a.Da=0;Pc(a)}function jc(a,b){var c=a.Y.length;a.Y.push([-1,b]);return c}function kc(a,b,c,d){0<=b&&ba.Y[b][0])&&(c=a.Nb*a.Ra/1E3*c|0,a.j.N&&(c+=Sc(a)),a.Y[b][0]=c)}function Tc(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Sc(a,b){var c=a.Ea-=a.a;a.a=a.aa=0;b&&(a.Ea=0);return c} -h.ve=function(){if(this.j.N){this.Ob>=this.Nb&&Pc(this,!0);this.ab=0;this.pb=ta();if(this.Da){var a=this.pb-this.Da;a>this.Wb&&(this.ua+=a,this.ua>this.pb&&(this.ua=this.pb))}try{do{for(var b,c=this.j.Bb?1:this.sb,d=this.Y.length-1;0<=d;d--){var e=this.Y[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Sb(b)}catch(f){if("number"!=typeof f)throw f;}b=Sc(this,!0);this.ab+=b;this.va+=b;Eb(this,b);Cb(this,b);this.$a-=b;if(0>=this.$a){this.$a+=this.sb;++this.Xb>=Uc&&(this.A&&Fb(this.A,void 0),this.Xb=0);break}}while(this.j.N)}catch(f){I(this); -this.A&&this.A.stop(ta(),Nc(this));a=f.stack||f.message;this.j.error=!0;this.B(a);return}if(this.j.N){a=setTimeout;b=this.qc;this.Da=ta();c=this.Wb;this.ab&&(c=Math.round(c*this.ab/this.sb));c-=this.Da-this.pb;if(d=this.Da-this.ua)this.Oa=Math.round(this.va/(10*d))/100,864E5<=d&&(this.Fa=0,Oc(this));if(0>c||this.Oac&&(this.ua-=c),c=0;this.Ob+=this.ab;this.Da+=c;a(b,c)}}}; -function Bb(a){var b;a.j.error?(a.Z(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.N)a.Z(a.toString()+" busy");else{Oc(a);a.j.N=!0;a.j.ec=!0;if(b=a.l.run)b.textContent="Halt";a.A&&a.A.start(a.ua,Nc(a));a.D||a.status("Started");setTimeout(a.qc,0)}}h.Sb=function(){return 0};function I(a){var b=!1;if(a.j.N){Sc(a);Db(a,a.va);a.va=0;a.j.N=!1;if(b=a.l.run)b.textContent="Run";a.A&&a.A.stop(ta(),Nc(a));b=!0;a.D||a.status("Stopped")}a.j.complete=void 0;return b}var Qc=30,Uc=15,Jc=["power","reset"]; -function Vc(a){var b=+a.model||1170;Ic.call(this,a,6666667);this.qa=b;this.nc=+a.addrReset||0;this.wa=this.i=this.C=this.u=this.m=this.o=this.w=0;this.b=this.ra=this.ja=[];this.I=this.s=this.Ha=this.ub=[];this.Aa=this.F=this.mc=this.Ba=this.Pa=this.Qa=this.Ca=this.G=this.tb=this.Sa=this.Ga=this.H=this.eb=this.fb=this.na=this.g=0;this.Sc=[4,2,0,1];this.Pb=0;this.pc=255;1120>=this.qa?(this.lc=Wc.bind(this),this.Ya=this.Zc,this.Pb=8,this.pc=-1,this.sc=255,this.rc=0):(this.lc=Xc.bind(this),this.Ya=this.$c, -this.sc=~(1792|(1140>=this.qa?2048:0))&65535,this.rc=1140e.xb&&(e.xb=c,c+=4)}return Ic.prototype.ga.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.qa);this.j.N&&I(this);this.u=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.nc,-1,-2,-3,-4,-5,-6,-7,-8];this.ra=[0,0,0,0,0,0];this.ja=[0,0,0,0];this.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, -65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ha=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ub=[0,0,0,0,0,0,0,0];this.C=0;this.wa=-1;this.h=this.f=this.Kb=this.L=this.T=this.g=this.tb=0;zb(this);Lc(this);this.j.error=!1;Ic.prototype.reset.call(this)};function zb(a){a.H=0;a.eb=0;a.fb=0;a.na=0;a.G=0;a.Sa=0;a.Ga=255;a.Ba=0;a.Pa=0;a.Qa=0;a.Ca=262143;a.Aa=a.b[7];a.F=0;a.K=null;a.v&&(pc(a),a.mc=dc(a.v))} -function pc(a){a.Fb=a.ic;a.Gb=a.Qb;a.Rb=a.Tb;a.Hb=a.Ub;a.Ba?(a.ta=65536,a.Eb=a.na&16?4186112:253952,a.pa=a.yc,a.W=a.Bc,a.nb=a.Ec,Wb(a.v,a.na&16?22:18)):(a.ta=0,a.Eb=57344,a.pa=a.cd,a.W=a.pe,a.nb=a.Df,Wb(a.v,16))}function oc(a,b){b&=-3073;if(a.H!=b){b&57344&&!(a.H&57344)&&(a.eb=a.F>>16&65535,a.fb=a.F&65535);a.H=b;a.Pa=(b&96)>>5;a.Qa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ba!=c&&(a.Ba=c,pc(a))}} -function Yc(a,b,c){a.nc=b;R(a,b);rc(a,0);a.v.reset();zb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.N||Bb(a)}else a.D&&a.j.S?I(a)||(a.D.g(),Fb(a.A,-1)):!1===c&&I(a);!a.j.N&&a.ma&&a.ma.stop()}h.xc=function(){return 0}; -h.save=function(){var a=new H(this);a.set(0,[this.b,this.ra,this.ja,this.I,this.s,this.Ha,this.ub,this.G,this.tb,this.Sa,this.Ga,this.H,this.eb,this.fb,this.na,this.Ba,this.Pa,this.Qa,this.Ca,this.Aa,this.g,this.F,this.wa,this.Yb,this.Zb]);a.set(1,[qc(this)]);a.set(2,[this.Fa,this.Ra,this.j.da]);a.set(3,Zc(this));a.set(4,Tc(this));return a.data()}; -h.restore=function(a){var b=ia(a[0]);this.b=b.next().value;this.ra=b.next().value;this.ja=b.next().value;this.I=b.next().value;this.s=b.next().value;this.Ha=b.next().value;this.ub=b.next().value;this.G=b.next().value;this.tb=b.next().value;this.Sa=b.next().value;this.Ga=b.next().value;this.H=b.next().value;this.eb=b.next().value;this.fb=b.next().value;this.na=b.next().value;this.Ba=b.next().value;this.Pa=b.next().value;this.Qa=b.next().value;this.Ca=b.next().value;this.Aa=b.next().value;this.g=b.next().value; -this.F=b.next().value;this.wa=b.next().value;this.Yb=b.next().value;this.Zb=b.next().value;b=a[1];rc(this,b[0]);b=a[2];this.Fa=b[0];Oc(this,b[1]);this.j.da=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function R(a,b){a.b[7]=b&65535}function lc(a,b,c,d){b={xb:b,gb:c,message:d||0,name:fb[b],next:null};a.ob.push(b);return b}function nc(a,b){var c=a.K;if(c==b)a.K=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.K&&(a.g|=1)} -function N(a,b){if(b){if(b!=a.K){var c=a.K;if(!c||c.gb<=b.gb)b.next=c,a.K=b;else{do{var d=c.next;if(!d||d.gb<=b.gb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}function Zc(a){var b=[];for(a=a.K;a;)b.push(a.xb),a=a.next;return b}function cd(a){return a.g&64?(L(a,168,64,-6),!0):a.g&32?(L(a,4,32,-5),!0):a.g&16?(L(a,12,16,-7),!0):!1}function qc(a){return a.i=a.i&63728|ad(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|$c(a)} -function rc(a,b){b&=a.sc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.u=b<<16;if((b^a.i)&a.rc)for(var c=a.ra.length;0<=--c;){var d=a.b[c];a.b[c]=a.ra[c];a.ra[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.ja[c]=a.b[6],a.b[6]=a.ja[a.C]);a.i=b;a.g&=-3;a.g|=a.K?2:1}h.ia=function(a){this.w=this.o=a;this.m=0};h.La=function(a,b){this.w=this.o=this.u=a;this.m=b||0};function dd(a,b){a.w=a.o=a.u=b;a.m=a.w^a.u>>1}function ed(a,b,c,d){a.w=a.o=a.u=b;a.m=(c^d)&(d^b)} -function L(a,b,c,d){if(!a.cb){0>a.wa?a.wa=qc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.C=0;var e=a.W(b|a.ta),f=a.W(b+2&65535|a.ta);rc(a,f&-12289|a.wa>>2&12288);fd(a,a.wa);fd(a,a.b[7]);R(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.Yb=d;a.Zb=b;-1==d&&I(a);if(-4<=d)throw b;}}function gd(a){var b=hd(a),c=hd(a);a.i&49152&&(c=c&-225|a.i&63712);R(a,b);rc(a,c);a.g&=-17} -function id(a,b){var c=b>>13&31;31>c&&(b=a.na&32?a.Ha[c]+(b&8191)&4194303:b&-3932161);return b} -function Ib(a,b,c){var d,e,f;if(!(c&a.Ba))return f=b&65535,57344<=f&&(f|=a.Eb),f;d=b>>13;a.na&a.Sc[a.C]||(d&=7);e=a.s[a.C][d];f=(a.I[a.C][d]<<6)+(b&8191)&a.Ca;3932160<=f&&(f=id(a,f));if(a.cb)return f;f>=a.mc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.s[a.C][d]=e;if(f!=(4194170&a.Ca)||a.C)a.Pa=a.C,a.Qa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.H&57344||(g|=a.H&4096|a.Pa<<5|a.Qa<<1,oc(a,a.H&-61695|g&61694)),L(a,168,64,-2)),a.H&61440||!(f<(4191360&a.Ca)||f>(4194239&a.Ca))||(a.H|=4096,a.H&512&&(a.g|=64)));return f}function hd(a){var b=a.W(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function fd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Ya(4,-2,c);a.nb(c,b)} -function jd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return L(a,4,0,-3),0;case 1:return 6==c&&a.Ya(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Ya(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Ya(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.W(e)|g;a.a-=8;break;case 6:return e=a.W(bd(a,2)),e=e+a.b[c]&65535,6==c&&a.Ya(d,0, -e),a.a-=6,e|g;case 7:return e=a.W(bd(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.ta),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.Zc=function(a,b,c){!this.C&&0>=b&&c<=this.Ga&&(this.g|=32)};h.$c=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Ga&&(c<=this.Ga-32?L(this,4,0,-4):(this.G|=8,this.g|=32)))};h.bd=function(a){return this.ic(a)};h.dd=function(a){return this.Qb(a)};h.ye=function(a,b){this.Tb(a,b)};h.Ae=function(a,b){this.Ub(a,b)}; -h.cd=function(a,b,c){return jd(this,a,b,c)};h.yc=function(a,b,c){return Ib(this,jd(this,a,b,c),c)};h.pe=function(a){return this.v.zb(this.Aa=a)};h.Bc=function(a){return this.v.zb(this.Aa=Ib(this,a,2))};h.Df=function(a,b){this.v.Ab(this.Aa=a,b)};h.Ec=function(a,b){this.v.Ab(this.Aa=Ib(this,a,4),b)}; -function kd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=jd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.W(d|c&a.ta),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.ja[a.i>>12&3];return c}function ld(a,b,c,d){a.F=a.F&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=jd(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=Ib(a,e|c&65536,4),a.C=a.i>>14&3,a.Hb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.ja[a.i>>12&3]=d} -function md(a,b){b>>=6;var c=a.T=b&7;return(b=a.L=(b&56)>>3)?a.Fb(a.pa(b,c,3)):a.b[c+a.Pb]&a.pc}function nd(a,b){var c;b>>=6;var d=a.T=b&7;(b=a.L=(b&56)>>3)?c=a.Gb(a.pa(b,d,2)):c=a.b[d+a.Pb];return c}function od(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return jd(a,b,c,8)}function pd(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Fb(a.pa(b,c,3)):a.b[c]&255}function qd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Gb(a.pa(b,d,2)):c=a.b[d];return c} -function T(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Kb=a.pa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.Rb(e,d.call(a,c,a.Fb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function U(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.pa(b,e,6),a.Hb(e,d.call(a,0>c?a.b[-c-1]:c,a.Gb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} -function rd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.pa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.Rb(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function sd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.pa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Hb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} -h.Sb=function(a){this.j.complete=!0;var b=a?this.j.ec?0:1:-1;this.j.ec=!1;this.Ea=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Sa&224)>>5,e=this.K&&this.K.gb>d?this.K:null;e&&(c=e.xb,d=e.gb);d>(this.i&224)>>5?(this.g&8&&(bd(this,2),this.g&=-9),L(this,c,0,-10),d=!0):d=!1;d&&(e&&nc(this,e),a=!0);this.K||this.Sa||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){I(this);break}if(0>b)break}if(this.g&112&&cd(this)){if(this.g& -4&&this.D.b(this.b[7],b)){I(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.lc(e)}while(0>1|b<<16;dd(this,a);return a&65535}function yd(a,b){a=b&128|b>>1|b<<8;dd(this,a<<8);return a&255}function zd(a,b){a=b&~a;this.ia(a);return a}function Ad(a,b){a=b&~a;this.ia(a<<8);return a}function Bd(a,b){a|=b;this.ia(a);return a}function Cd(a,b){a|=b;this.ia(a<<8);return a} -function Dd(a,b){a=~b|65536;this.La(a);return a&65535}function Ed(a,b){a=~b|256;this.La(a<<8);return a&255}function Fd(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function Gd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function Hd(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function Id(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function Jd(a,b){a=-b;this.La(a,a&b&32768);return a&65535} -function Kd(a,b){a=-b;this.La(a<<8,(a&b&128)<<8);return a&255}function Ld(a,b){a=b<<1|this.u>>16&1;dd(this,a);return a&65535}function Md(a,b){a=b<<1|this.u>>16&1;dd(this,a<<8);return a&255}function Nd(a,b){a=(this.u&65536|b)>>1|b<<16;dd(this,a);return a&65535}function Od(a,b){a=((this.u&65536)>>8|b)>>1|b<<8;dd(this,a<<8);return a&255}function Pd(a,b){var c=b-a;ed(this,c,a,b);return c&65535}function Qd(a,b){var c=b-a;ed(this,c<<8,a<<8,b<<8);return c&255} -function Rd(a,b){this.w=this.o=b&65280;this.m=this.u=0;return(b<<8|b>>8)&65535}function Sd(a,b){a^=b;this.ia(a);return a&65535}function Td(a){U(this,a,nd(this,a),td);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} -function Ud(a){var b=qd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.u=this.m=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} -function Vd(a){var b=qd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&=63;if(b&32){b=64-b;32>b-1;this.u=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function Wd(a){S(this,a,!$c(this))}function Xd(a){S(this,a,$c(this))} -function Yd(a){U(this,a,nd(this,a),zd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Zd(a){T(this,a,md(this,a),Ad);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function $d(a){U(this,a,nd(this,a),Bd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ae(a){T(this,a,md(this,a),Cd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} -function be(a){var b=nd(this,a);a=qd(this,a);this.ia((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function ce(a){var b=md(this,a);a=pd(this,a);this.ia(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function de(a){S(this,a,this.o&65535?0:4)}function ee(a){S(this,a,!ad(this)==!(this.m&32768))}function fe(a){S(this,a,!!(this.o&65535)&&!ad(this)==!(this.m&32768))} -function ge(a){S(this,a,!$c(this)&&!!(this.o&65535))}function he(a){S(this,a,(this.o&65535?0:4)||!ad(this)!=!(this.m&32768))}function ie(a){S(this,a,$c(this)||(this.o&65535?0:4))}function je(a){S(this,a,!ad(this)!=!(this.m&32768))}function ke(a){S(this,a,ad(this))}function le(a){S(this,a,!!(this.o&65535))}function me(a){S(this,a,!ad(this))}function ne(){L(this,12,0,-9)}function oe(a){S(this,a,!0)}function pe(a){S(this,a,!(this.m&32768))}function qe(a){S(this,a,this.m&32768?2:0)} -function V(a){a&1&&(this.u=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function re(a){var b=nd(this,a);a=qd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;ed(this,c,a,b);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function se(a){var b=md(this,a);a=pd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);ed(this,c,a,b);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)} -function te(a){var b=qd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.u=65536,this.a-=7}function ue(){L(this,24,0,-9);this.a-=20} -function ve(){this.i&49152?(this.G|=128,L(this,4,0,-8)):(this.ma&&1120==this.qa&&this.ma.setData(this.b[0],!0),this.D?this.D.i():I(this));this.a-=7}function we(){L(this,16,0,-9);this.a-=20}var xe=[0,7,7,10,7,11,9,13];function ye(a){this.aa=this.a;R(this,od(this,a));this.a=this.aa-xe[this.h]}var ze=[0,14,14,17,14,18,16,20];function Ae(a){this.aa=this.a;var b=od(this,a);a=a>>6&7;fd(this,this.b[a]);this.b[a]=this.b[7];R(this,b);this.a=this.aa-ze[this.h]} -var Be=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ce(a){var b=nd(this,a);this.aa=this.a;sd(this,a,b,this.ia);this.a=this.aa-Be[(this.L?8:0)+this.h]+(7!=this.f||this.h?0:2)}function De(a){var b=md(this,a);rd(this,a,b,65535,this.ia);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}var Ee=[7,13,13,17,14,18,17,21]; -function Fe(a){var b=qd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.m=0;this.u=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)R(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Le(a){U(this,a,nd(this,a),Pd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Me(a){U(this,a,0,Rd);this.a-=this.h?9:3+(7==this.f?2:0)}function Ne(){L(this,28,0,-9)} -function Oe(){this.ma&&(this.ma.U=this.b[7],this.ma.setData(this.b[0],!0));this.g|=8;bd(this,-2);this.a-=3}function Pe(a){U(this,a,this.b[(a>>6&7)+this.Pb],Sd);this.a-=this.h?9:3+(7==this.f?2:0)}function X(){L(this,8,0,-9)}function Wc(a){Qe[a>>12].call(this,a)}function Re(a){Se[a>>6&3].call(this,a)}function Te(a){Ue[a>>6&3].call(this,a)}function Ve(a){We[a>>6&3].call(this,a)}function Xe(a){Ye[a&15].call(this,a)}function Ze(a){$e[a&15].call(this,a)}function af(a){bf[a>>6&3].call(this,a)} -function cf(a){df[a>>6&3].call(this,a)}function ef(a){ff[a>>6&3].call(this,a)} -var Qe=[function(a){gf[a>>8&15].call(this,a)},Ce,re,be,Yd,$d,Td,X,function(a){hf[a>>8&15].call(this,a)},De,se,ce,Zd,ae,Le,X],gf=[function(a){jf[a>>4&15].call(this,a)},oe,le,de,ee,je,fe,he,Ae,Ae,Re,Te,Ve,X,X,X],Se=[function(a){sd(this,a,0,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Dd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Hd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Fd);this.a-=this.h?9:3+(7==this.f?2:0)}],Ue=[function(a){U(this,a,0,Jd); -this.a-=this.h?11:6},function(a){U(this,a,$c(this)?1:0,td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,$c(this)?1:0,Pd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=qd(this,a);this.La(a);this.a-=this.h?4:3+(7==this.f?2:0)}],We=[function(a){U(this,a,0,Nd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Ld);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,xd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,vd);this.a-=this.h?9:3+(7==this.f?2:0)}],jf= -[function(a){kf[a&15].call(this,a)},X,X,X,ye,ye,ye,ye,Ie,X,Xe,Ze,Me,Me,Me,Me],kf=[ve,Oe,Je,ne,we,He,X,X,X,X,X,X,X,X,X,X],Ye=[Ge,function(){this.u=0;this.a-=5},function(){this.m=0;this.a-=5},V,function(){this.o=1;this.a-=5},V,V,V,function(){this.w=0;this.a-=5},V,V,V,V,V,V,V],$e=[Ge,function(){this.u=65536;this.a-=5},function(){this.m=32768;this.a-=5},W,function(){this.o=0;this.a-=5},W,W,W,function(){this.w=32768;this.a-=5},W,W,W,W,W,W,W],hf=[me,ke,ge,ie,pe,qe,Wd,Xd,ue,Ne,af,cf,ef,X,X,X],bf=[function(a){rd(this, -a,0,255,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Gd);this.a-=this.h?9:3+(7==this.f?2:0)}],df=[function(a){T(this,a,0,Kd);this.a-=this.h?11:6},function(a){T(this,a,$c(this)?1:0,ud);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,$c(this)?1:0,Qd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=pd(this,a);this.La(a<<8);this.a-=this.h?4:3+ -(7==this.f?2:0)}],ff=[function(a){T(this,a,0,Od);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Md);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,yd);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,wd);this.a-=this.h?9:3+(7==this.f?2:0)}];function Xc(a){lf[a>>12].call(this,a)} -var lf=[function(a){mf[a>>8&15].call(this,a)},Ce,re,be,Yd,$d,Td,function(a){nf[a>>8&15].call(this,a)},function(a){of[a>>8&15].call(this,a)},De,se,ce,Zd,ae,Le,X],mf=[function(a){pf[a>>4&15].call(this,a)},oe,le,de,ee,je,fe,he,Ae,Ae,Re,Te,Ve,function(a){qf[a>>6&3].call(this,a)},X,X],qf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.ta);R(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=kd(this,a,0);this.ia(a);fd(this,a);this.a-=11},function(a){var b=hd(this);this.aa= -this.a;this.ia(b);ld(this,a,0,b);this.a=this.aa-Ee[this.h]},function(a){sd(this,a,ad(this)?65535:0,this.ia);this.a-=this.h?9:3+(7==this.f?2:0)}],pf=[function(a){rf[a&15].call(this,a)},X,X,X,ye,ye,ye,ye,Ie,function(a){!(a&8)||1145>this.qa?L(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},Xe,Ze,Me,Me,Me,Me],rf=[ve,Oe,function(){gd(this);this.g|=this.i&16;this.a-=13},ne,we,He,Je,function(){L(this,8,0,-9)},X,X,X,X,X,X,X,X],nf=[Fe,Fe,te,te,Ud,Ud,Vd,Vd,Pe,Pe,X, -X,X,X,Ke,Ke],of=[me,ke,ge,ie,pe,qe,Wd,Xd,ue,Ne,af,cf,ef,function(a){1145>this.qa?L(this,8,0,-9):sf[a>>6&3].call(this,a)},X,X],sf=[function(){L(this,8,0,-9)},function(a){a=kd(this,a,65536);this.ia(a);fd(this,a);this.a-=11},function(a){var b=hd(this);this.aa=this.a;this.ia(b);ld(this,a,65536,b);this.a=this.aa-Ee[this.h]},function(){L(this,8,0,-9)}]; -function tf(a){r.call(this,"ROM",a,0,128);this.ka=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=F(this.g);if(this.g){a=this.g;var b=Ba(this.m);"json"!=b&&"hex"!=b&&(a=Ka()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;G(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ra(c.Na,a,b),(a=Ja(a,b))?(c.b=a.O,c.ka=a.ka):c.g=null);uf(c)})}}n(tf,r); -h=tf.prototype;h.ea=function(a,b,c,d){this.v=b;this.c=c;this.D=d;uf(this)};h.ga=function(){this.ka&&(this.D&&this.D.a(this.id,this.h,this.a,this.ka),delete this.ka);return!0};h.fa=function(){return!0}; -function uf(a){if(!xa(a)){if(a.g){if(!a.b||!a.v)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+Aa(a.b.length,8,!0)+") does not match specified size ("+Aa(a.a,8,!0)+")";a.j.error=!0;a.B(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Ob){var c={},c=(c[b]=[tf.prototype.be,tf.prototype.mf,null,null,null,a.a>>1],c);if(lb(a.v,a,c)){a.status("Added "+a.a+"-byte ROM at "+za(b));b=a.i=!0;break a}}else if(Ub(a.v,b,a.a,vc)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),x=l,w=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(w)for(;w--;)cc(a.v,t++,b[x++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< -b.length;e++)cc(a.v,c+e,b[e]);k=!0}if(k){if(null==d||g)I(a.c),f=!1;null!=d&&Yc(a.c,d,f)}return k}Ua(function(){for(var a=C(document,B,"ram"),b=0;ba.Ma/a.Xa&&(b=1);a.Pa=b;b=a.Vb*a.Pa;if(a.Xa!=b){a.Xa=b;b=a.Xa.toFixed(2)+"Mhz";var d=a.l.setSpeed;d&&(d.textContent=b);a.Z("target speed: "+b)}c&&a.A&&Uc(a.A)}Db(a,a.va);a.va=0;a.ua=ta();a.Ba=0;Sc(a)}function jc(a,b){var c=a.Y.length;a.Y.push([-1,b]);return c}function kc(a,b,c,d){0<=b&&ba.Y[b][0])&&(c=a.Nb*a.Pa/1E3*c|0,a.j.N&&(c+=Vc(a)),a.Y[b][0]=c)}function Wc(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Vc(a,b){var c=a.Ca-=a.a;a.a=a.aa=0;b&&(a.Ca=0);return c} +h.ve=function(){if(this.j.N){this.Ob>=this.Nb&&Sc(this,!0);this.ab=0;this.nb=ta();if(this.Ba){var a=this.nb-this.Ba;a>this.Wb&&(this.ua+=a,this.ua>this.nb&&(this.ua=this.nb))}try{do{for(var b,c=this.j.Bb?1:this.qb,d=this.Y.length-1;0<=d;d--){var e=this.Y[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Sb(b)}catch(f){if("number"!=typeof f)throw f;}b=Vc(this,!0);this.ab+=b;this.va+=b;Eb(this,b);Cb(this,b);this.$a-=b;if(0>=this.$a){this.$a+=this.qb;++this.Xb>=Xc&&(this.A&&Fb(this.A,void 0),this.Xb=0);break}}while(this.j.N)}catch(f){I(this); +this.A&&this.A.stop(ta(),Qc(this));a=f.stack||f.message;this.j.error=!0;this.B(a);return}if(this.j.N){a=setTimeout;b=this.qc;this.Ba=ta();c=this.Wb;this.ab&&(c=Math.round(c*this.ab/this.qb));c-=this.Ba-this.nb;if(d=this.Ba-this.ua)this.Ma=Math.round(this.va/(10*d))/100,864E5<=d&&(this.Da=0,Rc(this));if(0>c||this.Mac&&(this.ua-=c),c=0;this.Ob+=this.ab;this.Ba+=c;a(b,c)}}}; +function Bb(a){var b;a.j.error?(a.Z(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.N)a.Z(a.toString()+" busy");else{Rc(a);a.j.N=!0;a.j.ec=!0;if(b=a.l.run)b.textContent="Halt";a.A&&a.A.start(a.ua,Qc(a));a.D||a.status("Started");setTimeout(a.qc,0)}}h.Sb=function(){return 0};function I(a){var b=!1;if(a.j.N){Vc(a);Db(a,a.va);a.va=0;a.j.N=!1;if(b=a.l.run)b.textContent="Run";a.A&&a.A.stop(ta(),Qc(a));b=!0;a.D||a.status("Stopped")}a.j.complete=void 0;return b}var Tc=30,Xc=15,Mc=["power","reset"]; +function Yc(a){var b=+a.model||1170;Lc.call(this,a,6666667);this.pa=b;this.nc=+a.addrReset||0;this.wa=this.i=this.C=this.u=this.m=this.o=this.w=0;this.b=this.ra=this.ja=[];this.H=this.s=this.Fa=this.ub=[];this.Aa=this.F=this.mc=this.Ya=this.Na=this.Oa=this.Va=this.G=this.rb=this.Qa=this.Ea=this.K=this.sb=this.tb=this.qa=this.g=0;this.Sc=[4,2,0,1];this.Pb=0;this.pc=255;1120>=this.pa?(this.lc=Zc.bind(this),this.Wa=this.Zc,this.Pb=8,this.pc=-1,this.sc=255,this.rc=0):(this.lc=$c.bind(this),this.Wa=this.$c, +this.sc=~(1792|(1140>=this.pa?2048:0))&65535,this.rc=1140e.xb&&(e.xb=c,c+=4)}return Lc.prototype.ga.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.pa);this.j.N&&I(this);this.u=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.nc,-1,-2,-3,-4,-5,-6,-7,-8];this.ra=[0,0,0,0,0,0];this.ja=[0,0,0,0];this.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, +65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ub=[0,0,0,0,0,0,0,0];this.C=0;this.wa=-1;this.h=this.f=this.Kb=this.L=this.T=this.g=this.rb=0;zb(this);Oc(this);this.j.error=!1;Lc.prototype.reset.call(this)};function zb(a){a.K=0;a.sb=0;a.tb=0;a.qa=0;a.G=0;a.Qa=0;a.Ea=255;a.Ya=0;a.Na=0;a.Oa=0;a.Va=262143;a.Aa=a.b[7];a.F=0;a.I=null;a.v&&(ad(a),a.mc=dc(a.v))} +function ad(a){a.Fb=a.ic;a.Gb=a.Qb;a.Rb=a.Tb;a.Hb=a.Ub;a.Ya?(a.ta=65536,a.Eb=a.qa&16?4186112:253952,a.oa=a.yc,a.W=a.Bc,a.lb=a.Ec,Wb(a.v,a.qa&16?22:18)):(a.ta=0,a.Eb=57344,a.oa=a.cd,a.W=a.pe,a.lb=a.Df,Wb(a.v,16))}function oc(a){var b=a.K;b&57344||(b=b&-3199|a.Na<<5|a.Oa<<1);return b}function pc(a,b){b&=-3073;if(a.K!=b){b&57344&&!(a.K&57344)&&(a.sb=a.F>>16&65535,a.tb=a.F&65535);a.K=b;a.Na=(b&96)>>5;a.Oa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ya!=c&&(a.Ya=c,ad(a))}} +function qc(a){a.K&57344||(a.sb=a.F>>16&65535);a=a.sb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function rc(a){a.K&57344||(a.tb=a.F&65535);return a.tb}function sc(a,b){1170>a.pa&&(b&=-49);a.qa!=b&&(a.qa=b,a.Va=b&16?4194303:262143,ad(a))}function bd(a,b,c){a.nc=b;R(a,b);uc(a,0);a.v.reset();zb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.N||Bb(a)}else a.D&&a.j.S?I(a)||(a.D.g(),Fb(a.A,-1)):!1===c&&I(a);!a.j.N&&a.ma&&a.ma.stop()}h.xc=function(){return 0}; +h.save=function(){var a=new H(this);a.set(0,[this.b,this.ra,this.ja,this.H,this.s,this.Fa,this.ub,this.G,this.rb,this.Qa,this.Ea,this.Na,this.Oa,this.Aa,this.g,this.F,this.wa,this.Yb,this.Zb]);a.set(1,[tc(this),oc(this),qc(this),rc(this),this.qa]);a.set(2,[this.Da,this.Pa,this.j.da]);a.set(3,cd(this));a.set(4,Wc(this));return a.data()}; +h.restore=function(a){var b=ia(a[0]);this.b=b.next().value;this.ra=b.next().value;this.ja=b.next().value;this.H=b.next().value;this.s=b.next().value;this.Fa=b.next().value;this.ub=b.next().value;this.G=b.next().value;this.rb=b.next().value;this.Qa=b.next().value;this.Ea=b.next().value;this.Na=b.next().value;this.Oa=b.next().value;this.Aa=b.next().value;this.g=b.next().value;this.F=b.next().value;this.wa=b.next().value;this.Yb=b.next().value;this.Zb=b.next().value;b=a[1];uc(this,b[0]);pc(this,b[1]); +this.sb=b[2];this.tb=b[3];sc(this,b[4]);b=a[2];this.Da=b[0];Rc(this,b[1]);this.j.da=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function R(a,b){a.b[7]=b&65535}function lc(a,b,c,d){b={xb:b,eb:c,message:d||0,name:fb[b],next:null};a.mb.push(b);return b}function nc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.g|=1)}function N(a,b){if(b){if(b!=a.I){var c=a.I;if(!c||c.eb<=b.eb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.eb<=b.eb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}} +function cd(a){var b=[];for(a=a.I;a;)b.push(a.xb),a=a.next;return b}function gd(a){return a.g&64?(L(a,168,64,-6),!0):a.g&32?(L(a,4,32,-5),!0):a.g&16?(L(a,12,16,-7),!0):!1}function tc(a){return a.i=a.i&63728|ed(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|dd(a)}function uc(a,b){b&=a.sc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.u=b<<16;if((b^a.i)&a.rc)for(var c=a.ra.length;0<=--c;){var d=a.b[c];a.b[c]=a.ra[c];a.ra[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.ja[c]=a.b[6],a.b[6]=a.ja[a.C]);a.i=b;a.g&=-3;a.g|=a.I?2:1} +h.ia=function(a){this.w=this.o=a;this.m=0};h.Ja=function(a,b){this.w=this.o=this.u=a;this.m=b||0};function hd(a,b){a.w=a.o=a.u=b;a.m=a.w^a.u>>1}function id(a,b,c,d){a.w=a.o=a.u=b;a.m=(c^d)&(d^b)} +function L(a,b,c,d){if(!a.cb){0>a.wa?a.wa=tc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.C=0;var e=a.W(b|a.ta),f=a.W(b+2&65535|a.ta);uc(a,f&-12289|a.wa>>2&12288);jd(a,a.wa);jd(a,a.b[7]);R(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.Yb=d;a.Zb=b;-1==d&&I(a);if(-4<=d)throw b;}}function kd(a){var b=ld(a),c=ld(a);a.i&49152&&(c=c&-225|a.i&63712);R(a,b);uc(a,c);a.g&=-17} +function md(a,b){var c=b>>13&31;31>c&&(b=a.qa&32?a.Fa[c]+(b&8191)&4194303:b&-3932161);return b} +function Ib(a,b,c){var d,e,f;if(!(c&a.Ya))return f=b&65535,57344<=f&&(f|=a.Eb),f;d=b>>13;a.qa&a.Sc[a.C]||(d&=7);e=a.s[a.C][d];f=(a.H[a.C][d]<<6)+(b&8191)&a.Va;3932160<=f&&(f=md(a,f));if(a.cb)return f;f>=a.mc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.s[a.C][d]=e;if(f!=(4194170&a.Va)||a.C)a.Na=a.C,a.Oa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.K&57344||(g|=a.K&4096|a.Na<<5|a.Oa<<1,pc(a,a.K&-61695|g&61694)),L(a,168,64,-2)),a.K&61440||!(f<(4191360&a.Va)||f>(4194239&a.Va))||(a.K|=4096,a.K&512&&(a.g|=64)));return f}function ld(a){var b=a.W(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function jd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Wa(4,-2,c);a.lb(c,b)} +function nd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return L(a,4,0,-3),0;case 1:return 6==c&&a.Wa(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Wa(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Wa(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.W(e)|g;a.a-=8;break;case 6:return e=a.W(fd(a,2)),e=e+a.b[c]&65535,6==c&&a.Wa(d,0, +e),a.a-=6,e|g;case 7:return e=a.W(fd(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.ta),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.Zc=function(a,b,c){!this.C&&0>=b&&c<=this.Ea&&(this.g|=32)};h.$c=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Ea&&(c<=this.Ea-32?L(this,4,0,-4):(this.G|=8,this.g|=32)))};h.bd=function(a){return this.ic(a)};h.dd=function(a){return this.Qb(a)};h.ye=function(a,b){this.Tb(a,b)};h.Ae=function(a,b){this.Ub(a,b)}; +h.cd=function(a,b,c){return nd(this,a,b,c)};h.yc=function(a,b,c){return Ib(this,nd(this,a,b,c),c)};h.pe=function(a){return this.v.zb(this.Aa=a)};h.Bc=function(a){return this.v.zb(this.Aa=Ib(this,a,2))};h.Df=function(a,b){this.v.Ab(this.Aa=a,b)};h.Ec=function(a,b){this.v.Ab(this.Aa=Ib(this,a,4),b)}; +function od(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=nd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.W(d|c&a.ta),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.ja[a.i>>12&3];return c}function pd(a,b,c,d){a.F=a.F&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=nd(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=Ib(a,e|c&65536,4),a.C=a.i>>14&3,a.Hb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.ja[a.i>>12&3]=d} +function qd(a,b){b>>=6;var c=a.T=b&7;return(b=a.L=(b&56)>>3)?a.Fb(a.oa(b,c,3)):a.b[c+a.Pb]&a.pc}function rd(a,b){var c;b>>=6;var d=a.T=b&7;(b=a.L=(b&56)>>3)?c=a.Gb(a.oa(b,d,2)):c=a.b[d+a.Pb];return c}function sd(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return nd(a,b,c,8)}function td(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Fb(a.oa(b,c,3)):a.b[c]&255}function ud(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Gb(a.oa(b,d,2)):c=a.b[d];return c} +function T(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Kb=a.oa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.Rb(e,d.call(a,c,a.Fb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function U(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,6),a.Hb(e,d.call(a,0>c?a.b[-c-1]:c,a.Gb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} +function vd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.oa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.Rb(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function wd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Hb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} +h.Sb=function(a){this.j.complete=!0;var b=a?this.j.ec?0:1:-1;this.j.ec=!1;this.Ca=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Qa&224)>>5,e=this.I&&this.I.eb>d?this.I:null;e&&(c=e.xb,d=e.eb);d>(this.i&224)>>5?(this.g&8&&(fd(this,2),this.g&=-9),L(this,c,0,-10),d=!0):d=!1;d&&(e&&nc(this,e),a=!0);this.I||this.Qa||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){I(this);break}if(0>b)break}if(this.g&112&&gd(this)){if(this.g& +4&&this.D.b(this.b[7],b)){I(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.lc(e)}while(0>1|b<<16;hd(this,a);return a&65535}function Cd(a,b){a=b&128|b>>1|b<<8;hd(this,a<<8);return a&255}function Dd(a,b){a=b&~a;this.ia(a);return a}function Ed(a,b){a=b&~a;this.ia(a<<8);return a}function Fd(a,b){a|=b;this.ia(a);return a}function Gd(a,b){a|=b;this.ia(a<<8);return a} +function Hd(a,b){a=~b|65536;this.Ja(a);return a&65535}function Id(a,b){a=~b|256;this.Ja(a<<8);return a&255}function Jd(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function Kd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function Ld(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function Md(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function Nd(a,b){a=-b;this.Ja(a,a&b&32768);return a&65535} +function Od(a,b){a=-b;this.Ja(a<<8,(a&b&128)<<8);return a&255}function Pd(a,b){a=b<<1|this.u>>16&1;hd(this,a);return a&65535}function Qd(a,b){a=b<<1|this.u>>16&1;hd(this,a<<8);return a&255}function Rd(a,b){a=(this.u&65536|b)>>1|b<<16;hd(this,a);return a&65535}function Sd(a,b){a=((this.u&65536)>>8|b)>>1|b<<8;hd(this,a<<8);return a&255}function Td(a,b){var c=b-a;id(this,c,a,b);return c&65535}function Ud(a,b){var c=b-a;id(this,c<<8,a<<8,b<<8);return c&255} +function Vd(a,b){this.w=this.o=b&65280;this.m=this.u=0;return(b<<8|b>>8)&65535}function Wd(a,b){a^=b;this.ia(a);return a&65535}function Xd(a){U(this,a,rd(this,a),xd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} +function Yd(a){var b=ud(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.u=this.m=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} +function Zd(a){var b=ud(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&=63;if(b&32){b=64-b;32>b-1;this.u=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function $d(a){S(this,a,!dd(this))}function ae(a){S(this,a,dd(this))} +function be(a){U(this,a,rd(this,a),Dd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ce(a){T(this,a,qd(this,a),Ed);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function de(a){U(this,a,rd(this,a),Fd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ee(a){T(this,a,qd(this,a),Gd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} +function fe(a){var b=rd(this,a);a=ud(this,a);this.ia((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function ge(a){var b=qd(this,a);a=td(this,a);this.ia(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function he(a){S(this,a,this.o&65535?0:4)}function ie(a){S(this,a,!ed(this)==!(this.m&32768))}function je(a){S(this,a,!!(this.o&65535)&&!ed(this)==!(this.m&32768))} +function ke(a){S(this,a,!dd(this)&&!!(this.o&65535))}function le(a){S(this,a,(this.o&65535?0:4)||!ed(this)!=!(this.m&32768))}function me(a){S(this,a,dd(this)||(this.o&65535?0:4))}function ne(a){S(this,a,!ed(this)!=!(this.m&32768))}function oe(a){S(this,a,ed(this))}function pe(a){S(this,a,!!(this.o&65535))}function qe(a){S(this,a,!ed(this))}function re(){L(this,12,0,-9)}function se(a){S(this,a,!0)}function te(a){S(this,a,!(this.m&32768))}function ue(a){S(this,a,this.m&32768?2:0)} +function V(a){a&1&&(this.u=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function ve(a){var b=rd(this,a);a=ud(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;id(this,c,a,b);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function we(a){var b=qd(this,a);a=td(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);id(this,c,a,b);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)} +function xe(a){var b=ud(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.u=65536,this.a-=7}function ye(){L(this,24,0,-9);this.a-=20} +function ze(){this.i&49152?(this.G|=128,L(this,4,0,-8)):(this.ma&&1120==this.pa&&this.ma.setData(this.b[0],!0),this.D?this.D.i():I(this));this.a-=7}function Ae(){L(this,16,0,-9);this.a-=20}var Be=[0,7,7,10,7,11,9,13];function Ce(a){this.aa=this.a;R(this,sd(this,a));this.a=this.aa-Be[this.h]}var De=[0,14,14,17,14,18,16,20];function Ee(a){this.aa=this.a;var b=sd(this,a);a=a>>6&7;jd(this,this.b[a]);this.b[a]=this.b[7];R(this,b);this.a=this.aa-De[this.h]} +var Fe=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ge(a){var b=rd(this,a);this.aa=this.a;wd(this,a,b,this.ia);this.a=this.aa-Fe[(this.L?8:0)+this.h]+(7!=this.f||this.h?0:2)}function He(a){var b=qd(this,a);vd(this,a,b,65535,this.ia);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}var Ie=[7,13,13,17,14,18,17,21]; +function Je(a){var b=ud(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.m=0;this.u=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)R(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Pe(a){U(this,a,rd(this,a),Td);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Qe(a){U(this,a,0,Vd);this.a-=this.h?9:3+(7==this.f?2:0)}function Re(){L(this,28,0,-9)} +function Se(){this.ma&&(this.ma.U=this.b[7],this.ma.setData(this.b[0],!0));this.g|=8;fd(this,-2);this.a-=3}function Te(a){U(this,a,this.b[(a>>6&7)+this.Pb],Wd);this.a-=this.h?9:3+(7==this.f?2:0)}function X(){L(this,8,0,-9)}function Zc(a){Ue[a>>12].call(this,a)}function Ve(a){We[a>>6&3].call(this,a)}function Xe(a){Ye[a>>6&3].call(this,a)}function Ze(a){$e[a>>6&3].call(this,a)}function af(a){bf[a&15].call(this,a)}function cf(a){df[a&15].call(this,a)}function ef(a){ff[a>>6&3].call(this,a)} +function gf(a){hf[a>>6&3].call(this,a)}function jf(a){kf[a>>6&3].call(this,a)} +var Ue=[function(a){lf[a>>8&15].call(this,a)},Ge,ve,fe,be,de,Xd,X,function(a){mf[a>>8&15].call(this,a)},He,we,ge,ce,ee,Pe,X],lf=[function(a){nf[a>>4&15].call(this,a)},se,pe,he,ie,ne,je,le,Ee,Ee,Ve,Xe,Ze,X,X,X],We=[function(a){wd(this,a,0,this.Ja);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Hd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Ld);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Jd);this.a-=this.h?9:3+(7==this.f?2:0)}],Ye=[function(a){U(this,a,0,Nd); +this.a-=this.h?11:6},function(a){U(this,a,dd(this)?1:0,xd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,dd(this)?1:0,Td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=ud(this,a);this.Ja(a);this.a-=this.h?4:3+(7==this.f?2:0)}],$e=[function(a){U(this,a,0,Rd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Pd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Bd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,zd);this.a-=this.h?9:3+(7==this.f?2:0)}],nf= +[function(a){of[a&15].call(this,a)},X,X,X,Ce,Ce,Ce,Ce,Me,X,af,cf,Qe,Qe,Qe,Qe],of=[ze,Se,Ne,re,Ae,Le,X,X,X,X,X,X,X,X,X,X],bf=[Ke,function(){this.u=0;this.a-=5},function(){this.m=0;this.a-=5},V,function(){this.o=1;this.a-=5},V,V,V,function(){this.w=0;this.a-=5},V,V,V,V,V,V,V],df=[Ke,function(){this.u=65536;this.a-=5},function(){this.m=32768;this.a-=5},W,function(){this.o=0;this.a-=5},W,W,W,function(){this.w=32768;this.a-=5},W,W,W,W,W,W,W],mf=[qe,oe,ke,me,te,ue,$d,ae,ye,Re,ef,gf,jf,X,X,X],ff=[function(a){vd(this, +a,0,255,this.Ja);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Md);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Kd);this.a-=this.h?9:3+(7==this.f?2:0)}],hf=[function(a){T(this,a,0,Od);this.a-=this.h?11:6},function(a){T(this,a,dd(this)?1:0,yd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,dd(this)?1:0,Ud);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=td(this,a);this.Ja(a<<8);this.a-=this.h?4:3+ +(7==this.f?2:0)}],kf=[function(a){T(this,a,0,Sd);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Qd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Cd);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Ad);this.a-=this.h?9:3+(7==this.f?2:0)}];function $c(a){pf[a>>12].call(this,a)} +var pf=[function(a){qf[a>>8&15].call(this,a)},Ge,ve,fe,be,de,Xd,function(a){rf[a>>8&15].call(this,a)},function(a){sf[a>>8&15].call(this,a)},He,we,ge,ce,ee,Pe,X],qf=[function(a){tf[a>>4&15].call(this,a)},se,pe,he,ie,ne,je,le,Ee,Ee,Ve,Xe,Ze,function(a){uf[a>>6&3].call(this,a)},X,X],uf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.ta);R(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=od(this,a,0);this.ia(a);jd(this,a);this.a-=11},function(a){var b=ld(this);this.aa= +this.a;this.ia(b);pd(this,a,0,b);this.a=this.aa-Ie[this.h]},function(a){wd(this,a,ed(this)?65535:0,this.ia);this.a-=this.h?9:3+(7==this.f?2:0)}],tf=[function(a){vf[a&15].call(this,a)},X,X,X,Ce,Ce,Ce,Ce,Me,function(a){!(a&8)||1145>this.pa?L(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},af,cf,Qe,Qe,Qe,Qe],vf=[ze,Se,function(){kd(this);this.g|=this.i&16;this.a-=13},re,Ae,Le,Ne,function(){L(this,8,0,-9)},X,X,X,X,X,X,X,X],rf=[Je,Je,xe,xe,Yd,Yd,Zd,Zd,Te,Te,X, +X,X,X,Oe,Oe],sf=[qe,oe,ke,me,te,ue,$d,ae,ye,Re,ef,gf,jf,function(a){1145>this.pa?L(this,8,0,-9):wf[a>>6&3].call(this,a)},X,X],wf=[function(){L(this,8,0,-9)},function(a){a=od(this,a,65536);this.ia(a);jd(this,a);this.a-=11},function(a){var b=ld(this);this.aa=this.a;this.ia(b);pd(this,a,65536,b);this.a=this.aa-Ie[this.h]},function(){L(this,8,0,-9)}]; +function xf(a){r.call(this,"ROM",a,0,128);this.ka=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=F(this.g);if(this.g){a=this.g;var b=Ba(this.m);"json"!=b&&"hex"!=b&&(a=Ka()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;G(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ra(c.La,a,b),(a=Ja(a,b))?(c.b=a.O,c.ka=a.ka):c.g=null);yf(c)})}}n(xf,r); +h=xf.prototype;h.ea=function(a,b,c,d){this.v=b;this.c=c;this.D=d;yf(this)};h.ga=function(){this.ka&&(this.D&&this.D.a(this.id,this.h,this.a,this.ka),delete this.ka);return!0};h.fa=function(){return!0}; +function yf(a){if(!xa(a)){if(a.g){if(!a.b||!a.v)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+Aa(a.b.length,8,!0)+") does not match specified size ("+Aa(a.a,8,!0)+")";a.j.error=!0;a.B(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Ob){var c={},c=(c[b]=[xf.prototype.be,xf.prototype.mf,null,null,null,a.a>>1],c);if(lb(a.v,a,c)){a.status("Added "+a.a+"-byte ROM at "+za(b));b=a.i=!0;break a}}else if(Ub(a.v,b,a.a,yc)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),x=l,w=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(w)for(;w--;)cc(a.v,t++,b[x++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< +b.length;e++)cc(a.v,c+e,b[e]);k=!0}if(k){if(null==d||g)I(a.c),f=!1;null!=d&&bd(a.c,d,f)}return k}Ua(function(){for(var a=C(document,B,"ram"),b=0;b=q.jc&&c<=q.Uc&&(b=c-(q.jc-q.Hc));b&&(a.preventDefault&&a.preventDefault(),d.Ib(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Jc&&(b=q.Ic);d.Ib(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +h.ha=function(a,b,c){var d=this;switch(b){case Df:return this.l[b]=this.h=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?q.kc:q.Kc:46==c?b=q.kc:a.ctrlKey&&c>=q.jc&&c<=q.Uc&&(b=c-(q.jc-q.Hc));b&&(a.preventDefault&&a.preventDefault(),d.Ib(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Jc&&(b=q.Ic);d.Ib(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Ib(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;var e=this;this.H=lc(this.c,this.C?-1:48,4,262144);this.I=jc(this.c,function(){var a;a=-1;e.f.length&&(a=e.f.shift()&255,e.w&&97<=a&&122>a&&(a-=32),kc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&N(c,e.H))});this.F=lc(this.c,this.C?-1:52,4,262144);this.Y=jc(this.c,function(){e.b|=128;e.b&64&&N(c,e.F)});lb(b,this,Af,this.C?64832+8*(this.C-1)-65392:0);nb(b,this.reset.bind(this));D(this)}; -h.zc=function(a){if(!this.g){var b=Kc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ga(c[0]);if(d!=this.Ma)return;c=Ga(c[1]);if(this.g=va(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.u);if(this.s=e.receiveData){this.u=a;this.G=e.receiveStatus;this.status("Connected "+this.Na+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ga=function(a,b){if(!b)if(this.zc(this.u),!a)this.reset();else if(!this.restore(a))return!1;return!0}; -h.fa=function(a){return a?this.save():!0};h.reset=function(){Bf(this)};h.save=function(){var a=new H(this);a.set(0,[this.o,this.a,this.b,this.f]);return a.data()};h.restore=function(a){return Bf(this,a[0])};function Bf(a,b){b||(b=[0,8192,128,a.f]);b=ia(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.f=b.next().value;return!0} +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;var e=this;this.H=lc(this.c,this.C?-1:48,4,262144);this.I=jc(this.c,function(){var a;a=-1;e.f.length&&(a=e.f.shift()&255,e.w&&97<=a&&122>a&&(a-=32),kc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&N(c,e.H))});this.F=lc(this.c,this.C?-1:52,4,262144);this.Y=jc(this.c,function(){e.b|=128;e.b&64&&N(c,e.F)});lb(b,this,Ef,this.C?64832+8*(this.C-1)-65392:0);nb(b,this.reset.bind(this));D(this)}; +h.zc=function(a){if(!this.g){var b=Nc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ga(c[0]);if(d!=this.Ka)return;c=Ga(c[1]);if(this.g=va(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.u);if(this.s=e.receiveData){this.u=a;this.G=e.receiveStatus;this.status("Connected "+this.La+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ga=function(a,b){if(!b)if(this.zc(this.u),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +h.fa=function(a){return a?this.save():!0};h.reset=function(){Ff(this)};h.save=function(){var a=new H(this);a.set(0,[this.o,this.a,this.b,this.f]);return a.data()};h.restore=function(a){return Ff(this,a[0])};function Ff(a,b){b||(b=[0,8192,128,a.f]);b=ia(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.f=b.next().value;return!0} h.Ib=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.m%a,this.T&&(b=" ".slice(0,c)));this.L&&!this.m&&c&&(b=String.fromCharCode(this.L)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.m+=c}}else if(null!= -this.i){if(10==a||1024<=this.i.length)this.Z(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}kc(this.c,this.Y,1E3/Math.round(this.aa/10));this.b&=-129};var zf="buffer",Cf={},Af=(Cf[65392]=[null,null,Z.prototype.Pd,Z.prototype.Ze,"RCSR"],Cf[65394]=[null,null,Z.prototype.Od,Z.prototype.Ye,"RBUF"],Cf[65396]=[null,null,Z.prototype.te,Z.prototype.Ff,"XCSR"],Cf[65398]=[null,null,Z.prototype.se,Z.prototype.Ef,"XBUF"],Cf); -Ua(function(){for(var a=C(document,B,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.l[b]=c,!0;case "readTape":e=Gf;case "loadTape":return e||(e=Hf),this.l[b]=c,c.onclick= -function(){var a=d.l.listTapes;a&&If(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.l[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;If(d,F(b,!0),b,Hf,a)}return!1};return!0;case Jf:return this.l[b]=c,!0}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;this.u=Kf(a);var e=this;if(a=Df(this,Kc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.s=lc(this.c,56,4,4096);this.H=jc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.mc.indexOf("/api/v1/dump")&&(e=Ba(c),f="json"==e||"gz"==e?encodeURI(c):Ka()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!G(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.S;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ra(a.Na,e,f),(e=Ja(e,f))&&Vf(a,b,c,d,e.O,e.ca,e.ba)); -a.j.Ua=!1;a.b&&(a.b--,a.b||D(a));Sf(a)})}function Nf(a,b,c,d){if((a=a.l.listTapes)&&a.options){for(var e=0;e'+b+"");a.innerHTML=b}},!0;case "descTape":return this.l[b]=c,!0;case "readTape":e=Kf;case "loadTape":return e||(e=Lf),this.l[b]=c,c.onclick= +function(){var a=d.l.listTapes;a&&Mf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.l[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Mf(d,F(b,!0),b,Lf,a)}return!1};return!0;case Nf:return this.l[b]=c,!0}return!1}; +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;this.u=Of(a);var e=this;if(a=Hf(this,Nc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.s=lc(this.c,56,4,4096);this.H=jc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.mc.indexOf("/api/v1/dump")&&(e=Ba(c),f="json"==e||"gz"==e?encodeURI(c):Ka()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!G(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.S;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ra(a.La,e,f),(e=Ja(e,f))&&Zf(a,b,c,d,e.O,e.ca,e.ba)); +a.j.Sa=!1;a.b&&(a.b--,a.b||D(a));Wf(a)})}function Rf(a,b,c,d){if((a=a.l.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ba(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ca(c,"/")&&(d="dir"),f=Ka()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Cb?"":e)+"&format=json"));return!!G(f, -null,!0,function(b,c,d){cg(a,b,c,d)})} -function cg(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.S;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.oa+'" (error '+d+": "+b+")",f);else{ra(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.J=k.length;a.R=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.V=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var x=l.bytes;if(void 0!==x&&x.length){for(var w=m<<2,Y=x.length;Y>2,e=Array(d),f=0;f>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ba(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ca(c,"/")&&(d="dir"),f=Ka()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Cb?"":e)+"&format=json"));return!!G(f, +null,!0,function(b,c,d){gg(a,b,c,d)})} +function gg(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.S;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.na+'" (error '+d+": "+b+")",f);else{ra(a.controller.La,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)v(k[0]);else{a.J=k.length;a.R=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.V=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var x=l.bytes;if(void 0!==x&&x.length){for(var w=m<<2,Y=x.length;Y>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.la?f=a.sa+a.la&&(a.la+=f-(a.sa+a.la)+1):(a.sa=f,a.la=1);d[f]=d[f]&~(255<g)break;e|=g<g)break;e|=g<=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.B("Unable to restore disk '"+this.oa+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=eg(this,a++);)hg(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function hg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var Zf=0;function Q(a){r.call(this,"RK11",a,0,65536);this.w=ig(this,a.autoMount);this.o=0;this.f=Array(8);this.C=!Pa("Mobi")&&window&&"FileReader"in window;this.h=[];this.Ka=null;this.u=this.b=this.a=this.m=this.i=this.g=this.s=0}n(Q,r); -function ig(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Q.prototype; -h.ha=function(a,b,c){var d=this;switch(b){case "listDisks":return this.l[b]=c,c.onchange=function(){var a=d.l.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.l[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&jg(d,a)}, -!0;case "loadDisk":return this.l[b]=c,c.onclick=function(){var a=d.l.listDisks;a&&a.options&&kg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.l[b]=c,c.onclick=function(){var a,b=d.l.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.f.length||!(a=d.f[b])?d.B("Unable to boot the selected drive"):a.P?(Yc(d.c,0,!0),(a=d.tc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.C){c.parentNode.removeChild(c); -break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.f&&((a=d.f[E(a.value)||0])?(a=a.P)?(a=Sa(gg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.C)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;kg(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;if(a=ig(this,Kc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);lg(this);this.Ka=lc(this.c,144,5,65536);lb(b,this,mg);nb(b,this.reset.bind(this));ng(this,"None",og,!0);this.C&&ng(this,"Local Disk",pg);ng(this,"Remote Disk",qg);rg(this)||D(this)}; -h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){this.h=[];for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";jg(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){lg(this)}; -h.save=function(){var a=new H(this);a.set(0,[this.u,this.b,this.a,this.m,this.i,this.g,this.s,tg(this)]);return a.data()};h.restore=function(a){return lg(this,a[0])}; -function lg(a,b){b||(b=[2368,0,128,0,0,0,0]);var c=ia(b);a.u=c.next().value;a.b=c.next().value;a.a=c.next().value;a.m=c.next().value;a.i=c.next().value;a.g=c.next().value;a.s=c.next().value;b[7]&&(a.h=b[7]);for(b=0;bg||9e||e>=a.f.length)a.B("Unable to load the selected drive");else if(c)if(c==pg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==qg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}vg(a,e,b,c,!1,d)}else sg(a,e)} -function vg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,sg(a,b,!0),k.Wa?a.B("RK11 busy"):(k.Wa=!0,e&&(k.Va=!0,a.o++),k.ya=!!f,bg(new Yf(a,k,"preload"),c,d,f,a.Mc)&&g++));return g} -h.Mc=function(a,b,c,d,e){a.Wa=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Ja)),b=null);if(b){a.P=b;a.oa=c;a.X=d;a:{var f;for(f=0;f=a.J){m=64;break}p=a.seek(b,c,d+1);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}var x,w;if(0>(x=a.read(p,t++))||0>(w=a.read(p,t++))){m=32;break}if(!k&&(Hb(this.v,id(this.c,f),x|w<<8),ic(this.v))){m=1024;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Nc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.P;var p=null,t;a||(m=128,e=0);for(;e;){var x=Jb(this.v,id(this.c,f));if(ic(this.v)){m=1024;break}if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1,!0);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}if(k){var w,Y;if(0>(w=a.read(p,t++))||0>(Y=a.read(p,t++))){m=32;break}if(x!=(w|Y<<8)){m=1;break}}else if(!a.write(p,t++,x&255)||!a.write(p,t++,x>>8)){m=32;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Lc=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&-49|f>>12&48;this.m=65536-e&65535;this.g=this.g&-16|d&15;this.b|=a;wg(this);return!0};function wg(a){a.a&=-32769;a.b&&(a.b|=32768,a.a|=32768,a.b&32736&&(a.a|=16384))}h.Ud=function(){return this.u};h.df=function(){};h.Vd=function(){return this.b};h.ef=function(){};h.Rd=function(){return this.a&61438}; +h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.B("Unable to restore disk '"+this.na+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=ig(this,a++);)lg(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function lg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var cg=0;function Q(a){r.call(this,"RK11",a,0,65536);this.w=mg(this,a.autoMount);this.o=0;this.f=Array(8);this.C=!Pa("Mobi")&&window&&"FileReader"in window;this.h=[];this.Ia=null;this.u=this.b=this.a=this.m=this.i=this.g=this.s=0}n(Q,r); +function mg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Q.prototype; +h.ha=function(a,b,c){var d=this;switch(b){case "listDisks":return this.l[b]=c,c.onchange=function(){var a=d.l.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.l[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&ng(d,a)}, +!0;case "loadDisk":return this.l[b]=c,c.onclick=function(){var a=d.l.listDisks;a&&a.options&&og(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.l[b]=c,c.onclick=function(){var a,b=d.l.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.f.length||!(a=d.f[b])?d.B("Unable to boot the selected drive"):a.P?(bd(d.c,0,!0),(a=d.tc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.C){c.parentNode.removeChild(c); +break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.f&&((a=d.f[E(a.value)||0])?(a=a.P)?(a=Sa(kg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.C)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;og(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;if(a=mg(this,Nc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);pg(this);this.Ia=lc(this.c,144,5,65536);lb(b,this,qg);nb(b,this.reset.bind(this));rg(this,"None",sg,!0);this.C&&rg(this,"Local Disk",tg);rg(this,"Remote Disk",ug);vg(this)||D(this)}; +h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){this.h=[];for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";ng(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){pg(this)}; +h.save=function(){var a=new H(this);a.set(0,[this.u,this.b,this.a,this.m,this.i,this.g,this.s,xg(this)]);return a.data()};h.restore=function(a){return pg(this,a[0])}; +function pg(a,b){b||(b=[2368,0,128,0,0,0,0]);var c=ia(b);a.u=c.next().value;a.b=c.next().value;a.a=c.next().value;a.m=c.next().value;a.i=c.next().value;a.g=c.next().value;a.s=c.next().value;b[7]&&(a.h=b[7]);for(b=0;bg||9e||e>=a.f.length)a.B("Unable to load the selected drive");else if(c)if(c==tg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==ug){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}zg(a,e,b,c,!1,d)}else wg(a,e)} +function zg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,wg(a,b,!0),k.Ua?a.B("RK11 busy"):(k.Ua=!0,e&&(k.Ta=!0,a.o++),k.ya=!!f,fg(new bg(a,k,"preload"),c,d,f,a.Mc)&&g++));return g} +h.Mc=function(a,b,c,d,e){a.Ua=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Ha)),b=null);if(b){a.P=b;a.na=c;a.X=d;a:{var f;for(f=0;f=a.J){m=64;break}p=a.seek(b,c,d+1);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}var x,w;if(0>(x=a.read(p,t++))||0>(w=a.read(p,t++))){m=32;break}if(!k&&(Hb(this.v,md(this.c,f),x|w<<8),ic(this.v))){m=1024;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Nc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.P;var p=null,t;a||(m=128,e=0);for(;e;){var x=Jb(this.v,md(this.c,f));if(ic(this.v)){m=1024;break}if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1,!0);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}if(k){var w,Y;if(0>(w=a.read(p,t++))||0>(Y=a.read(p,t++))){m=32;break}if(x!=(w|Y<<8)){m=1;break}}else if(!a.write(p,t++,x&255)||!a.write(p,t++,x>>8)){m=32;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Lc=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&-49|f>>12&48;this.m=65536-e&65535;this.g=this.g&-16|d&15;this.b|=a;Ag(this);return!0};function Ag(a){a.a&=-32769;a.b&&(a.b|=32768,a.a|=32768,a.b&32736&&(a.a|=16384))}h.Ud=function(){return this.u};h.df=function(){};h.Vd=function(){return this.b};h.ef=function(){};h.Rd=function(){return this.a&61438}; h.af=function(a){this.a=this.a&-3968|a&3967;if(this.a&1){a=!0;var b,c,d=(this.g&57344)>>13,e=this.f[d],f,g,k,l,m,p;this.a&=-8321;this.b&=-4;switch(c=this.a&14){case 0:this.b=this.g=0;this.a=128;break;case 10:case 4:b=this.tc;case 6:case 2:b||(b=this.Nc);f=(this.g&8160)>>5;g=(this.g&16)>>4;k=this.g&15;l=65536-this.m&65535;m=(this.a&48)<<12|this.i;p=this.a&2048?0:2;if(f>=e.J){this.b|=64;break}if(k>=e.M){this.b|=32;break}a=b.call(this,e,f,g,k,l,m,p,6<=c,this.Lc.bind(this));break;case 8:f=(this.g&8160)>> -5;f'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&zg(d,a)}, -!0;case "loadDisk":return this.l[b]=c,c.onclick=function(){var a=d.l.listDisks;a&&a.options&&Ag(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.l[b]=c,c.onclick=function(){var a,b=d.l.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.P?(Yc(d.c,0,!0),(a=d.uc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.u){c.parentNode.removeChild(c); -break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.b&&((a=d.b[E(a.value)||0])?(a=a.P)?(a=Sa(gg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.u)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ag(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;if(a=yg(this,Kc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.s[e]=a[e]);Bg(this);this.Ka=lc(this.c,112,5,131072);lb(b,this,Cg);nb(b,this.reset.bind(this));Dg(this,"None",Eg,!0);this.u&&Dg(this,"Local Disk",Fg);Dg(this,"Remote Disk",Gg);Hg(this)||D(this)}; -h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";zg(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){Bg(this)};h.save=function(){return(new H(this)).data()}; -h.restore=function(a){return Bg(this,a[0])};function Hg(a,b){b||(a.o=0);for(var c in a.s){var d=a.s[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.l.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==Fg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Gg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}Jg(a,e,b,c,!1,d)}else Ig(a,e)} -function Jg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,Ig(a,b,!0),k.Wa?a.B("RL11 busy"):(k.Wa=!0,e&&(k.Va=!0,a.o++),k.ya=!!f,bg(new Yf(a,k,"preload"),c,d,f,a.Pc)&&g++));return g}h.Pc=function(a,b,c,d,e){a.Wa=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Ja)),b=null);b?(a.P=b,a.oa=c,a.X=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Ja),a.Va||e),this.A&&Rc(this.A)):a.ya=!1;a.Va&&(a.Va=!1,--this.o||D(this));zg(this,a.Ja)}; -function Dg(a,b,c,d){if((a=a.l.listDisks)&&a.options){for(var e=0;e(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}Hb(this.v,id(this.c,f),p|t<<8);if(ic(this.v)){k=8192;break}f+=2;e--;if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Qc=function(a,b,c,d,e,f,g){var k=0;a=a.P;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Jb(this.v,id(this.c,f));if(ic(this.v)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +5;f'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&Dg(d,a)}, +!0;case "loadDisk":return this.l[b]=c,c.onclick=function(){var a=d.l.listDisks;a&&a.options&&Eg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.l[b]=c,c.onclick=function(){var a,b=d.l.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.P?(bd(d.c,0,!0),(a=d.uc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.u){c.parentNode.removeChild(c); +break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.b&&((a=d.b[E(a.value)||0])?(a=a.P)?(a=Sa(kg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.u)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Eg(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;if(a=Cg(this,Nc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.s[e]=a[e]);Fg(this);this.Ia=lc(this.c,112,5,131072);lb(b,this,Gg);nb(b,this.reset.bind(this));Hg(this,"None",Ig,!0);this.u&&Hg(this,"Local Disk",Jg);Hg(this,"Remote Disk",Kg);Lg(this)||D(this)}; +h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Dg(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){Fg(this)};h.save=function(){return(new H(this)).data()}; +h.restore=function(a){return Fg(this,a[0])};function Lg(a,b){b||(a.o=0);for(var c in a.s){var d=a.s[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.l.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==Jg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Kg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ng(a,e,b,c,!1,d)}else Mg(a,e)} +function Ng(a,b,c,d,e,f){var g=-1,k=a.b[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,Mg(a,b,!0),k.Ua?a.B("RL11 busy"):(k.Ua=!0,e&&(k.Ta=!0,a.o++),k.ya=!!f,fg(new bg(a,k,"preload"),c,d,f,a.Pc)&&g++));return g}h.Pc=function(a,b,c,d,e){a.Ua=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Ha)),b=null);b?(a.P=b,a.na=c,a.X=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Ha),a.Ta||e),this.A&&Uc(this.A)):a.ya=!1;a.Ta&&(a.Ta=!1,--this.o||D(this));Dg(this,a.Ha)}; +function Hg(a,b,c,d){if((a=a.l.listDisks)&&a.options){for(var e=0;e(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}Hb(this.v,md(this.c,f),p|t<<8);if(ic(this.v)){k=8192;break}f+=2;e--;if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +h.Qc=function(a,b,c,d,e,f,g){var k=0;a=a.P;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Jb(this.v,md(this.c,f));if(ic(this.v)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; h.Oc=function(a,b,c,d,e,f){this.m=f&65535;this.a=this.a&-49|f>>12&48;this.h=f>>16&63;this.g=this.f=b<<7|(c?64:0)|d&63;this.i=65536-e&65535;a&&(this.a=this.a|a|32768);return!0};h.Zd=function(){return this.a&65535}; h.jf=function(a){this.a=this.a&-1023|a&1022;this.h=this.h&60|(a&48)>>4;if(!(this.a&128)){a=!0;var b,c=this.b[(this.a&768)>>8],d=c.P,e,f,g;this.a&=-2;switch(this.a&14){case 4:this.i&8&&(this.a&=63);this.i=c.status|this.g&64|(d&&512==d.J?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.g=this.f&4?this.g+b:this.g-b,this.f=this.g=this.g&65408|c);break;case 8:this.i=this.g;break;case 12:b=this.uc;case 10:b||(b=this.Qc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.J||g>=d.M? -this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Oc.bind(this)))}a&&(this.a|=129,this.a&64&&N(this.c,this.Ka))}};h.Xd=function(){return this.m};h.gf=function(a){this.m=a&65534};h.$d=function(){return this.f};h.kf=function(a){this.f=a};h.ae=function(){return this.i};h.lf=function(a){this.i=a};h.Yd=function(){return this.h};h.hf=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4}; -var Eg="",Fg="?",Gg="??",Kg={},Cg=(Kg[63744]=[null,null,P.prototype.Zd,P.prototype.jf,"RLCS"],Kg[63746]=[null,null,P.prototype.Xd,P.prototype.gf,"RLBA"],Kg[63748]=[null,null,P.prototype.$d,P.prototype.kf,"RLDA"],Kg[63750]=[null,null,P.prototype.ae,P.prototype.lf,"RLMP"],Kg[63752]=[null,null,P.prototype.Yd,P.prototype.hf,"RLBE"],Kg); -function Lg(a,b,c){r.call(this,"Computer",a,0,33554432);this.j.S=!1;this.G=null;Mg(this,b);this.C=Kc(this,"autoPower",a,6);this.g=0;this.K=+a.busWidth||+a.buswidth;this.u=this.s=this.w=null;this.o=this.I=!1;this.i=this.h=null;this.H=this.m=this.F=!1;this.L=Kc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Ng(this);if(this.c=wa("CPU",this.id)){this.D=wa("Debugger",this.id);this.v=new Nb({id:this.Na+".bus",busWidth:this.K},this.c,this.D);var d,e=y(this.id);if((this.f=wa("Panel",this.id))&&this.f.bb)for(b= -0;b\nLicense: GPL version 3 or later ");this.Z("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bOg){if(Pg(d,this.u)){this.h=new H(this,"1.32.2",Yg);Pg(this.h)&&(Zg(this,d),a=bh,ch(this.h));this.h.set(Vg,Ia());dh(this.h);var e=this.a&&!this.o;if(a==Wg||ua("Click OK to restore the previous "+cb+" machine state, or CANCEL to reset the machine.")){if(c=Ug(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Pg(d,g):("error"==f&&"no machine state"!= -g?(this.B("Error: "+g),"unable to verify user"==g&&(Oa(eh,""),this.b=null)):this.Z(f+": "+g),ch(d),Pg(d)?(c=Ug(d),e=!0):c=!1))}e&&Sg(this,c?d:null)}else a==bh&&d.clear()}else Sg(this);delete this.u;delete this.i}e=y(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.S=!0;var d=this.l.power;d&&(d.textContent="Shutdown");this.c&&(fh(this,this.c,b,c,a),Fb(this,-2),this.c.da());this.F&&(Zg(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; -function Zg(a,b){if(ua("There may be a problem with your "+cb+" machine.\n\nTo help us diagnose it, click OK to send this "+cb+" machine state to http://www.pcjs.org.")){var c=a.L;a=a.b||"";b=b.toString();var d={};d.app=cb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;G("http://www.pcjs.org/api/v1/report",d,!0)}} -function gh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new H(a,"1.32.2"),g=new H(a,"1.32.2",Tg),k=Ia();g.set(Vg,k);f.set(Vg,k);f.set(hh,"1.32.2");f.set(ih,window?window.location.href:null);f.set(jh,window?window.navigator.userAgent:"");a.c&&a.c.fa&&(c&&(b&&(a.c.j.da=a.c.j.N),I(a.c)),d=a.c.fa(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.S=!1,!1===d&&(e=null)));for(var k=y(a.id),l=0;l\nLicense: GPL version 3 or later ");this.Z("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bSg){if(Tg(d,this.u)){this.h=new H(this,"1.32.2",bh);Tg(this.h)&&(ch(this,d),a=fh,gh(this.h));this.h.set(Zg,Ia());hh(this.h);var e=this.a&&!this.o;if(a==$g||ua("Click OK to restore the previous "+cb+" machine state, or CANCEL to reset the machine.")){if(c=Yg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Tg(d,g):("error"==f&&"no machine state"!= +g?(this.B("Error: "+g),"unable to verify user"==g&&(Oa(ih,""),this.b=null)):this.Z(f+": "+g),gh(d),Tg(d)?(c=Yg(d),e=!0):c=!1))}e&&Wg(this,c?d:null)}else a==fh&&d.clear()}else Wg(this);delete this.u;delete this.i}e=y(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.S=!0;var d=this.l.power;d&&(d.textContent="Shutdown");this.c&&(jh(this,this.c,b,c,a),Fb(this,-2),this.c.da());this.F&&(ch(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; +function ch(a,b){if(ua("There may be a problem with your "+cb+" machine.\n\nTo help us diagnose it, click OK to send this "+cb+" machine state to http://www.pcjs.org.")){var c=a.L;a=a.b||"";b=b.toString();var d={};d.app=cb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;G("http://www.pcjs.org/api/v1/report",d,!0)}} +function kh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new H(a,"1.32.2"),g=new H(a,"1.32.2",Xg),k=Ia();g.set(Zg,k);f.set(Zg,k);f.set(lh,"1.32.2");f.set(mh,window?window.location.href:null);f.set(nh,window?window.navigator.userAgent:"");a.c&&a.c.fa&&(c&&(b&&(a.c.j.da=a.c.j.N),I(a.c)),d=a.c.fa(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.S=!1,!1===d&&(e=null)));for(var k=y(a.id),l=0;l=d||30<=(c.hc+=d))&&(e.textContent=c.j.N?c.Oa.toFixed(2)+"Mhz":"Stopped",c.hc=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.j.N;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]:0=d||30<=(c.hc+=d))&&(e.textContent=c.j.N?c.Ma.toFixed(2)+"Mhz":"Stopped",c.hc=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.j.N;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");G(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);rh(a,b,c)}})}else c(a,null)} -function sh(a,b,c,d){function e(a){if(void 0===k){var b=g&&C(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ea(a))}function f(a){e("Error: "+a);l&&(--oh||Ya(!0));l=!1}var g,k,l=!0;oh++;sa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?ph(c,null,null,!1,e,function(d,l){l?(ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--oh||Ya(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--oh||Ya(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ph(b,a,d,!0,e,m):qh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(x){f(x.message)}return l}window.embedPDP11=function(a,b,c,d){Ya(!1);return sh(a,b,c,d)};window.findMachineComponent=function(a,b){return wa(b,a+".machine")};window.enableEvents=Ya;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map +h.ha=function(a,b,c){var d=this;switch(b){case "power":return this.l[b]=c,c.onclick=function(){d.g||(d.j.S?kh(d,!1,!0):Vg(d,d.vb))},!0;case "reset":return this.l[b]=c,c.onclick=function(){if(d.j.S&&!d.g)if(d.a&&!d.s){var a=ua("Click OK to save changes to this "+cb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");kh(d,a,!0);!a&&d.w?window&&window.location.reload():(a||(d.m=!0),d.vb(Sg),d.m=!1)}else d.reset(),d.c&&d.c.da()},!0;case "save":if(Ca(Ka(),"pcjs.org"))c.parentNode.removeChild(c);else return this.l[b]= +c,c.onclick=function(){var a=Rg(d,!0);if(a){var b=!!(d.a&&!d.s||d.w),c=kh(d,b);b?oh(d,a,c):d.B("Resume disabled, machine state not saved")}},!0}return!1};function Rg(a,b){var c=a.b;c||((c=Na(ih),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=qh(a,c))||a.B("The user ID is invalid.")):b&&a.B("Browser local storage is not available"));return c} +function qh(a,b){a.b=null;b=G(Ka()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Oa(ih,b.data),a.b=b.data)}catch(d){v(d.message+" ("+c+")")}return a.b}function Ug(a){var b=null;a.b&&(b=Ka()+"/api/v1/user?req=load&user="+a.b+"&state="+rh(a,"1.32.2"));return b} +function oh(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=rh(a,"1.32.2");d.data=c;b=G(Ka()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");G(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);vh(a,b,c)}})}else c(a,null)} +function wh(a,b,c,d){function e(a){if(void 0===k){var b=g&&C(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ea(a))}function f(a){e("Error: "+a);l&&(--sh||Ya(!0));l=!1}var g,k,l=!0;sh++;sa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?th(c,null,null,!1,e,function(d,l){l?(ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--sh||Ya(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--sh||Ya(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?th(b,a,d,!0,e,m):uh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(x){f(x.message)}return l}window.embedPDP11=function(a,b,c,d){Ya(!1);return wh(a,b,c,d)};window.findMachineComponent=function(a,b){return wa(b,a+".machine")};window.enableEvents=Ya;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map From 5edbdcdce2528bb8cf9f5a05386c2ad7c04e1327 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Sat, 28 Jan 2017 13:39:19 -0800 Subject: [PATCH 09/15] Factored PDP-11 drive controller logic into a device-independent superclass (drive.js) and a device-dependent subclass (rk11.js); the RL11 controller is ready to be factored next --- modules/pc8080/lib/bus.js | 2 +- modules/pc8080/lib/chipset.js | 2 +- modules/pc8080/lib/computer.js | 2 +- modules/pc8080/lib/cpu.js | 2 +- modules/pc8080/lib/keyboard.js | 2 +- modules/pc8080/lib/panel.js | 2 +- modules/pc8080/lib/ram.js | 2 +- modules/pc8080/lib/rom.js | 2 +- modules/pc8080/lib/serial.js | 2 +- modules/pc8080/lib/video.js | 2 +- modules/pdp11/lib/bus.js | 6 +- modules/pdp11/lib/computer.js | 2 +- modules/pdp11/lib/cpu.js | 2 +- modules/pdp11/lib/cpustate.js | 6 +- modules/pdp11/lib/debugger.js | 2 +- modules/pdp11/lib/defines.js | 3 + modules/pdp11/lib/device.js | 6 +- modules/pdp11/lib/disk.js | 6 +- modules/pdp11/lib/drive.js | 1093 ++++++++++++++++++++++++++ modules/pdp11/lib/keyboard.js | 2 +- modules/pdp11/lib/panel.js | 2 +- modules/pdp11/lib/pc11.js | 2 +- modules/pdp11/lib/ram.js | 2 +- modules/pdp11/lib/rk11.js | 998 +---------------------- modules/pdp11/lib/rl11.js | 2 +- modules/pdp11/lib/rom.js | 2 +- modules/pdp11/lib/serial.js | 6 +- modules/shared/es6/component.js | 11 +- modules/shared/es6/debugger.js | 4 +- package.json | 1 + versions/pc8080/1.32.2/pc8080-dbg.js | 14 +- versions/pdpjs/1.32.2/pdp11-dbg.js | 673 ++++++++-------- versions/pdpjs/1.32.2/pdp11.js | 506 ++++++------ 33 files changed, 1755 insertions(+), 1616 deletions(-) create mode 100644 modules/pdp11/lib/drive.js diff --git a/modules/pc8080/lib/bus.js b/modules/pc8080/lib/bus.js index 0bcf8af2b..15c93095b 100644 --- a/modules/pc8080/lib/bus.js +++ b/modules/pc8080/lib/bus.js @@ -72,7 +72,7 @@ class Bus8080 extends Component { */ constructor(parmsBus, cpu, dbg) { - super("Bus", parmsBus, Bus8080); + super("Bus", parmsBus); this.cpu = cpu; this.dbg = dbg; diff --git a/modules/pc8080/lib/chipset.js b/modules/pc8080/lib/chipset.js index 8e7d5a53e..0c0f8924d 100644 --- a/modules/pc8080/lib/chipset.js +++ b/modules/pc8080/lib/chipset.js @@ -60,7 +60,7 @@ class ChipSet8080 extends Component { */ constructor(parmsChipSet) { - super("ChipSet", parmsChipSet, ChipSet8080, Messages8080.CHIPSET); + super("ChipSet", parmsChipSet, Messages8080.CHIPSET); var model = parmsChipSet['model']; diff --git a/modules/pc8080/lib/computer.js b/modules/pc8080/lib/computer.js index 7f1295fd9..50c938be8 100644 --- a/modules/pc8080/lib/computer.js +++ b/modules/pc8080/lib/computer.js @@ -112,7 +112,7 @@ class Computer8080 extends Component { */ constructor(parmsComputer, parmsMachine, fSuspended) { - super("Computer", parmsComputer, Computer8080, Messages8080.COMPUTER); + super("Computer", parmsComputer, Messages8080.COMPUTER); this.flags.powered = false; diff --git a/modules/pc8080/lib/cpu.js b/modules/pc8080/lib/cpu.js index 039375687..95d4207be 100644 --- a/modules/pc8080/lib/cpu.js +++ b/modules/pc8080/lib/cpu.js @@ -76,7 +76,7 @@ class CPU8080 extends Component { */ constructor(parmsCPU, nCyclesDefault) { - super("CPU", parmsCPU, CPU8080, Messages8080.CPU); + super("CPU", parmsCPU, Messages8080.CPU); var nCycles = parmsCPU['cycles'] || nCyclesDefault; diff --git a/modules/pc8080/lib/keyboard.js b/modules/pc8080/lib/keyboard.js index c880dd38b..351eef25d 100644 --- a/modules/pc8080/lib/keyboard.js +++ b/modules/pc8080/lib/keyboard.js @@ -59,7 +59,7 @@ class Keyboard8080 extends Component { */ constructor(parmsKbd) { - super("Keyboard", parmsKbd, Keyboard8080, Messages8080.KEYBOARD); + super("Keyboard", parmsKbd, Messages8080.KEYBOARD); var model = parmsKbd['model']; diff --git a/modules/pc8080/lib/panel.js b/modules/pc8080/lib/panel.js index f62a8dbfd..3fa920e53 100644 --- a/modules/pc8080/lib/panel.js +++ b/modules/pc8080/lib/panel.js @@ -55,7 +55,7 @@ class Panel8080 extends Component { */ constructor(parmsPanel) { - super("Panel", parmsPanel, Panel8080); + super("Panel", parmsPanel); } /** diff --git a/modules/pc8080/lib/ram.js b/modules/pc8080/lib/ram.js index 2b14e1687..7bbaa0b66 100644 --- a/modules/pc8080/lib/ram.js +++ b/modules/pc8080/lib/ram.js @@ -66,7 +66,7 @@ class RAM8080 extends Component { */ constructor(parmsRAM) { - super("RAM", parmsRAM, RAM8080); + super("RAM", parmsRAM); this.abInit = null; this.aSymbols = null; diff --git a/modules/pc8080/lib/rom.js b/modules/pc8080/lib/rom.js index b56e6b3dd..56cf1146f 100644 --- a/modules/pc8080/lib/rom.js +++ b/modules/pc8080/lib/rom.js @@ -66,7 +66,7 @@ class ROM8080 extends Component { */ constructor(parmsROM) { - super("ROM", parmsROM, ROM8080); + super("ROM", parmsROM); this.abROM = null; this.addrROM = parmsROM['addr']; diff --git a/modules/pc8080/lib/serial.js b/modules/pc8080/lib/serial.js index 76ab67554..e57c1b678 100644 --- a/modules/pc8080/lib/serial.js +++ b/modules/pc8080/lib/serial.js @@ -69,7 +69,7 @@ class SerialPort8080 extends Component { */ constructor(parmsSerial) { - super("SerialPort", parmsSerial, SerialPort8080, Messages8080.SERIAL); + super("SerialPort", parmsSerial, Messages8080.SERIAL); this.iAdapter = +parmsSerial['adapter']; diff --git a/modules/pc8080/lib/video.js b/modules/pc8080/lib/video.js index 861699000..744182c32 100644 --- a/modules/pc8080/lib/video.js +++ b/modules/pc8080/lib/video.js @@ -101,7 +101,7 @@ class Video8080 extends Component { */ constructor(parmsVideo, canvas, context, textarea, container) { - super("Video", parmsVideo, Video8080, Messages8080.VIDEO); + super("Video", parmsVideo, Messages8080.VIDEO); var video = this; this.fGecko = Web.isUserAgent("Gecko/"); diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index 0e108aa19..04b8bb59d 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -54,7 +54,7 @@ if (NODE) { * count: BitField, * btmod: BitField, * type: BitField - * }} BlockInfoPDP11 + * }} */ var BlockInfoPDP11 = Usr.defineBitFields({num:20, count:8, btmod:1, type:3}); @@ -69,7 +69,7 @@ var BlockInfoPDP11 = Usr.defineBitFields({num:20, count:8, btmod:1, type:3}); * cbTotal: number, * cBlocks: number, * aBlocks: Array. - * }} BusInfoPDP11 + * }} */ var BusInfoPDP11; @@ -95,7 +95,7 @@ class BusPDP11 extends Component { */ constructor(parmsBus, cpu, dbg) { - super("Bus", parmsBus, BusPDP11, MessagesPDP11.BUS); + super("Bus", parmsBus, MessagesPDP11.BUS); this.cpu = cpu; this.dbg = dbg; diff --git a/modules/pdp11/lib/computer.js b/modules/pdp11/lib/computer.js index d9f0b9b14..c5de07d37 100644 --- a/modules/pdp11/lib/computer.js +++ b/modules/pdp11/lib/computer.js @@ -104,7 +104,7 @@ class ComputerPDP11 extends Component { */ constructor(parmsComputer, parmsMachine, fSuspended) { - super("Computer", parmsComputer, ComputerPDP11, MessagesPDP11.COMPUTER); + super("Computer", parmsComputer, MessagesPDP11.COMPUTER); this.flags.powered = false; diff --git a/modules/pdp11/lib/cpu.js b/modules/pdp11/lib/cpu.js index d07582f6a..4ece95c03 100644 --- a/modules/pdp11/lib/cpu.js +++ b/modules/pdp11/lib/cpu.js @@ -93,7 +93,7 @@ class CPUPDP11 extends Component { */ constructor(parmsCPU, nCyclesDefault) { - super("CPU", parmsCPU, CPUPDP11, MessagesPDP11.CPU); + super("CPU", parmsCPU, MessagesPDP11.CPU); var nCycles = +parmsCPU['cycles'] || nCyclesDefault; diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index be28a3671..a2622daf1 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -74,7 +74,7 @@ if (NODE) { * priority: number, * message: number, * next: (IRQ|null) - * }} IRQ + * }} */ var IRQ; @@ -675,8 +675,8 @@ class CPUStatePDP11 extends CPUPDP11 { restore(data) { /* - * ES6 ALERT: Love these destructuring assignments, which make it easy to perform the - * inverse of what save() does when it collects a bunch of object properties into an array. + * ES6 ALERT: A handy destructuring assignment, which makes it easy to perform the inverse + * of what save() does when it collects a bunch of object properties into an array. */ [ this.regsGen, diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index d786ef587..891cea6f6 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -59,7 +59,7 @@ if (NODE) { * nBase:(number|undefined), * sCmd:(string|undefined), * aCmds:(Array.|undefined) - * }} DbgAddrPDP11 + * }} */ var DbgAddrPDP11; diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index f29010248..2ef09fad6 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -690,6 +690,7 @@ var PDP11 = { RK11: { // RK11 Disk Controller PRI: 5, VEC: 0o220, + DRIVES: 8, // maximum of 8 drives RKDS: { // 177400: Drive Status Register SC: 0x000F, // (000017) Sector Counter SCESA: 0x0010, // (000020) Sector Counter Equals Sector Address @@ -874,6 +875,8 @@ var PDP11 = { } }; +PDP11.RK11.RK05 = [203, 2, 12, 512, PDP11.RK11.RKDS.RK05 | PDP11.RK11.RKDS.SOK | PDP11.RK11.RKDS.RRDY]; + PDP11.ACCESS.READ_WORD = PDP11.ACCESS.WORD | PDP11.ACCESS.READ; // formerly READ_MODE (2) PDP11.ACCESS.READ_BYTE = PDP11.ACCESS.BYTE | PDP11.ACCESS.READ; // formerly READ_MODE (2) | BYTE_MODE (1) PDP11.ACCESS.WRITE_WORD = PDP11.ACCESS.WORD | PDP11.ACCESS.WRITE; // formerly WRITE_MODE (4) diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index f2bc71c1a..5307d8c86 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -60,7 +60,7 @@ class DevicePDP11 extends Component { */ constructor(parmsDevice) { - super("Device", parmsDevice, DevicePDP11, MessagesPDP11.DEVICE); + super("Device", parmsDevice, MessagesPDP11.DEVICE); this.kw11 = { // KW11 registers lks: PDP11.KW11.LKS.MON, @@ -241,8 +241,8 @@ class DevicePDP11 extends Component { restore(data) { /* - * ES6 ALERT: Love these destructuring assignments, which make it easy to perform the - * inverse of what save() does when it collects a bunch of object properties into an array. + * ES6 ALERT: A handy destructuring assignment, which makes it easy to perform the inverse + * of what save() does when it collects a bunch of object properties into an array. */ [ this.kw11.lks diff --git a/modules/pdp11/lib/disk.js b/modules/pdp11/lib/disk.js index a54759875..39724d101 100644 --- a/modules/pdp11/lib/disk.js +++ b/modules/pdp11/lib/disk.js @@ -103,13 +103,13 @@ class DiskPDP11 extends Component { * This means, for example, that all references to "track[iSector].data" must actually appear as * "track[iSector]['data']". * - * @param {RK11|RL11} controller + * @param {DriveController|RK11|RL11} controller * @param {Object} drive * @param {string} mode */ constructor(controller, drive, mode) { - super("Disk", {'id': controller.idMachine + ".disk" + Str.toHex(++DiskPDP11.nDisks, 4)}, DiskPDP11, MessagesPDP11.DISK); + super("Disk", {'id': controller.idMachine + ".disk" + Str.toHex(++DiskPDP11.nDisks, 4)}, MessagesPDP11.DISK); /* * Route all non-Debugger messages (eg, notice() and println() calls) through @@ -371,6 +371,7 @@ class DiskPDP11 extends Component { } if (this.fnNotify) { + //noinspection JSUnresolvedFunction this.fnNotify.call(this.controller, this.drive, disk, this.sDiskName, this.sDiskPath); this.fnNotify = null; } @@ -590,6 +591,7 @@ class DiskPDP11 extends Component { } if (this.fnNotify) { + //noinspection JSUnresolvedFunction this.fnNotify.call(this.controllerNotify, this.drive, disk, this.sDiskName, this.sDiskPath); this.fnNotify = null; } diff --git a/modules/pdp11/lib/drive.js b/modules/pdp11/lib/drive.js new file mode 100644 index 000000000..8fde0dba6 --- /dev/null +++ b/modules/pdp11/lib/drive.js @@ -0,0 +1,1093 @@ +/** + * @fileoverview Implements a generic disk drive controller + * @author Jeff Parsons + * @copyright © Jeff Parsons 2012-2017 + * + * This file is part of PCjs, a computer emulation software project at . + * + * PCjs is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with PCjs. If not, + * see . + * + * You are required to include the above copyright notice in every modified copy of this work + * and to display that copyright notice when the software starts running; see COPYRIGHT in + * . + * + * Some PCjs files also attempt to load external resource files, such as character-image files, + * ROM files, and disk image files. Those external resource files are not considered part of PCjs + * for purposes of the GNU General Public License, and the author does not claim any copyright + * as to their contents. + */ + +"use strict"; + +if (NODE) { + var Str = require("../../shared/es6/strlib"); + var Web = require("../../shared/es6/weblib"); + var DiskAPI = require("../../shared/es6/diskapi"); + var Component = require("../../shared/es6/component"); + var State = require("../../shared/es6/state"); + var PDP11 = require("./defines"); + var MessagesPDP11 = require("./messages"); + var DiskPDP11 = require("./disk"); +} + +/** + * @typedef {{ + * PRI: number, + * VEC: number, + * DRIVES: number + * }} + */ +var Config; + +class DriveController extends Component { + /** + * DriveController(type, parms, bitsMessage, configDC) + * + * The DriveController component has the following component-specific (parms) properties: + * + * autoMount: one or more JSON-encoded objects, each containing 'name' and 'path' properties + * + * @param {string} type + * @param {Object} parms + * @param {number} bitsMessage + * @param {Config} configDC + * @param {Array} driveInfo + * @param {Object} tableIO + */ + constructor(type, parms, bitsMessage, configDC, driveInfo, tableIO) + { + super(type, parms, bitsMessage); + + /* + * We preliminarily parse and record any 'autoMount' object now, but we no longer process it + * until initBus(), because the Computer's getMachineParm() service may have an override for us. + */ + this.configMount = this.parseConfig(parms['autoMount']); + this.cAutoMount = 0; + + this.configDC = configDC; + this.driveInfo = driveInfo; + this.tableIO = tableIO; + + this.nDrives = configDC.DRIVES; + this.aDrives = new Array(this.nDrives); + this.fLocalDisks = (!Web.isMobile() && window && 'FileReader' in window); + this.sDiskSource = DriveController.SOURCE.NONE; + + /* + * The following array keeps track of every disk image we've ever mounted. Each entry in the + * array is another array whose elements are: + * + * [0]: name of disk + * [1]: path of disk + * [2]: array of deltas, uninitialized until the disk is unmounted and/or all state is saved + * + * See functions addDiskHistory() and updateDiskHistory(). + */ + this.aDiskHistory = []; + + this.irq = null; + } + + /** + * parseConfig(config) + * + * @this {DriveController} + * @param {*} config + * @return {*} + */ + parseConfig(config) + { + if (config && typeof config == "string") { + try { + /* + * The most likely source of any exception will be right here, where we're parsing + * this JSON-encoded data. + */ + config = eval("(" + config + ")"); + } catch (e) { + Component.error(this.type + " auto-mount error: " + e.message + " (" + config + ")"); + config = null; + } + } + return config || {}; + } + + /** + * setBinding(sType, sBinding, control, sValue) + * + * @this {DriveController} + * @param {string|null} sType is the type of the HTML control (eg, "button", "list", "text", etc) + * @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) + * @param {string} [sValue] optional data value + * @return {boolean} true if binding was successful, false if unrecognized binding request + */ + setBinding(sType, sBinding, control, sValue) + { + var dc = this; + + switch (sBinding) { + + case "listDisks": + this.bindings[sBinding] = control; + + control.onchange = function onChangeListDisks(event) { + var controlDesc = dc.bindings["descDisk"]; + var controlOption = control.options && control.options[control.selectedIndex]; + if (controlDesc && controlOption) { + var dataValue = {}; + var sValue = controlOption.getAttribute("data-value"); + if (sValue) { + try { + dataValue = eval("(" + sValue + ")"); + } catch (e) { + Component.error(dc.type + " option error: " + e.message); + } + } + var sHTML = dataValue['desc']; + if (sHTML === undefined) sHTML = ""; + var sHRef = dataValue['href']; + if (sHRef !== undefined) sHTML = "" + sHTML + ""; + controlDesc.innerHTML = sHTML; + } + }; + return true; + + case "descDisk": + case "listDrives": + this.bindings[sBinding] = control; + /* + * I tried going with onclick instead of onchange, so that if you wanted to confirm what's + * loaded in a particular drive, you could click the drive control without having to change it. + * However, that doesn't seem to work for all browsers, so I've reverted to onchange. + */ + control.onchange = function onChangeListDrives(event) { + var iDrive = Str.parseInt(control.value, 10); + if (iDrive != null) dc.displayDisk(iDrive); + }; + return true; + + case "loadDisk": + this.bindings[sBinding] = control; + + control.onclick = function onClickLoadDrive(event) { + var controlDisks = dc.bindings["listDisks"]; + if (controlDisks && controlDisks.options) { + var sDiskName = controlDisks.options[controlDisks.selectedIndex].text; + var sDiskPath = controlDisks.value; + dc.loadSelectedDrive(sDiskName, sDiskPath); + } + }; + return true; + + case "bootDisk": + this.bindings[sBinding] = control; + + control.onclick = function onClickBootDisk(event) { + dc.bootSelectedDisk(); + }; + return true; + + case "saveDisk": + /* + * Yes, technically, this feature does not require "Local disk support" (which is really a reference + * to FileReader support), but since fLocalDisks is also false for all mobile devices, and since there + * is an "orthogonality" to disabling both features in tandem, let's just let it slide, OK? + */ + if (!this.fLocalDisks) { + if (DEBUG) this.log("Local disk support not available"); + /* + * We could also simply hide the control; eg: + * + * control.style.display = "none"; + * + * but removing the control altogether seems better. + */ + control.parentNode.removeChild(/** @type {Node} */ (control)); + return false; + } + + this.bindings[sBinding] = control; + + control.onclick = function onClickSaveDrive(event) { + var controlDrives = dc.bindings["listDrives"]; + if (controlDrives && controlDrives.options && dc.aDrives) { + var iDriveSelected = Str.parseInt(controlDrives.value, 10) || 0; + var drive = dc.aDrives[iDriveSelected]; + if (drive) { + /* + * Note the similarity (and hence factoring opportunity) between this code and the HDC's "saveHD*" binding. + */ + var disk = drive.disk; + if (disk) { + if (DEBUG) dc.println("saving disk " + disk.sDiskPath + "..."); + var sAlert = Web.downloadFile(disk.encodeAsBase64(), "octet-stream", true, disk.sDiskFile.replace(".json", ".img")); + Component.alertUser(sAlert); + } else { + dc.notice("No disk loaded in drive."); + } + } else { + dc.notice("No disk drive selected."); + } + } + }; + return true; + + case "mountDisk": + if (!this.fLocalDisks) { + if (DEBUG) this.log("Local disk support not available"); + /* + * We could also simply hide the control; eg: + * + * control.style.display = "none"; + * + * but removing the control altogether seems better. + */ + control.parentNode.removeChild(/** @type {Node} */ (control)); + return false; + } + + this.bindings[sBinding] = control; + + /* + * Enable "Mount" button only if a file is actually selected + */ + control.addEventListener('change', function() { + var fieldset = control.children[0]; + var files = fieldset.children[0].files; + var submit = fieldset.children[1]; + submit.disabled = !files.length; + }); + + control.onsubmit = function(event) { + var file = event.currentTarget[1].files[0]; + if (file) { + var sDiskPath = file.name; + var sDiskName = Str.getBaseName(sDiskPath, true); + dc.loadSelectedDrive(sDiskName, sDiskPath, file); + } + /* + * Prevent reloading of web page after form submission + */ + return false; + }; + return true; + + default: + break; + } + return false; + } + + /** + * initBus(cmp, bus, cpu, dbg) + * + * @this {DriveController} + * @param {ComputerPDP11} cmp + * @param {BusPDP11} bus + * @param {CPUStatePDP11} cpu + * @param {DebuggerPDP11} dbg + */ + initBus(cmp, bus, cpu, dbg) + { + this.cmp = cmp; + this.bus = bus; + this.cpu = cpu; + this.dbg = dbg; + + var configMount = this.parseConfig(this.cmp.getMachineParm('autoMount')); + + /* + * Add only drives from the machine-wide autoMount configuration that match drives managed by this component. + */ + if (configMount) { + for (var sDrive in configMount) { + if (sDrive.substr(0, 2) != this.type.substr(0, 2)) continue; + this.configMount[sDrive] = configMount[sDrive]; + } + } + + /* + * If we didn't need auto-mount support, we could defer controller initialization until we received + * a powerUp() notification, at which point reset() would call initController(), or restore() would restore + * the controller; in that case, all we'd need to do here is call setReady(). + */ + this.initController(); + + this.irq = this.cpu.addIRQ(this.configDC.VEC, this.configDC.PRI, this.bitsMessage); + + bus.addIOTable(this, this.tableIO); + bus.addResetHandler(this.reset.bind(this)); + + this.addDisk("None", DriveController.SOURCE.NONE, true); + if (this.fLocalDisks) this.addDisk("Local Disk", DriveController.SOURCE.LOCAL); + this.addDisk("Remote Disk", DriveController.SOURCE.REMOTE); + + if (!this.autoMount()) this.setReady(); + } + + /** + * getDriveName(iDrive) + * + * Form a drive name using the two-letter controller type prefix and the drive number. + * + * @this {DriveController} + * @param {number} iDrive + * @return {string} + */ + getDriveName(iDrive) + { + return this.type.substr(0, 2) + iDrive; + } + + /** + * getDriveNumber(sDrive) + * + * @this {DriveController} + * @param {string} sDrive + * @return {number} (0-3, or -1 if error) + */ + getDriveNumber(sDrive) + { + var iDrive = -1; + if (sDrive) { + iDrive = sDrive.charCodeAt(sDrive.length - 1) - 0x30; + if (iDrive < 0 || iDrive > 9) iDrive = -1; + } + return iDrive; + } + + /** + * powerUp(data, fRepower) + * + * @this {DriveController} + * @param {Object|null} data + * @param {boolean} [fRepower] + * @return {boolean} true if successful, false if failure + */ + powerUp(data, fRepower) + { + if (!fRepower) { + if (!data) { + this.reset(); + if (this.cmp.fReload) { + /* + * If the computer's fReload flag is set, we're required to toss all currently + * loaded disks and remount all disks specified in the auto-mount configuration. + */ + this.unloadAllDrives(true); + this.autoMount(true); + } + } else { + if (!this.restore(data)) return false; + } + /* + * Populate the HTML controls to match the actual (well, um, specified) number of floppy drives. + */ + var controlDrives; + if ((controlDrives = this.bindings['listDrives'])) { + while (controlDrives.firstChild) { + controlDrives.removeChild(controlDrives.firstChild); + } + controlDrives.value = ""; + for (var iDrive = 0; iDrive < this.nDrives; iDrive++) { + var controlOption = document.createElement("option"); + controlOption.value = iDrive; + controlOption.text = this.getDriveName(iDrive); + controlDrives.appendChild(controlOption); + } + if (this.nDrives > 0) { + controlDrives.value = "0"; + this.displayDisk(0); + } + } + } + return true; + } + + /** + * powerDown(fSave, fShutdown) + * + * @this {DriveController} + * @param {boolean} [fSave] + * @param {boolean} [fShutdown] + * @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure + */ + powerDown(fSave, fShutdown) + { + return fSave? this.save() : true; + } + + /** + * reset() + * + * @this {DriveController} + */ + reset() + { + this.initController(); + } + + /** + * save() + * + * This implements save support for the DriveController component. + * + * @this {DriveController} + * @return {Object} + */ + save() + { + var state = new State(this); + state.set(0, this.saveController()); + state.set(0, this.saveDeltas()); + return state.data(); + } + + /** + * restore(data) + * + * This implements restore support for the DriveController component. + * + * @this {DriveController} + * @param {Object} data + * @return {boolean} true if successful, false if failure + */ + restore(data) + { + return this.initController(data[0], data[1]); + } + + /** + * initController(aRegs, aHistory) + * + * @this {DriveController} + * @param {Array} [aRegs] + * @param {Array} [aHistory] + * @return {boolean} true if successful, false if failure + */ + initController(aRegs, aHistory) + { + var fSuccess = true; + + /* + * Initialize the disk history (if available) before initializing the drives, so that any disk deltas can be + * applied to disk images that are already loaded. + */ + if (aHistory) this.aDiskHistory = aHistory; + + for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { + var drive = this.aDrives[iDrive]; + if (drive === undefined) { + drive = this.aDrives[iDrive] = {}; + } + if (!this.initDrive(drive, iDrive, this.driveInfo)) { + fSuccess = false; + } + } + return fSuccess; + } + + /** + * saveController() + * + * Placeholder for subclasses. + * + * @this {DriveController} + * @return {Array} + */ + saveController() + { + } + + /** + * saveDeltas() + * + * This returns an array of entries, one for each disk image we've ever mounted, including any deltas; ie: + * + * [name, path, deltas] + * + * aDiskHistory contains exactly that, except that deltas may not be up-to-date for any currently mounted + * disk image(s), so we call updateHistory() for all those disks, and then aDiskHistory is ready to be saved. + * + * @this {DriveController} + * @return {Array} + */ + saveDeltas() + { + for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { + var drive = this.aDrives[iDrive]; + if (drive.disk) { + this.updateDiskHistory(drive.sDiskName, drive.sDiskPath, drive.disk); + } + } + return this.aDiskHistory; + } + + /** + * initDrive(drive, iDrive, driveInfo) + * + * @this {DriveController} + * @param {Object} drive + * @param {number} iDrive + * @param {Array} driveInfo + * @return {boolean} true if successful, false if failure + */ + initDrive(drive, iDrive, driveInfo) + { + var i = 0; + var fSuccess = true; + + drive.iDrive = iDrive; + drive.name = this.idComponent; + drive.fBusy = drive.fLocal = false; + drive.fRemovable = true; + + /* + * NOTE: We initialize the following drive properties to their MAXIMUMs; disks may have + * these or SMALLER values (subject to the limits of what the controller supports, of course). + */ + drive.nCylinders = driveInfo[0]; + drive.nHeads = driveInfo[1]; + drive.nSectors = driveInfo[2]; + drive.cbSector = driveInfo[3]; + drive.status = driveInfo[4]; + + /* + * The next group of properties are set by various controller command sequences. + */ + drive.bHead = 0; + drive.bCylinder = 0; + drive.bSector = 1; + drive.bSectorEnd = drive.nSectors; // aka EOT + drive.nBytes = drive.cbSector; + + /* + * The next group of properties are managed by worker functions (eg, doRead()) to maintain state across DMA requests. + */ + drive.ibSector = 0; + drive.sector = null; + + if (!drive.disk) drive.sDiskPath = ""; // ensure this is initialized to a default that displayDisk() can deal with + + return fSuccess; + } + + /** + * autoMount(fRemount) + * + * @this {DriveController} + * @param {boolean} [fRemount] is true if we're remounting all auto-mounted disks + * @return {boolean} true if one or more disk images are being auto-mounted, false if none + */ + autoMount(fRemount) + { + if (!fRemount) this.cAutoMount = 0; + for (var sDrive in this.configMount) { + var configDrive = this.configMount[sDrive]; + var sDiskPath = configDrive['path'] || ""; + var sDiskName = configDrive['name'] || this.findDisk(sDiskPath); + if (sDiskPath && sDiskName) { + var iDrive = this.getDriveNumber(sDrive); + if (iDrive >= 0 && iDrive < this.aDrives.length) { + if (!this.loadDrive(iDrive, sDiskName, sDiskPath, true) && fRemount) { + this.setReady(false); + } + continue; + } + } + this.notice("Incorrect auto-mount settings for drive " + sDrive + " (" + JSON.stringify(configDrive) + ")"); + } + return !!this.cAutoMount; + } + + /** + * loadSelectedDrive(sDiskName, sDiskPath, file) + * + * @this {DriveController} + * @param {string} sDiskName + * @param {string} sDiskPath + * @param {File} [file] is set if there's an associated File object + */ + loadSelectedDrive(sDiskName, sDiskPath, file) + { + var controlDrives = this.bindings["listDrives"]; + var iDrive = controlDrives && Str.parseInt(controlDrives.value, 10); + + if (iDrive === undefined || iDrive < 0 || iDrive >= this.aDrives.length) { + this.notice("Unable to load the selected drive"); + return; + } + + if (!sDiskPath) { + this.unloadDrive(iDrive); + return; + } + + if (sDiskPath == DriveController.SOURCE.LOCAL) { + this.notice('Use "Choose File" and "Mount" to select and load a local disk.'); + return; + } + + /* + * If the special DriveController.SOURCE.REMOTE path is selected, then we want to prompt the user for a URL. + * Oh, and make sure we pass an empty string as the 2nd parameter to prompt(), so that IE won't display + * "undefined" -- because after all, undefined and "undefined" are EXACTLY the same thing, right? + * + * TODO: This is literally all I've done to support remote disk images. There's probably more + * I should do, like dynamically updating "listDisks" to include new entries, and adding new entries + * to the save/restore data. + */ + if (sDiskPath == DriveController.SOURCE.REMOTE) { + sDiskPath = window.prompt("Enter the URL of a remote disk image.", "") || ""; + if (!sDiskPath) return; + sDiskName = Str.getBaseName(sDiskPath); + this.status("Attempting to load " + sDiskPath + " as \"" + sDiskName + "\""); + this.sDiskSource = DriveController.SOURCE.REMOTE; + } + else { + this.sDiskSource = sDiskPath; + } + + this.loadDrive(iDrive, sDiskName, sDiskPath, false, file); + } + + /** + * bootSelectedDisk() + * + * @this {DriveController} + */ + bootSelectedDisk() + { + var drive; + var controlDrives = this.bindings["listDrives"]; + var iDrive = controlDrives && Str.parseInt(controlDrives.value, 10); + + if (iDrive == null || iDrive < 0 || iDrive >= this.aDrives.length || !(drive = this.aDrives[iDrive])) { + this.notice("Unable to boot the selected drive"); + return; + } + if (!drive.disk) { + this.notice("Load a disk into the drive first"); + return; + } + /* + * NOTE: We're calling setReset() BEFORE reading the boot code in order to eliminate any side-effects + * of the previous state of either the controller OR the CPU; for example, we don't want any previous MMU + * or UNIBUS Map registers affecting the simulated readData() call. Also, some boot code (eg, RSTS/E) + * expects the controller to be in a READY state; since setReset() triggers a call to our reset() handler, + * a READY state is assured, and the readData() call shouldn't do anything to change that. + */ + this.cpu.setReset(0, true); + var err = this.readData(drive, 0, 0, 0, 512, 0x0000, 2); + if (err) { + this.notice("Unable to read the boot sector (" + err + ")"); + } + } + + /** + * loadDrive(iDrive, sDiskName, sDiskPath, fAutoMount, file) + * + * NOTE: If sDiskPath is already loaded, nothing needs to be done. + * + * @this {DriveController} + * @param {number} iDrive + * @param {string} sDiskName + * @param {string} sDiskPath + * @param {boolean} [fAutoMount] + * @param {File} [file] is set if there's an associated File object + * @return {number} 1 if disk loaded, 0 if queued up (or busy), -1 if already loaded + */ + loadDrive(iDrive, sDiskName, sDiskPath, fAutoMount, file) + { + var nResult = -1; + var drive = this.aDrives[iDrive]; + + if (drive.sDiskPath.toLowerCase() != sDiskPath.toLowerCase()) { + + nResult++; + this.unloadDrive(iDrive, true); + + if (drive.fBusy) { + this.notice(this.type + " busy"); + } + else { + // this.status("disk queued: " + sDiskName); + drive.fBusy = true; + if (fAutoMount) { + drive.fAutoMount = true; + this.cAutoMount++; + if (this.messageEnabled()) this.printMessage("auto-loading disk: " + sDiskName); + } + drive.fLocal = !!file; + var disk = new DiskPDP11(this, drive, DiskAPI.MODE.PRELOAD); + if (disk.load(sDiskName, sDiskPath, file, this.finishLoadDrive)) { + nResult++; + } + } + } + return nResult; + } + + /** + * finishLoadDrive(drive, disk, sDiskName, sDiskPath, fAutoMount) + * + * The disk parameter is set if the disk was successfully loaded, null if not. + * + * @this {DriveController} + * @param {Object} drive + * @param {DiskPDP11} disk + * @param {string} sDiskName + * @param {string} sDiskPath + * @param {boolean} [fAutoMount] + */ + finishLoadDrive(drive, disk, sDiskName, sDiskPath, fAutoMount) + { + drive.fBusy = false; + + if (disk) { + /* + * TODO: While this is a perfectly reasonable thing to do, one wonders if the Disk object shouldn't + * have done this itself, since we passed our Drive object to it (it already knows the drive's limits). + */ + if (disk.nCylinders > drive.nCylinders || disk.nHeads > drive.nHeads /* || disk.nSectors > drive.nSectors */) { + this.notice("Disk \"" + sDiskName + "\" too large for drive " + this.getDriveName(drive.iDrive)); + disk = null; + } + } + + if (disk) { + drive.disk = disk; + drive.sDiskName = sDiskName; + drive.sDiskPath = sDiskPath; + + /* + * Adding local disk image names to the disk list seems like a nice idea, but it's too confusing, + * because then it looks like the "Mount" button should be able to (re)load them, and that can NEVER + * happen, for security reasons; local disk images can ONLY be loaded via the "Mount" button after + * the user has selected them via the "Choose File" button. + * + * this.addDisk(sDiskName, sDiskPath); + * + * So we're going to take a different approach: when displayDisk() is asked to display the name + * of a local disk image, it will map all such disks to "Local Disk", and any attempt to "Mount" such + * a disk, will essentially result in a "Disk not found" error. + */ + this.addDiskHistory(sDiskName, sDiskPath, disk); + + /* + * With the addition of notify(), users are now "alerted" whenever a disk has finished loading; + * notify() is selective about its output, using print() if a print window is open, alert() otherwise. + */ + this.notice("Loaded disk \"" + sDiskName + "\" in drive " + this.getDriveName(drive.iDrive), drive.fAutoMount || fAutoMount); + + /* + * Since you usually want the Computer to have focus again after loading a new disk, let's try automatically + * updating the focus after a successful load. + */ + if (this.cmp) this.cmp.setFocus(); + } + else { + drive.fLocal = false; + } + + if (drive.fAutoMount) { + drive.fAutoMount = false; + if (!--this.cAutoMount) this.setReady(); + } + + this.displayDisk(drive.iDrive); + } + + /** + * addDisk(sName, sPath, fTop) + * + * @this {DriveController} + * @param {string} sName + * @param {string} sPath + * @param {boolean} [fTop] (default is bottom) + */ + addDisk(sName, sPath, fTop) + { + var controlDisks = this.bindings["listDisks"]; + if (controlDisks && controlDisks.options) { + for (var i = 0; i < controlDisks.options.length; i++) { + if (controlDisks.options[i].value == sPath) return; + } + var controlOption = document.createElement("option"); + controlOption.text = sName; + controlOption.value = sPath; + if (fTop && controlDisks.childNodes[0]) { + controlDisks.insertBefore(controlOption, controlDisks.childNodes[0]); + } else { + controlDisks.appendChild(controlOption); + } + } + } + + /** + * findDisk(sPath) + * + * This is used to deal with mount requests (eg, autoMount) that supply a path without a name; + * if we can find the path in the "listDisks" control, then we return the associated disk name. + * + * @this {DriveController} + * @param {string} sPath + * @return {string|null} + */ + findDisk(sPath) + { + var controlDisks = this.bindings["listDisks"]; + if (controlDisks && controlDisks.options) { + for (var i = 0; i < controlDisks.options.length; i++) { + var control = controlDisks.options[i]; + if (control.value == sPath) return control.text; + } + } + return Str.getBaseName(sPath, true); + } + + /** + * displayDisk(iDrive, fUpdateDrive) + * + * @this {DriveController} + * @param {number} iDrive (unvalidated) + * @param {boolean} [fUpdateDrive] is true to update the drive list to match the specified drive (eg, the auto-mount case) + */ + displayDisk(iDrive, fUpdateDrive) + { + /* + * First things first: validate iDrive. + */ + if (iDrive >= 0 && iDrive < this.aDrives.length) { + var drive = this.aDrives[iDrive]; + var controlDisks = this.bindings["listDisks"]; + var controlDrives = this.bindings["listDrives"]; + /* + * Next, make sure controls for both drives and disks exist. + */ + if (controlDisks && controlDrives && controlDisks.options && controlDrives.options) { + /* + * Next, make sure the drive whose disk we're updating is the currently selected drive. + */ + var i; + var iDriveSelected = Str.parseInt(controlDrives.value, 10); + var sTargetPath = (drive.fLocal? DriveController.SOURCE.LOCAL : drive.sDiskPath); + if (!isNaN(iDriveSelected) && iDriveSelected == iDrive) { + for (i = 0; i < controlDisks.options.length; i++) { + if (controlDisks.options[i].value == sTargetPath) { + if (controlDisks.selectedIndex != i) { + controlDisks.selectedIndex = i; + } + break; + } + } + if (i == controlDisks.options.length) controlDisks.selectedIndex = 0; + } + if (fUpdateDrive) { + for (i = 0; i < controlDrives.options.length; i++) { + if (Str.parseInt(controlDrives.options[i].value, 10) == drive.iDrive) { + if (controlDrives.selectedIndex != i) { + controlDrives.selectedIndex = i; + } + break; + } + } + } + } + } + } + + /** + * unloadDrive(iDrive, fLoading) + * + * @this {DriveController} + * @param {number} iDrive + * @param {boolean} [fLoading] + */ + unloadDrive(iDrive, fLoading) + { + var drive = this.aDrives[iDrive]; + + if (drive.disk || fLoading === false) { + + /* + * Before we toss the disk's information, capture any deltas that may have occurred. + */ + this.updateDiskHistory(drive.sDiskName, drive.sDiskPath, drive.disk); + + drive.sDiskName = ""; + drive.sDiskPath = ""; + drive.disk = null; + drive.fLocal = false; + + // this.regInput |= FDC.REG_INPUT.DISK_CHANGE; + + if (!fLoading) { + this.notice("Drive " + this.getDriveName(iDrive) + " unloaded", fLoading); + this.sDiskSource = DriveController.SOURCE.NONE; + this.displayDisk(iDrive); + } + } + } + + /** + * unloadAllDrives(fDiscard) + * + * @this {DriveController} + * @param {boolean} fDiscard to discard all disk history before unloading + */ + unloadAllDrives(fDiscard) + { + if (fDiscard) this.aDiskHistory = []; + + for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { + this.unloadDrive(iDrive, true); + } + } + + /** + * addDiskHistory(sDiskName, sDiskPath, disk) + * + * @this {DriveController} + * @param {string} sDiskName + * @param {string} sDiskPath + * @param {DiskPDP11} disk containing corresponding disk image + */ + addDiskHistory(sDiskName, sDiskPath, disk) + { + var i; + this.assert(!!sDiskPath); + for (i = 0; i < this.aDiskHistory.length; i++) { + if (this.aDiskHistory[i][1] == sDiskPath) { + var nChanges = disk.restore(this.aDiskHistory[i][2]); + if (DEBUG && this.messageEnabled()) { + this.printMessage("disk '" + sDiskName + "' restored from history (" + nChanges + " changes)"); + } + return; + } + } + if (DEBUG && this.messageEnabled()) { + this.printMessage("disk '" + sDiskName + "' added to history (nothing to restore)"); + } + this.aDiskHistory[i] = [sDiskName, sDiskPath, []]; + } + + /** + * removeDiskHistory(sDiskName, sDiskPath) + * + * @this {DriveController} + * @param {string} sDiskName + * @param {string} sDiskPath + */ + removeDiskHistory(sDiskName, sDiskPath) + { + var i; + for (i = 0; i < this.aDiskHistory.length; i++) { + if (this.aDiskHistory[i][1] == sDiskPath) { + this.aDiskHistory.splice(i, 1); + if (DEBUG && this.messageEnabled()) { + this.printMessage("disk '" + sDiskName + "' removed from history"); + } + return; + } + } + if (DEBUG && this.messageEnabled()) { + this.printMessage("unable to remove disk '" + sDiskName + "' from history (" + sDiskPath + ")"); + } + } + + /** + * updateDiskHistory(sDiskName, sDiskPath, disk) + * + * @this {DriveController} + * @param {string} sDiskName + * @param {string} sDiskPath + * @param {DiskPDP11} disk containing corresponding disk image, with possible deltas + */ + updateDiskHistory(sDiskName, sDiskPath, disk) + { + var i; + for (i = 0; i < this.aDiskHistory.length; i++) { + if (this.aDiskHistory[i][1] == sDiskPath) { + this.aDiskHistory[i][2] = disk.save(); + if (DEBUG && this.messageEnabled()) { + this.printMessage("disk '" + sDiskName + "' updated in history"); + } + return; + } + } + /* + * I used to report this as an error (at least in the DEBUG release), but it's no longer really + * an error, because if we're trying to re-mount a clean copy of a disk, we toss its history, then + * unload, and then reload/remount. And since unloadDrive's normal behavior is to call updateDiskHistory() + * before unloading, the fact that the disk is no longer listed here can't be treated as an error. + */ + if (DEBUG && this.messageEnabled()) { + this.printMessage("unable to update disk '" + sDiskName + "' in history (" + sDiskPath + ")"); + } + } + + /** + * readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) + * + * Placeholder for subclasses. + * + * @this {DriveController} + * @param {Object} drive + * @param {number} iCylinder + * @param {number} iHead + * @param {number} iSector + * @param {number} nWords + * @param {number} addr + * @param {number} inc (normally 2, unless inhibited, in which case it's 0) + * @param {boolean} [fCheck] + * @param {function(...)} [done] + * @return {boolean|number} true if complete, false if queued (or if no done() is supplied, the error code, if any) + */ + readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) + { + return false; + } + + /** + * writeData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) + * + * Placeholder for subclasses. + * + * @this {DriveController} + * @param {Object} drive + * @param {number} iCylinder + * @param {number} iHead + * @param {number} iSector + * @param {number} nWords + * @param {number} addr + * @param {number} inc (normally 2, unless inhibited, in which case it's 0) + * @param {boolean} [fCheck] + * @param {function(...)} [done] + * @return {boolean|number} true if complete, false if queued (or if no done() is supplied, the error code, if any) + */ + writeData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) + { + return false; + } +} + +/* + * There's nothing super special about these values, except that NONE should be falsey and the others should not. + */ +DriveController.SOURCE = { + NONE: "", + LOCAL: "?", + REMOTE: "??" +}; diff --git a/modules/pdp11/lib/keyboard.js b/modules/pdp11/lib/keyboard.js index da8f8b02c..26707d6ef 100644 --- a/modules/pdp11/lib/keyboard.js +++ b/modules/pdp11/lib/keyboard.js @@ -43,7 +43,7 @@ class KeyboardPDP11 extends Component { */ constructor(parmsKbd) { - super("Keyboard", parmsKbd, KeyboardPDP11, MessagesPDP11.KEYBOARD); + super("Keyboard", parmsKbd, MessagesPDP11.KEYBOARD); this.setReady(); } diff --git a/modules/pdp11/lib/panel.js b/modules/pdp11/lib/panel.js index 73fbe46b7..252024006 100644 --- a/modules/pdp11/lib/panel.js +++ b/modules/pdp11/lib/panel.js @@ -53,7 +53,7 @@ class PanelPDP11 extends Component { */ constructor(parmsPanel, fBindings) { - super("Panel", parmsPanel, PanelPDP11, MessagesPDP11.PANEL); + super("Panel", parmsPanel, MessagesPDP11.PANEL); /* * If there are any live registers, LEDs, etc, to display, this will provide a count. diff --git a/modules/pdp11/lib/pc11.js b/modules/pdp11/lib/pc11.js index f144b9570..bba5feeb9 100644 --- a/modules/pdp11/lib/pc11.js +++ b/modules/pdp11/lib/pc11.js @@ -64,7 +64,7 @@ class PC11 extends Component { */ constructor(parms) { - super("PC11", parms, PC11); + super("PC11", parms); this.sDevice = "PTR"; // TODO: Make the device name configurable diff --git a/modules/pdp11/lib/ram.js b/modules/pdp11/lib/ram.js index b7d066a11..bf0d29c89 100644 --- a/modules/pdp11/lib/ram.js +++ b/modules/pdp11/lib/ram.js @@ -62,7 +62,7 @@ class RAMPDP11 extends Component { */ constructor(parmsRAM) { - super("RAM", parmsRAM, RAMPDP11); + super("RAM", parmsRAM); this.abInit = null; this.aSymbols = null; diff --git a/modules/pdp11/lib/rk11.js b/modules/pdp11/lib/rk11.js index f8589ab16..8ce061fd2 100644 --- a/modules/pdp11/lib/rk11.js +++ b/modules/pdp11/lib/rk11.js @@ -34,16 +34,12 @@ if (NODE) { var Str = require("../../shared/es6/strlib"); - var Web = require("../../shared/es6/weblib"); - var DiskAPI = require("../../shared/es6/diskapi"); - var Component = require("../../shared/es6/component"); - var State = require("../../shared/es6/state"); var PDP11 = require("./defines"); var MessagesPDP11 = require("./messages"); - var DiskPDP11 = require("./disk"); + var DriveController = require("./drive"); } -class RK11 extends Component { +class RK11 extends DriveController { /** * RK11(parms) * @@ -62,39 +58,10 @@ class RK11 extends Component { */ constructor(parms) { - super("RK11", parms, RK11, MessagesPDP11.RK11); + super("RK11", parms, MessagesPDP11.RK11, PDP11.RK11, PDP11.RK11.RK05, RK11.UNIBUS_IOTABLE); /* - * We preliminarily parse and record any 'autoMount' object now, but we no longer process it - * until initBus(), because the Computer's getMachineParm() service may have an override for us. - */ - this.configMount = this.parseConfig(parms['autoMount']); - this.cAutoMount = 0; - - /* - * The RK11 has three Drive Select bits, representing up to eight drives. - */ - this.nDrives = 8; - this.aDrives = new Array(this.nDrives); - this.fLocalDisks = (!Web.isMobile() && window && 'FileReader' in window); - this.sDiskSource = RK11.SOURCE.NONE; - - /* - * The following array keeps track of every disk image we've ever mounted. Each entry in the - * array is another array whose elements are: - * - * [0]: name of disk - * [1]: path of disk - * [2]: array of deltas, uninitialized until the disk is unmounted and/or all state is saved - * - * See functions addDiskHistory() and updateDiskHistory(). - */ - this.aDiskHistory = []; - - this.irq = null; - - /* - * Define all the properties to be initialized by initController() + * Define all the registers required for this controller. * * TODO: Determine what we should really be doing with the RKDB register. */ @@ -102,390 +69,22 @@ class RK11 extends Component { } /** - * parseConfig(config) + * initController(aRegs, aHistory) * * @this {RK11} - * @param {*} config - * @return {*} + * @param {Array} [aRegs] + * @param {Array} [aHistory] + * @return {boolean} true if successful, false if failure */ - parseConfig(config) + initController(aRegs, aHistory) { - if (config && typeof config == "string") { - try { - /* - * The most likely source of any exception will be right here, where we're parsing - * this JSON-encoded data. - */ - config = eval("(" + config + ")"); - } catch (e) { - Component.error(this.type + " auto-mount error: " + e.message + " (" + config + ")"); - config = null; - } - } - return config || {}; - } - - /** - * setBinding(sType, sBinding, control, sValue) - * - * @this {RK11} - * @param {string|null} sType is the type of the HTML control (eg, "button", "list", "text", etc) - * @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) - * @param {string} [sValue] optional data value - * @return {boolean} true if binding was successful, false if unrecognized binding request - */ - setBinding(sType, sBinding, control, sValue) - { - var rk11 = this; - - switch (sBinding) { - - case "listDisks": - this.bindings[sBinding] = control; - - control.onchange = function onChangeListDisks(event) { - var controlDesc = rk11.bindings["descDisk"]; - var controlOption = control.options && control.options[control.selectedIndex]; - if (controlDesc && controlOption) { - var dataValue = {}; - var sValue = controlOption.getAttribute("data-value"); - if (sValue) { - try { - dataValue = eval("(" + sValue + ")"); - } catch (e) { - Component.error("RK11 option error: " + e.message); - } - } - var sHTML = dataValue['desc']; - if (sHTML === undefined) sHTML = ""; - var sHRef = dataValue['href']; - if (sHRef !== undefined) sHTML = "" + sHTML + ""; - controlDesc.innerHTML = sHTML; - } - }; - return true; - - case "descDisk": - case "listDrives": - this.bindings[sBinding] = control; - /* - * I tried going with onclick instead of onchange, so that if you wanted to confirm what's - * loaded in a particular drive, you could click the drive control without having to change it. - * However, that doesn't seem to work for all browsers, so I've reverted to onchange. - */ - control.onchange = function onChangeListDrives(event) { - var iDrive = Str.parseInt(control.value, 10); - if (iDrive != null) rk11.displayDisk(iDrive); - }; - return true; - - case "loadDisk": - this.bindings[sBinding] = control; - - control.onclick = function onClickLoadDrive(event) { - var controlDisks = rk11.bindings["listDisks"]; - if (controlDisks && controlDisks.options) { - var sDiskName = controlDisks.options[controlDisks.selectedIndex].text; - var sDiskPath = controlDisks.value; - rk11.loadSelectedDrive(sDiskName, sDiskPath); - } - }; - return true; - - case "bootDisk": - this.bindings[sBinding] = control; - - control.onclick = function onClickBootDisk(event) { - rk11.bootSelectedDisk(); - }; - return true; - - case "saveDisk": - /* - * Yes, technically, this feature does not require "Local disk support" (which is really a reference - * to FileReader support), but since fLocalDisks is also false for all mobile devices, and since there - * is an "orthogonality" to disabling both features in tandem, let's just let it slide, OK? - */ - if (!this.fLocalDisks) { - if (DEBUG) this.log("Local disk support not available"); - /* - * We could also simply hide the control; eg: - * - * control.style.display = "none"; - * - * but removing the control altogether seems better. - */ - control.parentNode.removeChild(/** @type {Node} */ (control)); - return false; - } - - this.bindings[sBinding] = control; - - control.onclick = function onClickSaveDrive(event) { - var controlDrives = rk11.bindings["listDrives"]; - if (controlDrives && controlDrives.options && rk11.aDrives) { - var iDriveSelected = Str.parseInt(controlDrives.value, 10) || 0; - var drive = rk11.aDrives[iDriveSelected]; - if (drive) { - /* - * Note the similarity (and hence factoring opportunity) between this code and the HDC's "saveHD*" binding. - */ - var disk = drive.disk; - if (disk) { - if (DEBUG) rk11.println("saving disk " + disk.sDiskPath + "..."); - var sAlert = Web.downloadFile(disk.encodeAsBase64(), "octet-stream", true, disk.sDiskFile.replace(".json", ".img")); - Component.alertUser(sAlert); - } else { - rk11.notice("No disk loaded in drive."); - } - } else { - rk11.notice("No disk drive selected."); - } - } - }; - return true; - - case "mountDisk": - if (!this.fLocalDisks) { - if (DEBUG) this.log("Local disk support not available"); - /* - * We could also simply hide the control; eg: - * - * control.style.display = "none"; - * - * but removing the control altogether seems better. - */ - control.parentNode.removeChild(/** @type {Node} */ (control)); - return false; - } - - this.bindings[sBinding] = control; - - /* - * Enable "Mount" button only if a file is actually selected - */ - control.addEventListener('change', function() { - var fieldset = control.children[0]; - var files = fieldset.children[0].files; - var submit = fieldset.children[1]; - submit.disabled = !files.length; - }); - - control.onsubmit = function(event) { - var file = event.currentTarget[1].files[0]; - if (file) { - var sDiskPath = file.name; - var sDiskName = Str.getBaseName(sDiskPath, true); - rk11.loadSelectedDrive(sDiskName, sDiskPath, file); - } - /* - * Prevent reloading of web page after form submission - */ - return false; - }; - return true; - - default: - break; - } - return false; - } - - /** - * initBus(cmp, bus, cpu, dbg) - * - * @this {RK11} - * @param {ComputerPDP11} cmp - * @param {BusPDP11} bus - * @param {CPUStatePDP11} cpu - * @param {DebuggerPDP11} dbg - */ - initBus(cmp, bus, cpu, dbg) - { - this.cmp = cmp; - this.bus = bus; - this.cpu = cpu; - this.dbg = dbg; - - var configMount = this.parseConfig(this.cmp.getMachineParm('autoMount')); - - /* - * Add only drives from the machine-wide autoMount configuration that match drives managed by this component. - */ - if (configMount) { - for (var sDrive in configMount) { - if (sDrive.substr(0, 2) != this.type.substr(0, 2)) continue; - this.configMount[sDrive] = configMount[sDrive]; - } + if (!aRegs) { + aRegs = [(RK11.RKDS.RK05 | RK11.RKDS.SOK | RK11.RKDS.RRDY), 0, (RK11.RKCS.CRDY), 0, 0, 0, 0]; } /* - * If we didn't need auto-mount support, we could defer controller initialization until we received - * a powerUp() notification, at which point reset() would call initController(), or restore() would restore - * the controller; in that case, all we'd need to do here is call setReady(). - */ - this.initController(); - - this.irq = this.cpu.addIRQ(RK11.VEC, RK11.PRI, MessagesPDP11.RK11); - - bus.addIOTable(this, RK11.UNIBUS_IOTABLE); - bus.addResetHandler(this.reset.bind(this)); - - this.addDisk("None", RK11.SOURCE.NONE, true); - if (this.fLocalDisks) this.addDisk("Local Disk", RK11.SOURCE.LOCAL); - this.addDisk("Remote Disk", RK11.SOURCE.REMOTE); - - if (!this.autoMount()) this.setReady(); - } - - /** - * getDriveName(iDrive) - * - * @this {RK11} - * @param {number} iDrive - * @return {string} - */ - getDriveName(iDrive) - { - return "RK" + iDrive; - } - - /** - * getDriveNumber(sDrive) - * - * @this {RK11} - * @param {string} sDrive - * @return {number} (0-3, or -1 if error) - */ - getDriveNumber(sDrive) - { - var iDrive = -1; - if (sDrive) { - iDrive = sDrive.charCodeAt(sDrive.length - 1) - 0x30; - if (iDrive < 0 || iDrive > 9) iDrive = -1; - } - return iDrive; - } - - /** - * powerUp(data, fRepower) - * - * @this {RK11} - * @param {Object|null} data - * @param {boolean} [fRepower] - * @return {boolean} true if successful, false if failure - */ - powerUp(data, fRepower) - { - if (!fRepower) { - if (!data) { - this.reset(); - if (this.cmp.fReload) { - /* - * If the computer's fReload flag is set, we're required to toss all currently - * loaded disks and remount all disks specified in the auto-mount configuration. - */ - this.unloadAllDrives(true); - this.autoMount(true); - } - } else { - if (!this.restore(data)) return false; - } - /* - * Populate the HTML controls to match the actual (well, um, specified) number of floppy drives. - */ - var controlDrives; - if ((controlDrives = this.bindings['listDrives'])) { - while (controlDrives.firstChild) { - controlDrives.removeChild(controlDrives.firstChild); - } - controlDrives.value = ""; - for (var iDrive = 0; iDrive < this.nDrives; iDrive++) { - var controlOption = document.createElement("option"); - controlOption.value = iDrive; - controlOption.text = this.getDriveName(iDrive); - controlDrives.appendChild(controlOption); - } - if (this.nDrives > 0) { - controlDrives.value = "0"; - this.displayDisk(0); - } - } - } - return true; - } - - /** - * powerDown(fSave, fShutdown) - * - * @this {RK11} - * @param {boolean} [fSave] - * @param {boolean} [fShutdown] - * @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure - */ - powerDown(fSave, fShutdown) - { - return fSave? this.save() : true; - } - - /** - * reset() - * - * @this {RK11} - */ - reset() - { - this.initController(); - } - - /** - * save() - * - * This implements save support for the RK11 component. - * - * @this {RK11} - * @return {Object} - */ - save() - { - var state = new State(this); - state.set(0, this.saveController()); - return state.data(); - } - - /** - * restore(data) - * - * This implements restore support for the RK11 component. - * - * @this {RK11} - * @param {Object} data - * @return {boolean} true if successful, false if failure - */ - restore(data) - { - return this.initController(data[0]); - } - - /** - * initController(a) - * - * @this {RK11} - * @param {Array} [a] - * @return {boolean} true if successful, false if failure - */ - initController(a) - { - var fSuccess = true; - - if (!a) { - a = [(RK11.RKDS.RK05 | RK11.RKDS.SOK | RK11.RKDS.RRDY), 0, (RK11.RKCS.CRDY), 0, 0, 0, 0]; - } - - /* - * ES6 ALERT: Love these destructuring assignments, which make it easy to perform the - * inverse of what save() does when it collects a bunch of object properties into an array. + * ES6 ALERT: A handy destructuring assignment, which makes it easy to perform the inverse + * of what saveController() does when it collects a bunch of object properties into an array. */ [ this.regRKDS, @@ -495,26 +94,9 @@ class RK11 extends Component { this.regRKBA, this.regRKDA, this.regRKDB - ] = a; + ] = aRegs; - /* - * Initialize the disk history (if available) before initializing the drives, so that any disk deltas can be - * applied to disk images that are already loaded. - */ - if (a[7]) { - this.aDiskHistory = a[7]; - } - - for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { - var drive = this.aDrives[iDrive]; - if (drive === undefined) { - drive = this.aDrives[iDrive] = {}; - } - if (!this.initDrive(drive, iDrive)) { - fSuccess = false; - } - } - return fSuccess; + return super.initController(aRegs, aHistory); } /** @@ -534,547 +116,10 @@ class RK11 extends Component { this.regRKWC, this.regRKBA, this.regRKDA, - this.regRKDB, - this.saveDeltas() + this.regRKDB ]; } - /** - * saveDeltas() - * - * This returns an array of entries, one for each disk image we've ever mounted, including any deltas; ie: - * - * [name, path, deltas] - * - * aDiskHistory contains exactly that, except that deltas may not be up-to-date for any currently mounted - * disk image(s), so we call updateHistory() for all those disks, and then aDiskHistory is ready to be saved. - * - * @this {RK11} - * @return {Array} - */ - saveDeltas() - { - for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { - var drive = this.aDrives[iDrive]; - if (drive.disk) { - this.updateDiskHistory(drive.sDiskName, drive.sDiskPath, drive.disk); - } - } - return this.aDiskHistory; - } - - /** - * initDrive(drive, iDrive, data) - * - * TODO: Consider a separate Drive class that any drive controller can use, since there's a lot of commonality - * between the drive objects created by disk controllers. This will clean up overall drive management and allow - * us to factor out some common Drive methods. - * - * Also, either use or eliminate the data parameter; if there are no drive properties that need to be preserved - * across save/restore, then eliminate it. - * - * @this {RK11} - * @param {Object} drive - * @param {number} iDrive - * @param {Array|undefined} [data] - * @return {boolean} true if successful, false if failure - */ - initDrive(drive, iDrive, data) - { - var i = 0; - var fSuccess = true; - - drive.iDrive = iDrive; - drive.name = this.idComponent; - drive.fBusy = drive.fLocal = false; - - /* - * NOTE: We initialize the following drive properties to their MAXIMUMs; disks may have - * these or SMALLER values (subject to the limits of what the controller supports, of course). - */ - drive.nCylinders = 203; - drive.nHeads = 2; - drive.nSectors = 12; - drive.cbSector = 512; - drive.fRemovable = true; - - /* - * The next group of properties are set by various controller command sequences. - */ - drive.bHead = 0; - drive.bCylinder = 0; - drive.bSector = 1; - drive.bSectorEnd = drive.nSectors; // aka EOT - drive.nBytes = drive.cbSector; - - /* - * The next group of properties are managed by worker functions (eg, doRead()) to maintain state across DMA requests. - */ - drive.ibSector = 0; - drive.sector = null; - - if (!drive.disk) drive.sDiskPath = ""; // ensure this is initialized to a default that displayDisk() can deal with - - drive.status = RK11.RKDS.RK05 | RK11.RKDS.SOK | RK11.RKDS.RRDY; - - return fSuccess; - } - - /** - * autoMount(fRemount) - * - * @this {RK11} - * @param {boolean} [fRemount] is true if we're remounting all auto-mounted disks - * @return {boolean} true if one or more disk images are being auto-mounted, false if none - */ - autoMount(fRemount) - { - if (!fRemount) this.cAutoMount = 0; - for (var sDrive in this.configMount) { - var configDrive = this.configMount[sDrive]; - var sDiskPath = configDrive['path'] || ""; - var sDiskName = configDrive['name'] || this.findDisk(sDiskPath); - if (sDiskPath && sDiskName) { - var iDrive = this.getDriveNumber(sDrive); - if (iDrive >= 0 && iDrive < this.aDrives.length) { - if (!this.loadDrive(iDrive, sDiskName, sDiskPath, true) && fRemount) { - this.setReady(false); - } - continue; - } - } - this.notice("Incorrect auto-mount settings for drive " + sDrive + " (" + JSON.stringify(configDrive) + ")"); - } - return !!this.cAutoMount; - } - - /** - * loadSelectedDrive(sDiskName, sDiskPath, file) - * - * @this {RK11} - * @param {string} sDiskName - * @param {string} sDiskPath - * @param {File} [file] is set if there's an associated File object - */ - loadSelectedDrive(sDiskName, sDiskPath, file) - { - var controlDrives = this.bindings["listDrives"]; - var iDrive = controlDrives && Str.parseInt(controlDrives.value, 10); - - if (iDrive === undefined || iDrive < 0 || iDrive >= this.aDrives.length) { - this.notice("Unable to load the selected drive"); - return; - } - - if (!sDiskPath) { - this.unloadDrive(iDrive); - return; - } - - if (sDiskPath == RK11.SOURCE.LOCAL) { - this.notice('Use "Choose File" and "Mount" to select and load a local disk.'); - return; - } - - /* - * If the special RK11.SOURCE.REMOTE path is selected, then we want to prompt the user for a URL. - * Oh, and make sure we pass an empty string as the 2nd parameter to prompt(), so that IE won't display - * "undefined" -- because after all, undefined and "undefined" are EXACTLY the same thing, right? - * - * TODO: This is literally all I've done to support remote disk images. There's probably more - * I should do, like dynamically updating "listDisks" to include new entries, and adding new entries - * to the save/restore data. - */ - if (sDiskPath == RK11.SOURCE.REMOTE) { - sDiskPath = window.prompt("Enter the URL of a remote disk image.", "") || ""; - if (!sDiskPath) return; - sDiskName = Str.getBaseName(sDiskPath); - this.status("Attempting to load " + sDiskPath + " as \"" + sDiskName + "\""); - this.sDiskSource = RK11.SOURCE.REMOTE; - } - else { - this.sDiskSource = sDiskPath; - } - - this.loadDrive(iDrive, sDiskName, sDiskPath, false, file); - } - - /** - * bootSelectedDisk() - * - * @this {RK11} - */ - bootSelectedDisk() - { - var drive; - var controlDrives = this.bindings["listDrives"]; - var iDrive = controlDrives && Str.parseInt(controlDrives.value, 10); - - if (iDrive == null || iDrive < 0 || iDrive >= this.aDrives.length || !(drive = this.aDrives[iDrive])) { - this.notice("Unable to boot the selected drive"); - return; - } - if (!drive.disk) { - this.notice("Load a disk into the drive first"); - return; - } - /* - * NOTE: We're calling setReset() BEFORE reading the boot code in order to eliminate any side-effects - * of the previous state of either the controller OR the CPU; for example, we don't want any previous MMU - * or UNIBUS Map registers affecting the simulated readData() call. Also, some boot code (eg, RSTS/E) - * expects the controller to be in a READY state; since setReset() triggers a call to our reset() handler, - * a READY state is assured, and the readData() call shouldn't do anything to change that. - */ - this.cpu.setReset(0, true); - var err = this.readData(drive, 0, 0, 0, 512, 0x0000, 2); - if (err) { - this.notice("Unable to read the boot sector (" + err + ")"); - } - } - - /** - * loadDrive(iDrive, sDiskName, sDiskPath, fAutoMount, file) - * - * NOTE: If sDiskPath is already loaded, nothing needs to be done. - * - * @this {RK11} - * @param {number} iDrive - * @param {string} sDiskName - * @param {string} sDiskPath - * @param {boolean} [fAutoMount] - * @param {File} [file] is set if there's an associated File object - * @return {number} 1 if disk loaded, 0 if queued up (or busy), -1 if already loaded - */ - loadDrive(iDrive, sDiskName, sDiskPath, fAutoMount, file) - { - var nResult = -1; - var drive = this.aDrives[iDrive]; - - if (drive.sDiskPath.toLowerCase() != sDiskPath.toLowerCase()) { - - nResult++; - this.unloadDrive(iDrive, true); - - if (drive.fBusy) { - this.notice("RK11 busy"); - } - else { - // this.status("disk queued: " + sDiskName); - drive.fBusy = true; - if (fAutoMount) { - drive.fAutoMount = true; - this.cAutoMount++; - if (this.messageEnabled()) this.printMessage("auto-loading disk: " + sDiskName); - } - drive.fLocal = !!file; - var disk = new DiskPDP11(this, drive, DiskAPI.MODE.PRELOAD); - if (disk.load(sDiskName, sDiskPath, file, this.finishLoadDrive)) { - nResult++; - } - } - } - return nResult; - } - - /** - * finishLoadDrive(drive, disk, sDiskName, sDiskPath, fAutoMount) - * - * The disk parameter is set if the disk was successfully loaded, null if not. - * - * @this {RK11} - * @param {Object} drive - * @param {DiskPDP11} disk - * @param {string} sDiskName - * @param {string} sDiskPath - * @param {boolean} [fAutoMount] - */ - finishLoadDrive(drive, disk, sDiskName, sDiskPath, fAutoMount) - { - drive.fBusy = false; - - if (disk) { - /* - * TODO: While this is a perfectly reasonable thing to do, one wonders if the Disk object shouldn't - * have done this itself, since we passed our Drive object to it (it already knows the drive's limits). - */ - if (disk.nCylinders > drive.nCylinders || disk.nHeads > drive.nHeads /* || disk.nSectors > drive.nSectors */) { - this.notice("Disk \"" + sDiskName + "\" too large for drive " + this.getDriveName(drive.iDrive)); - disk = null; - } - } - - if (disk) { - drive.disk = disk; - drive.sDiskName = sDiskName; - drive.sDiskPath = sDiskPath; - - /* - * Adding local disk image names to the disk list seems like a nice idea, but it's too confusing, - * because then it looks like the "Mount" button should be able to (re)load them, and that can NEVER - * happen, for security reasons; local disk images can ONLY be loaded via the "Mount" button after - * the user has selected them via the "Choose File" button. - * - * this.addDisk(sDiskName, sDiskPath); - * - * So we're going to take a different approach: when displayDisk() is asked to display the name - * of a local disk image, it will map all such disks to "Local Disk", and any attempt to "Mount" such - * a disk, will essentially result in a "Disk not found" error. - */ - this.addDiskHistory(sDiskName, sDiskPath, disk); - - /* - * With the addition of notify(), users are now "alerted" whenever a disk has finished loading; - * notify() is selective about its output, using print() if a print window is open, alert() otherwise. - */ - this.notice("Loaded disk \"" + sDiskName + "\" in drive " + this.getDriveName(drive.iDrive), drive.fAutoMount || fAutoMount); - - /* - * Since you usually want the Computer to have focus again after loading a new disk, let's try automatically - * updating the focus after a successful load. - */ - if (this.cmp) this.cmp.setFocus(); - } - else { - drive.fLocal = false; - } - - if (drive.fAutoMount) { - drive.fAutoMount = false; - if (!--this.cAutoMount) this.setReady(); - } - - this.displayDisk(drive.iDrive); - } - - /** - * addDisk(sName, sPath, fTop) - * - * @this {RK11} - * @param {string} sName - * @param {string} sPath - * @param {boolean} [fTop] (default is bottom) - */ - addDisk(sName, sPath, fTop) - { - var controlDisks = this.bindings["listDisks"]; - if (controlDisks && controlDisks.options) { - for (var i = 0; i < controlDisks.options.length; i++) { - if (controlDisks.options[i].value == sPath) return; - } - var controlOption = document.createElement("option"); - controlOption.text = sName; - controlOption.value = sPath; - if (fTop && controlDisks.childNodes[0]) { - controlDisks.insertBefore(controlOption, controlDisks.childNodes[0]); - } else { - controlDisks.appendChild(controlOption); - } - } - } - - /** - * findDisk(sPath) - * - * This is used to deal with mount requests (eg, autoMount) that supply a path without a name; - * if we can find the path in the "listDisks" control, then we return the associated disk name. - * - * @this {RK11} - * @param {string} sPath - * @return {string|null} - */ - findDisk(sPath) - { - var controlDisks = this.bindings["listDisks"]; - if (controlDisks && controlDisks.options) { - for (var i = 0; i < controlDisks.options.length; i++) { - var control = controlDisks.options[i]; - if (control.value == sPath) return control.text; - } - } - return Str.getBaseName(sPath, true); - } - - /** - * displayDisk(iDrive, fUpdateDrive) - * - * @this {RK11} - * @param {number} iDrive (unvalidated) - * @param {boolean} [fUpdateDrive] is true to update the drive list to match the specified drive (eg, the auto-mount case) - */ - displayDisk(iDrive, fUpdateDrive) - { - /* - * First things first: validate iDrive. - */ - if (iDrive >= 0 && iDrive < this.aDrives.length) { - var drive = this.aDrives[iDrive]; - var controlDisks = this.bindings["listDisks"]; - var controlDrives = this.bindings["listDrives"]; - /* - * Next, make sure controls for both drives and disks exist. - */ - if (controlDisks && controlDrives && controlDisks.options && controlDrives.options) { - /* - * Next, make sure the drive whose disk we're updating is the currently selected drive. - */ - var i; - var iDriveSelected = Str.parseInt(controlDrives.value, 10); - var sTargetPath = (drive.fLocal? RK11.SOURCE.LOCAL : drive.sDiskPath); - if (!isNaN(iDriveSelected) && iDriveSelected == iDrive) { - for (i = 0; i < controlDisks.options.length; i++) { - if (controlDisks.options[i].value == sTargetPath) { - if (controlDisks.selectedIndex != i) { - controlDisks.selectedIndex = i; - } - break; - } - } - if (i == controlDisks.options.length) controlDisks.selectedIndex = 0; - } - if (fUpdateDrive) { - for (i = 0; i < controlDrives.options.length; i++) { - if (Str.parseInt(controlDrives.options[i].value, 10) == drive.iDrive) { - if (controlDrives.selectedIndex != i) { - controlDrives.selectedIndex = i; - } - break; - } - } - } - } - } - } - - /** - * unloadDrive(iDrive, fLoading) - * - * @this {RK11} - * @param {number} iDrive - * @param {boolean} [fLoading] - */ - unloadDrive(iDrive, fLoading) - { - var drive = this.aDrives[iDrive]; - - if (drive.disk || fLoading === false) { - - /* - * Before we toss the disk's information, capture any deltas that may have occurred. - */ - this.updateDiskHistory(drive.sDiskName, drive.sDiskPath, drive.disk); - - drive.sDiskName = ""; - drive.sDiskPath = ""; - drive.disk = null; - drive.fLocal = false; - - // this.regInput |= FDC.REG_INPUT.DISK_CHANGE; - - if (!fLoading) { - this.notice("Drive " + this.getDriveName(iDrive) + " unloaded", fLoading); - this.sDiskSource = RK11.SOURCE.NONE; - this.displayDisk(iDrive); - } - } - } - - /** - * unloadAllDrives(fDiscard) - * - * @this {RK11} - * @param {boolean} fDiscard to discard all disk history before unloading - */ - unloadAllDrives(fDiscard) - { - if (fDiscard) this.aDiskHistory = []; - - for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { - this.unloadDrive(iDrive, true); - } - } - - /** - * addDiskHistory(sDiskName, sDiskPath, disk) - * - * @this {RK11} - * @param {string} sDiskName - * @param {string} sDiskPath - * @param {DiskPDP11} disk containing corresponding disk image - */ - addDiskHistory(sDiskName, sDiskPath, disk) - { - var i; - this.assert(!!sDiskPath); - for (i = 0; i < this.aDiskHistory.length; i++) { - if (this.aDiskHistory[i][1] == sDiskPath) { - var nChanges = disk.restore(this.aDiskHistory[i][2]); - if (DEBUG && this.messageEnabled()) { - this.printMessage("disk '" + sDiskName + "' restored from history (" + nChanges + " changes)"); - } - return; - } - } - if (DEBUG && this.messageEnabled()) { - this.printMessage("disk '" + sDiskName + "' added to history (nothing to restore)"); - } - this.aDiskHistory[i] = [sDiskName, sDiskPath, []]; - } - - /** - * removeDiskHistory(sDiskName, sDiskPath) - * - * @this {RK11} - * @param {string} sDiskName - * @param {string} sDiskPath - */ - removeDiskHistory(sDiskName, sDiskPath) - { - var i; - for (i = 0; i < this.aDiskHistory.length; i++) { - if (this.aDiskHistory[i][1] == sDiskPath) { - this.aDiskHistory.splice(i, 1); - if (DEBUG && this.messageEnabled()) { - this.printMessage("disk '" + sDiskName + "' removed from history"); - } - return; - } - } - if (DEBUG && this.messageEnabled()) { - this.printMessage("unable to remove disk '" + sDiskName + "' from history (" + sDiskPath + ")"); - } - } - - /** - * updateDiskHistory(sDiskName, sDiskPath, disk) - * - * @this {RK11} - * @param {string} sDiskName - * @param {string} sDiskPath - * @param {DiskPDP11} disk containing corresponding disk image, with possible deltas - */ - updateDiskHistory(sDiskName, sDiskPath, disk) - { - var i; - for (i = 0; i < this.aDiskHistory.length; i++) { - if (this.aDiskHistory[i][1] == sDiskPath) { - this.aDiskHistory[i][2] = disk.save(); - if (DEBUG && this.messageEnabled()) { - this.printMessage("disk '" + sDiskName + "' updated in history"); - } - return; - } - } - /* - * I used to report this as an error (at least in the DEBUG release), but it's no longer really - * an error, because if we're trying to re-mount a clean copy of a disk, we toss its history, then - * unload, and then reload/remount. And since unloadDrive's normal behavior is to call updateDiskHistory() - * before unloading, the fact that the disk is no longer listed here can't be treated as an error. - */ - if (DEBUG && this.messageEnabled()) { - this.printMessage("unable to update disk '" + sDiskName + "' in history (" + sDiskPath + ")"); - } - } - /** * processCommand() * @@ -1554,20 +599,9 @@ class RK11 extends Component { } } -/* - * There's nothing super special about these values, except that NONE should be falsey and the others should not. - */ -RK11.SOURCE = { - NONE: "", - LOCAL: "?", - REMOTE: "??" -}; - /* * Alias RK11 definitions as class constants */ -RK11.PRI = PDP11.RK11.PRI; -RK11.VEC = PDP11.RK11.VEC; RK11.RKDS = PDP11.RK11.RKDS; // 177400: Drive Status Register RK11.RKER = PDP11.RK11.RKER; // 177402: Error Register RK11.RKCS = PDP11.RK11.RKCS; // 177404: Control Status Register diff --git a/modules/pdp11/lib/rl11.js b/modules/pdp11/lib/rl11.js index d2369c8be..20d9412d9 100644 --- a/modules/pdp11/lib/rl11.js +++ b/modules/pdp11/lib/rl11.js @@ -89,7 +89,7 @@ class RL11 extends Component { */ constructor(parms) { - super("RL11", parms, RL11, MessagesPDP11.RL11); + super("RL11", parms, MessagesPDP11.RL11); /* * We preliminarily parse and record any 'autoMount' object now, but we no longer process it diff --git a/modules/pdp11/lib/rom.js b/modules/pdp11/lib/rom.js index cb334145b..09dc55ca5 100644 --- a/modules/pdp11/lib/rom.js +++ b/modules/pdp11/lib/rom.js @@ -60,7 +60,7 @@ class ROMPDP11 extends Component { */ constructor(parmsROM) { - super("ROM", parmsROM, ROMPDP11, MessagesPDP11.ROM); + super("ROM", parmsROM, MessagesPDP11.ROM); this.abInit = null; this.aSymbols = null; diff --git a/modules/pdp11/lib/serial.js b/modules/pdp11/lib/serial.js index 3a0e462d5..0db11f202 100644 --- a/modules/pdp11/lib/serial.js +++ b/modules/pdp11/lib/serial.js @@ -100,7 +100,7 @@ class SerialPortPDP11 extends Component { */ constructor(parmsSerial) { - super("SerialPort", parmsSerial, SerialPortPDP11, MessagesPDP11.SERIAL); + super("SerialPort", parmsSerial, MessagesPDP11.SERIAL); this.iAdapter = +parmsSerial['adapter']; this.nBaudReceive = +parmsSerial['baudReceive'] || PDP11.DL11.RCSR.BAUD; @@ -498,8 +498,8 @@ class SerialPortPDP11 extends Component { } /* - * ES6 ALERT: Love these destructuring assignments, which make it easy to perform the - * inverse of what save() does when it collects a bunch of object properties into an array. + * ES6 ALERT: A handy destructuring assignment, which makes it easy to perform the inverse + * of what saveRegisters() does when it collects a bunch of object properties into an array. */ [ this.regRBUF, diff --git a/modules/shared/es6/component.js b/modules/shared/es6/component.js index d98e423de..58bafd9ff 100644 --- a/modules/shared/es6/component.js +++ b/modules/shared/es6/component.js @@ -76,7 +76,7 @@ */ class Component { /** - * Component(type, parms, constructor, bitsMessage) + * Component(type, parms, bitsMessage) * * A Component object requires: * @@ -88,14 +88,13 @@ class Component { * name: component name (default is ""; if blank, toString() will use the type name only) * comment: component comment string (default is undefined) * - * Subclasses that use Component.subclass() to extend Component will likely have additional (parms) properties. + * Component subclasses will usually have additional (parms) properties. * * @param {string} type * @param {Object} [parms] - * @param {Object} [constructor] * @param {number} [bitsMessage] selects message(s) that the component wants to enable (default is 0) */ - constructor(type, parms, constructor, bitsMessage) + constructor(type, parms, bitsMessage) { this.type = type; @@ -153,8 +152,8 @@ class Component { /* * TODO: Consider adding another parameter to the Component() constructor that allows components to tell * us if they support single or multiple instances per machine. For example, there can be multiple SerialPort - * components per machine, but only one CPU component (well, OK, an FPU is also supported, but that's considered - * a different component). + * components per machine, but only one CPU component (some machines also support an FPU, but that component + * is considered separate from the CPU). * * It's not critical, but it would help catch machine configuration errors; for example, a machine that mistakenly * includes two CPU components may, aside from wasting memory, end up with odd side-effects, like unresponsive diff --git a/modules/shared/es6/debugger.js b/modules/shared/es6/debugger.js index ddad4d44f..ef74a9ad3 100644 --- a/modules/shared/es6/debugger.js +++ b/modules/shared/es6/debugger.js @@ -48,7 +48,7 @@ if (NODE) { * fTemporary:(boolean|undefined), * sCmd:(string|undefined), * aCmds:(Array.|undefined) - * }} DbgAddr + * }} */ var DbgAddr; @@ -94,7 +94,7 @@ class Debugger extends Component { constructor(parmsDbg) { if (DEBUGGER) { - super("Debugger", parmsDbg, Debugger); + super("Debugger", parmsDbg); /* * Default base used to display all values; modified with the "s base" command. diff --git a/package.json b/package.json index 4b0f4aa24..e9f0d1555 100644 --- a/package.json +++ b/package.json @@ -200,6 +200,7 @@ "./modules/pdp11/lib/serial.js", "./modules/pdp11/lib/pc11.js", "./modules/pdp11/lib/disk.js", + "./modules/pdp11/lib/drive.js", "./modules/pdp11/lib/rk11.js", "./modules/pdp11/lib/rl11.js", "./modules/shared/es6/debugger.js", diff --git a/versions/pc8080/1.32.2/pc8080-dbg.js b/versions/pc8080/1.32.2/pc8080-dbg.js index 49d35e9d1..ae5043974 100644 --- a/versions/pc8080/1.32.2/pc8080-dbg.js +++ b/versions/pc8080/1.32.2/pc8080-dbg.js @@ -32,7 +32,7 @@ var k;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]} var m={le:0,oe:1,pe:2,qe:3,re:4,se:5,te:6,ue:7,ve:8,we:9,xe:10,ye:11,ze:12,Ae:13,Be:14,Ce:15,De:16,Ee:17,Fe:18,Ge:19,He:20,Ie:21,Je:22,Ke:23,Le:24,Me:25,Ne:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,pb:65,rc:66,tc:67,Rb:68,E:69,xc:70,yc:71,zc:72,Ac:73,Hc:74,Ic:75,Ub:76,Pc:77,Qc:78,Sc:79,Tc:80,Q:81,Zc:82,bd:83,hd:84,jd:85,kd:86,ld:87, nd:88,od:89,Db:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,pd:97,wf:98,xf:99,d:100,e:101,yf:102,zf:103,Af:104,Bf:105,Cf:106,k:107,Df:108,Ef:109,n:110,Ff:111,p:112,q:113,r:114,Gf:115,t:116,If:117,Jf:118,Kf:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Oe:127}; -function n(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.bc=b.comment;this.wd=b;this.exports={};this.P=this.bindings={};a=this.id.indexOf(".");0>a?this.$a=this.id:(this.ab=this.id.substr(0,a),this.$a=this.id.substr(a+1));this.G={ready:!1,jb:!1,Eb:!1,ja:!1,error:!1};this.vb=null;this.G.error=!1;this.ha=d||0;this.K=this.u=this.H=this.S=this.ta=null;ca.push(this)}function da(a,b,c){ea[a]&&b&&(ea[a][b]=c)}function fa(){return Date.now()||+new Date} +function n(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.bc=b.comment;this.wd=b;this.exports={};this.P=this.bindings={};a=this.id.indexOf(".");0>a?this.$a=this.id:(this.ab=this.id.substr(0,a),this.$a=this.id.substr(a+1));this.G={ready:!1,jb:!1,Eb:!1,ja:!1,error:!1};this.vb=null;this.G.error=!1;this.ha=c||0;this.K=this.u=this.H=this.S=this.ta=null;ca.push(this)}function da(a,b,c){ea[a]&&b&&(ea[a][b]=c)}function fa(){return Date.now()||+new Date} function ga(a,b,c){b||q((c?c+": ":"")+a)}function q(a){window&&window.alert(a)}function ha(a){var b=!1;window&&(b=window.confirm(a));return b}function ja(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Ca=!0};k.Vd=function(a,b){if(this.K&&null!=this.J){var c=this.K;sc(c,this.J+a,1,c.I)&&c.da(!0)}return this.lb(a,b)};k.Zd=function(a,b){if(this.K&&null!=this.J){var c=this.K;sc(c,this.J+a,2,c.I)&&c.da(!0)}return this.Jb(a,b)}; k.de=function(a,b,c){if(this.K&&null!=this.J){var d=this.K;sc(d,this.J+a,1,d.w)&&d.da(!0)}this.u?this.ob(0,b):this.nb(a,b,c)};k.he=function(a,b,c){if(this.K&&null!=this.J){var d=this.K;sc(d,this.J+a,2,d.w)&&d.da(!0)}this.u?this.ob(0,b):this.Ob(a,b,c)};k.Ud=function(a){return this.g[a]};k.Wd=function(a){return this.g[a]};k.Yd=function(a){return this.w.getUint16(a,!0)};k.$d=function(a){return a&1?this.g[a]|this.g[a+1]<<8:this.A[a>>1]};k.ce=function(a,b){this.g[a]=b;this.Ca=!0}; k.ee=function(a,b){this.g[a]=b;this.Ca=!0};k.ge=function(a,b){this.w.setUint16(a,b,!0);this.Ca=!0};k.ie=function(a,b){a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.A[a>>1]=b;this.Ca=!0};var Yb=0,Zb=2,Cb=["NONE","RAM","ROM","VID","H/W"],Xb=0,ec=[],cc=[z.prototype.Xd,z.prototype.fe,z.prototype.ae,z.prototype.je],hc=[z.prototype.Vd,z.prototype.de,z.prototype.Zd,z.prototype.he];if(qb)var bc=[z.prototype.Ud,z.prototype.ce,z.prototype.Yd,z.prototype.ge],ac=[z.prototype.Wd,z.prototype.ee,z.prototype.$d,z.prototype.ie]; -function tc(a,b){n.call(this,"CPU",a,0,1);var c=a.multiplier||1;this.Fa=a.cycles||b;this.U=c;this.Sa=Math.round(this.Fa/1E4)/100;this.Z=this.Sa*this.U;this.G.ka=!1;this.G.Mb=!1;this.G.ib=a.autoStart;this.G.ec=!1;this.G.Va=!1;this.ya=this.oa=0;this.za=a.csStart;this.na=a.csInterval;this.sa=a.csStop;this.T=[];this.zb=this.qb.bind(this);sa(this)}ba(tc,n);k=tc.prototype; +function tc(a,b){n.call(this,"CPU",a,1);var c=a.multiplier||1;this.Fa=a.cycles||b;this.U=c;this.Sa=Math.round(this.Fa/1E4)/100;this.Z=this.Sa*this.U;this.G.ka=!1;this.G.Mb=!1;this.G.ib=a.autoStart;this.G.ec=!1;this.G.Va=!1;this.ya=this.oa=0;this.za=a.csStart;this.na=a.csInterval;this.sa=a.csStop;this.T=[];this.zb=this.qb.bind(this);sa(this)}ba(tc,n);k=tc.prototype; k.Ea=function(a,b,c,d){this.S=a;this.H=b;this.K=d;for(b=0;b=a.oa&&(a.oa+=a.na,c=!0);0<=a.sa&&a.sa<=Cc(a)&&(a.na=a.sa=-1,xc(a),a.da(),c=!0);c&&a.i(Cc(a)+" cycles: checksum="+x(a.ya))}} @@ -118,7 +118,7 @@ md(this)||C(this,a);this.b-=10},function(){var a=G(this);Sb(this.H,a,this.g,this 11},function(){I(this,D(this));this.b-=11},function(){this.g=ud(this,G(this));this.b-=7},function(){I(this,this.j);C(this,32);this.b-=11},function(){od(this)&&(C(this,Bd(this)),this.b-=6);this.b-=5},function(){C(this,D(this));this.b-=5},function(){var a=H(this);od(this)&&C(this,a);this.b-=10},function(){var a=D(this);ld(this,jd(this));kd(this,a);this.b-=5},function(){var a=H(this);od(this)&&(I(this,this.j),C(this,a),this.b-=6);this.b-=11},Jd,function(){this.g=zd(this,G(this));this.b-=7},function(){I(this, this.j);C(this,40);this.b-=11},function(){rd(this)||(C(this,Bd(this)),this.b-=6);this.b-=5},function(){var a=Bd(this);Sc(this,a&255|this.N&-256);this.g=a>>8;this.b-=10},function(){var a=H(this);rd(this)||C(this,a);this.b-=10},function(){this.N&=-513;this.b-=4},function(){var a=H(this);rd(this)||(I(this,this.j),C(this,a),this.b-=6);this.b-=11},function(){I(this,Uc(this)&255|this.g<<8);this.b-=11},function(){this.g=xd(this,G(this));this.b-=7},function(){I(this,this.j);C(this,48);this.b-=11},function(){rd(this)&& (C(this,Bd(this)),this.b-=6);this.b-=5},function(){this.M=D(this)&65535;this.b-=5},function(){var a=H(this);rd(this)&&C(this,a);this.b-=10},function(){this.N|=512;this.b-=4;Cd(this)},function(){var a=H(this);rd(this)&&(I(this,this.j),C(this,a),this.b-=6);this.b-=11},Jd,function(){E(this,G(this));this.b-=7},function(){I(this,this.j);C(this,56);this.b-=11}]; -function Kd(a){n.call(this,"ChipSet",a,0,32768);var b=a.model;b&&!Ld[b]&&ga("Unrecognized ChipSet model: "+b);this.g=Ld[b]||{};a.sound&&(this.U=null,window&&(this.U=window.AudioContext||window.webkitAudioContext),this.U&&new this.U);sa(this)}ba(Kd,n);k=Kd.prototype;k.ca=function(){return!1}; +function Kd(a){n.call(this,"ChipSet",a,32768);var b=a.model;b&&!Ld[b]&&ga("Unrecognized ChipSet model: "+b);this.g=Ld[b]||{};a.sound&&(this.U=null,window&&(this.U=window.AudioContext||window.webkitAudioContext),this.U&&new this.U);sa(this)}ba(Kd,n);k=Kd.prototype;k.ca=function(){return!1}; k.Ea=function(a,b,c,d){this.H=b;this.u=c;this.K=d;this.S=a;this.B=vb(a,"Keyboard");this.C=vb(a,"SerialPort");this.video=vb(a,"Video");Nb(b,this,this.g.xb);Rb(b,this,this.g.yb);if(d){var e=this;Md(d,16384,function(){for(var a="",b=0;b=m.pb&&a<=m.Db?d.j&(fe|ge)||(d.j|=ge,he(d,20,!0),De(d)):a>=m.pd&&a<=m.z&&d.j&ge&&(d.j&=~ge,he(d,20,!1),De(d));return!0},c.onpaste=function(a){a:{if(d.C&&d.C.Ra&&(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(), a=a.clipboardData||window.clipboardData)){Ee(d.C,a.getData("Text"));a=!1;break a}a=!0}return a},!0;default:if(this.b.Ta&&void 0!==this.b.Ta[b])return this.P[e]=c,c.onclick=function(a,b){return function(c){c.preventDefault&&c.preventDefault();he(a,b,!0,!0)}}(this,this.b.Ta[b]),!0}}return!1};k.Ea=function(a,b,c,d){this.S=a;this.u=c;this.K=d;var e=this;this.L=Ic(this.u,function(){Fe(e)});this.W=vb(a,"ChipSet");this.C=vb(a,"SerialPort");Nb(b,this,this.b.xb);Rb(b,this,this.b.yb)}; k.ua=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.wa=function(a){return a?this.save():!0};k.reset=function(){this.g=[];this.j=0;this.b.INIT&&!this.restore(this.b.INIT)&&this.aa("reset error")};k.save=function(){var a=new Vc(this);switch(this.b.pa){case M.pa:a.set(0,[this.D,this.B,this.A,this.F,-1])}return a.data()}; @@ -155,7 +155,7 @@ k.Td=function(a,b,c){v(this,a,b,c,"KBDUART.STATUS");this.D=b;this.A=!0;this.F=Cc var Ge={pa:1978.1,Cb:{},Pb:Te,bb:{},Ta:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},N={},M={pa:100,Cb:(N[8]=3,N[m.Tc]=5,N[m.Sc]=6,N[m.od]=7,N[m.hd]=8,N[m.ld]=9,N[m.Q]=10,N[39]=16,N[221]=20,N[219]=21,N[m.Ac]=22,N[m.jd]=23,N[m.Zc]=24,N[m.E]=25,N[49]=26,N[37]=32,N[40]=34,N[117]=35,N[19]=35,N[192]=36,N[189]=37,N[57]=38,N[55]=39,N[52]=40,N[51]=41,N[27]=42,N[38]=48,N[114]=49,N[112]=50,N[46]=51,N[187]=52,N[48]=53,N[56]=54,N[54]=55,N[53]=56,N[50]=57,N[9]=58,N[103]=64,N[115]=65,N[113]=66,N[96]=67,N[118]= 68,N[220]=69,N[m.Ub]=70,N[m.Ic]=71,N[m.yc]=72,N[m.xc]=73,N[m.pb]=74,N[104]=80,N[2013]=81,N[98]=82,N[97]=83,N[222]=85,N[186]=86,N[m.Hc]=87,N[m.zc]=88,N[m.Rb]=89,N[m.bd]=90,N[110]=96,N[116]=97,N[101]=98,N[100]=99,N[13]=100,N[190]=101,N[188]=102,N[m.Qc]=103,N[m.rc]=104,N[m.nd]=105,N[119]=106,N[105]=112,N[99]=113,N[102]=114,N[109]=115,N[191]=117,N[m.Pc]=118,N[m[" "]]=119,N[m.kd]=120,N[m.tc]=121,N[m.Db]=122,N[120]=123,N[17]=124,N[16]=125,N[20]=126,N),Pb:{},bb:{},Ta:{"num-comma":116,"break":117,"line-feed":118, "no-scroll":119,setup:120},qc:{qa:130,INIT:127},Ba:{qa:130,Nc:1,Mc:2,Lc:4,Kc:8,Oc:16,Wb:32,Vb:63,ed:64,me:128,INIT:0},Jc:127};M.bb={l4:M.Ba.Nc,l3:M.Ba.Mc,l2:M.Ba.Lc,l1:M.Ba.Kc,locked:M.Ba.Oc,local:M.Ba.Wb,online:~M.Ba.Wb,"caps-lock":ge};var de={SI1978:Ge,VT100:M};M.INIT=[[M.Ba.INIT,M.qc.INIT,!1,0,-1]];M.xb={130:ce.prototype.Fd};M.yb={130:ce.prototype.Td};hb(function(){for(var a=pa(document,"pc8080","keyboard"),b=0;bMissing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=Ua().indexOf("MSIE")&&(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.onresize());var f=+(d.aspect||cb("aspect"));f&&.3<=f&&3.33>=f&&(gb("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");bb("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new Ue(d,e,g,f,c);oa(d,c)}}); -function rf(a){n.call(this,"SerialPort",a,0,8388608);this.T=+a.adapter;switch(this.T){case 0:this.U=0;this.X=2;break;default:q("Unrecognized serial adapter #"+this.T);return}this.g=this.j=null;this.V=a.tabSize;this.R=a.charBOL;this.w=0;this.N=!1;this.D=!0;var b=a.binding;if("console"==b)this.j="";else{var c;a=sf;b&&(void 0===c&&(c="Panel"),(c=la(c,this.id))&&(b=c.P[b])&&this.ca(null,a,b))}this.A="";this.b=this.Ra=this.I=null;this.exports={connect:this.ic,receiveData:this.Kb,receiveStatus:this.be}} +function rf(a){n.call(this,"SerialPort",a,8388608);this.T=+a.adapter;switch(this.T){case 0:this.U=0;this.X=2;break;default:q("Unrecognized serial adapter #"+this.T);return}this.g=this.j=null;this.V=a.tabSize;this.R=a.charBOL;this.w=0;this.N=!1;this.D=!0;var b=a.binding;if("console"==b)this.j="";else{var c;a=sf;b&&(void 0===c&&(c="Panel"),(c=la(c,this.id))&&(b=c.P[b])&&this.ca(null,a,b))}this.A="";this.b=this.Ra=this.I=null;this.exports={connect:this.ic,receiveData:this.Kb,receiveStatus:this.be}} ba(rf,n);k=rf.prototype; k.ca=function(a,b,c,d){var e=this;switch(b){case sf:return this.P[b]=this.g=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64\nLicense: GPL version 3 or later ");for(b=0;b":62,"?":63,"@":64,Jc:65,qg:66,sg:67,Pg:68,E:69,Qg:70,Rg:71,Sg:72,Tg:73,Ug:74,Vg:75,Wg:76,Xg:77,Yg:78,Zg:79,$g:80,Q:81,ah:82,bh:83,dh:84,eh:85,fh:86,gh:87,hh:88,ih:89,Gd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,jh:97,kh:98,lh:99,d:100,e:101,mh:102,nh:103,oh:104,ph:105,sh:106,k:107,th:108,uh:109,n:110,vh:111,p:112,q:113,r:114,wh:115,t:116,yh:117,zh:118,Ah:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,xd:127};function q(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Sc=b.comment;this.Fd=b;this.exports={};this.C=this.bindings={};a=this.id.indexOf(".");0>a?this.mb=this.id:(this.nb=this.id.substr(0,a),this.mb=this.id.substr(a+1));this.A={ready:!1,fb:!1,Ac:!1,fa:!1,error:!1};this.hc=null;this.A.error=!1;this.ja=d||0;this.G=this.f=this.D=this.J=this.Pa=null;va.push(this)}function xa(a,b,c){ya[a]&&b&&(ya[a][b]=c)} -function za(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function Aa(a){var b=!1;window&&(b=window.confirm(a));return b}function Ba(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b":62,"?":63,"@":64,Zc:65,lh:66,nh:67,Lh:68,E:69,Qh:70,Sh:71,Th:72,Uh:73,Vh:74,Wh:75,Xh:76,Yh:77,Zh:78,$h:79,bi:80,Q:81,di:82,ei:83,ii:84,ki:85,li:86,mi:87,ri:88,si:89,Ae:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,ti:97,ui:98,vi:99,d:100,e:101,wi:102,xi:103,yi:104,zi:105,Ci:106,k:107,Di:108,Ei:109,n:110,Fi:111,p:112,q:113,r:114,Gi:115,t:116,Ii:117,Ji:118,Ki:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,Zd:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.pd=b.comment;this.we=b;this.exports={};this.C=this.bindings={};a=this.id.indexOf(".");0>a?this.nb=this.id:(this.ob=this.id.substr(0,a),this.nb=this.id.substr(a+1));this.A={ready:!1,gb:!1,Qc:!1,fa:!1,error:!1};this.rc=null;this.A.error=!1;this.ia=c||0;this.G=this.f=this.D=this.J=this.Pa=null;va.push(this)}function wa(a,b,c){xa[a]&&b&&(xa[a][b]=c)} +function ya(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function za(a){var b=!1;window&&(b=window.confirm(a));return b}function Ba(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=1,f--;return d}function H(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d} -function Pa(a){var b=2,c="";b?10=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function J(a){return I(a,4,!0)} -function Qa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Xa[a]})}function Ya(a,b){return(a+" ").slice(0,b)} -function Za(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Xa={"&":"&","<":"<",">":">",'"':""","'":"'"},$a={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; -function ab(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function cb(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, +function Oa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=1,f--;return d}function F(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d} +function Qa(a){var b=2,c="";b?10=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function Ra(a){return H(a,4,!0)} +function Sa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Wa[a]})}function Xa(a,b){return(a+" ").slice(0,b)} +function ab(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Wa={"&":"&","<":"<",">":">",'"':""","'":"'"},bb={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function cb(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function eb(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function db(a,b){var c,d={ca:null,ha:null,Ba:null,Aa:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Ba=g.load;d.Aa=g.exec;if(e=g.bytes)d.ca=e;else if(e=g.words)for(d.ca=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ca=Array(4*e.length),f=c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Ba=g.load;d.Aa=g.exec;if(e=g.bytes)d.ca=e;else if(e=g.words)for(d.ca=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ca=Array(4*e.length),f=c=0;c>8&255,d.ca[f++]=e[c]>>16&255,d.ca[f++]=e[c]>>24&255;else d.ca=g;d.ha=g.symbols;d.ca.length?1==d.ca.length&&(v(d.ca[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.b["S"+a]=[0,0,!1,!1,this.Zd,a];this.G=this.f=this.D=this.J=null;A(this)}p(Tb,q);h=Tb.prototype; -h.reset=function(a){this.stop();a&&Vb(this,this.Sa=0)}; +function gb(){return"http://"+(window?window.location.host:"www.pcjs.org")}function hb(){if(null==ib){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}ib=a}return ib}function jb(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} +function kb(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function mb(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&!!b.match(/(iPod|iPhone|iPad)/)&&!!b.match(/AppleWebKit/)||"MSIE"==a&&!!b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)}return!1} +function sb(a){if(!tb){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}tb=c}return tb[a]} +function ub(a,b){var c=null;a="data:application/octet-stream;base64,"+a;b&&(c=document.createElement("a"),"string"!=typeof c.download&&(c=null));c?(c.href=a,c.download=b,document.body.appendChild(c),c.click(),document.body.removeChild(c),b="Check your Downloads folder for "+b+"."):(window.open(a),b="Check your browser for a new window/tab containing the requested data"+(b?" ("+b+")":"")+".");return b}function vb(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0a;a++)this.b["S"+a]=[0,0,!1,!1,this.Te,a];this.G=this.f=this.D=this.J=null;A(this)}p(Wb,q);h=Wb.prototype; +h.reset=function(a){this.stop();a&&Yb(this,this.Sa=0)}; h.sa=function(a,b,c,d){if(this.J&&this.J.sa(a,b,c,d)||this.f&&this.f.sa(a,b,c,d)||this.G&&this.G.sa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.C[b]=c,this.u++,!0;default:return"led"==a||"rled"==a?(this.C[b]=c,this.i[b]=d?1:0,this.u++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.C[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, -b){return function(){Wb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Xb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Wb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Xb(a,b)}}(this,b),!0):q.prototype.sa.call(this,a,b,c,d)}};h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;Yb(b,this,Zb);$b(b,this.reset.bind(this));ac(this);bc(this)}; -h.ya=function(a,b){if(!b)if(this.M&&cc(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.save=function(){var a=new L(this);a.set(0,[this.ga,this.Sa,this.Ta]);return a.data()};h.restore=function(a){if(a=a[0])dc(this,this.ga=a[0]),Vb(this,this.Sa=a[1]),ec(this,a[2]);return!0};function fc(a,b,c){if(a=a.C[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ac(a,b){for(var c in a.i)fc(a,c,null!=b?b:a.i[c])} -function gc(a,b,c){if(a=a.C[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function bc(a){for(var b in a.b)gc(a,b,a.b[b][1])}function hc(a,b,c,d){if(a.C[b]){var e=a.G&&a.G.Ca||8;c=c||0;c=8==e?H(c,d):I(c,d);a.C[b].textContent!=c&&(a.C[b].textContent=c)}}function Wb(a,b){var c=a.b[b];gc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=ic&&(a.H=b==jc,a.I=b==kc)} -function Xb(a,b){var c=a.b[b];c[2]&&c[3]&&(gc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Xd=function(a){a||this.f.A.T||(a=this.f,a.D.reset(),lc(a),this.b[mc]&&this.b[mc][1]&&nc(this.f))};h.Yd=function(){};h.Td=function(a){a||this.f.ba()}; -h.Rd=function(a){if(!a&&!this.f.A.T)if(this.b[mc]&&this.b[mc][1])nc(this.f);else{if((a=this.G)&&!Ma(a,!0))Na(a,!0),oc(a,0,null),Na(a,!1);else try{var b=this.f.ec(1);0=a.f.ka?8:16,c=65472<=a.ga&&a.ga<65472+b,b=c?1:2,c=c?15:a.D.I;a.b[ic]&&a.b[ic][1]||(b=-b);dc(a,a.ga&~c|a.ga+b&c)} -function dc(a,b){a.ga=b&a.D.I;if(a.B!==a.ga){a.B=a.ga;b=a.B;for(var c=0;22>c;c++)Ic(a,"A"+c,b&1<c;c++)Ic(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.H=this.M/this.j|0;this.U=this.H-1;this.Ma=[];this.ma=0;this.F=!1;this.O=[];this.Hd=[Oc,Pc,Qc,Rc];this.b=this.u=[];this.B=this.L=this.w=this.P=this.R=0;a=new O(this);Sc(a,this.G);this.b=Array(this.H);this.u=Array(this.H);for(b=0;b>>this.g;this.L=0;this.w=this.I;A(this)}p(Mc,q);function Vc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.u[a.R]=a.b[a.P])}}h=Mc.prototype;h.reset=function(){for(var a=0;a=a.f.ka?8:16,c=65472<=a.ga&&a.ga<65472+b,b=c?1:2,c=c?15:a.D.I;a.b[lc]&&a.b[lc][1]||(b=-b);gc(a,a.ga&~c|a.ga+b&c)} +function gc(a,b){a.ga=b&a.D.I;if(a.B!==a.ga){a.B=a.ga;b=a.B;for(var c=0;22>c;c++)Lc(a,"A"+c,b&1<c;c++)Lc(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.H=this.M/this.j|0;this.U=this.H-1;this.Ma=[];this.ma=0;this.F=!1;this.N=[];this.Be=[Rc,Sc,Tc,Uc];this.b=this.u=[];this.B=this.L=this.w=this.P=this.R=0;a=new K(this);Vc(a,this.G);this.b=Array(this.H);this.u=Array(this.H);for(b=0;b>>this.g;this.L=0;this.w=this.I;A(this)}p(Pc,q);function Yc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.u[a.R]=a.b[a.P])}}h=Pc.prototype;h.reset=function(){for(var a=0;a>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.K)return l.Ib+=l.K-f,l.K=f,!0;if(f>=l.K+l.Ib){n=l.size-(f-m);n>g&&(n=g);l.Ib=f-l.K+n;f=m+a.j;g-=n;k++;continue}}return Xc(Yc,f,g)}f=new O(a,f,n,a.j,d,e);Sc(f,a.G,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Zc[d]+" at "+H(b)),!0):Xc($c,b,c)}h.Kc=function(a){return this.u[(a&this.w)>>>this.g].wb(a&this.i,a)}; -h.dc=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Pb||b!=this.i?this.u[c].na(b,a):this.u[c++].wb(b,a)|this.u[c&this.U].wb(0,a+1)<<8};h.Lc=function(a,b){this.u[(a&this.w)>>>this.g].yb(a&this.i,b,a)};h.Mb=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Pb||c!=this.i?this.u[d].zb(c,b,a):(this.u[d++].yb(c,b&255,a),this.u[d&this.U].yb(0,b>>8&255,a+1))};function ad(a,b){return a.b[(b&a.I)>>>a.g]} -function Gc(a,b){var c;a.F=!1;a.ma++;var d=b&a.i,e=ad(a,b);Pb||d!=a.i?c=e.B(d,b):c=e.j(d,b)|ad(a,b+1).j(0,b+1)<<8;a.ma--;return c}function bd(a,b,c){a.F=!1;a.ma++;ad(a,b).D(b&a.i,c&255,b);a.ma--}function Ec(a,b,c){a.F=!1;a.ma++;var d=b&a.i,e=ad(a,b);Pb||d!=a.i?e.F(d,c&65535,b):(e.D(d,c&255,b),ad(a,b+1).D(0,c>>8&255,b+1));a.ma--} -function Wc(a){for(var b=0,c=[],d=0;da.f.ka)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Ma[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&B(this.f,16|e[5])&&C(this.f,e[4]+".readByte("+P(this.f,b)+"): "+P(this.f,c),!0,!d.ma),c;d.La(b,16,3);c=255;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to byte @"+P(this.f,b)+": "+P(this.f,c),!0,!d.ma);return c} -function Pc(a,b,c){var d=!1,e=this.controller,f=e.Ma[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ma[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&B(this.f,16|f[5])&&C(this.f,f[4]+".writeByte("+P(this.f,c)+","+P(this.f,b)+")",!0,!e.ma):(e.La(c,16,5),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to byte @"+P(this.f,c)+": "+P(this.f, -b),!0,!e.ma))}function Qc(a,b){var c=-1,d=this.controller;a=d.Ma[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".readWord("+P(this.f,b)+"): "+P(this.f,c),!0,!d.ma),c;d.La(b,16,2);c=65535;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to word @"+P(this.f,b)+": "+P(this.f,c),!0,!d.ma);return c} -function Rc(a,b,c){var d=!1,e=this.controller;a=e.Ma[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".writeWord("+P(this.f,c)+","+P(this.f,b)+")",!0,!e.ma):(e.La(c,16,4),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to word @"+P(this.f,c)+": "+P(this.f,b),!0,!e.ma))}function Q(a){q.call(this,"Device",a,0,256);this.b={Ya:128,Hc:-1}}p(Q,q);h=Q.prototype; -h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.G=d;var e=this;this.b.Hc=hd(c,function(){e.b.Ya|=128;e.b.Ya&64&&id(e.f,e.b.hb);e.J&&M(e.J,1);kd(e.f,e.b.Hc,1E3/60)});this.b.hb=ld(c,64,6,524288);Yb(b,this,md);$b(b,this.reset.bind(this));d&&nd(d,64,function(a){var b=e.f;od(e,"KIPDR",b.B[0],0,a[0]);od(e,"KDPDR",b.B[0],8,a[0]);od(e,"KIPAR",b.M[0],0,a[0]);od(e,"KDPAR",b.M[0],8,a[0],!0);od(e,"SIPDR",b.B[1],0,a[0]);od(e,"SDPDR",b.B[1],8,a[0]);od(e,"SIPAR",b.M[1],0,a[0]);od(e,"SDPAR",b.M[1],8,a[0], -!0);od(e,"UIPDR",b.B[3],0,a[0]);od(e,"UDPDR",b.B[3],8,a[0]);od(e,"UIPAR",b.M[3],0,a[0]);od(e,"UDPAR",b.M[3],8,a[0],!0);b.V&32&&od(e,"UNIMAP",b.Fa,-1,a[0])});A(this)};function od(a,b,c,d,e,f){a=a.G;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Fa[a>>1];return a&1?b>>16:b&65535};h.hg=function(a,b){b=b>>1&63;var c=b>>1;this.f.Fa[c]=b&1?this.f.Fa[c]&65535|(a&63)<<16:this.f.Fa[c]&-65536|a&65534};h.Qe=function(a){return this.f.B[1][a>>1&7]};h.ag=function(a,b){this.f.B[1][b>>1&7]=a&65295};h.Oe=function(a){return this.f.B[1][(a>>1&7)+8]};h.Zf=function(a,b){this.f.B[1][(b>>1&7)+8]=a&65295};h.Pe=function(a){return this.f.M[1][a>>1&7]}; -h.$f=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.Ne=function(a){return this.f.M[1][(a>>1&7)+8]};h.Yf=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.je=function(a){return this.f.B[0][a>>1&7]};h.wf=function(a,b){this.f.B[0][b>>1&7]=a&65295};h.he=function(a){return this.f.B[0][(a>>1&7)+8]};h.uf=function(a,b){this.f.B[0][(b>>1&7)+8]=a&65295};h.ie=function(a){return this.f.M[0][a>>1&7]};h.vf=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.B[0][b]&=65295}; -h.ge=function(a){return this.f.M[0][(a>>1&7)+8]};h.tf=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.B[0][b]&=65295};h.We=function(a){return this.f.B[3][a>>1&7]};h.gg=function(a,b){this.f.B[3][b>>1&7]=a&65295};h.Ue=function(a){return this.f.B[3][(a>>1&7)+8]};h.eg=function(a,b){this.f.B[3][(b>>1&7)+8]=a&65295};h.Ve=function(a){return this.f.M[3][a>>1&7]};h.fg=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Te=function(a){return this.f.M[3][(a>>1&7)+8]}; -h.dg=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Gb=function(a){a&=7;return this.f.w&2048?this.f.pa[a]:this.f.g[a]};h.Kb=function(a,b){b&=7;this.f.w&2048?this.f.pa[b]=a:this.f.g[b]=a};h.ue=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.Ff=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.xe=function(){return this.f.g[7]};h.If=function(a){this.f.g[7]=a};h.Hb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.pa[a]}; -h.Lb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.pa[b]=a};h.ve=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Gf=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.we=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Hf=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.fe=function(a){return this.f.ac[a-65504>>1]};h.sf=function(a,b){this.f.ac[b-65504>>1]=a};h.nd=function(a){return 65520==a?(cd(this.D)>>6)-1:0}; -h.sd=function(){};h.Se=function(){return 1};h.cg=function(){};h.ee=function(){return this.f.R};h.rf=function(){this.f.R=0};h.le=function(){return this.f.Yb};h.yf=function(a,b){b&1||(a&=255);this.f.Yb=a};h.qe=function(a,b){return b?0:this.f.Va};h.Bf=function(a){vd(this.f,a)};h.Re=function(a,b){return b?0:this.f.za&65280};h.bg=function(a){this.f.za=a|255};h.te=function(){return wd(this.f)};h.Ef=function(a){xd(this.f,a)};h.rd=function(a,b){B(this)&&C(this,"writeIgnored("+H(b)+"): "+H(a),!0,!0)}; -var R={},md=(R[61568]=[null,null,Q.prototype.Xe,Q.prototype.hg,"UNIMAP",64,1170],R[62592]=[null,null,Q.prototype.Qe,Q.prototype.ag,"SIPDR",8,1145,64],R[62608]=[null,null,Q.prototype.Oe,Q.prototype.Zf,"SDPDR",8,1145,64],R[62624]=[null,null,Q.prototype.Pe,Q.prototype.$f,"SIPAR",8,1145,64],R[62640]=[null,null,Q.prototype.Ne,Q.prototype.Yf,"SDPAR",8,1145,64],R[62656]=[null,null,Q.prototype.je,Q.prototype.wf,"KIPDR",8,1140,64],R[62672]=[null,null,Q.prototype.he,Q.prototype.uf,"KDPDR",8,1145,64],R[62688]= -[null,null,Q.prototype.ie,Q.prototype.vf,"KIPAR",8,1140,64],R[62704]=[null,null,Q.prototype.ge,Q.prototype.tf,"KDPAR",8,1145,64],R[62798]=[null,null,Q.prototype.pe,Q.prototype.Af,"MMR3",1,1145,64],R[65382]=[null,null,Q.prototype.ke,Q.prototype.xf,"LKS"],R[65402]=[null,null,Q.prototype.me,Q.prototype.zf,"MMR0",1,1140,64],R[65404]=[null,null,Q.prototype.ne,Q.prototype.rd,"MMR1",1,1145,64],R[65406]=[null,null,Q.prototype.oe,Q.prototype.rd,"MMR2",1,1140,64],R[65408]=[null,null,Q.prototype.We,Q.prototype.gg, -"UIPDR",8,1140,64],R[65424]=[null,null,Q.prototype.Ue,Q.prototype.eg,"UDPDR",8,1145,64],R[65440]=[null,null,Q.prototype.Ve,Q.prototype.fg,"UIPAR",8,1140,64],R[65456]=[null,null,Q.prototype.Te,Q.prototype.dg,"UDPAR",8,1145,64],R[65472]=[null,null,Q.prototype.Gb,Q.prototype.Kb,"R0SET0"],R[65473]=[null,null,Q.prototype.Gb,Q.prototype.Kb,"R1SET0"],R[65474]=[null,null,Q.prototype.Gb,Q.prototype.Kb,"R2SET0"],R[65475]=[null,null,Q.prototype.Gb,Q.prototype.Kb,"R3SET0"],R[65476]=[null,null,Q.prototype.Gb, -Q.prototype.Kb,"R4SET0"],R[65477]=[null,null,Q.prototype.Gb,Q.prototype.Kb,"R5SET0"],R[65478]=[null,null,Q.prototype.ue,Q.prototype.Ff,"R6KERNEL"],R[65479]=[null,null,Q.prototype.xe,Q.prototype.If,"R7KERNEL"],R[65480]=[null,null,Q.prototype.Hb,Q.prototype.Lb,"R0SET1",1,1145],R[65481]=[null,null,Q.prototype.Hb,Q.prototype.Lb,"R1SET1",1,1145],R[65482]=[null,null,Q.prototype.Hb,Q.prototype.Lb,"R2SET1",1,1145],R[65483]=[null,null,Q.prototype.Hb,Q.prototype.Lb,"R3SET1",1,1145],R[65484]=[null,null,Q.prototype.Hb, -Q.prototype.Lb,"R4SET1",1,1145],R[65485]=[null,null,Q.prototype.Hb,Q.prototype.Lb,"R5SET1",1,1145],R[65486]=[null,null,Q.prototype.ve,Q.prototype.Gf,"R6SUPER",1,1145],R[65487]=[null,null,Q.prototype.we,Q.prototype.Hf,"R6USER",1,1145],R[65504]=[null,null,Q.prototype.fe,Q.prototype.sf,"CTRL",8,1170],R[65520]=[null,null,Q.prototype.nd,Q.prototype.sd,"LSIZE",1,1170],R[65522]=[null,null,Q.prototype.nd,Q.prototype.sd,"HSIZE",1,1170],R[65524]=[null,null,Q.prototype.Se,Q.prototype.cg,"SYSID",1,1170],R[65526]= -[null,null,Q.prototype.ee,Q.prototype.rf,"ERR",1,1170],R[65528]=[null,null,Q.prototype.le,Q.prototype.yf,"MBR",1,1170],R[65530]=[null,null,Q.prototype.qe,Q.prototype.Bf,"PIR"],R[65532]=[null,null,Q.prototype.Re,Q.prototype.bg,"SLR"],R[65534]=[null,null,Q.prototype.te,Q.prototype.Ef,"PSW"],R); -wb(function(){for(var a=y(document,x,"device"),b=0;b>1),this.b=new Int32Array(this.u,0,this.size>>2),Ld(this,Md?Nd:Od);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.ce=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.cf=function(a,b){Ib&&a&1&&this.C.La(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8}; -h.pf=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Wa=!0};h.ae=function(a,b){this.f&&null!=this.K&&Vd(this.f,this.K+a);return this.j(a,b)};h.Ze=function(a,b){this.f&&null!=this.K&&Vd(this.f,this.K+a,2);return this.B(a,b)}; -h.mf=function(a,b,c){this.f&&null!=this.K&&Wd(this.f,this.K+a);this.J?this.Jb(0,b,c):this.D(a,b,c)};h.jg=function(a,b,c){this.f&&null!=this.K&&Wd(this.f,this.K+a,2);this.J?this.Jb(0,b,c):this.F(a,b,c)};h.$d=function(a){return this.g[a]};h.be=function(a,b){a=this.g[a];this.f&&B(this.f,32)&&C(this.f,"Memory.readByte("+P(this.f,b)+"): "+P(this.f,a),!0);return a};h.Ye=function(a,b){Ib&&a&1&&this.C.La(b,64,2);return this.w.getUint16(a,!0)}; -h.bf=function(a,b){Ib&&a&1&&this.C.La(b,64,2);a=!Pb&&a&1?this.g[a]|this.g[a+1]<<8:this.H[a>>1];this.f&&B(this.f,32)&&C(this.f,"Memory.readWord("+P(this.f,b)+"): "+P(this.f,a),!0);return a};h.lf=function(a,b){this.g[a]=b;this.Wa=!0};h.nf=function(a,b,c){this.g[a]=b;this.Wa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeByte("+P(this.f,c)+","+P(this.f,b)+")",!0)};h.ig=function(a,b,c){Ib&&a&1&&this.C.La(c,64,4);this.w.setUint16(a,b,!0);this.Wa=!0}; -h.kg=function(a,b,c){Ib&&a&1&&this.C.La(c,64,4);!Pb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.H[a>>1]=b;this.Wa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeWord("+P(this.f,c)+","+P(this.f,b)+")",!0)};var Bd=0,dd=1,Kd=2,Uc=4,Zc=["NONE","RAM","ROM","VID","H/W"],Ad=0,Qd=[],Pd=[O.prototype.ce,O.prototype.pf,O.prototype.cf,O.prototype.lg],Td=[O.prototype.ae,O.prototype.mf,O.prototype.Ze,O.prototype.jg]; -if(Eb)var Od=[O.prototype.$d,O.prototype.lf,O.prototype.Ye,O.prototype.ig],Nd=[O.prototype.be,O.prototype.nf,O.prototype.bf,O.prototype.kg];var Xd;if(Eb){var Yd=new ArrayBuffer(2);(new DataView(Yd)).setUint16(0,256,!0);Xd=256===(new Uint16Array(Yd))[0]}else Xd=!1;var Md=Xd; -function Zd(a,b){q.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.rc=0;this.pc=b;this.cb=c;this.wc=Math.round(this.pc/1E4)/100;this.pb=this.wc*this.cb;this.xc=this.Ub=this.tb=this.qc=0;this.A.T=this.A.lc=!1;this.A.va=a.autoStart;"string"==typeof this.A.va&&(this.A.va="true"==this.A.va);this.A.Bb=!1;this.Sb=this.Db=0;this.Tb=+a.csStart;this.Cb=+a.csInterval;this.Eb=+a.csStop;this.ia=[];this.Xc=this.gf.bind(this);this.eb=this.Ia=this.bb=this.b=this.la=this.Ha=this.Rb=this.ab=this.Fb= -this.yc=this.ob=0;this.ua=null;A(this)}p(Zd,q);h=Zd.prototype;h.wa=function(a,b,c,d){this.J=a;this.D=b;this.G=d;this.ua=a.i;for(a=0;a<$d.length;a++)(b=this.C[$d[a]])&&this.J.sa(null,$d[a],b);A(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1}; -h.ya=function(a,b){var c=ae(this.J,"autoStart");null!=c?this.A.va="true"==c?!0:"false"==c?!1:!!c:null==this.A.va&&(this.A.va=!this.G&&void 0===this.C.run);if(!b){if(a){be(this);if(!this.restore(a))return!1;ce(this)}else this.reset();this.G?(a=this.G,b=this.A.va,a.Ea=!0,a.v("Type ? for help with PDPjs Debugger commands"),de(a),b||ee(a),a.ua&&(b=a.ua,a.ua=null,fe(a,b))):this.status("No debugger detected");this.A.va||this.v("CPU will not be auto-started "+(this.ua?"(click Run to start)":"(type 'go' to start)"))}return!0}; -h.xa=function(a){return a?this.save():!0};h.va=function(){return this.A.T?!0:this.A.va?(nc(this),!0):!1};h.gd=function(){return 0};function ce(a){void 0===a.Tb&&(a.Tb=0);void 0===a.Cb&&(a.Cb=-1);void 0===a.Eb&&(a.Eb=-1);a.A.Bb=0<=a.Tb&&0=a.Db&&(a.Db+=a.Cb,c=!0);0<=a.Eb&&a.Eb<=ge(a)&&(a.Cb=a.Eb=-1,ce(a),a.ba(),c=!0);c&&a.v(ge(a)+" cycles: checksum="+I(a.Sb))}} -h.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.C[b]=c,!0;case "run":return this.C[b]=c,c.onclick=function(){var a;if(a=d.J)if(a=d.J,a.A.fa)a=!0;else{var b=null,c,k=Ba(a.id);for(c=0;ca.ob/a.pb?b=1:d=!0;a.cb=b;b=a.wc*a.cb;if(a.pb!=b){a.pb=b;b=a.pb.toFixed(2)+"Mhz";var e=a.C.setSpeed;e&&(e.textContent=b);a.v("target speed: "+b)}c&&a.J&&ke(a.J)}qc(a,a.Ia);a.Ia=0;a.Ha=za();a.ab=0;ie(a);return d}function hd(a,b){var c=a.ia.length;a.ia.push([-1,b]);return c}function kd(a,b,c,d){0<=b&&ba.ia[b][0])&&(c=a.pc*a.cb/1E3*c|0,a.A.T&&(c+=le(a)),a.ia[b][0]=c)} -function me(a,b){for(var c=a.ia.length-1;0<=c;c--){var d=a.ia[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function ne(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function le(a,b){var c=a.bb-=a.b;a.b=a.la=0;b&&(a.bb=0);return c} -h.gf=function(){if(this.A.T){this.qc>=this.pc&&ie(this,!0);this.Fb=0;this.Rb=za();if(this.ab){var a=this.Rb-this.ab;a>this.xc&&(this.Ha+=a,this.Ha>this.Rb&&(this.Ha=this.Rb))}try{do{var b=me(this,this.A.Bb?1:this.Ub);try{this.ec(b)}catch(e){if("number"!=typeof e)throw e;}b=le(this,!0);this.Fb+=b;this.Ia+=b;Cc(this,b);pc(this,b);this.tb-=b;if(0>=this.tb){this.tb+=this.Ub;++this.yc>=oe&&(this.J&&M(this.J,void 0),this.yc=0);break}}while(this.A.T)}catch(e){this.ba();this.J&&this.J.stop(za(),ge(this)); -Ja(this,e.stack||e.message);return}if(this.A.T){a=setTimeout;b=this.Xc;this.ab=za();var c=this.xc;this.Fb&&(c=Math.round(c*this.Fb/this.Ub));var c=c-(this.ab-this.Rb),d=this.ab-this.Ha;d&&(this.ob=Math.round(this.Ia/(10*d))/100,864E5<=d&&(this.eb=0,he(this)));if(0>c||this.obc&&(this.Ha-=c),c=0;this.qc+=this.Fb;this.ab+=c;a(b,c)}}}; -function nc(a,b){if(!Ka(a))if(a.A.T)a.v(a.toString()+" busy");else{he(a);a.A.T=!0;a.A.lc=!0;var c=a.C.run;c&&(c.textContent="Halt");a.J&&(b&&ke(a.J,!0),a.J.start(a.Ha,ge(a)));a.G||a.status("Started");setTimeout(a.Xc,0)}}h.ec=function(){return 0};h.ba=function(a){var b=!1;if(this.A.T){le(this);qc(this,this.Ia);this.Ia=0;this.A.T=!1;if(b=this.C.run)b.textContent="Run";this.J&&this.J.stop(za(),ge(this));b=!0;this.G||this.status("Stopped")}this.A.complete=a;return b};var je=30,oe=15,$d=["power","reset"]; -function pe(a){var b=+a.model||1170;Zd.call(this,a,6666667);this.ka=b;this.Rc=+a.addrReset||0;this.Ua=this.w=this.O=this.F=this.H=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Fa=this.ac=[];this.Za=this.P=this.Qc=this.qb=this.kb=this.rb=this.$a=this.R=this.Yb=this.Va=this.za=this.U=this.Zb=this.$b=this.V=this.i=0;this.Tc=[4,2,0,1];this.bc=0;this.Uc=255;1120>=this.ka?(this.Pc=qe.bind(this),this.Ab=this.Ld,this.bc=8,this.Uc=-1,this.Zc=255,this.Yc=0):(this.Pc=re.bind(this),this.Ab=this.Md, -this.Zc=~(1792|(1140>=this.ka?2048:0))&65535,this.Yc=1140e.xb&&(e.xb=c,c+=4)}return Zd.prototype.ya.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.ka);this.A.T&&this.ba();this.F=65536;this.H=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Rc,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535, -65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ac=[0,0,0,0,0,0,0,0];this.O=0;this.Ua=-1;this.u=this.j=this.oc=this.X=this.Z=this.i=this.Yb=0;lc(this);be(this);this.A.error=!1;Zd.prototype.reset.call(this)};function lc(a){a.U=0;a.Zb=0;a.$b=0;a.V=0;a.R=0;a.Va=0;a.za=255;a.qb=0;a.kb=0;a.rb=0;a.$a=262143;a.Za=a.g[7];a.P=0;a.S=null;a.D&&(se(a),a.Qc=cd(a.D))} -function se(a){a.Nb=a.sc;a.Ob=a.tc;a.mc=a.uc;a.Pb=a.vc;a.Wb&&(a.Nb=a.fd,a.Ob=a.ld);a.Xb&&(a.mc=a.pd,a.Pb=a.qd);a.qb?(a.Ga=65536,a.lb=a.V&16?4186112:253952,a.Ea=a.kd,a.na=a.Wb?a.af:a.Fc,a.zb=a.Xb?a.ng:a.Ic,Vc(a.D,a.V&16?22:18)):(a.Ga=0,a.lb=57344,a.Ea=a.Od,a.na=a.Wb?a.$e:a.od,a.zb=a.Xb?a.mg:a.td,Vc(a.D,16))}function qd(a){var b=a.U;b&57344||(b=b&-3199|a.kb<<5|a.rb<<1);return b} -function rd(a,b){b&=-3073;if(a.U!=b){b&57344&&!(a.U&57344)&&(a.Zb=a.P>>16&65535,a.$b=a.P&65535);a.U=b;a.kb=(b&96)>>5;a.rb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.qb!=c&&(a.qb=c,se(a))}}function sd(a){a.U&57344||(a.Zb=a.P>>16&65535);a=a.Zb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function td(a){a.U&57344||(a.$b=a.P&65535);return a.$b}function ud(a,b){1170>a.ka&&(b&=-49);a.V!=b&&(a.V=b,a.$a=b&16?4194303:262143,se(a))} -function te(a,b,c){a.Rc=b;ue(a,b);xd(a,0);a.D.reset();lc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.T||nc(a)}else a.G&&a.A.fa?a.ba()||(de(a.G),M(a.J,-1)):!1===c&&a.ba();!a.A.T&&a.ua&&a.ua.stop()}h.gd=function(){return 0}; -h.save=function(){var a=new L(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Fa,this.ac,this.R,this.Yb,this.Va,this.za,this.kb,this.rb,this.Za,this.i,this.P,this.Ua,this.cc,this.fc]);a.set(1,[wd(this),qd(this),sd(this),td(this),this.V]);a.set(2,[this.eb,this.cb,this.A.va]);a.set(3,ve(this));a.set(4,ne(this));return a.data()}; -h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Fa=b.next().value;this.ac=b.next().value;this.R=b.next().value;this.Yb=b.next().value;this.Va=b.next().value;this.za=b.next().value;this.kb=b.next().value;this.rb=b.next().value;this.Za=b.next().value;this.i=b.next().value;this.P=b.next().value;this.Ua=b.next().value;this.cc=b.next().value;this.fc=b.next().value;b=a[1];xd(this,b[0]);rd(this,b[1]); -this.Zb=b[2];this.$b=b[3];ud(this,b[4]);b=a[2];this.eb=b[0];he(this,b[1]);this.A.va=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function ue(a,b){a.g[7]=b&65535}function ld(a,b,c,d){b={xb:b,ib:c,message:d||0,name:Rb[b],next:null};a.Qb.push(b);return b}function Be(a,b){var c=a.S;if(c==b)a.S=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.S&&(a.i|=1)} -function id(a,b){if(b){if(b!=a.S){var c=a.S;if(!c||c.ib<=b.ib)b.next=c,a.S=b;else{do{var d=c.next;if(!d||d.ib<=b.ib){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&B(a,b.message|8)&&C(a,"setIRQ(vector="+H(b.xb)+",priority="+b.ib+")",!0,!0)}}function pd(a,b){b&&(Be(a,b),b.message&&B(a,b.message|8)&&C(a,"clearIRQ(vector="+H(b.xb)+",priority="+b.ib+")",!0,!0))}function ve(a){var b=[];for(a=a.S;a;)b.push(a.xb),a=a.next;return b} -function Ce(a){return a.i&64?(a.ta(168,64,-6),!0):a.i&32?(a.ta(4,32,-5),!0):a.i&16?(a.ta(12,16,-7),!0):!1}function wd(a){return a.w=a.w&63728|ze(a)|ye(a)|xe(a)|we(a)}function xd(a,b){b&=a.Zc;a.I=b<<12;a.L=~b&4;a.H=b<<14;a.F=b<<16;if((b^a.w)&a.Yc)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.O=b>>14&3;c=a.w>>14&3;a.O!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.O]);a.w=b;a.i&=-3;a.i|=a.S?2:1}function vd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.Va=b} -h.Da=function(a){this.I=this.L=a;this.H=0};h.jb=function(a,b){this.I=this.L=this.F=a;this.H=b||0};function De(a,b){a.I=a.L=a.F=b;a.H=a.I^a.F>>1}function Ee(a,b,c,d){a.I=a.L=a.F=b;a.H=(c^d)&(d^b)} -h.ta=function(a,b,c){if(!this.oa){0>this.Ua?this.Ua=wd(this):this.O||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.R|=4,this.g[6]=a=4);if(-1!=c){this.P=a|4143316992;this.O=0;var d=this.na(a|this.Ga),e=this.na(a+2&65535|this.Ga);xd(this,e&-12289|this.Ua>>2&12288);Fe(this,this.Ua);Fe(this,this.g[7]);ue(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Ua=-1;this.cc=c;this.fc=a;-1==c&&this.ba();if(-4<=c)throw a;}}; -function Ge(a){var b=He(a),c=He(a);a.w&49152&&(c=c&-225|a.w&63712);ue(a,b);xd(a,c);a.i&=-17}function Ie(a,b){var c=b>>13&31;31>c&&(b=a.V&32?a.Fa[c]+(b&8191)&4194303:b&-3932161);return b} -function Je(a,b,c){var d=[];if(c){c=Ie(a,b);var e=b>>13&31;d.push(c);d.push(e);a.V&32&&(d.push(a.Fa[e]),d.push(b&8191))}else if(a.qb){var e=a.O<<1,f=b>>13;7>13;a.V&a.Tc[a.O]||(d&=7);e=a.B[a.O][d];f=(a.M[a.O][d]<<6)+(b&8191)&a.$a;3932160<=f&&(f=Ie(a,f));if(a.oa)return f;f>=a.Qc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.B[a.O][d]=e;if(f!=(4194170&a.$a)||a.O)a.kb=a.O,a.rb=d;g&&(g&57344&&(0<=a.Ua&&(g|=128),a.U&57344||(g|=a.U&4096|a.kb<<5|a.rb<<1,rd(a,a.U&-61695|g&61694)),a.ta(168,64,-2)),a.U&61440||!(f<(4191360&a.$a)||f>(4194239&a.$a))||(a.U|=4096,a.U&512&&(a.i|=64)));return f}function He(a){var b=a.na(a.g[6]|a.Ga);a.g[6]=a.g[6]+2&65535;return b}function Fe(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.P=a.P&65535|(a.P&-65536)<<8|16121856;a.i&256||a.Ab(4,-2,c);a.zb(c,b)} -function Ke(a,b,c,d){var e,f,g=d&8?0:a.Ga;switch(b){case 0:return a.ta(4,0,-3),0;case 1:return 6==c&&a.Ab(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Ab(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Ab(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(Ae(a,2)),e=e+a.g[c]&65535,6==c&&a.Ab(d, -0,e),a.b-=6,e|g;case 7:return e=a.na(Ae(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ga),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.P=a.P&65535|(a.P&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ld=function(a,b,c){!this.O&&0>=b&&c<=this.za&&(this.i|=32)};h.Md=function(a,b,c){this.O||(65534<=c&&(c|=-65536),a&4&&c<=this.za&&(c<=this.za-32?this.ta(4,0,-4):(this.R|=8,this.i|=32)))};h.fd=function(a){this.G&&Vd(this.G,a,1);return this.sc(a)};h.ld=function(a){this.G&&Vd(this.G,a,2);return this.tc(a)}; -h.pd=function(a,b){this.G&&Wd(this.G,a,1);this.uc(a,b)};h.qd=function(a,b){this.G&&Wd(this.G,a,2);this.vc(a,b)};function Hc(a,b){a.oa++;b=a.D.dc(Fc(a,b,2));a.oa--;return b}function Le(a,b){(b?--a.Xb:--a.Wb)||se(a)}h.Od=function(a,b,c){return Ke(this,a,b,c)};h.kd=function(a,b,c){return Fc(this,Ke(this,a,b,c),c)};h.od=function(a){return this.D.dc(this.Za=a)};h.$e=function(a){this.G&&Vd(this.G,a,2);return this.od(a)};h.Fc=function(a){return this.D.dc(this.Za=Fc(this,a,2))}; -h.af=function(a){this.G&&Vd(this.G,a,2);return this.Fc(a)};h.td=function(a,b){this.D.Mb(this.Za=a,b)};h.mg=function(a,b){this.G&&Wd(this.G,a,2);this.td(a,b)};h.Ic=function(a,b){this.D.Mb(this.Za=Fc(this,a,4),b)};h.ng=function(a,b){this.G&&Wd(this.G,a,2);this.Ic(a,b)};function Me(a,b,c){var d=a.j=b&7;(b=a.u=(b&56)>>3)?(d=Ke(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.O=a.w>>12&3,c=a.na(d|c&a.Ga),a.O=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} -function Ne(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=Ke(a,b,e,4),c&65536||(e&=65535),a.O=a.w>>12&3,e=Fc(a,e|c&65536,4),a.O=a.w>>14&3,a.Pb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Oe(a,b){b>>=6;var c=a.Z=b&7;return(b=a.X=(b&56)>>3)?a.Nb(a.Ea(b,c,3)):a.g[c+a.bc]&a.Uc}function Pe(a,b){var c;b>>=6;var d=a.Z=b&7;(b=a.X=(b&56)>>3)?c=a.Ob(a.Ea(b,d,2)):c=a.g[d+a.bc];return c}function Qe(a,b){var c=a.j=b&7;b=a.u=(b&56)>>3;return Ke(a,b,c,8)} -function mf(a,b){var c=a.j=b&7;return(b=a.u=(b&56)>>3)?a.Nb(a.Ea(b,c,3)):a.g[c]&255}function nf(a,b){var c,d=a.j=b&7;(b=a.u=(b&56)>>3)?c=a.Ob(a.Ea(b,d,2)):c=a.g[d];return c}function of(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.oc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.mc(e,d.call(a,c,a.Nb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} -function U(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,6),a.Pb(e,d.call(a,0>c?a.g[-c-1]:c,a.Ob(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function pf(a,b,c,d,e){var f=a.j=b&7;(b=a.u=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.mc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} -function qf(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Pb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} -h.ec=function(a){this.A.complete=!0;var b=this.G?rf(this.G)?1:this.A.lc?-1:0:0,c=a?this.A.lc?0:1:-1;this.A.lc=!1;this.bb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(sf(this.G,this.g[7],c)){this.ba();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.Va&224)>>5,f=this.S&&this.S.ib>e?this.S:null;f&&(d=f.xb,e=f.ib);e>(this.w&224)>>5?(this.i&8&&(Ae(this,2),this.i&=-9),this.ta(d,0,-10),e=!0):e=!1;e&&(f&&Be(this,f),a=!0);this.S||this.Va||(this.i&=-3)}else this.i& -1&&this.i++;if(a){if(this.i&4&&sf(this.G,this.g[7],c)){this.ba();break}if(0>c)break}if(this.i&112&&Ce(this)){if(this.i&4&&sf(this.G,this.g[7],c)){this.ba();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.Pc(f)}while(0>1|b<<16;De(this,a);return a&65535}function yf(a,b){a=b&128|b>>1|b<<8;De(this,a<<8);return a&255}function zf(a,b){a=b&~a;this.Da(a);return a}function Af(a,b){a=b&~a;this.Da(a<<8);return a} -function Bf(a,b){a|=b;this.Da(a);return a}function Cf(a,b){a|=b;this.Da(a<<8);return a}function Df(a,b){a=~b|65536;this.jb(a);return a&65535}function Ef(a,b){a=~b|256;this.jb(a<<8);return a&255}function Ff(a,b){this.I=this.L=a=b-a;this.H=b&(b^a);return a&65535}function Gf(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.H=b&(b^c);return a&255}function Hf(a,b){this.I=this.L=a=b+a;this.H=a&(b^a);return a&65535}function If(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.H=c&(b<<8^c);return a&255} -function Jf(a,b){a=-b;this.jb(a,a&b&32768);return a&65535}function Kf(a,b){a=-b;this.jb(a<<8,(a&b&128)<<8);return a&255}function Lf(a,b){a=b<<1|this.F>>16&1;De(this,a);return a&65535}function Mf(a,b){a=b<<1|this.F>>16&1;De(this,a<<8);return a&255}function Nf(a,b){a=(this.F&65536|b)>>1|b<<16;De(this,a);return a&65535}function Of(a,b){a=((this.F&65536)>>8|b)>>1|b<<8;De(this,a<<8);return a&255}function Pf(a,b){var c=b-a;Ee(this,c,a,b);return c&65535} -function Qf(a,b){var c=b-a;Ee(this,c<<8,a<<8,b<<8);return c&255}function Rf(a,b){this.I=this.L=b&65280;this.H=this.F=0;return(b<<8|b>>8)&65535}function Sf(a,b){a^=b;this.Da(a);return a&65535}function Tf(a){U(this,a,Pe(this,a),tf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} -function Uf(a){var b=nf(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.F=this.H=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.H=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.u?6:7)+b} -function Vf(a){var b=nf(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&=63;if(b&32){b=64-b;32>b-1;this.F=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.u?6:7)+b}function Wf(a){T(this,a,!we(this))}function Xf(a){T(this,a,we(this))} -function Yf(a){U(this,a,Pe(this,a),zf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Zf(a){of(this,a,Oe(this,a),Af);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function $f(a){U(this,a,Pe(this,a),Bf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function ag(a){of(this,a,Oe(this,a),Cf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} -function bg(a){var b=Pe(this,a);a=nf(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function cg(a){var b=Oe(this,a);a=mf(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function dg(a){T(this,a,ye(this))}function eg(a){T(this,a,!ze(this)==!xe(this))}function fg(a){T(this,a,!ye(this)&&!ze(this)==!xe(this))}function gg(a){T(this,a,!we(this)&&!ye(this))} -function hg(a){T(this,a,ye(this)||!ze(this)!=!xe(this))}function ig(a){T(this,a,we(this)||ye(this))}function jg(a){T(this,a,!ze(this)!=!xe(this))}function kg(a){T(this,a,ze(this))}function lg(a){T(this,a,!ye(this))}function mg(a){T(this,a,!ze(this))}function ng(){this.ta(12,0,-9)}function og(a){T(this,a,!0)}function pg(a){T(this,a,!xe(this))}function qg(a){T(this,a,xe(this))}function rg(a){a&1&&(this.F=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} -function sg(a){var b=Pe(this,a);a=nf(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Ee(this,c,a,b);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function tg(a){var b=Oe(this,a);a=mf(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Ee(this,c,a,b);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} -function ug(a){var b=nf(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.H=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.H=32768,this.F=65536,this.b-=7}function vg(){this.ta(24,0,-9);this.b-=20} -function wg(){this.w&49152?(this.R|=128,this.ta(4,0,-8)):(this.ua&&1120==this.ka&&this.ua.setData(this.g[0],!0),this.G?xg(this.G):this.ba());this.b-=7}function yg(){this.ta(16,0,-9);this.b-=20}var zg=[0,7,7,10,7,11,9,13];function Ag(a){this.la=this.b;ue(this,Qe(this,a));this.b=this.la-zg[this.u]}var Bg=[0,14,14,17,14,18,16,20];function Cg(a){this.la=this.b;var b=Qe(this,a);a=a>>6&7;Fe(this,this.g[a]);this.g[a]=this.g[7];ue(this,b);this.b=this.la-Bg[this.u]} -var Dg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Eg(a){var b=Pe(this,a);this.la=this.b;qf(this,a,b,this.Da);this.b=this.la-Dg[(this.X?8:0)+this.u]+(7!=this.j||this.u?0:2)}function Fg(a){var b=Oe(this,a);pf(this,a,b,65535,this.Da);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Gg=[7,13,13,17,14,18,17,21]; -function Hg(a){var b=nf(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.H=0;this.F=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)ue(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Og(a){U(this,a,Pe(this,a),Pf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Pg(a){U(this,a,0,Rf);this.b-=this.u?9:3+(7==this.j?2:0)}function Qg(){this.ta(28,0,-9)} -function Rg(){this.ua&&(this.ua.Gc(this.g[7],!0),this.ua.setData(this.g[0],!0));this.i|=8;Ae(this,-2);this.b-=3}function Sg(a){U(this,a,this.g[(a>>6&7)+this.bc],Sf);this.b-=this.u?9:3+(7==this.j?2:0)}function V(a){var b;if(b=this.G)b=this.G,B(b,1)?(C(b,"undefined opcode "+P(b,a),!0,!0),b=xg(b)):b=!1;b||this.ta(8,0,-9)}function qe(a){Tg[a>>12].call(this,a)}function Ug(a){Vg[a>>6&3].call(this,a)}function Wg(a){Xg[a>>6&3].call(this,a)}function Yg(a){Zg[a>>6&3].call(this,a)} -function $g(a){ah[a&15].call(this,a)}function bh(a){ch[a&15].call(this,a)}function dh(a){eh[a>>6&3].call(this,a)}function fh(a){gh[a>>6&3].call(this,a)}function hh(a){ih[a>>6&3].call(this,a)} -var Tg=[function(a){jh[a>>8&15].call(this,a)},Eg,sg,bg,Yf,$f,Tf,V,function(a){kh[a>>8&15].call(this,a)},Fg,tg,cg,Zf,ag,Og,V],jh=[function(a){lh[a>>4&15].call(this,a)},og,lg,dg,eg,jg,fg,hg,Cg,Cg,Ug,Wg,Yg,V,V,V],Vg=[function(a){qf(this,a,0,this.jb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){U(this,a,0,Df);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){U(this,a,1,Hf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){U(this,a,1,Ff);this.b-=this.u?9:3+(7==this.j?2:0)}],Xg=[function(a){U(this,a,0,Jf); -this.b-=this.u?11:6},function(a){U(this,a,we(this)?1:0,tf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){U(this,a,we(this)?1:0,Pf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=nf(this,a);this.jb(a);this.b-=this.u?4:3+(7==this.j?2:0)}],Zg=[function(a){U(this,a,0,Nf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){U(this,a,0,Lf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){U(this,a,0,xf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){U(this,a,0,vf);this.b-=this.u?9:3+(7==this.j?2:0)}],lh= -[function(a){mh[a&15].call(this,a)},V,V,V,Ag,Ag,Ag,Ag,Kg,V,$g,bh,Pg,Pg,Pg,Pg],mh=[wg,Rg,Lg,ng,yg,Jg,V,V,V,V,V,V,V,V,V,V],ah=[Ig,function(){this.F=0;this.b-=5},function(){this.H=0;this.b-=5},rg,function(){this.L=1;this.b-=5},rg,rg,rg,function(){this.I=0;this.b-=5},rg,rg,rg,rg,rg,rg,rg],ch=[Ig,function(){this.F=65536;this.b-=5},function(){this.H=32768;this.b-=5},Mg,function(){this.L=0;this.b-=5},Mg,Mg,Mg,function(){this.I=32768;this.b-=5},Mg,Mg,Mg,Mg,Mg,Mg,Mg],kh=[mg,kg,gg,ig,pg,qg,Wf,Xf,vg,Qg,dh,fh, -hh,V,V,V],eh=[function(a){pf(this,a,0,255,this.jb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){of(this,a,0,Ef);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){of(this,a,1,If);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){of(this,a,1,Gf);this.b-=this.u?9:3+(7==this.j?2:0)}],gh=[function(a){of(this,a,0,Kf);this.b-=this.u?11:6},function(a){of(this,a,we(this)?1:0,uf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){of(this,a,we(this)?1:0,Qf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=mf(this, -a);this.jb(a<<8);this.b-=this.u?4:3+(7==this.j?2:0)}],ih=[function(a){of(this,a,0,Of);this.b-=this.u?9+(this.oc&1):3+(7==this.j?2:0)},function(a){of(this,a,0,Mf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){of(this,a,0,yf);this.b-=this.u?9+(this.oc&1):3+(7==this.j?2:0)},function(a){of(this,a,0,wf);this.b-=this.u?9:3+(7==this.j?2:0)}];function re(a){nh[a>>12].call(this,a)} -var nh=[function(a){oh[a>>8&15].call(this,a)},Eg,sg,bg,Yf,$f,Tf,function(a){ph[a>>8&15].call(this,a)},function(a){qh[a>>8&15].call(this,a)},Fg,tg,cg,Zf,ag,Og,V],oh=[function(a){rh[a>>4&15].call(this,a)},og,lg,dg,eg,jg,fg,hg,Cg,Cg,Ug,Wg,Yg,function(a){sh[a>>6&3].call(this,a)},V,V],sh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.na(a|this.Ga);ue(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Me(this,a,0);this.Da(a);Fe(this,a);this.b-=11},function(a){var b=He(this); -this.la=this.b;this.Da(b);Ne(this,a,0,b);this.b=this.la-Gg[this.u]},function(a){qf(this,a,ze(this)?65535:0,this.Da);this.b-=this.u?9:3+(7==this.j?2:0)}],rh=[function(a){th[a&15].call(this,a)},V,V,V,Ag,Ag,Ag,Ag,Kg,function(a){!(a&8)||1145>this.ka?V.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},$g,bh,Pg,Pg,Pg,Pg],th=[wg,Rg,function(){Ge(this);this.i|=this.w&16;this.b-=13},ng,yg,Jg,Lg,function(a){V.call(this,a)},V,V,V,V,V,V,V,V],ph=[Hg,Hg,ug,ug,Uf,Uf,Vf,Vf, -Sg,Sg,V,V,V,V,Ng,Ng],qh=[mg,kg,gg,ig,pg,qg,Wf,Xf,vg,Qg,dh,fh,hh,function(a){1145>this.ka?V.call(this,a):uh[a>>6&3].call(this,a)},V,V],uh=[function(a){V.call(this,a)},function(a){a=Me(this,a,65536);this.Da(a);Fe(this,a);this.b-=11},function(a){var b=He(this);this.la=this.b;this.Da(b);Ne(this,a,65536,b);this.b=this.la-Gg[this.u]},function(a){V.call(this,a)}]; -function vh(a){q.call(this,"ROM",a,0,128);this.ha=this.g=null;this.u=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Qa(this.j);if(this.j){a=this.j;var b=Ra(this.B);"json"!=b&&"hex"!=b&&(a=eb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;cb(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(xa(c.nb,a,b),(a=db(a,b))?(c.g=a.ca,c.ha=a.ha):c.j=null);wh(c)})}}p(vh,q); -h=vh.prototype;h.wa=function(a,b,c,d){this.D=b;this.f=c;this.G=d;wh(this)};h.ya=function(){this.ha&&(this.G&&xh(this.G,this.id,this.u,this.b,this.ha),delete this.ha);return!0};h.xa=function(){return!0}; -function wh(a){if(!La(a)){if(a.j){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Ja(a,"ROM size ("+I(a.g.length,8,!0)+") does not match specified size ("+I(a.b,8,!0)+")");else{var b;a:{b=a.u;if(57344<=b&&b<57344+Nc){var c={},c=(c[b]=[vh.prototype.Me,vh.prototype.Xf,null,null,null,a.b>>1],c);if(Yb(a.D,a,c)){a.status("Added "+a.b+"-byte ROM at "+H(b));b=a.w=!0;break a}}else if(Tc(a.D,b,a.b,Kd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){C(a,"invalid block at offset "+J(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,E=r-=6;0=b.length){C(a,"insufficient data for block at offset "+J(n),4096);break}m+= -b[l++]&255;if(m&255){C(a,"invalid checksum ("+I(m,2,!0)+") for block at offset "+J(n),4096);break}if(E)for(C(a,"loading "+J(E)+" bytes at "+J(u)+"-"+J(u+E),4096);E--;)bd(a.D,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&C(a,"starting address: "+J(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=ua.Jc&&c<=ua.Gd&&(b=c-(ua.Jc-ua.ud));b&&(a.preventDefault&&a.preventDefault(),d.ic(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ua.wd&&(b=ua.vd);d.ic(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); -a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ic(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;var e=this;this.R=ld(this.f,this.M?-1:48,4,262144);this.S=hd(this.f,function(){var a;a=-1;e.i.length&&(a=e.i.shift()&255,C(e,"receiveByte("+I(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),kd(e.f,e.S,1E3/Math.round(e.U/10)));0<=a&&(e.F=a,e.b&128?e.F|=49152:e.b|=128,e.b&64&&id(c,e.R))});this.O=ld(this.f,this.M?-1:52,4,262144);this.X=hd(this.f,function(){e.g|=128;e.g&64&&id(c,e.O)});Yb(b,this,Eh,this.M?64832+8*(this.M-1)-65392:0);$b(b,this.reset.bind(this)); -A(this)};h.md=function(a){if(!this.j){var b=ae(this.J,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Za(c[0]);if(d!=this.mb)return;c=Za(c[1]);if(this.j=Ca(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.H=e.receiveData){this.I=a;this.P=e.receiveStatus;this.status("Connected "+this.nb+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -h.ya=function(a,b){if(!b)if(this.md(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Fh(this)};h.save=function(){var a=new L(this);a.set(0,[this.F,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Fh(this,a[0])};function Fh(a,b){b||(b=[0,8192,128,a.i]);b=ja(b);a.F=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0} -h.ic=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Ya("",c)));this.V&&!this.B&&c&&(b=String.fromCharCode(this.V)+b);this.u.value+=b;this.u.scrollTop=this.u.scrollHeight;this.B+=c}}else if(null!=this.w){if(10== -a||1024<=this.w.length)this.v(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}kd(this.f,this.X,1E3/Math.round(this.Z/10));this.g&=-129};var Dh="buffer",Gh={},Eh=(Gh[65392]=[null,null,Ch.prototype.ze,Ch.prototype.Kf,"RCSR"],Gh[65394]=[null,null,Ch.prototype.ye,Ch.prototype.Jf,"RBUF"],Gh[65396]=[null,null,Ch.prototype.ef,Ch.prototype.pg,"XCSR"],Gh[65398]=[null,null,Ch.prototype.df,Ch.prototype.og,"XBUF"],Gh); -wb(function(){for(var a=y(document,x,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.C[b]=c,!0;case "readTape":e=Kh;case "loadTape":return e||(e=Lh),this.C[b]=c,c.onclick= -function(){var a=d.C.listTapes;a&&Mh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.C[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Mh(d,Qa(b,!0),b,Lh,a)}return!1};return!0;case Nh:return this.C[b]=c,!0}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;this.I=Oh(a);var e=this;if(a=Hh(this,ae(this.J,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.H=ld(this.f,56,4,4096);this.R=hd(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=Ra(c),f="json"==e||"gz"==e?encodeURI(c):eb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!cb(f,null,!0,function(e,f,g){var k=0>g&&!!a.J&&!a.J.A.fa;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(xa(a.nb,e,f),(e=db(e,f))&&Zh(a,b,c,d,e.ca,e.Ba, -e.Aa));a.A.fb=!1;a.g&&(a.g--,a.g||A(a));Wh(a)})}function Rh(a,b,c,d){if((a=a.C.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.Y);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ra(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Sa(c,"/")&&(d="dir"),f=eb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.gc?"":e)+"&format=json"));return!!cb(f, -null,!0,function(b,c,d){gi(a,b,c,d)})} -function gi(a,b,c,d){var e=null,f=0>d&&!!a.J&&!a.J.A.fa;a.j=!1;if(d)a.controller.N('Unable to load disk "'+a.Na+'" (error '+d+": "+b+")",f);else{xa(a.controller.nb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.Y=k.length;a.ea=k[0].length;a.aa=k[0][0].length;var l=k[0][0][0];a.qa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;E>2,e=Array(d),f=0;f>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.K)return l.Kb+=l.K-f,l.K=f,!0;if(f>=l.K+l.Kb){n=l.size-(f-m);n>g&&(n=g);l.Kb=f-l.K+n;f=m+a.j;g-=n;k++;continue}}return $c(ad,f,g)}f=new K(a,f,n,a.j,d,e);Vc(f,a.G,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+bd[d]+" at "+F(b)),!0):$c(cd,b,c)}h.$c=function(a){return this.u[(a&this.w)>>>this.g].xb(a&this.i,a)}; +h.ic=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Lb||b!=this.i?this.u[c].na(b,a):this.u[c++].xb(b,a)|this.u[c&this.U].xb(0,a+1)<<8};h.ad=function(a,b){this.u[(a&this.w)>>>this.g].zb(a&this.i,b,a)};h.Ob=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Lb||c!=this.i?this.u[d].Ab(c,b,a):(this.u[d++].zb(c,b&255,a),this.u[d&this.U].zb(0,b>>8&255,a+1))};function dd(a,b){return a.b[(b&a.I)>>>a.g]} +function Jc(a,b){var c;a.F=!1;a.ma++;var d=b&a.i,e=dd(a,b);Lb||d!=a.i?c=e.B(d,b):c=e.j(d,b)|dd(a,b+1).j(0,b+1)<<8;a.ma--;return c}function ed(a,b,c){a.F=!1;a.ma++;dd(a,b).D(b&a.i,c&255,b);a.ma--}function wc(a,b,c){a.F=!1;a.ma++;var d=b&a.i,e=dd(a,b);Lb||d!=a.i?e.F(d,c&65535,b):(e.D(d,c&255,b),dd(a,b+1).D(0,c>>8&255,b+1));a.ma--} +function Zc(a){for(var b=0,c=[],d=0;da.f.ka)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Ma[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&B(this.f,16|e[5])&&C(this.f,e[4]+".readByte("+M(this.f,b)+"): "+M(this.f,c),!0,!d.ma),c;d.La(b,16,3);c=255;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to byte @"+M(this.f,b)+": "+M(this.f,c),!0,!d.ma);return c} +function Sc(a,b,c){var d=!1,e=this.controller,f=e.Ma[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ma[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&B(this.f,16|f[5])&&C(this.f,f[4]+".writeByte("+M(this.f,c)+","+M(this.f,b)+")",!0,!e.ma):(e.La(c,16,5),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to byte @"+M(this.f,c)+": "+M(this.f, +b),!0,!e.ma))}function Tc(a,b){var c=-1,d=this.controller;a=d.Ma[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".readWord("+M(this.f,b)+"): "+M(this.f,c),!0,!d.ma),c;d.La(b,16,2);c=65535;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to word @"+M(this.f,b)+": "+M(this.f,c),!0,!d.ma);return c} +function Uc(a,b,c){var d=!1,e=this.controller;a=e.Ma[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".writeWord("+M(this.f,c)+","+M(this.f,b)+")",!0,!e.ma):(e.La(c,16,4),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to word @"+M(this.f,c)+": "+M(this.f,b),!0,!e.ma))}function N(a){q.call(this,"Device",a,256);this.b={Za:128,Xc:-1}}p(N,q);h=N.prototype; +h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.G=d;var e=this;this.b.Xc=kd(c,function(){e.b.Za|=128;e.b.Za&64&&ld(e.f,e.b.ib);e.J&&J(e.J,1);md(e.f,e.b.Xc,1E3/60)});this.b.ib=nd(c,64,6,524288);ac(b,this,od);cc(b,this.reset.bind(this));d&&pd(d,64,function(a){var b=e.f;rd(e,"KIPDR",b.B[0],0,a[0]);rd(e,"KDPDR",b.B[0],8,a[0]);rd(e,"KIPAR",b.M[0],0,a[0]);rd(e,"KDPAR",b.M[0],8,a[0],!0);rd(e,"SIPDR",b.B[1],0,a[0]);rd(e,"SDPDR",b.B[1],8,a[0]);rd(e,"SIPAR",b.M[1],0,a[0]);rd(e,"SDPAR",b.M[1],8,a[0], +!0);rd(e,"UIPDR",b.B[3],0,a[0]);rd(e,"UDPDR",b.B[3],8,a[0]);rd(e,"UIPAR",b.M[3],0,a[0]);rd(e,"UDPAR",b.M[3],8,a[0],!0);b.V&32&&rd(e,"UNIMAP",b.Fa,-1,a[0])});A(this)};function rd(a,b,c,d,e,f){a=a.G;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Fa[a>>1];return a&1?b>>16:b&65535};h.bh=function(a,b){b=b>>1&63;var c=b>>1;this.f.Fa[c]=b&1?this.f.Fa[c]&65535|(a&63)<<16:this.f.Fa[c]&-65536|a&65534};h.Mf=function(a){return this.f.B[1][a>>1&7]};h.Vg=function(a,b){this.f.B[1][b>>1&7]=a&65295};h.Kf=function(a){return this.f.B[1][(a>>1&7)+8]};h.Tg=function(a,b){this.f.B[1][(b>>1&7)+8]=a&65295};h.Lf=function(a){return this.f.M[1][a>>1&7]}; +h.Ug=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.Jf=function(a){return this.f.M[1][(a>>1&7)+8]};h.Sg=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.df=function(a){return this.f.B[0][a>>1&7]};h.qg=function(a,b){this.f.B[0][b>>1&7]=a&65295};h.bf=function(a){return this.f.B[0][(a>>1&7)+8]};h.og=function(a,b){this.f.B[0][(b>>1&7)+8]=a&65295};h.cf=function(a){return this.f.M[0][a>>1&7]};h.pg=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.B[0][b]&=65295}; +h.af=function(a){return this.f.M[0][(a>>1&7)+8]};h.ng=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.B[0][b]&=65295};h.Sf=function(a){return this.f.B[3][a>>1&7]};h.ah=function(a,b){this.f.B[3][b>>1&7]=a&65295};h.Qf=function(a){return this.f.B[3][(a>>1&7)+8]};h.Zg=function(a,b){this.f.B[3][(b>>1&7)+8]=a&65295};h.Rf=function(a){return this.f.M[3][a>>1&7]};h.$g=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Pf=function(a){return this.f.M[3][(a>>1&7)+8]}; +h.Yg=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Ib=function(a){a&=7;return this.f.w&2048?this.f.pa[a]:this.f.g[a]};h.Mb=function(a,b){b&=7;this.f.w&2048?this.f.pa[b]=a:this.f.g[b]=a};h.qf=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.zg=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.tf=function(){return this.f.g[7]};h.Cg=function(a){this.f.g[7]=a};h.Jb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.pa[a]}; +h.Nb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.pa[b]=a};h.rf=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Ag=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.sf=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Bg=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.$e=function(a){return this.f.fc[a-65504>>1]};h.mg=function(a,b){this.f.fc[b-65504>>1]=a};h.Od=function(a){return 65520==a?(fd(this.D)>>6)-1:0}; +h.Td=function(){};h.Of=function(){return 1};h.Xg=function(){};h.Ze=function(){return this.f.R};h.lg=function(){this.f.R=0};h.ff=function(){return this.f.cc};h.sg=function(a,b){b&1||(a&=255);this.f.cc=a};h.lf=function(a,b){return b?0:this.f.Va};h.vg=function(a){yd(this.f,a)};h.Nf=function(a,b){return b?0:this.f.za&65280};h.Wg=function(a){this.f.za=a|255};h.pf=function(){return zd(this.f)};h.yg=function(a){Ad(this.f,a)};h.Sd=function(a,b){B(this)&&C(this,"writeIgnored("+F(b)+"): "+F(a),!0,!0)}; +var O={},od=(O[61568]=[null,null,N.prototype.Tf,N.prototype.bh,"UNIMAP",64,1170],O[62592]=[null,null,N.prototype.Mf,N.prototype.Vg,"SIPDR",8,1145,64],O[62608]=[null,null,N.prototype.Kf,N.prototype.Tg,"SDPDR",8,1145,64],O[62624]=[null,null,N.prototype.Lf,N.prototype.Ug,"SIPAR",8,1145,64],O[62640]=[null,null,N.prototype.Jf,N.prototype.Sg,"SDPAR",8,1145,64],O[62656]=[null,null,N.prototype.df,N.prototype.qg,"KIPDR",8,1140,64],O[62672]=[null,null,N.prototype.bf,N.prototype.og,"KDPDR",8,1145,64],O[62688]= +[null,null,N.prototype.cf,N.prototype.pg,"KIPAR",8,1140,64],O[62704]=[null,null,N.prototype.af,N.prototype.ng,"KDPAR",8,1145,64],O[62798]=[null,null,N.prototype.kf,N.prototype.ug,"MMR3",1,1145,64],O[65382]=[null,null,N.prototype.ef,N.prototype.rg,"LKS"],O[65402]=[null,null,N.prototype.gf,N.prototype.tg,"MMR0",1,1140,64],O[65404]=[null,null,N.prototype.hf,N.prototype.Sd,"MMR1",1,1145,64],O[65406]=[null,null,N.prototype.jf,N.prototype.Sd,"MMR2",1,1140,64],O[65408]=[null,null,N.prototype.Sf,N.prototype.ah, +"UIPDR",8,1140,64],O[65424]=[null,null,N.prototype.Qf,N.prototype.Zg,"UDPDR",8,1145,64],O[65440]=[null,null,N.prototype.Rf,N.prototype.$g,"UIPAR",8,1140,64],O[65456]=[null,null,N.prototype.Pf,N.prototype.Yg,"UDPAR",8,1145,64],O[65472]=[null,null,N.prototype.Ib,N.prototype.Mb,"R0SET0"],O[65473]=[null,null,N.prototype.Ib,N.prototype.Mb,"R1SET0"],O[65474]=[null,null,N.prototype.Ib,N.prototype.Mb,"R2SET0"],O[65475]=[null,null,N.prototype.Ib,N.prototype.Mb,"R3SET0"],O[65476]=[null,null,N.prototype.Ib, +N.prototype.Mb,"R4SET0"],O[65477]=[null,null,N.prototype.Ib,N.prototype.Mb,"R5SET0"],O[65478]=[null,null,N.prototype.qf,N.prototype.zg,"R6KERNEL"],O[65479]=[null,null,N.prototype.tf,N.prototype.Cg,"R7KERNEL"],O[65480]=[null,null,N.prototype.Jb,N.prototype.Nb,"R0SET1",1,1145],O[65481]=[null,null,N.prototype.Jb,N.prototype.Nb,"R1SET1",1,1145],O[65482]=[null,null,N.prototype.Jb,N.prototype.Nb,"R2SET1",1,1145],O[65483]=[null,null,N.prototype.Jb,N.prototype.Nb,"R3SET1",1,1145],O[65484]=[null,null,N.prototype.Jb, +N.prototype.Nb,"R4SET1",1,1145],O[65485]=[null,null,N.prototype.Jb,N.prototype.Nb,"R5SET1",1,1145],O[65486]=[null,null,N.prototype.rf,N.prototype.Ag,"R6SUPER",1,1145],O[65487]=[null,null,N.prototype.sf,N.prototype.Bg,"R6USER",1,1145],O[65504]=[null,null,N.prototype.$e,N.prototype.mg,"CTRL",8,1170],O[65520]=[null,null,N.prototype.Od,N.prototype.Td,"LSIZE",1,1170],O[65522]=[null,null,N.prototype.Od,N.prototype.Td,"HSIZE",1,1170],O[65524]=[null,null,N.prototype.Of,N.prototype.Xg,"SYSID",1,1170],O[65526]= +[null,null,N.prototype.Ze,N.prototype.lg,"ERR",1,1170],O[65528]=[null,null,N.prototype.ff,N.prototype.sg,"MBR",1,1170],O[65530]=[null,null,N.prototype.lf,N.prototype.vg,"PIR"],O[65532]=[null,null,N.prototype.Nf,N.prototype.Wg,"SLR"],O[65534]=[null,null,N.prototype.pf,N.prototype.yg,"PSW"],O); +yb(function(){for(var a=y(document,x,"device"),b=0;b>1),this.b=new Int32Array(this.u,0,this.size>>2),Gd(this,Hd?Id:Rd);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.Xe=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.Zf=function(a,b){Kb&&a&1&&this.C.La(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8}; +h.jg=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Xa=!0};h.Ve=function(a,b){this.f&&null!=this.K&&Yd(this.f,this.K+a);return this.j(a,b)};h.Vf=function(a,b){this.f&&null!=this.K&&Yd(this.f,this.K+a,2);return this.B(a,b)}; +h.hg=function(a,b,c){this.f&&null!=this.K&&Zd(this.f,this.K+a);this.J?this.Lb(0,b,c):this.D(a,b,c)};h.eh=function(a,b,c){this.f&&null!=this.K&&Zd(this.f,this.K+a,2);this.J?this.Lb(0,b,c):this.F(a,b,c)};h.Ue=function(a){return this.g[a]};h.We=function(a,b){a=this.g[a];this.f&&B(this.f,32)&&C(this.f,"Memory.readByte("+M(this.f,b)+"): "+M(this.f,a),!0);return a};h.Uf=function(a,b){Kb&&a&1&&this.C.La(b,64,2);return this.w.getUint16(a,!0)}; +h.Yf=function(a,b){Kb&&a&1&&this.C.La(b,64,2);a=!Lb&&a&1?this.g[a]|this.g[a+1]<<8:this.H[a>>1];this.f&&B(this.f,32)&&C(this.f,"Memory.readWord("+M(this.f,b)+"): "+M(this.f,a),!0);return a};h.gg=function(a,b){this.g[a]=b;this.Xa=!0};h.ig=function(a,b,c){this.g[a]=b;this.Xa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeByte("+M(this.f,c)+","+M(this.f,b)+")",!0)};h.dh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);this.w.setUint16(a,b,!0);this.Xa=!0}; +h.fh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);!Lb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.H[a>>1]=b;this.Xa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeWord("+M(this.f,c)+","+M(this.f,b)+")",!0)};var Ed=0,gd=1,Fd=2,Xc=4,bd=["NONE","RAM","ROM","VID","H/W"],Dd=0,Td=[],Sd=[K.prototype.Xe,K.prototype.jg,K.prototype.Zf,K.prototype.gh],Wd=[K.prototype.Ve,K.prototype.hg,K.prototype.Vf,K.prototype.eh]; +if(Gb)var Rd=[K.prototype.Ue,K.prototype.gg,K.prototype.Uf,K.prototype.dh],Id=[K.prototype.We,K.prototype.ig,K.prototype.Yf,K.prototype.fh];var $d;if(Gb){var ae=new ArrayBuffer(2);(new DataView(ae)).setUint16(0,256,!0);$d=256===(new Uint16Array(ae))[0]}else $d=!1;var Hd=$d; +function be(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Cc=0;this.zc=b;this.eb=c;this.Kc=Math.round(this.zc/1E4)/100;this.qb=this.Kc*this.eb;this.Lc=this.Zb=this.ub=this.Ac=0;this.A.T=this.A.vc=!1;this.A.va=a.autoStart;"string"==typeof this.A.va&&(this.A.va="true"==this.A.va);this.A.Db=!1;this.Xb=this.Fb=0;this.Yb=+a.csStart;this.Eb=+a.csInterval;this.Gb=+a.csStop;this.ja=[];this.ud=this.cg.bind(this);this.fb=this.Ia=this.cb=this.b=this.la=this.Ha=this.Wb=this.bb=this.Hb= +this.Mc=this.pb=0;this.ua=null;A(this)}p(be,q);h=be.prototype;h.wa=function(a,b,c,d){this.J=a;this.D=b;this.G=d;this.ua=a.i;for(a=0;a=a.Fb&&(a.Fb+=a.Eb,c=!0);0<=a.Gb&&a.Gb<=je(a)&&(a.Eb=a.Gb=-1,fe(a),a.ba(),c=!0);c&&a.v(je(a)+" cycles: checksum="+H(a.Xb))}} +h.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.C[b]=c,!0;case "run":return this.C[b]=c,c.onclick=function(){var a;if(a=d.J)if(a=d.J,a.A.fa)a=!0;else{var b=null,c,k=Ba(a.id);for(c=0;ca.pb/a.qb?b=1:d=!0;a.eb=b;b=a.Kc*a.eb;if(a.qb!=b){a.qb=b;b=a.qb.toFixed(2)+"Mhz";var e=a.C.setSpeed;e&&(e.textContent=b);a.v("target speed: "+b)}c&&a.J&&ne(a.J)}tc(a,a.Ia);a.Ia=0;a.Ha=ya();a.bb=0;le(a);return d}function kd(a,b){var c=a.ja.length;a.ja.push([-1,b]);return c}function md(a,b,c,d){0<=b&&ba.ja[b][0])&&(c=a.zc*a.eb/1E3*c|0,a.A.T&&(c+=oe(a)),a.ja[b][0]=c)} +function pe(a,b){for(var c=a.ja.length-1;0<=c;c--){var d=a.ja[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function qe(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function oe(a,b){var c=a.cb-=a.b;a.b=a.la=0;b&&(a.cb=0);return c} +h.cg=function(){if(this.A.T){this.Ac>=this.zc&&le(this,!0);this.Hb=0;this.Wb=ya();if(this.bb){var a=this.Wb-this.bb;a>this.Lc&&(this.Ha+=a,this.Ha>this.Wb&&(this.Ha=this.Wb))}try{do{var b=pe(this,this.A.Db?1:this.Zb);try{this.jc(b)}catch(e){if("number"!=typeof e)throw e;}b=oe(this,!0);this.Hb+=b;this.Ia+=b;uc(this,b);sc(this,b);this.ub-=b;if(0>=this.ub){this.ub+=this.Zb;++this.Mc>=re&&(this.J&&J(this.J,void 0),this.Mc=0);break}}while(this.A.T)}catch(e){this.ba();this.J&&this.J.stop(ya(),je(this)); +Fa(this,e.stack||e.message);return}if(this.A.T){a=setTimeout;b=this.ud;this.bb=ya();var c=this.Lc;this.Hb&&(c=Math.round(c*this.Hb/this.Zb));var c=c-(this.bb-this.Wb),d=this.bb-this.Ha;d&&(this.pb=Math.round(this.Ia/(10*d))/100,864E5<=d&&(this.fb=0,ke(this)));if(0>c||this.pbc&&(this.Ha-=c),c=0;this.Ac+=this.Hb;this.bb+=c;a(b,c)}}}; +function qc(a,b){if(!Ga(a))if(a.A.T)a.v(a.toString()+" busy");else{ke(a);a.A.T=!0;a.A.vc=!0;var c=a.C.run;c&&(c.textContent="Halt");a.J&&(b&&ne(a.J,!0),a.J.start(a.Ha,je(a)));a.G||a.status("Started");setTimeout(a.ud,0)}}h.jc=function(){return 0};h.ba=function(a){var b=!1;if(this.A.T){oe(this);tc(this,this.Ia);this.Ia=0;this.A.T=!1;if(b=this.C.run)b.textContent="Run";this.J&&this.J.stop(ya(),je(this));b=!0;this.G||this.status("Stopped")}this.A.complete=a;return b};var me=30,re=15,ce=["power","reset"]; +function se(a){var b=+a.model||1170;be.call(this,a,6666667);this.ka=b;this.od=+a.addrReset||0;this.Ua=this.w=this.N=this.F=this.H=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Fa=this.fc=[];this.$a=this.P=this.ld=this.rb=this.lb=this.sb=this.ab=this.R=this.cc=this.Va=this.za=this.U=this.dc=this.ec=this.V=this.i=0;this.qd=[4,2,0,1];this.gc=0;this.rd=255;1120>=this.ka?(this.kd=te.bind(this),this.Cb=this.Fe,this.gc=8,this.rd=-1,this.yd=255,this.xd=0):(this.kd=ue.bind(this),this.Cb=this.Ge, +this.yd=~(1792|(1140>=this.ka?2048:0))&65535,this.xd=1140e.yb&&(e.yb=c,c+=4)}return be.prototype.ya.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.ka);this.A.T&&this.ba();this.F=65536;this.H=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.od,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535, +65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.fc=[0,0,0,0,0,0,0,0];this.N=0;this.Ua=-1;this.u=this.j=this.yc=this.X=this.Z=this.i=this.cc=0;oc(this);ee(this);this.A.error=!1;be.prototype.reset.call(this)};function oc(a){a.U=0;a.dc=0;a.ec=0;a.V=0;a.R=0;a.Va=0;a.za=255;a.rb=0;a.lb=0;a.sb=0;a.ab=262143;a.$a=a.g[7];a.P=0;a.S=null;a.D&&(ve(a),a.ld=fd(a.D))} +function ve(a){a.Sb=a.Ec;a.Tb=a.Fc;a.wc=a.Gc;a.Ub=a.Jc;a.ac&&(a.Sb=a.Hd,a.Tb=a.Md);a.bc&&(a.wc=a.Qd,a.Ub=a.Rd);a.rb?(a.Ga=65536,a.mb=a.V&16?4186112:253952,a.Ea=a.Ld,a.na=a.ac?a.Xf:a.Vc,a.Ab=a.bc?a.ih:a.Yc,Yc(a.D,a.V&16?22:18)):(a.Ga=0,a.mb=57344,a.Ea=a.Ie,a.na=a.ac?a.Wf:a.Pd,a.Ab=a.bc?a.hh:a.Ud,Yc(a.D,16))}function td(a){var b=a.U;b&57344||(b=b&-3199|a.lb<<5|a.sb<<1);return b} +function ud(a,b){b&=-3073;if(a.U!=b){b&57344&&!(a.U&57344)&&(a.dc=a.P>>16&65535,a.ec=a.P&65535);a.U=b;a.lb=(b&96)>>5;a.sb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.rb!=c&&(a.rb=c,ve(a))}}function vd(a){a.U&57344||(a.dc=a.P>>16&65535);a=a.dc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function wd(a){a.U&57344||(a.ec=a.P&65535);return a.ec}function xd(a,b){1170>a.ka&&(b&=-49);a.V!=b&&(a.V=b,a.ab=b&16?4194303:262143,ve(a))} +function we(a,b,c){a.od=b;xe(a,b);Ad(a,0);a.D.reset();oc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.T||qc(a)}else a.G&&a.A.fa?a.ba()||(ge(a.G),J(a.J,-1)):!1===c&&a.ba();!a.A.T&&a.ua&&a.ua.stop()}h.Id=function(){return 0}; +h.save=function(){var a=new I(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Fa,this.fc,this.R,this.cc,this.Va,this.za,this.lb,this.sb,this.$a,this.i,this.P,this.Ua,this.hc,this.kc]);a.set(1,[zd(this),td(this),vd(this),wd(this),this.V]);a.set(2,[this.fb,this.eb,this.A.va]);a.set(3,ye(this));a.set(4,qe(this));return a.data()}; +h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Fa=b.next().value;this.fc=b.next().value;this.R=b.next().value;this.cc=b.next().value;this.Va=b.next().value;this.za=b.next().value;this.lb=b.next().value;this.sb=b.next().value;this.$a=b.next().value;this.i=b.next().value;this.P=b.next().value;this.Ua=b.next().value;this.hc=b.next().value;this.kc=b.next().value;b=a[1];Ad(this,b[0]);ud(this,b[1]); +this.dc=b[2];this.ec=b[3];xd(this,b[4]);b=a[2];this.fb=b[0];ke(this,b[1]);this.A.va=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function xe(a,b){a.g[7]=b&65535}function nd(a,b,c,d){b={yb:b,jb:c,message:d||0,name:Ob[b],next:null};a.Vb.push(b);return b}function Ee(a,b){var c=a.S;if(c==b)a.S=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.S&&(a.i|=1)} +function ld(a,b){if(b){if(b!=a.S){var c=a.S;if(!c||c.jb<=b.jb)b.next=c,a.S=b;else{do{var d=c.next;if(!d||d.jb<=b.jb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&B(a,b.message|8)&&C(a,"setIRQ(vector="+F(b.yb)+",priority="+b.jb+")",!0,!0)}}function sd(a,b){b&&(Ee(a,b),b.message&&B(a,b.message|8)&&C(a,"clearIRQ(vector="+F(b.yb)+",priority="+b.jb+")",!0,!0))}function ye(a){var b=[];for(a=a.S;a;)b.push(a.yb),a=a.next;return b} +function Fe(a){return a.i&64?(a.ta(168,64,-6),!0):a.i&32?(a.ta(4,32,-5),!0):a.i&16?(a.ta(12,16,-7),!0):!1}function zd(a){return a.w=a.w&63728|Ce(a)|Be(a)|Ae(a)|ze(a)}function Ad(a,b){b&=a.yd;a.I=b<<12;a.L=~b&4;a.H=b<<14;a.F=b<<16;if((b^a.w)&a.xd)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.N=b>>14&3;c=a.w>>14&3;a.N!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.N]);a.w=b;a.i&=-3;a.i|=a.S?2:1}function yd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.Va=b} +h.Da=function(a){this.I=this.L=a;this.H=0};h.kb=function(a,b){this.I=this.L=this.F=a;this.H=b||0};function Ge(a,b){a.I=a.L=a.F=b;a.H=a.I^a.F>>1}function He(a,b,c,d){a.I=a.L=a.F=b;a.H=(c^d)&(d^b)} +h.ta=function(a,b,c){if(!this.oa){0>this.Ua?this.Ua=zd(this):this.N||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.R|=4,this.g[6]=a=4);if(-1!=c){this.P=a|4143316992;this.N=0;var d=this.na(a|this.Ga),e=this.na(a+2&65535|this.Ga);Ad(this,e&-12289|this.Ua>>2&12288);Ie(this,this.Ua);Ie(this,this.g[7]);xe(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Ua=-1;this.hc=c;this.kc=a;-1==c&&this.ba();if(-4<=c)throw a;}}; +function Je(a){var b=Ke(a),c=Ke(a);a.w&49152&&(c=c&-225|a.w&63712);xe(a,b);Ad(a,c);a.i&=-17}function Le(a,b){var c=b>>13&31;31>c&&(b=a.V&32?a.Fa[c]+(b&8191)&4194303:b&-3932161);return b} +function Me(a,b,c){var d=[];if(c){c=Le(a,b);var e=b>>13&31;d.push(c);d.push(e);a.V&32&&(d.push(a.Fa[e]),d.push(b&8191))}else if(a.rb){var e=a.N<<1,f=b>>13;7>13;a.V&a.qd[a.N]||(d&=7);e=a.B[a.N][d];f=(a.M[a.N][d]<<6)+(b&8191)&a.ab;3932160<=f&&(f=Le(a,f));if(a.oa)return f;f>=a.ld&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.B[a.N][d]=e;if(f!=(4194170&a.ab)||a.N)a.lb=a.N,a.sb=d;g&&(g&57344&&(0<=a.Ua&&(g|=128),a.U&57344||(g|=a.U&4096|a.lb<<5|a.sb<<1,ud(a,a.U&-61695|g&61694)),a.ta(168,64,-2)),a.U&61440||!(f<(4191360&a.ab)||f>(4194239&a.ab))||(a.U|=4096,a.U&512&&(a.i|=64)));return f}function Ke(a){var b=a.na(a.g[6]|a.Ga);a.g[6]=a.g[6]+2&65535;return b}function Ie(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.P=a.P&65535|(a.P&-65536)<<8|16121856;a.i&256||a.Cb(4,-2,c);a.Ab(c,b)} +function Ne(a,b,c,d){var e,f,g=d&8?0:a.Ga;switch(b){case 0:return a.ta(4,0,-3),0;case 1:return 6==c&&a.Cb(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Cb(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Cb(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(De(a,2)),e=e+a.g[c]&65535,6==c&&a.Cb(d, +0,e),a.b-=6,e|g;case 7:return e=a.na(De(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ga),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.P=a.P&65535|(a.P&-65536)<<8|(f<<3&248|c)<<16;return e}h.Fe=function(a,b,c){!this.N&&0>=b&&c<=this.za&&(this.i|=32)};h.Ge=function(a,b,c){this.N||(65534<=c&&(c|=-65536),a&4&&c<=this.za&&(c<=this.za-32?this.ta(4,0,-4):(this.R|=8,this.i|=32)))};h.Hd=function(a){this.G&&Yd(this.G,a,1);return this.Ec(a)};h.Md=function(a){this.G&&Yd(this.G,a,2);return this.Fc(a)}; +h.Qd=function(a,b){this.G&&Zd(this.G,a,1);this.Gc(a,b)};h.Rd=function(a,b){this.G&&Zd(this.G,a,2);this.Jc(a,b)};function Kc(a,b){a.oa++;b=a.D.ic(xc(a,b,2));a.oa--;return b}function Oe(a,b){(b?--a.bc:--a.ac)||ve(a)}h.Ie=function(a,b,c){return Ne(this,a,b,c)};h.Ld=function(a,b,c){return xc(this,Ne(this,a,b,c),c)};h.Pd=function(a){return this.D.ic(this.$a=a)};h.Wf=function(a){this.G&&Yd(this.G,a,2);return this.Pd(a)};h.Vc=function(a){return this.D.ic(this.$a=xc(this,a,2))}; +h.Xf=function(a){this.G&&Yd(this.G,a,2);return this.Vc(a)};h.Ud=function(a,b){this.D.Ob(this.$a=a,b)};h.hh=function(a,b){this.G&&Zd(this.G,a,2);this.Ud(a,b)};h.Yc=function(a,b){this.D.Ob(this.$a=xc(this,a,4),b)};h.ih=function(a,b){this.G&&Zd(this.G,a,2);this.Yc(a,b)};function Pe(a,b,c){var d=a.j=b&7;(b=a.u=(b&56)>>3)?(d=Ne(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.N=a.w>>12&3,c=a.na(d|c&a.Ga),a.N=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} +function Qe(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=Ne(a,b,e,4),c&65536||(e&=65535),a.N=a.w>>12&3,e=xc(a,e|c&65536,4),a.N=a.w>>14&3,a.Ub(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Re(a,b){b>>=6;var c=a.Z=b&7;return(b=a.X=(b&56)>>3)?a.Sb(a.Ea(b,c,3)):a.g[c+a.gc]&a.rd}function Se(a,b){var c;b>>=6;var d=a.Z=b&7;(b=a.X=(b&56)>>3)?c=a.Tb(a.Ea(b,d,2)):c=a.g[d+a.gc];return c}function Te(a,b){var c=a.j=b&7;b=a.u=(b&56)>>3;return Ne(a,b,c,8)} +function Ue(a,b){var c=a.j=b&7;return(b=a.u=(b&56)>>3)?a.Sb(a.Ea(b,c,3)):a.g[c]&255}function Ve(a,b){var c,d=a.j=b&7;(b=a.u=(b&56)>>3)?c=a.Tb(a.Ea(b,d,2)):c=a.g[d];return c}function We(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.yc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.wc(e,d.call(a,c,a.Sb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} +function S(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,6),a.Ub(e,d.call(a,0>c?a.g[-c-1]:c,a.Tb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function sf(a,b,c,d,e){var f=a.j=b&7;(b=a.u=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.wc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} +function tf(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Ub(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} +h.jc=function(a){this.A.complete=!0;var b=this.G?uf(this.G)?1:this.A.vc?-1:0:0,c=a?this.A.vc?0:1:-1;this.A.vc=!1;this.cb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(vf(this.G,this.g[7],c)){this.ba();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.Va&224)>>5,f=this.S&&this.S.jb>e?this.S:null;f&&(d=f.yb,e=f.jb);e>(this.w&224)>>5?(this.i&8&&(De(this,2),this.i&=-9),this.ta(d,0,-10),e=!0):e=!1;e&&(f&&Ee(this,f),a=!0);this.S||this.Va||(this.i&=-3)}else this.i& +1&&this.i++;if(a){if(this.i&4&&vf(this.G,this.g[7],c)){this.ba();break}if(0>c)break}if(this.i&112&&Fe(this)){if(this.i&4&&vf(this.G,this.g[7],c)){this.ba();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.kd(f)}while(0>1|b<<16;Ge(this,a);return a&65535}function Bf(a,b){a=b&128|b>>1|b<<8;Ge(this,a<<8);return a&255}function Cf(a,b){a=b&~a;this.Da(a);return a}function Df(a,b){a=b&~a;this.Da(a<<8);return a} +function Ef(a,b){a|=b;this.Da(a);return a}function Ff(a,b){a|=b;this.Da(a<<8);return a}function Gf(a,b){a=~b|65536;this.kb(a);return a&65535}function Hf(a,b){a=~b|256;this.kb(a<<8);return a&255}function If(a,b){this.I=this.L=a=b-a;this.H=b&(b^a);return a&65535}function Jf(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.H=b&(b^c);return a&255}function Kf(a,b){this.I=this.L=a=b+a;this.H=a&(b^a);return a&65535}function Lf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.H=c&(b<<8^c);return a&255} +function Mf(a,b){a=-b;this.kb(a,a&b&32768);return a&65535}function Nf(a,b){a=-b;this.kb(a<<8,(a&b&128)<<8);return a&255}function Of(a,b){a=b<<1|this.F>>16&1;Ge(this,a);return a&65535}function Pf(a,b){a=b<<1|this.F>>16&1;Ge(this,a<<8);return a&255}function Qf(a,b){a=(this.F&65536|b)>>1|b<<16;Ge(this,a);return a&65535}function Rf(a,b){a=((this.F&65536)>>8|b)>>1|b<<8;Ge(this,a<<8);return a&255}function Sf(a,b){var c=b-a;He(this,c,a,b);return c&65535} +function Tf(a,b){var c=b-a;He(this,c<<8,a<<8,b<<8);return c&255}function Uf(a,b){this.I=this.L=b&65280;this.H=this.F=0;return(b<<8|b>>8)&65535}function Vf(a,b){a^=b;this.Da(a);return a&65535}function Wf(a){S(this,a,Se(this,a),wf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function Xf(a){var b=Ve(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.F=this.H=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.H=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.u?6:7)+b} +function Yf(a){var b=Ve(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&=63;if(b&32){b=64-b;32>b-1;this.F=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.u?6:7)+b}function Zf(a){R(this,a,!ze(this))}function $f(a){R(this,a,ze(this))} +function ag(a){S(this,a,Se(this,a),Cf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function bg(a){We(this,a,Re(this,a),Df);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function cg(a){S(this,a,Se(this,a),Ef);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function dg(a){We(this,a,Re(this,a),Ff);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function eg(a){var b=Se(this,a);a=Ve(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function fg(a){var b=Re(this,a);a=Ue(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function gg(a){R(this,a,Be(this))}function hg(a){R(this,a,!Ce(this)==!Ae(this))}function ig(a){R(this,a,!Be(this)&&!Ce(this)==!Ae(this))}function jg(a){R(this,a,!ze(this)&&!Be(this))} +function kg(a){R(this,a,Be(this)||!Ce(this)!=!Ae(this))}function lg(a){R(this,a,ze(this)||Be(this))}function mg(a){R(this,a,!Ce(this)!=!Ae(this))}function ng(a){R(this,a,Ce(this))}function og(a){R(this,a,!Be(this))}function pg(a){R(this,a,!Ce(this))}function qg(){this.ta(12,0,-9)}function rg(a){R(this,a,!0)}function sg(a){R(this,a,!Ae(this))}function tg(a){R(this,a,Ae(this))}function ug(a){a&1&&(this.F=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} +function vg(a){var b=Se(this,a);a=Ve(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;He(this,c,a,b);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function wg(a){var b=Re(this,a);a=Ue(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);He(this,c,a,b);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} +function xg(a){var b=Ve(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.H=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.H=32768,this.F=65536,this.b-=7}function yg(){this.ta(24,0,-9);this.b-=20} +function zg(){this.w&49152?(this.R|=128,this.ta(4,0,-8)):(this.ua&&1120==this.ka&&this.ua.setData(this.g[0],!0),this.G?Ag(this.G):this.ba());this.b-=7}function Bg(){this.ta(16,0,-9);this.b-=20}var Cg=[0,7,7,10,7,11,9,13];function Dg(a){this.la=this.b;xe(this,Te(this,a));this.b=this.la-Cg[this.u]}var Eg=[0,14,14,17,14,18,16,20];function Fg(a){this.la=this.b;var b=Te(this,a);a=a>>6&7;Ie(this,this.g[a]);this.g[a]=this.g[7];xe(this,b);this.b=this.la-Eg[this.u]} +var Gg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Hg(a){var b=Se(this,a);this.la=this.b;tf(this,a,b,this.Da);this.b=this.la-Gg[(this.X?8:0)+this.u]+(7!=this.j||this.u?0:2)}function Ig(a){var b=Re(this,a);sf(this,a,b,65535,this.Da);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Jg=[7,13,13,17,14,18,17,21]; +function Kg(a){var b=Ve(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.H=0;this.F=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)xe(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Rg(a){S(this,a,Se(this,a),Sf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Sg(a){S(this,a,0,Uf);this.b-=this.u?9:3+(7==this.j?2:0)}function Tg(){this.ta(28,0,-9)} +function Ug(){this.ua&&(this.ua.Wc(this.g[7],!0),this.ua.setData(this.g[0],!0));this.i|=8;De(this,-2);this.b-=3}function Vg(a){S(this,a,this.g[(a>>6&7)+this.gc],Vf);this.b-=this.u?9:3+(7==this.j?2:0)}function T(a){var b;if(b=this.G)b=this.G,B(b,1)?(C(b,"undefined opcode "+M(b,a),!0,!0),b=Ag(b)):b=!1;b||this.ta(8,0,-9)}function te(a){Wg[a>>12].call(this,a)}function Xg(a){Yg[a>>6&3].call(this,a)}function Zg(a){$g[a>>6&3].call(this,a)}function ah(a){bh[a>>6&3].call(this,a)} +function ch(a){dh[a&15].call(this,a)}function eh(a){fh[a&15].call(this,a)}function gh(a){hh[a>>6&3].call(this,a)}function ih(a){jh[a>>6&3].call(this,a)}function kh(a){lh[a>>6&3].call(this,a)} +var Wg=[function(a){mh[a>>8&15].call(this,a)},Hg,vg,eg,ag,cg,Wf,T,function(a){nh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Rg,T],mh=[function(a){oh[a>>4&15].call(this,a)},rg,og,gg,hg,mg,ig,kg,Fg,Fg,Xg,Zg,ah,T,T,T],Yg=[function(a){tf(this,a,0,this.kb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,0,Gf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,1,Kf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,1,If);this.b-=this.u?9:3+(7==this.j?2:0)}],$g=[function(a){S(this,a,0,Mf); +this.b-=this.u?11:6},function(a){S(this,a,ze(this)?1:0,wf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,ze(this)?1:0,Sf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=Ve(this,a);this.kb(a);this.b-=this.u?4:3+(7==this.j?2:0)}],bh=[function(a){S(this,a,0,Qf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,0,Of);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,0,Af);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,0,yf);this.b-=this.u?9:3+(7==this.j?2:0)}],oh= +[function(a){ph[a&15].call(this,a)},T,T,T,Dg,Dg,Dg,Dg,Ng,T,ch,eh,Sg,Sg,Sg,Sg],ph=[zg,Ug,Og,qg,Bg,Mg,T,T,T,T,T,T,T,T,T,T],dh=[Lg,function(){this.F=0;this.b-=5},function(){this.H=0;this.b-=5},ug,function(){this.L=1;this.b-=5},ug,ug,ug,function(){this.I=0;this.b-=5},ug,ug,ug,ug,ug,ug,ug],fh=[Lg,function(){this.F=65536;this.b-=5},function(){this.H=32768;this.b-=5},Pg,function(){this.L=0;this.b-=5},Pg,Pg,Pg,function(){this.I=32768;this.b-=5},Pg,Pg,Pg,Pg,Pg,Pg,Pg],nh=[pg,ng,jg,lg,sg,tg,Zf,$f,yg,Tg,gh,ih, +kh,T,T,T],hh=[function(a){sf(this,a,0,255,this.kb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,0,Hf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,1,Lf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,1,Jf);this.b-=this.u?9:3+(7==this.j?2:0)}],jh=[function(a){We(this,a,0,Nf);this.b-=this.u?11:6},function(a){We(this,a,ze(this)?1:0,xf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,ze(this)?1:0,Tf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=Ue(this, +a);this.kb(a<<8);this.b-=this.u?4:3+(7==this.j?2:0)}],lh=[function(a){We(this,a,0,Rf);this.b-=this.u?9+(this.yc&1):3+(7==this.j?2:0)},function(a){We(this,a,0,Pf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,0,Bf);this.b-=this.u?9+(this.yc&1):3+(7==this.j?2:0)},function(a){We(this,a,0,zf);this.b-=this.u?9:3+(7==this.j?2:0)}];function ue(a){qh[a>>12].call(this,a)} +var qh=[function(a){rh[a>>8&15].call(this,a)},Hg,vg,eg,ag,cg,Wf,function(a){sh[a>>8&15].call(this,a)},function(a){th[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Rg,T],rh=[function(a){uh[a>>4&15].call(this,a)},rg,og,gg,hg,mg,ig,kg,Fg,Fg,Xg,Zg,ah,function(a){vh[a>>6&3].call(this,a)},T,T],vh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.na(a|this.Ga);xe(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Pe(this,a,0);this.Da(a);Ie(this,a);this.b-=11},function(a){var b=Ke(this); +this.la=this.b;this.Da(b);Qe(this,a,0,b);this.b=this.la-Jg[this.u]},function(a){tf(this,a,Ce(this)?65535:0,this.Da);this.b-=this.u?9:3+(7==this.j?2:0)}],uh=[function(a){wh[a&15].call(this,a)},T,T,T,Dg,Dg,Dg,Dg,Ng,function(a){!(a&8)||1145>this.ka?T.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},ch,eh,Sg,Sg,Sg,Sg],wh=[zg,Ug,function(){Je(this);this.i|=this.w&16;this.b-=13},qg,Bg,Mg,Og,function(a){T.call(this,a)},T,T,T,T,T,T,T,T],sh=[Kg,Kg,xg,xg,Xf,Xf,Yf,Yf, +Vg,Vg,T,T,T,T,Qg,Qg],th=[pg,ng,jg,lg,sg,tg,Zf,$f,yg,Tg,gh,ih,kh,function(a){1145>this.ka?T.call(this,a):xh[a>>6&3].call(this,a)},T,T],xh=[function(a){T.call(this,a)},function(a){a=Pe(this,a,65536);this.Da(a);Ie(this,a);this.b-=11},function(a){var b=Ke(this);this.la=this.b;this.Da(b);Qe(this,a,65536,b);this.b=this.la-Jg[this.u]},function(a){T.call(this,a)}]; +function yh(a){q.call(this,"ROM",a,128);this.ha=this.g=null;this.u=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Sa(this.j);if(this.j){a=this.j;var b=Ta(this.B);"json"!=b&&"hex"!=b&&(a=gb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;eb(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(wa(c.ob,a,b),(a=fb(a,b))?(c.g=a.ca,c.ha=a.ha):c.j=null);zh(c)})}}p(yh,q); +h=yh.prototype;h.wa=function(a,b,c,d){this.D=b;this.f=c;this.G=d;zh(this)};h.ya=function(){this.ha&&(this.G&&Ah(this.G,this.id,this.u,this.b,this.ha),delete this.ha);return!0};h.xa=function(){return!0}; +function zh(a){if(!Ha(a)){if(a.j){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Fa(a,"ROM size ("+H(a.g.length,8,!0)+") does not match specified size ("+H(a.b,8,!0)+")");else{var b;a:{b=a.u;if(57344<=b&&b<57344+Qc){var c={},c=(c[b]=[yh.prototype.If,yh.prototype.Rg,null,null,null,a.b>>1],c);if(ac(a.D,a,c)){a.status("Added "+a.b+"-byte ROM at "+F(b));b=a.w=!0;break a}}else if(Wc(a.D,b,a.b,Fd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){C(a,"invalid block at offset "+Ra(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,E=r-=6;0=b.length){C(a,"insufficient data for block at offset "+Ra(n),4096); +break}m+=b[l++]&255;if(m&255){C(a,"invalid checksum ("+H(m,2,!0)+") for block at offset "+Ra(n),4096);break}if(E)for(C(a,"loading "+Ra(E)+" bytes at "+Ra(u)+"-"+Ra(u+E),4096);E--;)ed(a.D,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&C(a,"starting address: "+Ra(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=ta.Zc&&c<=ta.Ae&&(b=c-(ta.Zc-ta.Wd));b&&(a.preventDefault&&a.preventDefault(),d.sc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ta.Yd&&(b=ta.Xd);d.sc(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.sc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;var e=this;this.R=nd(this.f,this.M?-1:48,4,262144);this.S=kd(this.f,function(){var a;a=-1;e.i.length&&(a=e.i.shift()&255,C(e,"receiveByte("+H(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),md(e.f,e.S,1E3/Math.round(e.U/10)));0<=a&&(e.F=a,e.b&128?e.F|=49152:e.b|=128,e.b&64&&ld(c,e.R))});this.N=nd(this.f,this.M?-1:52,4,262144);this.X=kd(this.f,function(){e.g|=128;e.g&64&&ld(c,e.N)});ac(b,this,Hh,this.M?64832+8*(this.M-1)-65392:0);cc(b,this.reset.bind(this)); +A(this)};h.Nd=function(a){if(!this.j){var b=de(this.J,"connection");if(b){var c=b.split("->");if(2==c.length){var d=ab(c[0]);if(d!=this.nb)return;c=ab(c[1]);if(this.j=Ca(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.H=e.receiveData){this.I=a;this.P=e.receiveStatus;this.status("Connected "+this.ob+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +h.ya=function(a,b){if(!b)if(this.Nd(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Ih(this)};h.save=function(){var a=new I(this);a.set(0,[this.F,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Ih(this,a[0])};function Ih(a,b){b||(b=[0,8192,128,a.i]);b=ja(b);a.F=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0} +h.sc=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Xa("",c)));this.V&&!this.B&&c&&(b=String.fromCharCode(this.V)+b);this.u.value+=b;this.u.scrollTop=this.u.scrollHeight;this.B+=c}}else if(null!=this.w){if(10== +a||1024<=this.w.length)this.v(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}md(this.f,this.X,1E3/Math.round(this.Z/10));this.g&=-129};var Gh="buffer",Jh={},Hh=(Jh[65392]=[null,null,Fh.prototype.vf,Fh.prototype.Eg,"RCSR"],Jh[65394]=[null,null,Fh.prototype.uf,Fh.prototype.Dg,"RBUF"],Jh[65396]=[null,null,Fh.prototype.ag,Fh.prototype.kh,"XCSR"],Jh[65398]=[null,null,Fh.prototype.$f,Fh.prototype.jh,"XBUF"],Jh); +yb(function(){for(var a=y(document,x,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.C[b]=c,!0;case "readTape":e=Nh;case "loadTape":return e||(e=Oh),this.C[b]=c,c.onclick= +function(){var a=d.C.listTapes;a&&Ph(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.N){c.parentNode.removeChild(c);break}this.C[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ph(d,Sa(b,!0),b,Oh,a)}return!1};return!0;case Qh:return this.C[b]=c,!0}return!1}; +h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;this.I=Rh(a);var e=this;if(a=Kh(this,de(this.J,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.H=nd(this.f,56,4,4096);this.R=kd(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=Ta(c),f="json"==e||"gz"==e?encodeURI(c):gb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!eb(f,null,!0,function(e,f,g){var k=0>g&&!!a.J&&!a.J.A.fa;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(wa(a.ob,e,f),(e=fb(e,f))&&bi(a,b,c,d,e.ca,e.Ba, +e.Aa));a.A.gb=!1;a.g&&(a.g--,a.g||A(a));Zh(a)})}function Uh(a,b,c,d){if((a=a.C.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.Y);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ua(c,"/")&&(d="dir"),f=gb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.qc?"":e)+"&format=json"));return!!eb(f, +null,!0,function(b,c,d){ji(a,b,c,d)})} +function ji(a,b,c,d){var e=null,f=0>d&&!!a.J&&!a.J.A.fa;a.j=!1;if(d)a.controller.O('Unable to load disk "'+a.Na+'" (error '+d+": "+b+")",f);else{wa(a.controller.ob,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)v(k[0]);else{a.Y=k.length;a.ea=k[0].length;a.aa=k[0][0].length;var l=k[0][0][0];a.qa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;E>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ja?f=a.Ra+a.Ja&&(a.Ja+=f-(a.Ra+a.Ja)+1):(a.Ra=f,a.Ja=1);d[f]=d[f]&~(255<g)break;e|=g<g)break;e|=g<=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.N("Unable to restore disk '"+this.Na+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=ii(this,a++);)li(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function li(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var ci=0;function S(a){q.call(this,"RK11",a,0,65536);this.L=mi(this,a.autoMount);this.F=0;this.i=Array(8);this.M=!pb("Mobi")&&window&&"FileReader"in window;this.u=[];this.hb=null;this.I=this.g=this.b=this.B=this.w=this.j=this.H=0}p(S,q); -function mi(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=S.prototype; -h.sa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.C[b]=c,c.onchange=function(){var a=d.C.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.C[b]=c,c.onchange=function(){var a=G(c.value,10);null!=a&&Gi(d, -a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&Ii(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&G(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.N("Unable to boot the selected drive"):a.da?(te(d.f,0,!0),(a=d.Vc(a,0,0,0,512,0,2))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c); -break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.i&&((a=d.i[G(a.value,10)||0])?(a=a.da)?(a=sb(ki(a),a.kc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.M)return this.C[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ii(d,Qa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=mi(this,ae(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.L[e]=a[e]);Ji(this);this.hb=ld(this.f,144,5,65536);Yb(b,this,Ki);$b(b,this.reset.bind(this));Li(this,"None",Mi,!0);this.M&&Li(this,"Local Disk",Ni);Li(this,"Remote Disk",Oi);Pi(this)||A(this)}; -h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){this.u=[];for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Gi(this,0)}}return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Ji(this)}; -h.save=function(){var a=new L(this);a.set(0,[this.I,this.g,this.b,this.B,this.w,this.j,this.H,Ri(this)]);return a.data()};h.restore=function(a){return Ji(this,a[0])}; -function Ji(a,b){b||(b=[2368,0,128,0,0,0,0]);var c=ja(b);a.I=c.next().value;a.g=c.next().value;a.b=c.next().value;a.B=c.next().value;a.w=c.next().value;a.j=c.next().value;a.H=c.next().value;b[7]&&(a.u=b[7]);for(b=0;bg||9e||e>=a.i.length)a.N("Unable to load the selected drive");else if(c)if(c==Ni)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Oi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Qa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ti(a,e,b,c,!1,d)}else Qi(a,e)} -function Ti(a,b,c,d,e,f){var g=-1,k=a.i[b];k.ra.toLowerCase()!=d.toLowerCase()&&(g++,Qi(a,b,!0),k.vb?a.N("RK11 busy"):(k.vb=!0,e&&(k.ub=!0,a.F++,B(a)&&C(a,"auto-loading disk: "+c)),k.Xa=!!f,fi(new bi(a,k,"preload"),c,d,f,a.Ad)&&g++));return g} -h.Ad=function(a,b,c,d,e){a.vb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.gb)),b=null);if(b){a.da=b;a.Na=c;a.ra=d;a:{var f;for(f=0;f=a.Y){m=64;break}n=a.seek(b,c,d+1);if(!n){m=4096;break}r=0;++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=32;break}if(!k&&(Ec(this.D,Ie(this.f,f),u|t<<8),gd(this.D))){m=1024;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Bd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var n=null,r;a||(m=128,e=0);for(;e;){var u=Gc(this.D,Ie(this.f,f));if(gd(this.D)){m=1024;break}if(!n){if(b>=a.Y){m=64;break}n=a.seek(b,c,d+1,!0);if(!n){m=4096;break}r=0;++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=32;break}if(u!=(t|E<<8)){m=1;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=32;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.zd=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&-49|f>>12&48;this.B=65536-e&65535;this.j=this.j&-16|d&15;this.g|=a;Ui(this);return!0};function Ui(a){a.b&=-32769;a.g&&(a.g|=32768,a.b|=32768,a.g&32736&&(a.b|=16384),B(a)&&C(a,a.type+": ERROR: "+H(a.g)))}h.Ee=function(){return this.I};h.Pf=function(){};h.Fe=function(){return this.g};h.Qf=function(){};h.Be=function(){return this.b&61438}; -h.Mf=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){a=!0;var b,c,d="",e=(this.j&57344)>>13,f=this.i[e],g,k,l,m,n,r;this.b&=-8321;this.g&=-4;switch(c=this.b&14){case 0:B(this)&&C(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=128;break;case 10:d="RCHK";case 4:d||(d="READ"),b=this.Vc;case 6:d||(d="WCHK");case 2:d||(d="WRITE");b||(b=this.Bd);g=(this.j&8160)>>5;k=(this.j&16)>>4;l=this.j&15;m=65536-this.B&65535;n=(this.b&48)<<12|this.w;r=this.b&2048?0:2;B(this)&&C(this,this.type+": "+ -d+"("+g+":"+k+":"+l+") "+H(n)+"--"+H(n+(m<<1)),!0,!0);if(g>=f.Y){this.g|=64;break}if(l>=f.aa){this.g|=32;break}a=b.call(this,f,g,k,l,m,n,r,6<=c,this.zd.bind(this));break;case 8:g=(this.j&8160)>>5;B(this)&&C(this,this.type+": SEEK("+g+")",!0);g'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.C[b]=c,c.onchange=function(){var a=G(c.value,10);null!=a&&Xi(d, -a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&Yi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&G(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.N("Unable to boot the selected drive"):a.da?(te(d.f,0,!0),(a=d.Wc(a,0,0,0,512,0))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.I){c.parentNode.removeChild(c); -break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.g&&((a=d.g[G(a.value,10)||0])?(a=a.da)?(a=sb(ki(a),a.kc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.I)return this.C[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Yi(d,Qa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=Wi(this,ae(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.H[e]=a[e]);Zi(this);this.hb=ld(this.f,112,5,131072);Yb(b,this,$i);$b(b,this.reset.bind(this));aj(this,"None",bj,!0);this.I&&aj(this,"Local Disk",cj);aj(this,"Remote Disk",dj);ej(this)||A(this)}; -h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Xi(this,0)}}return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Zi(this)};h.save=function(){return(new L(this)).data()}; -h.restore=function(a){return Zi(this,a[0])};function ej(a,b){b||(a.F=0);for(var c in a.H){var d=a.H[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.C.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if(c==cj)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==dj){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Qa(c);a.status("Attempting to load "+c+' as "'+b+'"')}gj(a,e,b,c,!1,d)}else fj(a,e)} -function gj(a,b,c,d,e,f){var g=-1,k=a.g[b];k.ra.toLowerCase()!=d.toLowerCase()&&(g++,fj(a,b,!0),k.vb?a.N("RL11 busy"):(k.vb=!0,e&&(k.ub=!0,a.F++,B(a)&&C(a,"auto-loading disk: "+c)),k.Xa=!!f,fi(new bi(a,k,"preload"),c,d,f,a.Dd)&&g++));return g} -h.Dd=function(a,b,c,d,e){a.vb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.gb)),b=null);b?(a.da=b,a.Na=c,a.ra=d,this.N('Loaded disk "'+c+'" in drive '+("RL"+a.gb),a.ub||e),this.J&&ke(this.J)):a.Xa=!1;a.ub&&(a.ub=!1,--this.F||A(this));Xi(this,a.gb)}; -function aj(a,b,c,d){if((a=a.C.listDisks)&&a.options){for(var e=0;e(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}Ec(this.D,Ie(this.f,f),n|r<<8);if(gd(this.D)){k=8192;break}f+=2;e--;if(m>=a.qa&&(l=null,++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Ed=function(a,b,c,d,e,f,g){var k=0;a=a.da;var l=null,m;a||(k=5120,e=0);for(;e;){var n=Gc(this.D,Ie(this.f,f));if(gd(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.qa&&(l=null,++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Cd=function(a,b,c,d,e,f){this.B=f&65535;this.b=this.b&-49|f>>12&48;this.u=f>>16&63;this.j=this.i=b<<7|(c?64:0)|d&63;this.w=65536-e&65535;a&&(this.b=this.b|a|32768);return!0};h.Je=function(){return this.b&65535}; -h.Uf=function(a){this.b=this.b&-1023|a&1022;this.u=this.u&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c="",d=this.g[(this.b&768)>>8],e=d.da,f,g,k;this.b&=-2;switch(this.b&14){case 4:this.w&8&&(this.b&=63);this.w=d.status|this.j&64|(e&&512==e.Y?128:0);break;case 6:1==(this.i&3)&&(b=this.i&65408,c=(this.i&16)<<2,this.j=this.i&4?this.j+b:this.j-b,this.i=this.j=this.j&65408|c);break;case 8:this.w=this.j;break;case 12:c="READ",b=this.Wc;case 10:c||(c="WRITE"),b||(b=this.Ed),f=this.i>>7,g=this.i&64?1:0,k= -this.i&63,!e||f>=e.Y||k>=e.aa?this.b|=37888:(a=65536-this.w&65535,e=(this.u&63)<<16|this.B,B(this)&&C(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+H(e)+"--"+H(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.Cd.bind(this)))}a&&(this.b|=129,this.b&64&&id(this.f,this.hb))}};h.He=function(){return this.B};h.Sf=function(a){this.B=a&65534};h.Ke=function(){return this.i};h.Vf=function(a){this.i=a};h.Le=function(){return this.w};h.Wf=function(a){this.w=a};h.Ie=function(){return this.u}; -h.Tf=function(a){this.u=a&63;this.b=this.b&-49|(this.u&3)<<4};var bj="",cj="?",dj="??",hj={},$i=(hj[63744]=[null,null,zd.prototype.Je,zd.prototype.Uf,"RLCS"],hj[63746]=[null,null,zd.prototype.He,zd.prototype.Sf,"RLBA"],hj[63748]=[null,null,zd.prototype.Ke,zd.prototype.Vf,"RLDA"],hj[63750]=[null,null,zd.prototype.Le,zd.prototype.Wf,"RLMP"],hj[63752]=[null,null,zd.prototype.Ie,zd.prototype.Tf,"RLBE"],hj); -function ij(a){q.call(this,"Debugger",a);this.Ca=+a.base||16;this.ia=!1;this.w=0;this.P=!1;this.u=-1;this.j=[];this.U={}}p(ij,q);ij.prototype.hd=function(){return-1};ij.prototype.jd=function(){}; -function jj(a,b,c,d){if(c)if(b){0>a.u&&a.j.length&&(a.u=0);if(0>a.u||b!=a.j[a.u])a.j.splice(0,0,b),a.u=0;a.u--}else a.P?b="end":b=a.j[a.u+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(Za(b.substring(c,f))),c=f+1}}return a} -function kj(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Na+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=li(this,a++);)oi(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function oi(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var fi=0;function pi(a,b,c,d,e,f){q.call(this,a,b,c);this.L=qi(this,b.autoMount);this.F=0;this.P=d;this.R=e;this.S=f;this.N=d.ce;this.i=Array(this.N);this.M=!mb("Mobi")&&window&&"FileReader"in window;this.u=[];this.ib=null}p(pi,q); +function qi(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=pi.prototype; +h.sa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.C[b]=c,c.onchange=function(){var a=d.C.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v(d.type+" option error: "+k.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.C[b]=c,c.onchange=function(){var a=Oa(c.value,10);null!=a&& +ri(d,a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&si(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&Oa(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.O("Unable to boot the selected drive"):a.da?(we(d.f,0,!0),(a=d.Dc(a,0,0,0,512,0,2))&&d.O("Unable to read the boot sector ("+a+")")):d.O("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c); +break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.i&&((a=d.i[Oa(a.value,10)||0])?(a=a.da)?(a=ub(ni(a),a.uc.replace(".json",".img")),v(a)):d.O("No disk loaded in drive."):d.O("No disk drive selected."))};return!0;case "mountDisk":if(this.M)return this.C[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;si(d,Sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=qi(this,de(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.L[e]=a[e]);this.Rb();this.ib=nd(this.f,this.P.xe,this.P.he,this.ia);ac(b,this,this.S);cc(b,this.reset.bind(this));Mi(this,"None",Oi,!0);this.M&&Mi(this,"Local Disk",Pi);Mi(this,"Remote Disk",Qi);Ri(this)||A(this)}; +h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){this.u=[];for(a=0;ag||9e||e>=a.i.length)a.O("Unable to load the selected drive");else if(c)if(c==Pi)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Qi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Vi(a,e,b,c,!1,d)}else Si(a,e)} +function Vi(a,b,c,d,e,f){var g=-1,k=a.i[b];k.ra.toLowerCase()!=d.toLowerCase()&&(g++,Si(a,b,!0),k.wb?a.O(a.type+" busy"):(k.wb=!0,e&&(k.vb=!0,a.F++,B(a)&&C(a,"auto-loading disk: "+c)),k.Ya=!!f,ii(new ei(a,k,"preload"),c,d,f,a.ee)&&g++));return g} +h.ee=function(a,b,c,d,e){a.wb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.O('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.hb)),b=null);if(b){a.da=b;a.Na=c;a.ra=d;a:{var f;for(f=0;f=a.Y){m=V.mc;break}n=a.seek(b,c,d+1);if(!n){m=V.vd;break}r=0;++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=V.nc;break}if(!k&&(wc(this.D,Le(this.f,f),u|t<<8),jd(this.D))){m=V.nd;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.fd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var n=null,r;a||(m=V.md,e=0);for(;e;){var u=Jc(this.D,Le(this.f,f));if(jd(this.D)){m=V.nd;break}if(!n){if(b>=a.Y){m=V.mc;break}n=a.seek(b,c,d+1,!0);if(!n){m=V.vd;break}r=0;++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=V.nc;break}if(u!=(t|E<<8)){m=V.ye;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=V.nc;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.ke=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&~U.Bb|f>>16-U.Wa.Bb&U.Bb;this.B=65536-e&65535;this.j=this.j&~Yi.Nc|d&Yi.Nc;this.g|=a;Zi(this);return!0};function Zi(a){a.b&=~U.gd;a.g&&(a.g|=V.ae,a.b|=U.gd,a.g&V.Hc&&(a.b|=U.Hc),B(a)&&C(a,a.type+": ERROR: "+F(a.g)))}h.Af=function(){return this.I};h.Jg=function(){};h.Bf=function(){return this.g};h.Kg=function(){};h.xf=function(){return this.b&U.re}; +h.Gg=function(a){this.b=this.b&~U.Ad|a&U.Ad;if(this.b&U.hd){a=!0;var b,c,d="",e=(this.j&Yi.Bc)>>Yi.Wa.Bc,f=this.i[e],g,k,l,m,n,r;this.b&=~(U.Qb|U.Oc);this.g&=~V.te;switch(c=this.b&U.lc){case $i.Vd:B(this)&&C(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=U.Qb;break;case $i.ie:d="RCHK";case $i.je:d||(d="READ"),b=this.Dc;case $i.zd:d||(d="WCHK");case $i.ze:d||(d="WRITE");b||(b=this.fd);g=(this.j&Yi.Pb)>>Yi.Wa.Pb;k=(this.j&Yi.Ic)>>Yi.Wa.Ic;l=this.j&Yi.Nc;m=65536-this.B&65535;n=(this.b&U.Bb)<< +16-U.Wa.Bb|this.w;r=this.b&U.fe?0:2;B(this)&&C(this,this.type+": "+d+"("+g+":"+k+":"+l+") "+F(n)+"--"+F(n+(m<<1)),!0,!0);if(g>=f.Y){this.g|=V.mc;break}if(l>=f.aa){this.g|=V.nc;break}a=b.call(this,f,g,k,l,m,n,r,c>=$i.zd,this.ke.bind(this));break;case $i.ue:g=(this.j&Yi.Pb)>>Yi.Wa.Pb;B(this)&&C(this,this.type+": SEEK("+g+")",!0);g'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.C[b]=c,c.onchange=function(){var a=Oa(c.value,10);null!=a&&cj(d, +a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&dj(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&Oa(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.O("Unable to boot the selected drive"):a.da?(we(d.f,0,!0),(a=d.sd(a,0,0,0,512,0))&&d.O("Unable to read the boot sector ("+a+")")):d.O("Load a disk into the drive first")},!0;case "saveDisk":if(!this.I){c.parentNode.removeChild(c); +break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.g&&((a=d.g[Oa(a.value,10)||0])?(a=a.da)?(a=ub(ni(a),a.uc.replace(".json",".img")),v(a)):d.O("No disk loaded in drive."):d.O("No disk drive selected."))};return!0;case "mountDisk":if(this.I)return this.C[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;dj(d,Sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=bj(this,de(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.H[e]=a[e]);ej(this);this.ib=nd(this.f,112,5,131072);ac(b,this,fj);cc(b,this.reset.bind(this));gj(this,"None",hj,!0);this.I&&gj(this,"Local Disk",ij);gj(this,"Remote Disk",jj);kj(this)||A(this)}; +h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";cj(this,0)}}return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){ej(this)};h.save=function(){return(new I(this)).data()}; +h.restore=function(a){return ej(this,a[0])};function kj(a,b){b||(a.F=0);for(var c in a.H){var d=a.H[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.C.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.O("Unable to load the selected drive");else if(c)if(c==ij)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==jj){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}mj(a,e,b,c,!1,d)}else lj(a,e)} +function mj(a,b,c,d,e,f){var g=-1,k=a.g[b];k.ra.toLowerCase()!=d.toLowerCase()&&(g++,lj(a,b,!0),k.wb?a.O("RL11 busy"):(k.wb=!0,e&&(k.vb=!0,a.F++,B(a)&&C(a,"auto-loading disk: "+c)),k.Ya=!!f,ii(new ei(a,k,"preload"),c,d,f,a.pe)&&g++));return g} +h.pe=function(a,b,c,d,e){a.wb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.hb)),b=null);b?(a.da=b,a.Na=c,a.ra=d,this.O('Loaded disk "'+c+'" in drive '+("RL"+a.hb),a.vb||e),this.J&&ne(this.J)):a.Ya=!1;a.vb&&(a.vb=!1,--this.F||A(this));cj(this,a.hb)}; +function gj(a,b,c,d){if((a=a.C.listDisks)&&a.options){for(var e=0;e(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}wc(this.D,Le(this.f,f),n|r<<8);if(jd(this.D)){k=8192;break}f+=2;e--;if(m>=a.qa&&(l=null,++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +h.qe=function(a,b,c,d,e,f,g){var k=0;a=a.da;var l=null,m;a||(k=5120,e=0);for(;e;){var n=Jc(this.D,Le(this.f,f));if(jd(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.qa&&(l=null,++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +h.oe=function(a,b,c,d,e,f){this.B=f&65535;this.b=this.b&-49|f>>12&48;this.u=f>>16&63;this.j=this.i=b<<7|(c?64:0)|d&63;this.w=65536-e&65535;a&&(this.b=this.b|a|32768);return!0};h.Ff=function(){return this.b&65535}; +h.Og=function(a){this.b=this.b&-1023|a&1022;this.u=this.u&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c="",d=this.g[(this.b&768)>>8],e=d.da,f,g,k;this.b&=-2;switch(this.b&14){case 4:this.w&8&&(this.b&=63);this.w=d.status|this.j&64|(e&&512==e.Y?128:0);break;case 6:1==(this.i&3)&&(b=this.i&65408,c=(this.i&16)<<2,this.j=this.i&4?this.j+b:this.j-b,this.i=this.j=this.j&65408|c);break;case 8:this.w=this.j;break;case 12:c="READ",b=this.sd;case 10:c||(c="WRITE"),b||(b=this.qe),f=this.i>>7,g=this.i&64?1:0,k= +this.i&63,!e||f>=e.Y||k>=e.aa?this.b|=37888:(a=65536-this.w&65535,e=(this.u&63)<<16|this.B,B(this)&&C(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+F(e)+"--"+F(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.oe.bind(this)))}a&&(this.b|=129,this.b&64&&ld(this.f,this.ib))}};h.Df=function(){return this.B};h.Mg=function(a){this.B=a&65534};h.Gf=function(){return this.i};h.Pg=function(a){this.i=a};h.Hf=function(){return this.w};h.Qg=function(a){this.w=a};h.Ef=function(){return this.u}; +h.Ng=function(a){this.u=a&63;this.b=this.b&-49|(this.u&3)<<4};var hj="",ij="?",jj="??",nj={},fj=(nj[63744]=[null,null,Cd.prototype.Ff,Cd.prototype.Og,"RLCS"],nj[63746]=[null,null,Cd.prototype.Df,Cd.prototype.Mg,"RLBA"],nj[63748]=[null,null,Cd.prototype.Gf,Cd.prototype.Pg,"RLDA"],nj[63750]=[null,null,Cd.prototype.Hf,Cd.prototype.Qg,"RLMP"],nj[63752]=[null,null,Cd.prototype.Ef,Cd.prototype.Ng,"RLBE"],nj); +function oj(a){q.call(this,"Debugger",a);this.Ca=+a.base||16;this.ja=!1;this.w=0;this.P=!1;this.u=-1;this.j=[];this.U={}}p(oj,q);oj.prototype.Jd=function(){return-1};oj.prototype.Kd=function(){}; +function pj(a,b,c,d){if(c)if(b){0>a.u&&a.j.length&&(a.u=0);if(0>a.u||b!=a.j[a.u])a.j.splice(0,0,b),a.u=0;a.u--}else a.P?b="end":b=a.j[a.u+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ab(b.substring(c,f))),c=f+1}}return a} +function qj(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function lj(a,b,c){var d;if(b){b=mj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=I(c,0,!0)+" "+c+". "+H(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.v((null!=b?b+": ":"")+d);return e} -function qj(a,b){if(b)return pj(a,b,a.U[b]);var c=0;for(b in a.U)pj(a,b,a.U[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function rj(a){ij.call(this,a);this.Ea=!1;this.ia=!0;this.H=W();this.za=W();this.O=W();this.B=[];this.g=this.L=this.F=[];sj(this);this.R=this.Z=0;this.i=[];this.oa=void 0;tj(this);this.G=this;this.ka={};this.ja=this.cd=0;this.S=null;this.M=[];uj(this,a.messages);this.ua=a.commands;this.Ha=vj;this.W=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.X=this.la=0;this.b=this.V=null;var b=this;window?void 0===window[x]&&(window[x]=function(a){return fe(b,a)}):void 0===global[x]&&(global[x]= -function(a){return fe(b,a)})}p(rj,ij);function wj(a){a=a&&a.K;null==a&&(a=-1);return a}function W(a,b,c){return{K:void 0===a?null:a,Ka:void 0===b?!1:b,Qa:!1,Ca:c}}h=rj.prototype;h.Gc=function(a,b){a.K=b;a.Qa=!1;a.Ca=void 0;return a};function xj(a){return[a.K,a.Ka,a.Ca,a.Qa,a.jc]}function yj(a,b){var c=W(b[0],b[1],b[2]);c.Qa=b[3];b[4]&&(c.$c=jj(a,c.jc=b[4]));return c} -h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.b=a.i;(a=ae(a,"messages"))&&uj(this,a);1140>this.f.ka&&(this.W=this.W.concat(zj));1145>this.f.ka&&(this.W=this.W.concat(Aj));nd(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=wj(Bj(d,c));if(-1===a){d.v("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.v("blockid physical blockaddr used size type");d.v("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.v("..."): -(c=n.type,m=Zc[c],n&&d.v(I(n.id,8)+" %"+I(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -h.jd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Hj:b=wd(this.f);break;case Ij:b=c.Va;break;case Jj:b=c.R;break;case Kj:b=c.za&65280;break;case Lj:b=qd(c);break;case Mj:b=sd(c);break;case Nj:b=td(c);break;case Oj:b=c.V;break;case Pj:d&&(b=d.ga);break;case Qj:d&&(b=d.Sa);break;case Rj:d&&Jc(d)&&(b=d.Ta)}}return b}; -h.message=function(a,b){b&&(a+=" @"+Ej(this,W(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.ja&1073741824)this.M.push(a);else{var c;if(this.ja&-2147483648&&this.f&&(c=this.f.A.T)||Ma(this,!0))this.ba(),c&&(a+=" (cpu halted)");this.v(a);this.f&&(a=this.f,le(a),a.tb=0,a.J&&M(a.J,void 0))}}; -function tj(a){var b;if(!rf(a))a.i&&a.i.length&&a.v("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Sj);for(b=0;b>8;a.v("trapped to "+P(a,c&255,1)+" ("+(0>d?Qb[-d]:P(a,d))+")")}a.H=W(a.f.g[7]);b&&1!=a.I?Wj(a):Xj(a)}}function Uj(a,b){var c;(c=!a.f||!La(a.f))||(c=a.f,c.A.fa?c=!0:(c.v(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.T?(b||a.v("cpu busy or unavailable, command ignored"),!1):!Ka(a.f)}h.ya=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; -h.xa=function(a,b){b&&this.v(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){tj(this);this.X=0;this.S=null;this.w=0;this.H=W(this.f.g[7]);this.A.T=!1;Yj(this);a||de(this)};h.save=function(){var a=new L(this);a.set(0,xj(this.H));a.set(1,xj(this.O));a.set(2,[this.j,this.P,this.ja]);a.set(3,this.B);return a.data()}; -h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=yj(this,a[b++]),this.O=yj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.ja|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.v("running");this.A.T=!0;this.Fa=a;this.Ga=b}; -h.stop=function(a,b){if(this.A.T){this.A.T=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Hc(a.f,b)),65535!=(d&65535)&&(a.Gc(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function xg(a){var b=a.f;if(b.A.T)throw ue(b,a.f.P&65535),a.ba(),-1;return!1}function Vd(a,b,c){Zj(a,b,c||1,a.L)&&a.ba(!1)}function Wd(a,b,c){Zj(a,b,c||1,a.F)&&a.ba(!1)} -function sj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Le(a.f,!1);a.L=["br"];if(a.F)for(b=1;b>>c.g],!0)):Le(a.f,!0);a.F=["bw"];a.la=0;a.Z=0} -h.sb=function(a,b,c){var d=!0;c||ak(this,a,b,!1,!0);if(a!=this.g){var e=wj(b);if(-1===e)this.v("invalid address: "+Ej(this,b)),d=!1;else{var f=a==this.F;65535>>g.g].sb(e&g.i,f)}else e=this.f,(f?e.Xb++:e.Wb++)||se(e)}}d&&(a.push(b),c?b.Qa=!0:(bk(this,a,a.length-1,"set"),tj(this)));return d}; -function ak(a,b,c,d,e){var f=!1;c=wj(c);for(var g=1;g>>d.g],b)):Le(a.f,b));k.Qa||tj(a);break}}return f}function ck(a,b){for(var c=1;c>23)&65535,z=P(t,u);else if(D==ik)u=u.K-((f&63)<<1)&65535,z=P(t,u);else if(D==jk)z=P(t,f&7,1);else if(D==kk)z=P(t,f&63,1);else if(D==lk)z=P(t,f&255,1);else if(D=f&E,E&mk&&(D>>=6,E>>=6),E&Y){var E=null,F=D& -nk;switch(D&ok){case 0:z=Gj(F);break;case 8:z="@"+Gj(F);E=pk(t,t.f.g[F]);break;case 16:7>F?z="("+Gj(F)+")+":(D=t.Oa(u,2),z="#"+P(t,D,0,!0));break;case 24:7>F?z="@("+Gj(F)+")+":(D=t.Oa(u,2),z="@#"+P(t,D,0,!0),E=pk(t,D));break;case 32:z="-("+Gj(F)+")";break;case 40:z="@-("+Gj(F)+")";break;case 48:D=t.Oa(u,2);z=P(t,D,0,!0)+"("+Gj(F)+")";7==F&&(z=P(t,D=D+u.K&65535),E=pk(t,D));break;case 56:D=t.Oa(u,2),z="@"+P(t,D)+"("+Gj(F)+")",7==F&&(z="@"+P(t,D=D+u.K&65535),E=pk(t,Hc(t.f,D)))}E&&(z=[z,E])}t=z;if(!t|| -!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.lb&&b=c.B&&(b=c.Ma[b&fd])&&(a=b[4]);return a}function qk(a,b){switch(b){case "N":a=ze(a.f);break;case "Z":a=ye(a.f);break;case "V":a=xe(a.f);break;case "C":a=we(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} -function Z(a,b){var c="",d=a.f;if(8>b)c=Gj(b),c+="="+P(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+P(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+P(a,d.W[b-16]);else switch(b){case Hj:c="PS="+P(a,wd(d));break;case Ij:c="PI="+P(a,d.Va);break;case Jj:c="ER="+P(a,d.R);break;case Kj:c="SL="+P(a,d.za&65280);break;case Lj:c="M0="+P(a,qd(d));break;case Mj:c="M1="+P(a,sd(d));break;case Nj:c="M2="+P(a,td(d));break;case Oj:c="M3="+P(a,d.V);break;case Pj:a.b&&(c="AR="+P(a,a.b.ga,3));break;case Qj:a.b&&(c="DR="+ -P(a,a.b.Sa));break;case Rj:a.b&&Jc(a.b)&&(c="SR="+P(a,a.b.Ta,3))}c&&(c+=" ");return c}function rk(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Hj)+Z(a,Ij)+Z(a,Kj);d+=qk(a,"T")+qk(a,"N")+qk(a,"Z")+qk(a,"V")+qk(a,"C");b&&(b=d,c=""+(Z(a,Lj)+Z(a,Mj)),c+=Z(a,Nj)+Z(a,Oj)+Z(a,Jj),c=c+"\n"+(Z(a,Rj)+Z(a,Pj)+Z(a,Qj)),d=b+("\n"+c));return d}h.dd=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=ab(n,l,a.dd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({xh:b,K:c,Qd:d,ha:e,ad:f})}function sk(a,b,c){var d=[],e=wj(b)>>>0;for(b=0;b>>0,k=f.Qd;if(e>=g&&eb)){e.g[b]= -g&65535;break}a.v("unknown register: "+f);return}M(a.J);a.v("updated registers:")}}a.v(rk(a,d));c&&(a.H=W(e.g[7]),Xj(a,Ej(a,a.H)))}}function wk(a,b){b=Za(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.v(m)}k[3]&&(g=k[3],f=null);f=ek(a,b,g,f);a.v(f);a.H=b;e-=b.K-l;c++}}} -function dk(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.v(Vj+b):(a.P&&(a.v("ended assemble at "+Ej(a,a.O)),a.H=a.O,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(La(a)&&0n||"z"Ga.length&&(a.v("note: only "+Ga.length+" available"),qa=Ga.length);wa-=qa;0>wa&&(null==Ga[Ga.length-1].K?(qa=wa+qa,wa=0):wa+=Ga.length);var Ue=[];"call"==ri&&(rc=1E5,Ue=["CALL"]);for(void 0!==qi&&a.v(qa+" instructions earlier:");0=Ga.length&&(wa=0);a.oa=qa;ti++;rc--}}ti||(a.v("no "+si+"history available"),a.oa=void 0)}else{var fa=Bj(a,Fa);if(fa)if("da"==Ta){var Ve=fa.Ka||65535K.length?(2ib&&(ib=0);65536Ze?String.fromCharCode(Ze):"."),Ed=Ed>>8}kb&&(kb+="\n");kb=We?kb+(lb+","):kb+(Fa+": "+lb+(Dd?"":" "+Ye))}kb&&a.v(kb);a.za=fa;a.Ca=$k}}}}break;case "e":if("else"== -g[0])break;var Nb,$e,af,bf,cf=g[0],df=g[1];"eb"==cf?(Nb=1,$e=255,af=a.Nc,bf=a.Oc):"e"==cf||"ew"==cf?(Nb=2,$e=65535,af=a.Oa,bf=a.yd):df=null;if(null==df)a.v("edit memory commands:"),a.v("\teb [a] [...] edit bytes at address a"),a.v("\tew [a] [...] edit words at address a");else{var Fd=Bj(a,df);if(Fd)for(var Gd=2;Gdgf;){for(var mb=null,dl=256;65536>xc.K>>>0;){hf.K=a.Oa(xc,2);if(null==xc.K||!dl--)break;if(!(hf.K&1)){for(var el=a,Hd=hf,yi=null,yc=Hd.K,zi=yc,jf=1;6>=jf&&yc;jf++){if(2> ";wb(function(){for(var a=y(document,x,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.v("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bEk){if(Fk(d,this.I)){this.u=new L(this,"1.32.2",Ok);Fk(this.u)&&(Pk(this,d),a=Qk,Rk(this.u));this.u.set(Lk,bb());Sk(this.u);var e=this.b&&!this.F;if(a==Mk||Aa("Click OK to restore the previous "+Fb+" machine state, or CANCEL to reset the machine.")){if(c=Kk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Fk(d,g):("error"==f&&"no machine state"!= -g?(this.N("Error: "+g),"unable to verify user"==g&&(ob(Tk,""),this.g=null)):this.v(f+": "+g),Rk(d),Fk(d)?(c=Kk(d),e=!0):c=!1))}e&&Ik(this,c?d:null)}else a==Qk&&d.clear()}else Ik(this);delete this.I;delete this.w}e=Ba(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.A.fa=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.f&&(Uk(this,this.f,b,c,a),M(this,-2),this.f.va());this.O&&(Pk(this,b),b.clear());!c&&this.u&&(this.u.clear(),delete this.u);this.j=0}; -function Pk(a,b){if(Aa("There may be a problem with your "+Fb+" machine.\n\nTo help us diagnose it, click OK to send this "+Fb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Fb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;cb("http://www.pcjs.org/api/v1/report",d,!0)}} -function yk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new L(a,"1.32.2"),g=new L(a,"1.32.2",Jk),k=bb();g.set(Lk,k);f.set(Lk,k);f.set(Vk,"1.32.2");f.set(Wk,window?window.location.href:null);f.set(Zk,window?window.navigator.userAgent:"");a.f&&a.f.xa&&(c&&(b&&(a.f.A.va=a.f.A.T),a.f.ba()),d=a.f.xa(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.fa=!1,!1===d&&(e=null)));for(var k=Ba(a.id),l=0;l=d||30<=(c.rc+=d))&&(e.textContent=c.A.T?c.ob.toFixed(2)+"Mhz":"Stopped",c.rc=0)}if(a.i&&(a=a.i,b=b||0,a.u)){c=a.f.A.T;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;eb?a.ga=a.f.g[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");cb(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);pl(a,b,c)}})}else c(a,null)} -function ql(a,b,c,d){function e(a){if(void 0===k){var b=g&&y(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Wa(a))}function f(a){e("Error: "+a);l&&(--ml||Ab(!0));l=!1}var g,k,l=!0;ml++;ya[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?nl(c,null,null,!1,e,function(d,l){l?(xa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--ml||Ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--ml||Ab(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?nl(b,a,d,!0,e,m):ol(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Ab(!1);return ql(a,b,c,d)};window.findMachineComponent=function(a,b){return Da(b,a+".machine")};window.enableEvents=Ab;window.sendEvent=Cb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11-dbg.map +function rj(a,b,c){var d;if(b){b=sj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=H(c,0,!0)+" "+c+". "+F(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.v((null!=b?b+": ":"")+d);return e} +function wj(a,b){if(b)return vj(a,b,a.U[b]);var c=0;for(b in a.U)vj(a,b,a.U[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; +function xj(a){oj.call(this,a);this.Ea=!1;this.ja=!0;this.H=W();this.za=W();this.N=W();this.B=[];this.g=this.L=this.F=[];yj(this);this.R=this.Z=0;this.i=[];this.oa=void 0;zj(this);this.G=this;this.ka={};this.ia=this.Ed=0;this.S=null;this.M=[];Aj(this,a.messages);this.ua=a.commands;this.Ha=Bj;this.W=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.X=this.la=0;this.b=this.V=null;var b=this;window?void 0===window[x]&&(window[x]=function(a){return ie(b,a)}):void 0===global[x]&&(global[x]= +function(a){return ie(b,a)})}p(xj,oj);function Cj(a){a=a&&a.K;null==a&&(a=-1);return a}function W(a,b,c){return{K:void 0===a?null:a,Ka:void 0===b?!1:b,Qa:!1,Ca:c}}h=xj.prototype;h.Wc=function(a,b){a.K=b;a.Qa=!1;a.Ca=void 0;return a};function Dj(a){return[a.K,a.Ka,a.Ca,a.Qa,a.tc]}function Ej(a,b){var c=W(b[0],b[1],b[2]);c.Qa=b[3];b[4]&&(c.Bd=pj(a,c.tc=b[4]));return c} +h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.b=a.i;(a=de(a,"messages"))&&Aj(this,a);1140>this.f.ka&&(this.W=this.W.concat(Fj));1145>this.f.ka&&(this.W=this.W.concat(Gj));pd(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=Cj(Hj(d,c));if(-1===a){d.v("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.v("blockid physical blockaddr used size type");d.v("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.v("..."): +(c=n.type,m=bd[c],n&&d.v(H(n.id,8)+" %"+H(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} +h.Kd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Nj:b=zd(this.f);break;case Oj:b=c.Va;break;case Pj:b=c.R;break;case Qj:b=c.za&65280;break;case Rj:b=td(c);break;case Sj:b=vd(c);break;case Tj:b=wd(c);break;case Uj:b=c.V;break;case Vj:d&&(b=d.ga);break;case Wj:d&&(b=d.Sa);break;case Xj:d&&Mc(d)&&(b=d.Ta)}}return b}; +h.message=function(a,b){b&&(a+=" @"+Kj(this,W(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.ia&1073741824)this.M.push(a);else{var c;if(this.ia&-2147483648&&this.f&&(c=this.f.A.T)||Ia(this,!0))this.ba(),c&&(a+=" (cpu halted)");this.v(a);this.f&&(a=this.f,oe(a),a.ub=0,a.J&&J(a.J,void 0))}}; +function zj(a){var b;if(!uf(a))a.i&&a.i.length&&a.v("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Yj);for(b=0;b>8;a.v("trapped to "+M(a,c&255,1)+" ("+(0>d?Mb[-d]:M(a,d))+")")}a.H=W(a.f.g[7]);b&&1!=a.I?ck(a):dk(a)}}function ak(a,b){var c;(c=!a.f||!Ha(a.f))||(c=a.f,c.A.fa?c=!0:(c.v(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.T?(b||a.v("cpu busy or unavailable, command ignored"),!1):!Ga(a.f)}h.ya=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; +h.xa=function(a,b){b&&this.v(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){zj(this);this.X=0;this.S=null;this.w=0;this.H=W(this.f.g[7]);this.A.T=!1;ek(this);a||ge(this)};h.save=function(){var a=new I(this);a.set(0,Dj(this.H));a.set(1,Dj(this.N));a.set(2,[this.j,this.P,this.ia]);a.set(3,this.B);return a.data()}; +h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=Ej(this,a[b++]),this.N=Ej(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.ia|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.v("running");this.A.T=!0;this.Fa=a;this.Ga=b}; +h.stop=function(a,b){if(this.A.T){this.A.T=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Kc(a.f,b)),65535!=(d&65535)&&(a.Wc(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function Ag(a){var b=a.f;if(b.A.T)throw xe(b,a.f.P&65535),a.ba(),-1;return!1}function Yd(a,b,c){fk(a,b,c||1,a.L)&&a.ba(!1)}function Zd(a,b,c){fk(a,b,c||1,a.F)&&a.ba(!1)} +function yj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Oe(a.f,!1);a.L=["br"];if(a.F)for(b=1;b>>c.g],!0)):Oe(a.f,!0);a.F=["bw"];a.la=0;a.Z=0} +h.tb=function(a,b,c){var d=!0;c||gk(this,a,b,!1,!0);if(a!=this.g){var e=Cj(b);if(-1===e)this.v("invalid address: "+Kj(this,b)),d=!1;else{var f=a==this.F;65535>>g.g].tb(e&g.i,f)}else e=this.f,(f?e.bc++:e.ac++)||ve(e)}}d&&(a.push(b),c?b.Qa=!0:(hk(this,a,a.length-1,"set"),zj(this)));return d}; +function gk(a,b,c,d,e){var f=!1;c=Cj(c);for(var g=1;g>>d.g],b)):Oe(a.f,b));k.Qa||zj(a);break}}return f}function ik(a,b){for(var c=1;c>23)&65535,z=M(t,u);else if(D==ok)u=u.K-((f&63)<<1)&65535,z=M(t,u);else if(D==pk)z=M(t,f&7,1);else if(D==qk)z=M(t,f&63,1);else if(D==rk)z=M(t,f&255,1);else if(D=f&E,E&sk&&(D>>=6,E>>=6),E&Y){var E=null,G=D& +tk;switch(D&uk){case 0:z=Mj(G);break;case 8:z="@"+Mj(G);E=vk(t,t.f.g[G]);break;case 16:7>G?z="("+Mj(G)+")+":(D=t.Oa(u,2),z="#"+M(t,D,0,!0));break;case 24:7>G?z="@("+Mj(G)+")+":(D=t.Oa(u,2),z="@#"+M(t,D,0,!0),E=vk(t,D));break;case 32:z="-("+Mj(G)+")";break;case 40:z="@-("+Mj(G)+")";break;case 48:D=t.Oa(u,2);z=M(t,D,0,!0)+"("+Mj(G)+")";7==G&&(z=M(t,D=D+u.K&65535),E=vk(t,D));break;case 56:D=t.Oa(u,2),z="@"+M(t,D)+"("+Mj(G)+")",7==G&&(z="@"+M(t,D=D+u.K&65535),E=vk(t,Kc(t.f,D)))}E&&(z=[z,E])}t=z;if(!t|| +!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.mb&&b=c.B&&(b=c.Ma[b&id])&&(a=b[4]);return a}function wk(a,b){switch(b){case "N":a=Ce(a.f);break;case "Z":a=Be(a.f);break;case "V":a=Ae(a.f);break;case "C":a=ze(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} +function Z(a,b){var c="",d=a.f;if(8>b)c=Mj(b),c+="="+M(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+M(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+M(a,d.W[b-16]);else switch(b){case Nj:c="PS="+M(a,zd(d));break;case Oj:c="PI="+M(a,d.Va);break;case Pj:c="ER="+M(a,d.R);break;case Qj:c="SL="+M(a,d.za&65280);break;case Rj:c="M0="+M(a,td(d));break;case Sj:c="M1="+M(a,vd(d));break;case Tj:c="M2="+M(a,wd(d));break;case Uj:c="M3="+M(a,d.V);break;case Vj:a.b&&(c="AR="+M(a,a.b.ga,3));break;case Wj:a.b&&(c="DR="+ +M(a,a.b.Sa));break;case Xj:a.b&&Mc(a.b)&&(c="SR="+M(a,a.b.Ta,3))}c&&(c+=" ");return c}function xk(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Nj)+Z(a,Oj)+Z(a,Qj);d+=wk(a,"T")+wk(a,"N")+wk(a,"Z")+wk(a,"V")+wk(a,"C");b&&(b=d,c=""+(Z(a,Rj)+Z(a,Sj)),c+=Z(a,Tj)+Z(a,Uj)+Z(a,Pj),c=c+"\n"+(Z(a,Xj)+Z(a,Vj)+Z(a,Wj)),d=b+("\n"+c));return d}h.Fd=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=cb(n,l,a.Fd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({Hi:b,K:c,Ke:d,ha:e,Cd:f})}function yk(a,b,c){var d=[],e=Cj(b)>>>0;for(b=0;b>>0,k=f.Ke;if(e>=g&&eb)){e.g[b]= +g&65535;break}a.v("unknown register: "+f);return}J(a.J);a.v("updated registers:")}}a.v(xk(a,d));c&&(a.H=W(e.g[7]),dk(a,Kj(a,a.H)))}}function Ck(a,b){b=ab(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.v(m)}k[3]&&(g=k[3],f=null);f=kk(a,b,g,f);a.v(f);a.H=b;e-=b.K-l;c++}}} +function jk(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.v(bk+b):(a.P&&(a.v("ended assemble at "+Kj(a,a.N)),a.H=a.N,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(Ha(a)&&0n||"z"Ka.length&&(a.v("note: only "+Ka.length+" available"),ua=Ka.length);Aa-=ua;0>Aa&&(null==Ka[Ka.length-1].K?(ua=Aa+ua,Aa=0):Aa+=Ka.length);var $e=[];"call"==xi&&(yc=1E5,$e=["CALL"]);for(void 0!==wi&&a.v(ua+" instructions earlier:");0=Ka.length&&(Aa=0);a.oa=ua;zi++;yc--}}zi||(a.v("no "+yi+"history available"),a.oa=void 0)}else{var ha=Hj(a,Ja);if(ha)if("da"==Ya){var af=ha.Ka||65535L.length?(2nb&&(nb=0);65536ef?String.fromCharCode(ef):"."),Ld=Ld>>8}pb&&(pb+="\n");pb=bf?pb+(qb+","):pb+(Ja+": "+qb+(Kd?"":" "+df))}pb&&a.v(pb);a.za=ha;a.Ca=fl}}}}break;case "e":if("else"== +g[0])break;var Tb,ff,gf,hf,jf=g[0],kf=g[1];"eb"==jf?(Tb=1,ff=255,gf=a.cd,hf=a.dd):"e"==jf||"ew"==jf?(Tb=2,ff=65535,gf=a.Oa,hf=a.de):kf=null;if(null==kf)a.v("edit memory commands:"),a.v("\teb [a] [...] edit bytes at address a"),a.v("\tew [a] [...] edit words at address a");else{var Md=Hj(a,kf);if(Md)for(var Nd=2;Ndnf;){for(var rb=null,jl=256;65536>Ec.K>>>0;){of.K=a.Oa(Ec,2);if(null==Ec.K||!jl--)break;if(!(of.K&1)){for(var kl=a,Od=of,Ei=null,Fc=Od.K,Fi=Fc,pf=1;6>=pf&&Fc;pf++){if(2> ";yb(function(){for(var a=y(document,x,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.v("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bKk){if(Lk(d,this.I)){this.u=new I(this,"1.32.2",Uk);Lk(this.u)&&(Vk(this,d),a=Wk,Xk(this.u));this.u.set(Rk,db());Yk(this.u);var e=this.b&&!this.F;if(a==Sk||za("Click OK to restore the previous "+Hb+" machine state, or CANCEL to reset the machine.")){if(c=Qk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Lk(d,g):("error"==f&&"no machine state"!= +g?(this.O("Error: "+g),"unable to verify user"==g&&(kb(Zk,""),this.g=null)):this.v(f+": "+g),Xk(d),Lk(d)?(c=Qk(d),e=!0):c=!1))}e&&Ok(this,c?d:null)}else a==Wk&&d.clear()}else Ok(this);delete this.I;delete this.w}e=Ba(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.A.fa=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.f&&($k(this,this.f,b,c,a),J(this,-2),this.f.va());this.N&&(Vk(this,b),b.clear());!c&&this.u&&(this.u.clear(),delete this.u);this.j=0}; +function Vk(a,b){if(za("There may be a problem with your "+Hb+" machine.\n\nTo help us diagnose it, click OK to send this "+Hb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Hb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;eb("http://www.pcjs.org/api/v1/report",d,!0)}} +function Ek(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new I(a,"1.32.2"),g=new I(a,"1.32.2",Pk),k=db();g.set(Rk,k);f.set(Rk,k);f.set(al,"1.32.2");f.set(bl,window?window.location.href:null);f.set(el,window?window.navigator.userAgent:"");a.f&&a.f.xa&&(c&&(b&&(a.f.A.va=a.f.A.T),a.f.ba()),d=a.f.xa(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.fa=!1,!1===d&&(e=null)));for(var k=Ba(a.id),l=0;l=d||30<=(c.Cc+=d))&&(e.textContent=c.A.T?c.pb.toFixed(2)+"Mhz":"Stopped",c.Cc=0)}if(a.i&&(a=a.i,b=b||0,a.u)){c=a.f.A.T;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;eb?a.ga=a.f.g[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");eb(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);vl(a,b,c)}})}else c(a,null)} +function wl(a,b,c,d){function e(a){if(void 0===k){var b=g&&y(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Va(a))}function f(a){e("Error: "+a);l&&(--sl||Cb(!0));l=!1}var g,k,l=!0;sl++;xa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?tl(c,null,null,!1,e,function(d,l){l?(wa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--sl||Cb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--sl||Cb(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?tl(b,a,d,!0,e,m):ul(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Cb(!1);return wl(a,b,c,d)};window.findMachineComponent=function(a,b){return Da(b,a+".machine")};window.enableEvents=Cb;window.sendEvent=Eb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11-dbg.map diff --git a/versions/pdpjs/1.32.2/pdp11.js b/versions/pdpjs/1.32.2/pdp11.js index 02899c297..486323bcb 100644 --- a/versions/pdpjs/1.32.2/pdp11.js +++ b/versions/pdpjs/1.32.2/pdp11.js @@ -28,264 +28,268 @@ http://pcjs.org/modules/pdp11/lib/cpuops.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/serial.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/disk.js (C) Jeff Parsons 2012-2017 + http://pcjs.org/modules/pdp11/lib/drive.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/es6/debugger.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2017 */ -var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var ea=0;function da(a){return"jscomp_symbol_"+(a||"")+ea++} -function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ga(this)}});fa=function(){}}function ga(a){var b=0;return ha(function(){return b":62,"?":63,"@":64,jc:65,Gf:66,If:67,eg:68,E:69,fg:70,gg:71,hg:72,ig:73,jg:74,kg:75,lg:76,mg:77,ng:78,og:79,pg:80,Q:81,qg:82,rg:83,sg:84,tg:85,ug:86,vg:87,wg:88,xg:89,Uc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,yg:97,zg:98,Ag:99,d:100,e:101,Bg:102,Cg:103,Dg:104,Eg:105,Hg:106,k:107,Ig:108,Jg:109,n:110,Kg:111,p:112,q:113,r:114,Lg:115,t:116,Mg:117,Ng:118,Og:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Kc:127};function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.oc=b.comment;this.Tc=b;this.exports={};this.l=this.bindings={};a=this.id.indexOf(".");0>a?this.Ka=this.id:(this.La=this.id.substr(0,a),this.Ka=this.id.substr(a+1));this.j={ready:!1,Sa:!1,ac:!1,S:!1,error:!1};this.Db=null;this.j.error=!1;this.Rc=d||0;this.D=this.c=this.v=this.A=this.bb=null;u.push(this)}function ra(a,b,c){sa[a]&&b&&(sa[a][b]=c)} -function ta(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b":62,"?":63,"@":64,zc:65,Ag:66,Cg:67,$g:68,E:69,fh:70,hh:71,ih:72,jh:73,kh:74,lh:75,mh:76,nh:77,oh:78,ph:79,rh:80,Q:81,th:82,uh:83,yh:84,Ah:85,Bh:86,Ch:87,Gh:88,Hh:89,Pd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ih:97,Jh:98,Kh:99,d:100,e:101,Lh:102,Mh:103,Nh:104,Oh:105,Rh:106,k:107,Sh:108,Th:109,n:110,Uh:111,p:112,q:113,r:114,Vh:115,t:116,Wh:117,Xh:118,Yh:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,nd:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Mc=b.comment;this.Kd=b;this.exports={};this.l=this.bindings={};a=this.id.indexOf(".");0>a?this.La=this.id:(this.Ma=this.id.substr(0,a),this.La=this.id.substr(a+1));this.j={ready:!1,Ta:!1,qc:!1,S:!1,error:!1};this.Nb=null;this.j.error=!1;this.Jc=c||0;this.F=this.c=this.v=this.A=this.eb=null;r.push(this)}function ta(a,b,c){ua[a]&&b&&(ua[a][b]=c)} +function va(){return Date.now()||+new Date}function u(a){window&&window.alert(a)}function wa(a){var b=!1;window&&(b=window.confirm(a));return b}function xa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=3;return""+c}function Aa(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} -function F(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Fa[a]})}function Ga(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} -var Fa={"&":"&","<":"<",">":">",'"':""","'":"'"},Ha={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; -function Ia(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function G(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, +function C(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return""+c}function Da(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} +function D(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Ha[a]})}function Ja(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} +var Ha={"&":"&","<":"<",">":">",'"':""","'":"'"},Ka={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function La(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function E(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function Ja(a,b){var c,d={O:null,ka:null,ca:null,ba:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ca=g.load;d.ba=g.exec;if(e=g.bytes)d.O=e;else if(e=g.words)for(d.O=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.O=Array(4*e.length),f=c=0;c>8&255,d.O[f++]=e[c]>>16&255,d.O[f++]=e[c]>>24&255;else d.O=g;d.ka=g.symbols;d.O.length?1==d.O.length&&(v(d.O[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.a["S"+a]=[0,0,!1,!1,this.od,a];this.D=this.c=this.v=this.A=null;D(this)}n(gb,r);h=gb.prototype; -h.reset=function(a){this.stop();a&&ib(this,this.f=0)}; -h.ha=function(a,b,c,d){if(this.A&&this.A.ha(a,b,c,d)||this.c&&this.c.ha(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.l[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.l[b]=c,this.h[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.l[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){jb(a, -b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){kb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){jb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){kb(a,b)}}(this,b),!0):r.prototype.ha.call(this,a,b,c,d)}};h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;lb(b,this,mb);nb(b,this.reset.bind(this));ob(this);pb(this)};h.ga=function(a,b){if(!b)if(this.G&&qb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0}; -h.fa=function(a){return a?this.save():!0};h.save=function(){var a=new H(this);a.set(0,[this.U,this.f,this.b]);return a.data()};h.restore=function(a){if(a=a[0])rb(this,this.U=a[0]),ib(this,this.f=a[1]),sb(this,a[2]);return!0};function tb(a,b,c){if(a=a.l[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ob(a,b){for(var c in a.h)tb(a,c,null!=b?b:a.h[c])}function ub(a,b,c){if(a=a.l[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} -function pb(a){for(var b in a.a)ub(a,b,a.a[b][1])}function vb(a,b,c,d){if(a.l[b]){var e=a.D&&a.D.h||8;c=c||0;c=8==e?za(c,d):Aa(c,d);a.l[b].textContent!=c&&(a.l[b].textContent=c)}}function jb(a,b){var c=a.a[b];ub(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=wb&&(a.w=b==xb,a.C=b==yb)}function kb(a,b){var c=a.a[b];c[2]&&c[3]&&(ub(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.md=function(a){a||this.c.j.N||(a=this.c,a.v.reset(),zb(a),this.a[Ab]&&this.a[Ab][1]&&Bb(this.c))};h.nd=function(){}; -h.hd=function(a){a||I(this.c)};h.fd=function(a){if(!a&&!this.c.j.N)if(this.a[Ab]&&this.a[Ab][1])Bb(this.c);else{a=this.D;var b;if(b=a)a.j.Sa&&(a.j.ac=!0),b=!a.j.Sa;if(b)ya(a,!0),a.f(0,null),ya(a,!1);else try{var c=this.c.Sb(1);0=a.c.pa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.v.u;a.a[wb]&&a.a[wb][1]||(b=-b);rb(a,a.U&~c|a.U+b&c)}function rb(a,b){a.U=b&a.v.u;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Kb(a,"A"+c,b&1<c;c++)Kb(a,"D"+c,b&1<c;c++)a.a["S"+c][1]=b&1<>2;this.f=this.g-1;this.s=this.F/this.g|0;this.L=this.s-1;this.Ga=[];this.m=0;this.o=!1;this.G=[];this.Vc=[Pb,Qb,Rb,Sb];this.a=this.b=[];this.C=this.w=this.i=this.H=this.I=0;a=new J(this);Tb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.u;D(this)}n(Nb,r);function Wb(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Nb.prototype;h.reset=function(){for(var a=0;a>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ra)return l.wb+=l.Ra-f,l.Ra=f,!0;if(f>=l.Ra+l.wb){p=l.size-(f-m);p>g&&(p=g);l.wb=f-l.Ra+p;f=m+a.g;g-=p;k++;continue}}return Yb(Zb,f,g)}f=new J(a,f,p,a.g,d,e);Tb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+$b[d]+" at "+za(b)),!0):Yb(ac,b,c)}h.Fc=function(a){return this.b[(a&this.i)>>>this.h].fb(a&this.f,a)}; -h.zb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return eb||b!=this.f?this.b[c].W(b,a):this.b[c++].fb(b,a)|this.b[c&this.L].fb(0,a+1)<<8};h.Gc=function(a,b){this.b[(a&this.i)>>>this.h].ib(a&this.f,b,a)};h.Ab=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;eb||c!=this.f?this.b[d].lb(c,b,a):(this.b[d++].ib(c,b&255,a),this.b[d&this.L].ib(0,b>>8&255,a+1))};function bc(a,b){return a.a[(b&a.u)>>>a.h]} -function Jb(a,b){var c;a.o=!1;a.m++;var d=b&a.f,e=bc(a,b);eb||d!=a.f?c=e.D(d,b):c=e.i(d,b)|bc(a,b+1).i(0,b+1)<<8;a.m--;return c}function cc(a,b,c){a.o=!1;a.m++;bc(a,b).l(b&a.f,c&255,b);a.m--}function Hb(a,b,c){a.o=!1;a.m++;var d=b&a.f,e=bc(a,b);eb||d!=a.f?e.m(d,c&65535,b):(e.l(d,c&255,b),bc(a,b+1).l(0,c>>8&255,b+1));a.m--} -function Xb(a){for(var b=0,c=[],d=0;da.c.pa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],x=g[5]||1,w=0;w>8:e[2](f)&255):f&1&&(e=d.Ga[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;K(d,b,16);return 255} -function Qb(a,b,c){var d=!1,e=this.controller,f=e.Ga[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ga[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||K(e,c,16)}function Rb(a,b){var c=-1,d=this.controller;a=d.Ga[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;K(d,b,16);return 65535} -function Sb(a,b,c){var d=!1,e=this.controller;a=e.Ga[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||K(e,c,16)}function M(a){r.call(this,"Device",a,0,256);this.a={za:128,fc:-1}}n(M,r);h=M.prototype;h.ea=function(a,b,c,d){this.v=b;this.A=a;this.c=c;this.D=d;var e=this;this.a.fc=jc(c,function(){e.a.za|=128;e.a.za&64&&N(e.c,e.a.Ia);e.A&&Fb(e.A,1);kc(e.c,e.a.fc,1E3/60)});this.a.Ia=lc(c,64,6,524288);lb(b,this,mc);nb(b,this.reset.bind(this));D(this)}; -h.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){this.a.za=128;kc(this.c,this.a.fc,1E3/60,!0)};h.save=function(){var a=new H(this);a.set(0,[this.a.za]);return a.data()};h.restore=function(a){a=ia(a[0]);this.a.za=a.next().value;return!0};h.Ad=function(){return this.a.za};h.Me=function(a){this.a.za=a&192;this.a.za&64||(a=this.a.Ia)&&nc(this.c,a)};h.Cd=function(){return oc(this.c)}; -h.Oe=function(a){pc(this.c,a&-129|this.c.K&128)};h.Dd=function(){return qc(this.c)};h.Ed=function(){return rc(this.c)};h.Fd=function(){return this.c.qa};h.Pe=function(a){sc(this.c,a)};h.me=function(a){a=a>>1&63;var b=this.c.Fa[a>>1];return a&1?b>>16:b&65535};h.yf=function(a,b){b=b>>1&63;var c=b>>1;this.c.Fa[c]=b&1?this.c.Fa[c]&65535|(a&63)<<16:this.c.Fa[c]&-65536|a&65534};h.fe=function(a){return this.c.s[1][a>>1&7]};h.rf=function(a,b){this.c.s[1][b>>1&7]=a&65295}; -h.de=function(a){return this.c.s[1][(a>>1&7)+8]};h.pf=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.ee=function(a){return this.c.H[1][a>>1&7]};h.qf=function(a,b){b=b>>1&7;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.ce=function(a){return this.c.H[1][(a>>1&7)+8]};h.nf=function(a,b){b=(b>>1&7)+8;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.zd=function(a){return this.c.s[0][a>>1&7]};h.Le=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.xd=function(a){return this.c.s[0][(a>>1&7)+8]}; -h.Je=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.yd=function(a){return this.c.H[0][a>>1&7]};h.Ke=function(a,b){b=b>>1&7;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.wd=function(a){return this.c.H[0][(a>>1&7)+8]};h.Ie=function(a,b){b=(b>>1&7)+8;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.le=function(a){return this.c.s[3][a>>1&7]};h.xf=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.je=function(a){return this.c.s[3][(a>>1&7)+8]};h.vf=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295}; -h.ke=function(a){return this.c.H[3][a>>1&7]};h.wf=function(a,b){b=b>>1&7;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.ie=function(a){return this.c.H[3][(a>>1&7)+8]};h.uf=function(a,b){b=(b>>1&7)+8;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.gb=function(a){a&=7;return this.c.i&2048?this.c.ra[a]:this.c.b[a]};h.jb=function(a,b){b&=7;this.c.i&2048?this.c.ra[b]=a:this.c.b[b]=a};h.Kd=function(){return this.c.i&49152?this.c.ja[0]:this.c.b[6]};h.Ue=function(a){this.c.i&49152?this.c.ja[0]=a:this.c.b[6]=a}; -h.Nd=function(){return this.c.b[7]};h.Xe=function(a){this.c.b[7]=a};h.hb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.ra[a]};h.kb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.ra[b]=a};h.Ld=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[1]};h.Ve=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[1]=a};h.Md=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[3]};h.We=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[3]=a}; -h.vd=function(a){return this.c.ub[a-65504>>1]};h.He=function(a,b){this.c.ub[b-65504>>1]=a};h.Ac=function(a){return 65520==a?(dc(this.v)>>6)-1:0};h.Dc=function(){};h.he=function(){return 1};h.tf=function(){};h.ud=function(){return this.c.G};h.Ge=function(){this.c.G=0};h.Bd=function(){return this.c.rb};h.Ne=function(a,b){b&1||(a&=255);this.c.rb=a};h.Gd=function(a,b){return b?0:this.c.Qa};h.Qe=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Qa=a}; -h.ge=function(a,b){return b?0:this.c.Ea&65280};h.sf=function(a){this.c.Ea=a|255};h.Jd=function(){return tc(this.c)};h.Te=function(a){uc(this.c,a)};h.Cc=function(){}; -var O={},mc=(O[61568]=[null,null,M.prototype.me,M.prototype.yf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.fe,M.prototype.rf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.de,M.prototype.pf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.ee,M.prototype.qf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.ce,M.prototype.nf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.zd,M.prototype.Le,"KIPDR",8,1140,64],O[62672]=[null,null,M.prototype.xd,M.prototype.Je,"KDPDR",8,1145,64],O[62688]= -[null,null,M.prototype.yd,M.prototype.Ke,"KIPAR",8,1140,64],O[62704]=[null,null,M.prototype.wd,M.prototype.Ie,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Fd,M.prototype.Pe,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Ad,M.prototype.Me,"LKS"],O[65402]=[null,null,M.prototype.Cd,M.prototype.Oe,"MMR0",1,1140,64],O[65404]=[null,null,M.prototype.Dd,M.prototype.Cc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Ed,M.prototype.Cc,"MMR2",1,1140,64],O[65408]=[null,null,M.prototype.le,M.prototype.xf, -"UIPDR",8,1140,64],O[65424]=[null,null,M.prototype.je,M.prototype.vf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.ke,M.prototype.wf,"UIPAR",8,1140,64],O[65456]=[null,null,M.prototype.ie,M.prototype.uf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.gb,M.prototype.jb,"R0SET0"],O[65473]=[null,null,M.prototype.gb,M.prototype.jb,"R1SET0"],O[65474]=[null,null,M.prototype.gb,M.prototype.jb,"R2SET0"],O[65475]=[null,null,M.prototype.gb,M.prototype.jb,"R3SET0"],O[65476]=[null,null,M.prototype.gb, -M.prototype.jb,"R4SET0"],O[65477]=[null,null,M.prototype.gb,M.prototype.jb,"R5SET0"],O[65478]=[null,null,M.prototype.Kd,M.prototype.Ue,"R6KERNEL"],O[65479]=[null,null,M.prototype.Nd,M.prototype.Xe,"R7KERNEL"],O[65480]=[null,null,M.prototype.hb,M.prototype.kb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.hb,M.prototype.kb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.hb,M.prototype.kb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.hb,M.prototype.kb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.hb, -M.prototype.kb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.hb,M.prototype.kb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Ld,M.prototype.Ve,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.Md,M.prototype.We,"R6USER",1,1145],O[65504]=[null,null,M.prototype.vd,M.prototype.He,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Ac,M.prototype.Dc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Ac,M.prototype.Dc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.he,M.prototype.tf,"SYSID",1,1170],O[65526]= -[null,null,M.prototype.ud,M.prototype.Ge,"ERR",1,1170],O[65528]=[null,null,M.prototype.Bd,M.prototype.Ne,"MBR",1,1170],O[65530]=[null,null,M.prototype.Gd,M.prototype.Qe,"PIR"],O[65532]=[null,null,M.prototype.ge,M.prototype.sf,"SLR"],O[65534]=[null,null,M.prototype.Jd,M.prototype.Te,"PSW"],O); -Ua(function(){for(var a=C(document,B,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),zc(this,Bc?Cc:Dc);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.sd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.re=function(a,b){db&&a&1&&K(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; -h.Ee=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.xa=!0};h.qd=function(a,b){return this.i(a,b)};h.oe=function(a,b){return this.D(a,b)};h.Ce=function(a,b,c){this.A?this.yb(0,0,c):this.l(a,b,c)};h.Af=function(a,b,c){this.A?this.yb(0,0,c):this.m(a,b,c)};h.pd=function(a){return this.a[a]}; -h.rd=function(a){return this.a[a]};h.ne=function(a,b){db&&a&1&&K(this.b,b,64);return this.v.getUint16(a,!0)};h.qe=function(a,b){db&&a&1&&K(this.b,b,64);return!eb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Be=function(a,b){this.a[a]=b;this.xa=!0};h.De=function(a,b){this.a[a]=b;this.xa=!0};h.zf=function(a,b,c){db&&a&1&&K(this.b,c,64);this.v.setUint16(a,b,!0);this.xa=!0};h.Bf=function(a,b,c){db&&a&1&&K(this.b,c,64);!eb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.xa=!0}; -var xc=0,ec=1,yc=2,Vb=4,$b=["NONE","RAM","ROM","VID","H/W"],wc=0,Fc=[],Ec=[J.prototype.sd,J.prototype.Ee,J.prototype.re,J.prototype.Cf],Ic=[J.prototype.qd,J.prototype.Ce,J.prototype.oe,J.prototype.Af];if(bb)var Dc=[J.prototype.pd,J.prototype.Be,J.prototype.ne,J.prototype.zf],Cc=[J.prototype.rd,J.prototype.De,J.prototype.qe,J.prototype.Bf];var Jc;if(bb){var Kc=new ArrayBuffer(2);(new DataView(Kc)).setUint16(0,256,!0);Jc=256===(new Uint16Array(Kc))[0]}else Jc=!1;var Bc=Jc; -function Lc(a,b){r.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.hc=0;this.Nb=b;this.Pa=c;this.Vb=Math.round(this.Nb/1E4)/100;this.Xa=this.Vb*this.Pa;this.Wb=this.qb=this.$a=this.Ob=0;this.j.N=this.j.ec=!1;this.j.da=a.autoStart;"string"==typeof this.j.da&&(this.j.da="true"==this.j.da);this.j.Bb=!1;this.Lb=this.Za=0;this.Mb=+a.csStart;this.ob=+a.csInterval;this.pb=+a.csStop;this.Y=[];this.qc=this.ve.bind(this);this.Da=this.va=this.Ca=this.a=this.aa=this.ua=this.nb=this.Ba=this.ab= -this.Xb=this.Ma=0;this.ma=null;D(this)}n(Lc,r);h=Lc.prototype;h.ea=function(a,b,c,d){this.A=a;this.v=b;this.D=d;this.ma=a.f;for(a=0;a=a.Za&&(a.Za+=a.ob,c=!0);0<=a.pb&&a.pb<=Qc(a)&&(a.ob=a.pb=-1,Pc(a),I(a),c=!0);c&&a.Z(Qc(a)+" cycles: checksum="+Aa(a.Lb))}} -h.ha=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.l[b]=c,!0;case "run":return this.l[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.S)a=!0;else{var b=null,c,k=y(a.id);for(c=0;ca.Ma/a.Xa&&(b=1);a.Pa=b;b=a.Vb*a.Pa;if(a.Xa!=b){a.Xa=b;b=a.Xa.toFixed(2)+"Mhz";var d=a.l.setSpeed;d&&(d.textContent=b);a.Z("target speed: "+b)}c&&a.A&&Uc(a.A)}Db(a,a.va);a.va=0;a.ua=ta();a.Ba=0;Sc(a)}function jc(a,b){var c=a.Y.length;a.Y.push([-1,b]);return c}function kc(a,b,c,d){0<=b&&ba.Y[b][0])&&(c=a.Nb*a.Pa/1E3*c|0,a.j.N&&(c+=Vc(a)),a.Y[b][0]=c)}function Wc(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Vc(a,b){var c=a.Ca-=a.a;a.a=a.aa=0;b&&(a.Ca=0);return c} -h.ve=function(){if(this.j.N){this.Ob>=this.Nb&&Sc(this,!0);this.ab=0;this.nb=ta();if(this.Ba){var a=this.nb-this.Ba;a>this.Wb&&(this.ua+=a,this.ua>this.nb&&(this.ua=this.nb))}try{do{for(var b,c=this.j.Bb?1:this.qb,d=this.Y.length-1;0<=d;d--){var e=this.Y[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Sb(b)}catch(f){if("number"!=typeof f)throw f;}b=Vc(this,!0);this.ab+=b;this.va+=b;Eb(this,b);Cb(this,b);this.$a-=b;if(0>=this.$a){this.$a+=this.qb;++this.Xb>=Xc&&(this.A&&Fb(this.A,void 0),this.Xb=0);break}}while(this.j.N)}catch(f){I(this); -this.A&&this.A.stop(ta(),Qc(this));a=f.stack||f.message;this.j.error=!0;this.B(a);return}if(this.j.N){a=setTimeout;b=this.qc;this.Ba=ta();c=this.Wb;this.ab&&(c=Math.round(c*this.ab/this.qb));c-=this.Ba-this.nb;if(d=this.Ba-this.ua)this.Ma=Math.round(this.va/(10*d))/100,864E5<=d&&(this.Da=0,Rc(this));if(0>c||this.Mac&&(this.ua-=c),c=0;this.Ob+=this.ab;this.Ba+=c;a(b,c)}}}; -function Bb(a){var b;a.j.error?(a.Z(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.N)a.Z(a.toString()+" busy");else{Rc(a);a.j.N=!0;a.j.ec=!0;if(b=a.l.run)b.textContent="Halt";a.A&&a.A.start(a.ua,Qc(a));a.D||a.status("Started");setTimeout(a.qc,0)}}h.Sb=function(){return 0};function I(a){var b=!1;if(a.j.N){Vc(a);Db(a,a.va);a.va=0;a.j.N=!1;if(b=a.l.run)b.textContent="Run";a.A&&a.A.stop(ta(),Qc(a));b=!0;a.D||a.status("Stopped")}a.j.complete=void 0;return b}var Tc=30,Xc=15,Mc=["power","reset"]; -function Yc(a){var b=+a.model||1170;Lc.call(this,a,6666667);this.pa=b;this.nc=+a.addrReset||0;this.wa=this.i=this.C=this.u=this.m=this.o=this.w=0;this.b=this.ra=this.ja=[];this.H=this.s=this.Fa=this.ub=[];this.Aa=this.F=this.mc=this.Ya=this.Na=this.Oa=this.Va=this.G=this.rb=this.Qa=this.Ea=this.K=this.sb=this.tb=this.qa=this.g=0;this.Sc=[4,2,0,1];this.Pb=0;this.pc=255;1120>=this.pa?(this.lc=Zc.bind(this),this.Wa=this.Zc,this.Pb=8,this.pc=-1,this.sc=255,this.rc=0):(this.lc=$c.bind(this),this.Wa=this.$c, -this.sc=~(1792|(1140>=this.pa?2048:0))&65535,this.rc=1140e.xb&&(e.xb=c,c+=4)}return Lc.prototype.ga.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.pa);this.j.N&&I(this);this.u=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.nc,-1,-2,-3,-4,-5,-6,-7,-8];this.ra=[0,0,0,0,0,0];this.ja=[0,0,0,0];this.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, -65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ub=[0,0,0,0,0,0,0,0];this.C=0;this.wa=-1;this.h=this.f=this.Kb=this.L=this.T=this.g=this.rb=0;zb(this);Oc(this);this.j.error=!1;Lc.prototype.reset.call(this)};function zb(a){a.K=0;a.sb=0;a.tb=0;a.qa=0;a.G=0;a.Qa=0;a.Ea=255;a.Ya=0;a.Na=0;a.Oa=0;a.Va=262143;a.Aa=a.b[7];a.F=0;a.I=null;a.v&&(ad(a),a.mc=dc(a.v))} -function ad(a){a.Fb=a.ic;a.Gb=a.Qb;a.Rb=a.Tb;a.Hb=a.Ub;a.Ya?(a.ta=65536,a.Eb=a.qa&16?4186112:253952,a.oa=a.yc,a.W=a.Bc,a.lb=a.Ec,Wb(a.v,a.qa&16?22:18)):(a.ta=0,a.Eb=57344,a.oa=a.cd,a.W=a.pe,a.lb=a.Df,Wb(a.v,16))}function oc(a){var b=a.K;b&57344||(b=b&-3199|a.Na<<5|a.Oa<<1);return b}function pc(a,b){b&=-3073;if(a.K!=b){b&57344&&!(a.K&57344)&&(a.sb=a.F>>16&65535,a.tb=a.F&65535);a.K=b;a.Na=(b&96)>>5;a.Oa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ya!=c&&(a.Ya=c,ad(a))}} -function qc(a){a.K&57344||(a.sb=a.F>>16&65535);a=a.sb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function rc(a){a.K&57344||(a.tb=a.F&65535);return a.tb}function sc(a,b){1170>a.pa&&(b&=-49);a.qa!=b&&(a.qa=b,a.Va=b&16?4194303:262143,ad(a))}function bd(a,b,c){a.nc=b;R(a,b);uc(a,0);a.v.reset();zb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.N||Bb(a)}else a.D&&a.j.S?I(a)||(a.D.g(),Fb(a.A,-1)):!1===c&&I(a);!a.j.N&&a.ma&&a.ma.stop()}h.xc=function(){return 0}; -h.save=function(){var a=new H(this);a.set(0,[this.b,this.ra,this.ja,this.H,this.s,this.Fa,this.ub,this.G,this.rb,this.Qa,this.Ea,this.Na,this.Oa,this.Aa,this.g,this.F,this.wa,this.Yb,this.Zb]);a.set(1,[tc(this),oc(this),qc(this),rc(this),this.qa]);a.set(2,[this.Da,this.Pa,this.j.da]);a.set(3,cd(this));a.set(4,Wc(this));return a.data()}; -h.restore=function(a){var b=ia(a[0]);this.b=b.next().value;this.ra=b.next().value;this.ja=b.next().value;this.H=b.next().value;this.s=b.next().value;this.Fa=b.next().value;this.ub=b.next().value;this.G=b.next().value;this.rb=b.next().value;this.Qa=b.next().value;this.Ea=b.next().value;this.Na=b.next().value;this.Oa=b.next().value;this.Aa=b.next().value;this.g=b.next().value;this.F=b.next().value;this.wa=b.next().value;this.Yb=b.next().value;this.Zb=b.next().value;b=a[1];uc(this,b[0]);pc(this,b[1]); -this.sb=b[2];this.tb=b[3];sc(this,b[4]);b=a[2];this.Da=b[0];Rc(this,b[1]);this.j.da=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function R(a,b){a.b[7]=b&65535}function lc(a,b,c,d){b={xb:b,eb:c,message:d||0,name:fb[b],next:null};a.mb.push(b);return b}function nc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.g|=1)}function N(a,b){if(b){if(b!=a.I){var c=a.I;if(!c||c.eb<=b.eb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.eb<=b.eb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}} -function cd(a){var b=[];for(a=a.I;a;)b.push(a.xb),a=a.next;return b}function gd(a){return a.g&64?(L(a,168,64,-6),!0):a.g&32?(L(a,4,32,-5),!0):a.g&16?(L(a,12,16,-7),!0):!1}function tc(a){return a.i=a.i&63728|ed(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|dd(a)}function uc(a,b){b&=a.sc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.u=b<<16;if((b^a.i)&a.rc)for(var c=a.ra.length;0<=--c;){var d=a.b[c];a.b[c]=a.ra[c];a.ra[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.ja[c]=a.b[6],a.b[6]=a.ja[a.C]);a.i=b;a.g&=-3;a.g|=a.I?2:1} -h.ia=function(a){this.w=this.o=a;this.m=0};h.Ja=function(a,b){this.w=this.o=this.u=a;this.m=b||0};function hd(a,b){a.w=a.o=a.u=b;a.m=a.w^a.u>>1}function id(a,b,c,d){a.w=a.o=a.u=b;a.m=(c^d)&(d^b)} -function L(a,b,c,d){if(!a.cb){0>a.wa?a.wa=tc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.C=0;var e=a.W(b|a.ta),f=a.W(b+2&65535|a.ta);uc(a,f&-12289|a.wa>>2&12288);jd(a,a.wa);jd(a,a.b[7]);R(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.Yb=d;a.Zb=b;-1==d&&I(a);if(-4<=d)throw b;}}function kd(a){var b=ld(a),c=ld(a);a.i&49152&&(c=c&-225|a.i&63712);R(a,b);uc(a,c);a.g&=-17} -function md(a,b){var c=b>>13&31;31>c&&(b=a.qa&32?a.Fa[c]+(b&8191)&4194303:b&-3932161);return b} -function Ib(a,b,c){var d,e,f;if(!(c&a.Ya))return f=b&65535,57344<=f&&(f|=a.Eb),f;d=b>>13;a.qa&a.Sc[a.C]||(d&=7);e=a.s[a.C][d];f=(a.H[a.C][d]<<6)+(b&8191)&a.Va;3932160<=f&&(f=md(a,f));if(a.cb)return f;f>=a.mc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.s[a.C][d]=e;if(f!=(4194170&a.Va)||a.C)a.Na=a.C,a.Oa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.K&57344||(g|=a.K&4096|a.Na<<5|a.Oa<<1,pc(a,a.K&-61695|g&61694)),L(a,168,64,-2)),a.K&61440||!(f<(4191360&a.Va)||f>(4194239&a.Va))||(a.K|=4096,a.K&512&&(a.g|=64)));return f}function ld(a){var b=a.W(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function jd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Wa(4,-2,c);a.lb(c,b)} -function nd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return L(a,4,0,-3),0;case 1:return 6==c&&a.Wa(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Wa(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Wa(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.W(e)|g;a.a-=8;break;case 6:return e=a.W(fd(a,2)),e=e+a.b[c]&65535,6==c&&a.Wa(d,0, -e),a.a-=6,e|g;case 7:return e=a.W(fd(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.ta),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.Zc=function(a,b,c){!this.C&&0>=b&&c<=this.Ea&&(this.g|=32)};h.$c=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Ea&&(c<=this.Ea-32?L(this,4,0,-4):(this.G|=8,this.g|=32)))};h.bd=function(a){return this.ic(a)};h.dd=function(a){return this.Qb(a)};h.ye=function(a,b){this.Tb(a,b)};h.Ae=function(a,b){this.Ub(a,b)}; -h.cd=function(a,b,c){return nd(this,a,b,c)};h.yc=function(a,b,c){return Ib(this,nd(this,a,b,c),c)};h.pe=function(a){return this.v.zb(this.Aa=a)};h.Bc=function(a){return this.v.zb(this.Aa=Ib(this,a,2))};h.Df=function(a,b){this.v.Ab(this.Aa=a,b)};h.Ec=function(a,b){this.v.Ab(this.Aa=Ib(this,a,4),b)}; -function od(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=nd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.W(d|c&a.ta),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.ja[a.i>>12&3];return c}function pd(a,b,c,d){a.F=a.F&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=nd(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=Ib(a,e|c&65536,4),a.C=a.i>>14&3,a.Hb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.ja[a.i>>12&3]=d} -function qd(a,b){b>>=6;var c=a.T=b&7;return(b=a.L=(b&56)>>3)?a.Fb(a.oa(b,c,3)):a.b[c+a.Pb]&a.pc}function rd(a,b){var c;b>>=6;var d=a.T=b&7;(b=a.L=(b&56)>>3)?c=a.Gb(a.oa(b,d,2)):c=a.b[d+a.Pb];return c}function sd(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return nd(a,b,c,8)}function td(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Fb(a.oa(b,c,3)):a.b[c]&255}function ud(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Gb(a.oa(b,d,2)):c=a.b[d];return c} -function T(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Kb=a.oa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.Rb(e,d.call(a,c,a.Fb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function U(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,6),a.Hb(e,d.call(a,0>c?a.b[-c-1]:c,a.Gb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} -function vd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.oa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.Rb(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function wd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Hb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} -h.Sb=function(a){this.j.complete=!0;var b=a?this.j.ec?0:1:-1;this.j.ec=!1;this.Ca=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Qa&224)>>5,e=this.I&&this.I.eb>d?this.I:null;e&&(c=e.xb,d=e.eb);d>(this.i&224)>>5?(this.g&8&&(fd(this,2),this.g&=-9),L(this,c,0,-10),d=!0):d=!1;d&&(e&&nc(this,e),a=!0);this.I||this.Qa||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){I(this);break}if(0>b)break}if(this.g&112&&gd(this)){if(this.g& -4&&this.D.b(this.b[7],b)){I(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.lc(e)}while(0>1|b<<16;hd(this,a);return a&65535}function Cd(a,b){a=b&128|b>>1|b<<8;hd(this,a<<8);return a&255}function Dd(a,b){a=b&~a;this.ia(a);return a}function Ed(a,b){a=b&~a;this.ia(a<<8);return a}function Fd(a,b){a|=b;this.ia(a);return a}function Gd(a,b){a|=b;this.ia(a<<8);return a} -function Hd(a,b){a=~b|65536;this.Ja(a);return a&65535}function Id(a,b){a=~b|256;this.Ja(a<<8);return a&255}function Jd(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function Kd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function Ld(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function Md(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function Nd(a,b){a=-b;this.Ja(a,a&b&32768);return a&65535} -function Od(a,b){a=-b;this.Ja(a<<8,(a&b&128)<<8);return a&255}function Pd(a,b){a=b<<1|this.u>>16&1;hd(this,a);return a&65535}function Qd(a,b){a=b<<1|this.u>>16&1;hd(this,a<<8);return a&255}function Rd(a,b){a=(this.u&65536|b)>>1|b<<16;hd(this,a);return a&65535}function Sd(a,b){a=((this.u&65536)>>8|b)>>1|b<<8;hd(this,a<<8);return a&255}function Td(a,b){var c=b-a;id(this,c,a,b);return c&65535}function Ud(a,b){var c=b-a;id(this,c<<8,a<<8,b<<8);return c&255} -function Vd(a,b){this.w=this.o=b&65280;this.m=this.u=0;return(b<<8|b>>8)&65535}function Wd(a,b){a^=b;this.ia(a);return a&65535}function Xd(a){U(this,a,rd(this,a),xd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} -function Yd(a){var b=ud(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.u=this.m=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} -function Zd(a){var b=ud(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&=63;if(b&32){b=64-b;32>b-1;this.u=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function $d(a){S(this,a,!dd(this))}function ae(a){S(this,a,dd(this))} -function be(a){U(this,a,rd(this,a),Dd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ce(a){T(this,a,qd(this,a),Ed);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function de(a){U(this,a,rd(this,a),Fd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ee(a){T(this,a,qd(this,a),Gd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} -function fe(a){var b=rd(this,a);a=ud(this,a);this.ia((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function ge(a){var b=qd(this,a);a=td(this,a);this.ia(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function he(a){S(this,a,this.o&65535?0:4)}function ie(a){S(this,a,!ed(this)==!(this.m&32768))}function je(a){S(this,a,!!(this.o&65535)&&!ed(this)==!(this.m&32768))} -function ke(a){S(this,a,!dd(this)&&!!(this.o&65535))}function le(a){S(this,a,(this.o&65535?0:4)||!ed(this)!=!(this.m&32768))}function me(a){S(this,a,dd(this)||(this.o&65535?0:4))}function ne(a){S(this,a,!ed(this)!=!(this.m&32768))}function oe(a){S(this,a,ed(this))}function pe(a){S(this,a,!!(this.o&65535))}function qe(a){S(this,a,!ed(this))}function re(){L(this,12,0,-9)}function se(a){S(this,a,!0)}function te(a){S(this,a,!(this.m&32768))}function ue(a){S(this,a,this.m&32768?2:0)} -function V(a){a&1&&(this.u=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function ve(a){var b=rd(this,a);a=ud(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;id(this,c,a,b);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function we(a){var b=qd(this,a);a=td(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);id(this,c,a,b);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)} -function xe(a){var b=ud(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.u=65536,this.a-=7}function ye(){L(this,24,0,-9);this.a-=20} -function ze(){this.i&49152?(this.G|=128,L(this,4,0,-8)):(this.ma&&1120==this.pa&&this.ma.setData(this.b[0],!0),this.D?this.D.i():I(this));this.a-=7}function Ae(){L(this,16,0,-9);this.a-=20}var Be=[0,7,7,10,7,11,9,13];function Ce(a){this.aa=this.a;R(this,sd(this,a));this.a=this.aa-Be[this.h]}var De=[0,14,14,17,14,18,16,20];function Ee(a){this.aa=this.a;var b=sd(this,a);a=a>>6&7;jd(this,this.b[a]);this.b[a]=this.b[7];R(this,b);this.a=this.aa-De[this.h]} -var Fe=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ge(a){var b=rd(this,a);this.aa=this.a;wd(this,a,b,this.ia);this.a=this.aa-Fe[(this.L?8:0)+this.h]+(7!=this.f||this.h?0:2)}function He(a){var b=qd(this,a);vd(this,a,b,65535,this.ia);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}var Ie=[7,13,13,17,14,18,17,21]; -function Je(a){var b=ud(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.m=0;this.u=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)R(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Pe(a){U(this,a,rd(this,a),Td);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Qe(a){U(this,a,0,Vd);this.a-=this.h?9:3+(7==this.f?2:0)}function Re(){L(this,28,0,-9)} -function Se(){this.ma&&(this.ma.U=this.b[7],this.ma.setData(this.b[0],!0));this.g|=8;fd(this,-2);this.a-=3}function Te(a){U(this,a,this.b[(a>>6&7)+this.Pb],Wd);this.a-=this.h?9:3+(7==this.f?2:0)}function X(){L(this,8,0,-9)}function Zc(a){Ue[a>>12].call(this,a)}function Ve(a){We[a>>6&3].call(this,a)}function Xe(a){Ye[a>>6&3].call(this,a)}function Ze(a){$e[a>>6&3].call(this,a)}function af(a){bf[a&15].call(this,a)}function cf(a){df[a&15].call(this,a)}function ef(a){ff[a>>6&3].call(this,a)} -function gf(a){hf[a>>6&3].call(this,a)}function jf(a){kf[a>>6&3].call(this,a)} -var Ue=[function(a){lf[a>>8&15].call(this,a)},Ge,ve,fe,be,de,Xd,X,function(a){mf[a>>8&15].call(this,a)},He,we,ge,ce,ee,Pe,X],lf=[function(a){nf[a>>4&15].call(this,a)},se,pe,he,ie,ne,je,le,Ee,Ee,Ve,Xe,Ze,X,X,X],We=[function(a){wd(this,a,0,this.Ja);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Hd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Ld);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Jd);this.a-=this.h?9:3+(7==this.f?2:0)}],Ye=[function(a){U(this,a,0,Nd); -this.a-=this.h?11:6},function(a){U(this,a,dd(this)?1:0,xd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,dd(this)?1:0,Td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=ud(this,a);this.Ja(a);this.a-=this.h?4:3+(7==this.f?2:0)}],$e=[function(a){U(this,a,0,Rd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Pd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Bd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,zd);this.a-=this.h?9:3+(7==this.f?2:0)}],nf= -[function(a){of[a&15].call(this,a)},X,X,X,Ce,Ce,Ce,Ce,Me,X,af,cf,Qe,Qe,Qe,Qe],of=[ze,Se,Ne,re,Ae,Le,X,X,X,X,X,X,X,X,X,X],bf=[Ke,function(){this.u=0;this.a-=5},function(){this.m=0;this.a-=5},V,function(){this.o=1;this.a-=5},V,V,V,function(){this.w=0;this.a-=5},V,V,V,V,V,V,V],df=[Ke,function(){this.u=65536;this.a-=5},function(){this.m=32768;this.a-=5},W,function(){this.o=0;this.a-=5},W,W,W,function(){this.w=32768;this.a-=5},W,W,W,W,W,W,W],mf=[qe,oe,ke,me,te,ue,$d,ae,ye,Re,ef,gf,jf,X,X,X],ff=[function(a){vd(this, -a,0,255,this.Ja);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Md);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Kd);this.a-=this.h?9:3+(7==this.f?2:0)}],hf=[function(a){T(this,a,0,Od);this.a-=this.h?11:6},function(a){T(this,a,dd(this)?1:0,yd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,dd(this)?1:0,Ud);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=td(this,a);this.Ja(a<<8);this.a-=this.h?4:3+ -(7==this.f?2:0)}],kf=[function(a){T(this,a,0,Sd);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Qd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Cd);this.a-=this.h?9+(this.Kb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Ad);this.a-=this.h?9:3+(7==this.f?2:0)}];function $c(a){pf[a>>12].call(this,a)} -var pf=[function(a){qf[a>>8&15].call(this,a)},Ge,ve,fe,be,de,Xd,function(a){rf[a>>8&15].call(this,a)},function(a){sf[a>>8&15].call(this,a)},He,we,ge,ce,ee,Pe,X],qf=[function(a){tf[a>>4&15].call(this,a)},se,pe,he,ie,ne,je,le,Ee,Ee,Ve,Xe,Ze,function(a){uf[a>>6&3].call(this,a)},X,X],uf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.ta);R(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=od(this,a,0);this.ia(a);jd(this,a);this.a-=11},function(a){var b=ld(this);this.aa= -this.a;this.ia(b);pd(this,a,0,b);this.a=this.aa-Ie[this.h]},function(a){wd(this,a,ed(this)?65535:0,this.ia);this.a-=this.h?9:3+(7==this.f?2:0)}],tf=[function(a){vf[a&15].call(this,a)},X,X,X,Ce,Ce,Ce,Ce,Me,function(a){!(a&8)||1145>this.pa?L(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},af,cf,Qe,Qe,Qe,Qe],vf=[ze,Se,function(){kd(this);this.g|=this.i&16;this.a-=13},re,Ae,Le,Ne,function(){L(this,8,0,-9)},X,X,X,X,X,X,X,X],rf=[Je,Je,xe,xe,Yd,Yd,Zd,Zd,Te,Te,X, -X,X,X,Oe,Oe],sf=[qe,oe,ke,me,te,ue,$d,ae,ye,Re,ef,gf,jf,function(a){1145>this.pa?L(this,8,0,-9):wf[a>>6&3].call(this,a)},X,X],wf=[function(){L(this,8,0,-9)},function(a){a=od(this,a,65536);this.ia(a);jd(this,a);this.a-=11},function(a){var b=ld(this);this.aa=this.a;this.ia(b);pd(this,a,65536,b);this.a=this.aa-Ie[this.h]},function(){L(this,8,0,-9)}]; -function xf(a){r.call(this,"ROM",a,0,128);this.ka=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=F(this.g);if(this.g){a=this.g;var b=Ba(this.m);"json"!=b&&"hex"!=b&&(a=Ka()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;G(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ra(c.La,a,b),(a=Ja(a,b))?(c.b=a.O,c.ka=a.ka):c.g=null);yf(c)})}}n(xf,r); -h=xf.prototype;h.ea=function(a,b,c,d){this.v=b;this.c=c;this.D=d;yf(this)};h.ga=function(){this.ka&&(this.D&&this.D.a(this.id,this.h,this.a,this.ka),delete this.ka);return!0};h.fa=function(){return!0}; -function yf(a){if(!xa(a)){if(a.g){if(!a.b||!a.v)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+Aa(a.b.length,8,!0)+") does not match specified size ("+Aa(a.a,8,!0)+")";a.j.error=!0;a.B(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Ob){var c={},c=(c[b]=[xf.prototype.be,xf.prototype.mf,null,null,null,a.a>>1],c);if(lb(a.v,a,c)){a.status("Added "+a.a+"-byte ROM at "+za(b));b=a.i=!0;break a}}else if(Ub(a.v,b,a.a,yc)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),x=l,w=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(w)for(;w--;)cc(a.v,t++,b[x++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< -b.length;e++)cc(a.v,c+e,b[e]);k=!0}if(k){if(null==d||g)I(a.c),f=!1;null!=d&&bd(a.c,d,f)}return k}Ua(function(){for(var a=C(document,B,"ram"),b=0;b=q.jc&&c<=q.Uc&&(b=c-(q.jc-q.Hc));b&&(a.preventDefault&&a.preventDefault(),d.Ib(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Jc&&(b=q.Ic);d.Ib(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); -a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Ib(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;var e=this;this.H=lc(this.c,this.C?-1:48,4,262144);this.I=jc(this.c,function(){var a;a=-1;e.f.length&&(a=e.f.shift()&255,e.w&&97<=a&&122>a&&(a-=32),kc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&N(c,e.H))});this.F=lc(this.c,this.C?-1:52,4,262144);this.Y=jc(this.c,function(){e.b|=128;e.b&64&&N(c,e.F)});lb(b,this,Ef,this.C?64832+8*(this.C-1)-65392:0);nb(b,this.reset.bind(this));D(this)}; -h.zc=function(a){if(!this.g){var b=Nc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ga(c[0]);if(d!=this.Ka)return;c=Ga(c[1]);if(this.g=va(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.u);if(this.s=e.receiveData){this.u=a;this.G=e.receiveStatus;this.status("Connected "+this.La+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ga=function(a,b){if(!b)if(this.zc(this.u),!a)this.reset();else if(!this.restore(a))return!1;return!0}; -h.fa=function(a){return a?this.save():!0};h.reset=function(){Ff(this)};h.save=function(){var a=new H(this);a.set(0,[this.o,this.a,this.b,this.f]);return a.data()};h.restore=function(a){return Ff(this,a[0])};function Ff(a,b){b||(b=[0,8192,128,a.f]);b=ia(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.f=b.next().value;return!0} -h.Ib=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.m%a,this.T&&(b=" ".slice(0,c)));this.L&&!this.m&&c&&(b=String.fromCharCode(this.L)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.m+=c}}else if(null!= -this.i){if(10==a||1024<=this.i.length)this.Z(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}kc(this.c,this.Y,1E3/Math.round(this.aa/10));this.b&=-129};var Df="buffer",Gf={},Ef=(Gf[65392]=[null,null,Z.prototype.Pd,Z.prototype.Ze,"RCSR"],Gf[65394]=[null,null,Z.prototype.Od,Z.prototype.Ye,"RBUF"],Gf[65396]=[null,null,Z.prototype.te,Z.prototype.Ff,"XCSR"],Gf[65398]=[null,null,Z.prototype.se,Z.prototype.Ef,"XBUF"],Gf); -Ua(function(){for(var a=C(document,B,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.l[b]=c,!0;case "readTape":e=Kf;case "loadTape":return e||(e=Lf),this.l[b]=c,c.onclick= -function(){var a=d.l.listTapes;a&&Mf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.l[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Mf(d,F(b,!0),b,Lf,a)}return!1};return!0;case Nf:return this.l[b]=c,!0}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;this.u=Of(a);var e=this;if(a=Hf(this,Nc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.s=lc(this.c,56,4,4096);this.H=jc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.mc.indexOf("/api/v1/dump")&&(e=Ba(c),f="json"==e||"gz"==e?encodeURI(c):Ka()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!G(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.S;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ra(a.La,e,f),(e=Ja(e,f))&&Zf(a,b,c,d,e.O,e.ca,e.ba)); -a.j.Sa=!1;a.b&&(a.b--,a.b||D(a));Wf(a)})}function Rf(a,b,c,d){if((a=a.l.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ba(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ca(c,"/")&&(d="dir"),f=Ka()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Cb?"":e)+"&format=json"));return!!G(f, -null,!0,function(b,c,d){gg(a,b,c,d)})} -function gg(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.S;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.na+'" (error '+d+": "+b+")",f);else{ra(a.controller.La,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.J=k.length;a.R=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.V=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var x=l.bytes;if(void 0!==x&&x.length){for(var w=m<<2,Y=x.length;Y>2,e=Array(d),f=0;fb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ca=g.load;d.ba=g.exec;if(e=g.bytes)d.O=e;else if(e=g.words)for(d.O=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.O=Array(4*e.length),f=c=0;c>8&255,d.O[f++]=e[c]>>16&255,d.O[f++]=e[c]>>24&255;else d.O=g;d.ka=g.symbols;d.O.length?1==d.O.length&&(u(d.O[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.a["S"+a]=[0,0,!1,!1,this.ie,a];this.F=this.c=this.v=this.A=null;B(this)}n(jb,q);h=jb.prototype; +h.reset=function(a){this.stop();a&&lb(this,this.f=0)}; +h.ha=function(a,b,c,d){if(this.A&&this.A.ha(a,b,c,d)||this.c&&this.c.ha(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.l[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.l[b]=c,this.h[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.l[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){mb(a, +b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){nb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){mb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){nb(a,b)}}(this,b),!0):q.prototype.ha.call(this,a,b,c,d)}};h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;ob(b,this,pb);qb(b,this.reset.bind(this));rb(this);sb(this)};h.ga=function(a,b){if(!b)if(this.G&&tb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0}; +h.fa=function(a){return a?this.save():!0};h.save=function(){var a=new G(this);a.set(0,[this.U,this.f,this.b]);return a.data()};h.restore=function(a){if(a=a[0])ub(this,this.U=a[0]),lb(this,this.f=a[1]),vb(this,a[2]);return!0};function wb(a,b,c){if(a=a.l[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function rb(a,b){for(var c in a.h)wb(a,c,null!=b?b:a.h[c])}function xb(a,b,c){if(a=a.l[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} +function sb(a){for(var b in a.a)xb(a,b,a.a[b][1])}function yb(a,b,c,d){if(a.l[b]){var e=a.F&&a.F.h||8;c=c||0;c=8==e?Ca(c,d):Da(c,d);a.l[b].textContent!=c&&(a.l[b].textContent=c)}}function mb(a,b){var c=a.a[b];xb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=zb&&(a.w=b==Ab,a.C=b==Bb)}function nb(a,b){var c=a.a[b];c[2]&&c[3]&&(xb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.ge=function(a){a||this.c.j.N||(a=this.c,a.v.reset(),Cb(a),this.a[Db]&&this.a[Db][1]&&Eb(this.c))};h.he=function(){}; +h.ce=function(a){a||H(this.c)};h.ae=function(a){if(!a&&!this.c.j.N)if(this.a[Db]&&this.a[Db][1])Eb(this.c);else{a=this.F;var b;if(b=a)a.j.Ta&&(a.j.qc=!0),b=!a.j.Ta;if(b)Ba(a,!0),a.f(0,null),Ba(a,!1);else try{var c=this.c.bc(1);0=a.c.pa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.v.u;a.a[zb]&&a.a[zb][1]||(b=-b);ub(a,a.U&~c|a.U+b&c)}function ub(a,b){a.U=b&a.v.u;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Nb(a,"A"+c,b&1<c;c++)Nb(a,"D"+c,b&1<c;c++)a.a["S"+c][1]=b&1<>2;this.f=this.g-1;this.s=this.D/this.g|0;this.L=this.s-1;this.Ha=[];this.m=0;this.o=!1;this.G=[];this.Qd=[Sb,Tb,Ub,Vb];this.a=this.b=[];this.C=this.w=this.i=this.H=this.I=0;a=new I(this);Wb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.u;B(this)}n(Qb,q);function Zb(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Qb.prototype;h.reset=function(){for(var a=0;a>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Sa)return l.Bb+=l.Sa-f,l.Sa=f,!0;if(f>=l.Sa+l.Bb){p=l.size-(f-m);p>g&&(p=g);l.Bb=f-l.Sa+p;f=m+a.g;g-=p;k++;continue}}return ac(bc,f,g)}f=new I(a,f,p,a.g,d,e);Wb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+cc[d]+" at "+Ca(b)),!0):ac(dc,b,c)}h.gd=function(a){return this.b[(a&this.i)>>>this.h].hb(a&this.f,a)}; +h.Eb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return hb||b!=this.f?this.b[c].W(b,a):this.b[c++].hb(b,a)|this.b[c&this.L].hb(0,a+1)<<8};h.hd=function(a,b){this.b[(a&this.i)>>>this.h].kb(a&this.f,b,a)};h.Fb=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;hb||c!=this.f?this.b[d].nb(c,b,a):(this.b[d++].kb(c,b&255,a),this.b[d&this.L].kb(0,b>>8&255,a+1))};function ec(a,b){return a.a[(b&a.u)>>>a.h]} +function Mb(a,b){var c;a.o=!1;a.m++;var d=b&a.f,e=ec(a,b);hb||d!=a.f?c=e.F(d,b):c=e.i(d,b)|ec(a,b+1).i(0,b+1)<<8;a.m--;return c}function fc(a,b,c){a.o=!1;a.m++;ec(a,b).l(b&a.f,c&255,b);a.m--}function Kb(a,b,c){a.o=!1;a.m++;var d=b&a.f,e=ec(a,b);hb||d!=a.f?e.m(d,c&65535,b):(e.l(d,c&255,b),ec(a,b+1).l(0,c>>8&255,b+1));a.m--} +function $b(a){for(var b=0,c=[],d=0;da.c.pa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],y=g[5]||1,x=0;x>8:e[2](f)&255):f&1&&(e=d.Ha[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255} +function Tb(a,b,c){var d=!1,e=this.controller,f=e.Ha[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ha[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function Ub(a,b){var c=-1,d=this.controller;a=d.Ha[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535} +function Vb(a,b,c){var d=!1,e=this.controller;a=e.Ha[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function L(a){q.call(this,"Device",a,256);this.a={Aa:128,vc:-1}}n(L,q);h=L.prototype;h.ea=function(a,b,c,d){this.v=b;this.A=a;this.c=c;this.F=d;var e=this;this.a.vc=lc(c,function(){e.a.Aa|=128;e.a.Aa&64&&nc(e.c,e.a.Ja);e.A&&Ib(e.A,1);oc(e.c,e.a.vc,1E3/60)});this.a.Ja=pc(c,64,6,524288);ob(b,this,qc);qb(b,this.reset.bind(this));B(this)}; +h.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){this.a.Aa=128;oc(this.c,this.a.vc,1E3/60,!0)};h.save=function(){var a=new G(this);a.set(0,[this.a.Aa]);return a.data()};h.restore=function(a){a=ja(a[0]);this.a.Aa=a.next().value;return!0};h.ue=function(){return this.a.Aa};h.If=function(a){this.a.Aa=a&192;this.a.Aa&64||(a=this.a.Ja)&&rc(this.c,a)};h.we=function(){return sc(this.c)}; +h.Kf=function(a){tc(this.c,a&-129|this.c.K&128)};h.xe=function(){return uc(this.c)};h.ye=function(){return vc(this.c)};h.ze=function(){return this.c.qa};h.Lf=function(a){wc(this.c,a)};h.gf=function(a){a=a>>1&63;var b=this.c.Ga[a>>1];return a&1?b>>16:b&65535};h.sg=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ga[c]=b&1?this.c.Ga[c]&65535|(a&63)<<16:this.c.Ga[c]&-65536|a&65534};h.$e=function(a){return this.c.s[1][a>>1&7]};h.lg=function(a,b){this.c.s[1][b>>1&7]=a&65295}; +h.Ye=function(a){return this.c.s[1][(a>>1&7)+8]};h.jg=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.Ze=function(a){return this.c.H[1][a>>1&7]};h.kg=function(a,b){b=b>>1&7;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.Xe=function(a){return this.c.H[1][(a>>1&7)+8]};h.ig=function(a,b){b=(b>>1&7)+8;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.te=function(a){return this.c.s[0][a>>1&7]};h.Hf=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.re=function(a){return this.c.s[0][(a>>1&7)+8]}; +h.Ff=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.se=function(a){return this.c.H[0][a>>1&7]};h.Gf=function(a,b){b=b>>1&7;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.qe=function(a){return this.c.H[0][(a>>1&7)+8]};h.Ef=function(a,b){b=(b>>1&7)+8;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.ff=function(a){return this.c.s[3][a>>1&7]};h.rg=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.df=function(a){return this.c.s[3][(a>>1&7)+8]};h.pg=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295}; +h.ef=function(a){return this.c.H[3][a>>1&7]};h.qg=function(a,b){b=b>>1&7;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.cf=function(a){return this.c.H[3][(a>>1&7)+8]};h.og=function(a,b){b=(b>>1&7)+8;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.ib=function(a){a&=7;return this.c.i&2048?this.c.ra[a]:this.c.b[a]};h.lb=function(a,b){b&=7;this.c.i&2048?this.c.ra[b]=a:this.c.b[b]=a};h.Ee=function(){return this.c.i&49152?this.c.ja[0]:this.c.b[6]};h.Qf=function(a){this.c.i&49152?this.c.ja[0]=a:this.c.b[6]=a}; +h.He=function(){return this.c.b[7]};h.Tf=function(a){this.c.b[7]=a};h.jb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.ra[a]};h.mb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.ra[b]=a};h.Fe=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[1]};h.Rf=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[1]=a};h.Ge=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[3]};h.Sf=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[3]=a}; +h.pe=function(a){return this.c.zb[a-65504>>1]};h.Df=function(a,b){this.c.zb[b-65504>>1]=a};h.bd=function(a){return 65520==a?(gc(this.v)>>6)-1:0};h.ed=function(){};h.bf=function(){return 1};h.ng=function(){};h.oe=function(){return this.c.G};h.Cf=function(){this.c.G=0};h.ve=function(){return this.c.wb};h.Jf=function(a,b){b&1||(a&=255);this.c.wb=a};h.Ae=function(a,b){return b?0:this.c.Ra};h.Mf=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Ra=a}; +h.af=function(a,b){return b?0:this.c.Fa&65280};h.mg=function(a){this.c.Fa=a|255};h.De=function(){return xc(this.c)};h.Pf=function(a){yc(this.c,a)};h.dd=function(){}; +var M={},qc=(M[61568]=[null,null,L.prototype.gf,L.prototype.sg,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.$e,L.prototype.lg,"SIPDR",8,1145,64],M[62608]=[null,null,L.prototype.Ye,L.prototype.jg,"SDPDR",8,1145,64],M[62624]=[null,null,L.prototype.Ze,L.prototype.kg,"SIPAR",8,1145,64],M[62640]=[null,null,L.prototype.Xe,L.prototype.ig,"SDPAR",8,1145,64],M[62656]=[null,null,L.prototype.te,L.prototype.Hf,"KIPDR",8,1140,64],M[62672]=[null,null,L.prototype.re,L.prototype.Ff,"KDPDR",8,1145,64],M[62688]= +[null,null,L.prototype.se,L.prototype.Gf,"KIPAR",8,1140,64],M[62704]=[null,null,L.prototype.qe,L.prototype.Ef,"KDPAR",8,1145,64],M[62798]=[null,null,L.prototype.ze,L.prototype.Lf,"MMR3",1,1145,64],M[65382]=[null,null,L.prototype.ue,L.prototype.If,"LKS"],M[65402]=[null,null,L.prototype.we,L.prototype.Kf,"MMR0",1,1140,64],M[65404]=[null,null,L.prototype.xe,L.prototype.dd,"MMR1",1,1145,64],M[65406]=[null,null,L.prototype.ye,L.prototype.dd,"MMR2",1,1140,64],M[65408]=[null,null,L.prototype.ff,L.prototype.rg, +"UIPDR",8,1140,64],M[65424]=[null,null,L.prototype.df,L.prototype.pg,"UDPDR",8,1145,64],M[65440]=[null,null,L.prototype.ef,L.prototype.qg,"UIPAR",8,1140,64],M[65456]=[null,null,L.prototype.cf,L.prototype.og,"UDPAR",8,1145,64],M[65472]=[null,null,L.prototype.ib,L.prototype.lb,"R0SET0"],M[65473]=[null,null,L.prototype.ib,L.prototype.lb,"R1SET0"],M[65474]=[null,null,L.prototype.ib,L.prototype.lb,"R2SET0"],M[65475]=[null,null,L.prototype.ib,L.prototype.lb,"R3SET0"],M[65476]=[null,null,L.prototype.ib, +L.prototype.lb,"R4SET0"],M[65477]=[null,null,L.prototype.ib,L.prototype.lb,"R5SET0"],M[65478]=[null,null,L.prototype.Ee,L.prototype.Qf,"R6KERNEL"],M[65479]=[null,null,L.prototype.He,L.prototype.Tf,"R7KERNEL"],M[65480]=[null,null,L.prototype.jb,L.prototype.mb,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.jb,L.prototype.mb,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.jb,L.prototype.mb,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.jb,L.prototype.mb,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.jb, +L.prototype.mb,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.jb,L.prototype.mb,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Fe,L.prototype.Rf,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Ge,L.prototype.Sf,"R6USER",1,1145],M[65504]=[null,null,L.prototype.pe,L.prototype.Df,"CTRL",8,1170],M[65520]=[null,null,L.prototype.bd,L.prototype.ed,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.bd,L.prototype.ed,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.bf,L.prototype.ng,"SYSID",1,1170],M[65526]= +[null,null,L.prototype.oe,L.prototype.Cf,"ERR",1,1170],M[65528]=[null,null,L.prototype.ve,L.prototype.Jf,"MBR",1,1170],M[65530]=[null,null,L.prototype.Ae,L.prototype.Mf,"PIR"],M[65532]=[null,null,L.prototype.af,L.prototype.mg,"SLR"],M[65534]=[null,null,L.prototype.De,L.prototype.Pf,"PSW"],M); +Xa(function(){for(var a=A(document,z,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),Dc(this,Ec?Fc:Gc);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.me=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.mf=function(a,b){gb&&a&1&&J(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; +h.Af=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.ya=!0};h.ke=function(a,b){return this.i(a,b)};h.jf=function(a,b){return this.F(a,b)};h.yf=function(a,b,c){this.A?this.Db(0,0,c):this.l(a,b,c)};h.ug=function(a,b,c){this.A?this.Db(0,0,c):this.m(a,b,c)};h.je=function(a){return this.a[a]}; +h.le=function(a){return this.a[a]};h.hf=function(a,b){gb&&a&1&&J(this.b,b,64);return this.v.getUint16(a,!0)};h.lf=function(a,b){gb&&a&1&&J(this.b,b,64);return!hb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.xf=function(a,b){this.a[a]=b;this.ya=!0};h.zf=function(a,b){this.a[a]=b;this.ya=!0};h.tg=function(a,b,c){gb&&a&1&&J(this.b,c,64);this.v.setUint16(a,b,!0);this.ya=!0};h.vg=function(a,b,c){gb&&a&1&&J(this.b,c,64);!hb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.ya=!0}; +var Bc=0,hc=1,Cc=2,Yb=4,cc=["NONE","RAM","ROM","VID","H/W"],Ac=0,Jc=[],Ic=[I.prototype.me,I.prototype.Af,I.prototype.mf,I.prototype.wg],Mc=[I.prototype.ke,I.prototype.yf,I.prototype.jf,I.prototype.ug];if(eb)var Gc=[I.prototype.je,I.prototype.xf,I.prototype.hf,I.prototype.tg],Fc=[I.prototype.le,I.prototype.zf,I.prototype.lf,I.prototype.vg];var Nc;if(eb){var Oc=new ArrayBuffer(2);(new DataView(Oc)).setUint16(0,256,!0);Nc=256===(new Uint16Array(Oc))[0]}else Nc=!1;var Ec=Nc; +function Pc(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.xc=0;this.Xb=b;this.Qa=c;this.gc=Math.round(this.Xb/1E4)/100;this.Za=this.gc*this.Qa;this.hc=this.vb=this.bb=this.Yb=0;this.j.N=this.j.uc=!1;this.j.da=a.autoStart;"string"==typeof this.j.da&&(this.j.da="true"==this.j.da);this.j.Lb=!1;this.Vb=this.ab=0;this.Wb=+a.csStart;this.tb=+a.csInterval;this.ub=+a.csStop;this.Y=[];this.Oc=this.rf.bind(this);this.Ea=this.va=this.Da=this.a=this.aa=this.ua=this.sb=this.Ca=this.cb= +this.ic=this.Na=0;this.ma=null;B(this)}n(Pc,q);h=Pc.prototype;h.ea=function(a,b,c,d){this.A=a;this.v=b;this.F=d;this.ma=a.f;for(a=0;a=a.ab&&(a.ab+=a.tb,c=!0);0<=a.ub&&a.ub<=Uc(a)&&(a.tb=a.ub=-1,Tc(a),H(a),c=!0);c&&a.Z(Uc(a)+" cycles: checksum="+Da(a.Vb))}} +h.ha=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.l[b]=c,!0;case "run":return this.l[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.S)a=!0;else{var b=null,c,k=xa(a.id);for(c=0;ca.Na/a.Za&&(b=1);a.Qa=b;b=a.gc*a.Qa;if(a.Za!=b){a.Za=b;b=a.Za.toFixed(2)+"Mhz";var d=a.l.setSpeed;d&&(d.textContent=b);a.Z("target speed: "+b)}c&&a.A&&Yc(a.A)}Gb(a,a.va);a.va=0;a.ua=va();a.Ca=0;Wc(a)}function lc(a,b){var c=a.Y.length;a.Y.push([-1,b]);return c}function oc(a,b,c,d){0<=b&&ba.Y[b][0])&&(c=a.Xb*a.Qa/1E3*c|0,a.j.N&&(c+=Zc(a)),a.Y[b][0]=c)}function $c(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Zc(a,b){var c=a.Da-=a.a;a.a=a.aa=0;b&&(a.Da=0);return c} +h.rf=function(){if(this.j.N){this.Yb>=this.Xb&&Wc(this,!0);this.cb=0;this.sb=va();if(this.Ca){var a=this.sb-this.Ca;a>this.hc&&(this.ua+=a,this.ua>this.sb&&(this.ua=this.sb))}try{do{for(var b,c=this.j.Lb?1:this.vb,d=this.Y.length-1;0<=d;d--){var e=this.Y[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.bc(b)}catch(f){if("number"!=typeof f)throw f;}b=Zc(this,!0);this.cb+=b;this.va+=b;Hb(this,b);Fb(this,b);this.bb-=b;if(0>=this.bb){this.bb+=this.vb;++this.ic>=ad&&(this.A&&Ib(this.A,void 0),this.ic=0);break}}while(this.j.N)}catch(f){H(this); +this.A&&this.A.stop(va(),Uc(this));a=f.stack||f.message;this.j.error=!0;this.B(a);return}if(this.j.N){a=setTimeout;b=this.Oc;this.Ca=va();c=this.hc;this.cb&&(c=Math.round(c*this.cb/this.vb));c-=this.Ca-this.sb;if(d=this.Ca-this.ua)this.Na=Math.round(this.va/(10*d))/100,864E5<=d&&(this.Ea=0,Vc(this));if(0>c||this.Nac&&(this.ua-=c),c=0;this.Yb+=this.cb;this.Ca+=c;a(b,c)}}}; +function Eb(a){var b;a.j.error?(a.Z(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.N)a.Z(a.toString()+" busy");else{Vc(a);a.j.N=!0;a.j.uc=!0;if(b=a.l.run)b.textContent="Halt";a.A&&a.A.start(a.ua,Uc(a));a.F||a.status("Started");setTimeout(a.Oc,0)}}h.bc=function(){return 0};function H(a){var b=!1;if(a.j.N){Zc(a);Gb(a,a.va);a.va=0;a.j.N=!1;if(b=a.l.run)b.textContent="Run";a.A&&a.A.stop(va(),Uc(a));b=!0;a.F||a.status("Stopped")}a.j.complete=void 0;return b}var Xc=30,ad=15,Qc=["power","reset"]; +function bd(a){var b=+a.model||1170;Pc.call(this,a,6666667);this.pa=b;this.Ic=+a.addrReset||0;this.wa=this.i=this.C=this.u=this.m=this.o=this.w=0;this.b=this.ra=this.ja=[];this.H=this.s=this.Ga=this.zb=[];this.Ba=this.D=this.Hc=this.$a=this.Oa=this.Pa=this.Wa=this.G=this.wb=this.Ra=this.Fa=this.K=this.xb=this.yb=this.qa=this.g=0;this.Jd=[4,2,0,1];this.Zb=0;this.Nc=255;1120>=this.pa?(this.Gc=cd.bind(this),this.Ya=this.Ud,this.Zb=8,this.Nc=-1,this.Sc=255,this.Pc=0):(this.Gc=dd.bind(this),this.Ya=this.Vd, +this.Sc=~(1792|(1140>=this.pa?2048:0))&65535,this.Pc=1140e.Cb&&(e.Cb=c,c+=4)}return Pc.prototype.ga.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.pa);this.j.N&&H(this);this.u=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.Ic,-1,-2,-3,-4,-5,-6,-7,-8];this.ra=[0,0,0,0,0,0];this.ja=[0,0,0,0];this.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, +65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ga=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.zb=[0,0,0,0,0,0,0,0];this.C=0;this.wa=-1;this.h=this.f=this.Ub=this.L=this.T=this.g=this.wb=0;Cb(this);Sc(this);this.j.error=!1;Pc.prototype.reset.call(this)};function Cb(a){a.K=0;a.xb=0;a.yb=0;a.qa=0;a.G=0;a.Ra=0;a.Fa=255;a.$a=0;a.Oa=0;a.Pa=0;a.Wa=262143;a.Ba=a.b[7];a.D=0;a.I=null;a.v&&(ed(a),a.Hc=gc(a.v))} +function ed(a){a.Pb=a.yc;a.Qb=a.$b;a.ac=a.cc;a.Rb=a.ec;a.$a?(a.ta=65536,a.Ob=a.qa&16?4186112:253952,a.oa=a.$c,a.W=a.cd,a.nb=a.fd,Zb(a.v,a.qa&16?22:18)):(a.ta=0,a.Ob=57344,a.oa=a.Yd,a.W=a.kf,a.nb=a.xg,Zb(a.v,16))}function sc(a){var b=a.K;b&57344||(b=b&-3199|a.Oa<<5|a.Pa<<1);return b}function tc(a,b){b&=-3073;if(a.K!=b){b&57344&&!(a.K&57344)&&(a.xb=a.D>>16&65535,a.yb=a.D&65535);a.K=b;a.Oa=(b&96)>>5;a.Pa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.$a!=c&&(a.$a=c,ed(a))}} +function uc(a){a.K&57344||(a.xb=a.D>>16&65535);a=a.xb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function vc(a){a.K&57344||(a.yb=a.D&65535);return a.yb}function wc(a,b){1170>a.pa&&(b&=-49);a.qa!=b&&(a.qa=b,a.Wa=b&16?4194303:262143,ed(a))}function fd(a,b,c){a.Ic=b;P(a,b);yc(a,0);a.v.reset();Cb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.N||Eb(a)}else a.F&&a.j.S?H(a)||(a.F.g(),Ib(a.A,-1)):!1===c&&H(a);!a.j.N&&a.ma&&a.ma.stop()}h.Zc=function(){return 0}; +h.save=function(){var a=new G(this);a.set(0,[this.b,this.ra,this.ja,this.H,this.s,this.Ga,this.zb,this.G,this.wb,this.Ra,this.Fa,this.Oa,this.Pa,this.Ba,this.g,this.D,this.wa,this.lc,this.mc]);a.set(1,[xc(this),sc(this),uc(this),vc(this),this.qa]);a.set(2,[this.Ea,this.Qa,this.j.da]);a.set(3,gd(this));a.set(4,$c(this));return a.data()}; +h.restore=function(a){var b=ja(a[0]);this.b=b.next().value;this.ra=b.next().value;this.ja=b.next().value;this.H=b.next().value;this.s=b.next().value;this.Ga=b.next().value;this.zb=b.next().value;this.G=b.next().value;this.wb=b.next().value;this.Ra=b.next().value;this.Fa=b.next().value;this.Oa=b.next().value;this.Pa=b.next().value;this.Ba=b.next().value;this.g=b.next().value;this.D=b.next().value;this.wa=b.next().value;this.lc=b.next().value;this.mc=b.next().value;b=a[1];yc(this,b[0]);tc(this,b[1]); +this.xb=b[2];this.yb=b[3];wc(this,b[4]);b=a[2];this.Ea=b[0];Vc(this,b[1]);this.j.da=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function P(a,b){a.b[7]=b&65535}function pc(a,b,c,d){b={Cb:b,gb:c,message:d||0,name:ib[b],next:null};a.rb.push(b);return b}function rc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.g|=1)}function nc(a,b){if(b){if(b!=a.I){var c=a.I;if(!c||c.gb<=b.gb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.gb<=b.gb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}} +function gd(a){var b=[];for(a=a.I;a;)b.push(a.Cb),a=a.next;return b}function kd(a){return a.g&64?(K(a,168,64,-6),!0):a.g&32?(K(a,4,32,-5),!0):a.g&16?(K(a,12,16,-7),!0):!1}function xc(a){return a.i=a.i&63728|id(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|hd(a)}function yc(a,b){b&=a.Sc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.u=b<<16;if((b^a.i)&a.Pc)for(var c=a.ra.length;0<=--c;){var d=a.b[c];a.b[c]=a.ra[c];a.ra[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.ja[c]=a.b[6],a.b[6]=a.ja[a.C]);a.i=b;a.g&=-3;a.g|=a.I?2:1} +h.ia=function(a){this.w=this.o=a;this.m=0};h.Ka=function(a,b){this.w=this.o=this.u=a;this.m=b||0};function ld(a,b){a.w=a.o=a.u=b;a.m=a.w^a.u>>1}function md(a,b,c,d){a.w=a.o=a.u=b;a.m=(c^d)&(d^b)} +function K(a,b,c,d){if(!a.fb){0>a.wa?a.wa=xc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.D=b|4143316992;a.C=0;var e=a.W(b|a.ta),f=a.W(b+2&65535|a.ta);yc(a,f&-12289|a.wa>>2&12288);nd(a,a.wa);nd(a,a.b[7]);P(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.lc=d;a.mc=b;-1==d&&H(a);if(-4<=d)throw b;}}function od(a){var b=pd(a),c=pd(a);a.i&49152&&(c=c&-225|a.i&63712);P(a,b);yc(a,c);a.g&=-17} +function qd(a,b){var c=b>>13&31;31>c&&(b=a.qa&32?a.Ga[c]+(b&8191)&4194303:b&-3932161);return b} +function Lb(a,b,c){var d,e,f;if(!(c&a.$a))return f=b&65535,57344<=f&&(f|=a.Ob),f;d=b>>13;a.qa&a.Jd[a.C]||(d&=7);e=a.s[a.C][d];f=(a.H[a.C][d]<<6)+(b&8191)&a.Wa;3932160<=f&&(f=qd(a,f));if(a.fb)return f;f>=a.Hc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.s[a.C][d]=e;if(f!=(4194170&a.Wa)||a.C)a.Oa=a.C,a.Pa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.K&57344||(g|=a.K&4096|a.Oa<<5|a.Pa<<1,tc(a,a.K&-61695|g&61694)),K(a,168,64,-2)),a.K&61440||!(f<(4191360&a.Wa)||f>(4194239&a.Wa))||(a.K|=4096,a.K&512&&(a.g|=64)));return f}function pd(a){var b=a.W(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function nd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.D=a.D&65535|(a.D&-65536)<<8|16121856;a.g&256||a.Ya(4,-2,c);a.nb(c,b)} +function rd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return K(a,4,0,-3),0;case 1:return 6==c&&a.Ya(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Ya(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Ya(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.W(e)|g;a.a-=8;break;case 6:return e=a.W(jd(a,2)),e=e+a.b[c]&65535,6==c&&a.Ya(d,0, +e),a.a-=6,e|g;case 7:return e=a.W(jd(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.ta),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.D=a.D&65535|(a.D&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ud=function(a,b,c){!this.C&&0>=b&&c<=this.Fa&&(this.g|=32)};h.Vd=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Fa&&(c<=this.Fa-32?K(this,4,0,-4):(this.G|=8,this.g|=32)))};h.Xd=function(a){return this.yc(a)};h.Zd=function(a){return this.$b(a)};h.uf=function(a,b){this.cc(a,b)};h.wf=function(a,b){this.ec(a,b)}; +h.Yd=function(a,b,c){return rd(this,a,b,c)};h.$c=function(a,b,c){return Lb(this,rd(this,a,b,c),c)};h.kf=function(a){return this.v.Eb(this.Ba=a)};h.cd=function(a){return this.v.Eb(this.Ba=Lb(this,a,2))};h.xg=function(a,b){this.v.Fb(this.Ba=a,b)};h.fd=function(a,b){this.v.Fb(this.Ba=Lb(this,a,4),b)}; +function sd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=rd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.W(d|c&a.ta),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.ja[a.i>>12&3];return c}function td(a,b,c,d){a.D=a.D&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=rd(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=Lb(a,e|c&65536,4),a.C=a.i>>14&3,a.Rb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.ja[a.i>>12&3]=d} +function ud(a,b){b>>=6;var c=a.T=b&7;return(b=a.L=(b&56)>>3)?a.Pb(a.oa(b,c,3)):a.b[c+a.Zb]&a.Nc}function vd(a,b){var c;b>>=6;var d=a.T=b&7;(b=a.L=(b&56)>>3)?c=a.Qb(a.oa(b,d,2)):c=a.b[d+a.Zb];return c}function wd(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return rd(a,b,c,8)}function xd(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Pb(a.oa(b,c,3)):a.b[c]&255}function yd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Qb(a.oa(b,d,2)):c=a.b[d];return c} +function R(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Ub=a.oa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.ac(e,d.call(a,c,a.Pb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function S(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,6),a.Rb(e,d.call(a,0>c?a.b[-c-1]:c,a.Qb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} +function zd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.oa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.ac(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function Ad(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Rb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} +h.bc=function(a){this.j.complete=!0;var b=a?this.j.uc?0:1:-1;this.j.uc=!1;this.Da=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Ra&224)>>5,e=this.I&&this.I.gb>d?this.I:null;e&&(c=e.Cb,d=e.gb);d>(this.i&224)>>5?(this.g&8&&(jd(this,2),this.g&=-9),K(this,c,0,-10),d=!0):d=!1;d&&(e&&rc(this,e),a=!0);this.I||this.Ra||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.F.b(this.b[7],b)){H(this);break}if(0>b)break}if(this.g&112&&kd(this)){if(this.g& +4&&this.F.b(this.b[7],b)){H(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.D=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.Gc(e)}while(0>1|b<<16;ld(this,a);return a&65535}function Gd(a,b){a=b&128|b>>1|b<<8;ld(this,a<<8);return a&255}function Hd(a,b){a=b&~a;this.ia(a);return a}function Id(a,b){a=b&~a;this.ia(a<<8);return a}function Jd(a,b){a|=b;this.ia(a);return a}function Kd(a,b){a|=b;this.ia(a<<8);return a} +function Ld(a,b){a=~b|65536;this.Ka(a);return a&65535}function Md(a,b){a=~b|256;this.Ka(a<<8);return a&255}function Nd(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function Od(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function Pd(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function Qd(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function Rd(a,b){a=-b;this.Ka(a,a&b&32768);return a&65535} +function Sd(a,b){a=-b;this.Ka(a<<8,(a&b&128)<<8);return a&255}function Td(a,b){a=b<<1|this.u>>16&1;ld(this,a);return a&65535}function Ud(a,b){a=b<<1|this.u>>16&1;ld(this,a<<8);return a&255}function Vd(a,b){a=(this.u&65536|b)>>1|b<<16;ld(this,a);return a&65535}function Wd(a,b){a=((this.u&65536)>>8|b)>>1|b<<8;ld(this,a<<8);return a&255}function Xd(a,b){var c=b-a;md(this,c,a,b);return c&65535}function Yd(a,b){var c=b-a;md(this,c<<8,a<<8,b<<8);return c&255} +function Zd(a,b){this.w=this.o=b&65280;this.m=this.u=0;return(b<<8|b>>8)&65535}function $d(a,b){a^=b;this.ia(a);return a&65535}function ae(a){S(this,a,vd(this,a),Bd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} +function be(a){var b=yd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.u=this.m=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} +function ce(a){var b=yd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&=63;if(b&32){b=64-b;32>b-1;this.u=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function de(a){Q(this,a,!hd(this))}function ee(a){Q(this,a,hd(this))} +function fe(a){S(this,a,vd(this,a),Hd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ge(a){R(this,a,ud(this,a),Id);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function he(a){S(this,a,vd(this,a),Jd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ie(a){R(this,a,ud(this,a),Kd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} +function je(a){var b=vd(this,a);a=yd(this,a);this.ia((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function ke(a){var b=ud(this,a);a=xd(this,a);this.ia(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function le(a){Q(this,a,this.o&65535?0:4)}function me(a){Q(this,a,!id(this)==!(this.m&32768))}function ne(a){Q(this,a,!!(this.o&65535)&&!id(this)==!(this.m&32768))} +function oe(a){Q(this,a,!hd(this)&&!!(this.o&65535))}function pe(a){Q(this,a,(this.o&65535?0:4)||!id(this)!=!(this.m&32768))}function qe(a){Q(this,a,hd(this)||(this.o&65535?0:4))}function re(a){Q(this,a,!id(this)!=!(this.m&32768))}function se(a){Q(this,a,id(this))}function te(a){Q(this,a,!!(this.o&65535))}function ue(a){Q(this,a,!id(this))}function ve(){K(this,12,0,-9)}function we(a){Q(this,a,!0)}function xe(a){Q(this,a,!(this.m&32768))}function ye(a){Q(this,a,this.m&32768?2:0)} +function T(a){a&1&&(this.u=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function ze(a){var b=vd(this,a);a=yd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;md(this,c,a,b);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function Ae(a){var b=ud(this,a);a=xd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);md(this,c,a,b);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)} +function Be(a){var b=yd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.u=65536,this.a-=7}function Ce(){K(this,24,0,-9);this.a-=20} +function De(){this.i&49152?(this.G|=128,K(this,4,0,-8)):(this.ma&&1120==this.pa&&this.ma.setData(this.b[0],!0),this.F?this.F.i():H(this));this.a-=7}function Ee(){K(this,16,0,-9);this.a-=20}var Fe=[0,7,7,10,7,11,9,13];function Ge(a){this.aa=this.a;P(this,wd(this,a));this.a=this.aa-Fe[this.h]}var He=[0,14,14,17,14,18,16,20];function Ie(a){this.aa=this.a;var b=wd(this,a);a=a>>6&7;nd(this,this.b[a]);this.b[a]=this.b[7];P(this,b);this.a=this.aa-He[this.h]} +var Je=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ke(a){var b=vd(this,a);this.aa=this.a;Ad(this,a,b,this.ia);this.a=this.aa-Je[(this.L?8:0)+this.h]+(7!=this.f||this.h?0:2)}function Le(a){var b=ud(this,a);zd(this,a,b,65535,this.ia);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}var Me=[7,13,13,17,14,18,17,21]; +function Ne(a){var b=yd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.m=0;this.u=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)P(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Te(a){S(this,a,vd(this,a),Xd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Ue(a){S(this,a,0,Zd);this.a-=this.h?9:3+(7==this.f?2:0)}function Ve(){K(this,28,0,-9)} +function We(){this.ma&&(this.ma.U=this.b[7],this.ma.setData(this.b[0],!0));this.g|=8;jd(this,-2);this.a-=3}function Xe(a){S(this,a,this.b[(a>>6&7)+this.Zb],$d);this.a-=this.h?9:3+(7==this.f?2:0)}function V(){K(this,8,0,-9)}function cd(a){Ye[a>>12].call(this,a)}function Ze(a){$e[a>>6&3].call(this,a)}function af(a){bf[a>>6&3].call(this,a)}function cf(a){df[a>>6&3].call(this,a)}function ef(a){ff[a&15].call(this,a)}function gf(a){hf[a&15].call(this,a)}function jf(a){kf[a>>6&3].call(this,a)} +function lf(a){mf[a>>6&3].call(this,a)}function nf(a){of[a>>6&3].call(this,a)} +var Ye=[function(a){pf[a>>8&15].call(this,a)},Ke,ze,je,fe,he,ae,V,function(a){qf[a>>8&15].call(this,a)},Le,Ae,ke,ge,ie,Te,V],pf=[function(a){rf[a>>4&15].call(this,a)},we,te,le,me,re,ne,pe,Ie,Ie,Ze,af,cf,V,V,V],$e=[function(a){Ad(this,a,0,this.Ka);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ld);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Pd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Nd);this.a-=this.h?9:3+(7==this.f?2:0)}],bf=[function(a){S(this,a,0,Rd); +this.a-=this.h?11:6},function(a){S(this,a,hd(this)?1:0,Bd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,hd(this)?1:0,Xd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=yd(this,a);this.Ka(a);this.a-=this.h?4:3+(7==this.f?2:0)}],df=[function(a){S(this,a,0,Vd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Fd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Dd);this.a-=this.h?9:3+(7==this.f?2:0)}],rf= +[function(a){sf[a&15].call(this,a)},V,V,V,Ge,Ge,Ge,Ge,Qe,V,ef,gf,Ue,Ue,Ue,Ue],sf=[De,We,Re,ve,Ee,Pe,V,V,V,V,V,V,V,V,V,V],ff=[Oe,function(){this.u=0;this.a-=5},function(){this.m=0;this.a-=5},T,function(){this.o=1;this.a-=5},T,T,T,function(){this.w=0;this.a-=5},T,T,T,T,T,T,T],hf=[Oe,function(){this.u=65536;this.a-=5},function(){this.m=32768;this.a-=5},U,function(){this.o=0;this.a-=5},U,U,U,function(){this.w=32768;this.a-=5},U,U,U,U,U,U,U],qf=[ue,se,oe,qe,xe,ye,de,ee,Ce,Ve,jf,lf,nf,V,V,V],kf=[function(a){zd(this, +a,0,255,this.Ka);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Md);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Qd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Od);this.a-=this.h?9:3+(7==this.f?2:0)}],mf=[function(a){R(this,a,0,Sd);this.a-=this.h?11:6},function(a){R(this,a,hd(this)?1:0,Cd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,hd(this)?1:0,Yd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=xd(this,a);this.Ka(a<<8);this.a-=this.h?4:3+ +(7==this.f?2:0)}],of=[function(a){R(this,a,0,Wd);this.a-=this.h?9+(this.Ub&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ud);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Gd);this.a-=this.h?9+(this.Ub&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)}];function dd(a){tf[a>>12].call(this,a)} +var tf=[function(a){uf[a>>8&15].call(this,a)},Ke,ze,je,fe,he,ae,function(a){vf[a>>8&15].call(this,a)},function(a){wf[a>>8&15].call(this,a)},Le,Ae,ke,ge,ie,Te,V],uf=[function(a){xf[a>>4&15].call(this,a)},we,te,le,me,re,ne,pe,Ie,Ie,Ze,af,cf,function(a){yf[a>>6&3].call(this,a)},V,V],yf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.ta);P(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=sd(this,a,0);this.ia(a);nd(this,a);this.a-=11},function(a){var b=pd(this);this.aa= +this.a;this.ia(b);td(this,a,0,b);this.a=this.aa-Me[this.h]},function(a){Ad(this,a,id(this)?65535:0,this.ia);this.a-=this.h?9:3+(7==this.f?2:0)}],xf=[function(a){zf[a&15].call(this,a)},V,V,V,Ge,Ge,Ge,Ge,Qe,function(a){!(a&8)||1145>this.pa?K(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},ef,gf,Ue,Ue,Ue,Ue],zf=[De,We,function(){od(this);this.g|=this.i&16;this.a-=13},ve,Ee,Pe,Re,function(){K(this,8,0,-9)},V,V,V,V,V,V,V,V],vf=[Ne,Ne,Be,Be,be,be,ce,ce,Xe,Xe,V, +V,V,V,Se,Se],wf=[ue,se,oe,qe,xe,ye,de,ee,Ce,Ve,jf,lf,nf,function(a){1145>this.pa?K(this,8,0,-9):Af[a>>6&3].call(this,a)},V,V],Af=[function(){K(this,8,0,-9)},function(a){a=sd(this,a,65536);this.ia(a);nd(this,a);this.a-=11},function(a){var b=pd(this);this.aa=this.a;this.ia(b);td(this,a,65536,b);this.a=this.aa-Me[this.h]},function(){K(this,8,0,-9)}]; +function Bf(a){q.call(this,"ROM",a,128);this.ka=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=D(this.g);if(this.g){a=this.g;var b=Ea(this.m);"json"!=b&&"hex"!=b&&(a=Na()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;E(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ta(c.Ma,a,b),(a=Ma(a,b))?(c.b=a.O,c.ka=a.ka):c.g=null);Cf(c)})}}n(Bf,q);h=Bf.prototype; +h.ea=function(a,b,c,d){this.v=b;this.c=c;this.F=d;Cf(this)};h.ga=function(){this.ka&&(this.F&&this.F.a(this.id,this.h,this.a,this.ka),delete this.ka);return!0};h.fa=function(){return!0}; +function Cf(a){if(!Aa(a)){if(a.g){if(!a.b||!a.v)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+Da(a.b.length,8,!0)+") does not match specified size ("+Da(a.a,8,!0)+")";a.j.error=!0;a.B(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Rb){var c={},c=(c[b]=[Bf.prototype.We,Bf.prototype.hg,null,null,null,a.a>>1],c);if(ob(a.v,a,c)){a.status("Added "+a.a+"-byte ROM at "+Ca(b));b=a.i=!0;break a}}else if(Xb(a.v,b,a.a,Cc)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),y=l,x=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(x)for(;x--;)fc(a.v,t++,b[y++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< +b.length;e++)fc(a.v,c+e,b[e]);k=!0}if(k){if(null==d||g)H(a.c),f=!1;null!=d&&fd(a.c,d,f)}return k}Xa(function(){for(var a=A(document,z,"ram"),b=0;b=sa.zc&&c<=sa.Pd&&(b=c-(sa.zc-sa.kd));b&&(a.preventDefault&&a.preventDefault(),d.Sb(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==sa.md&&(b=sa.ld);d.Sb(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Sb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;var e=this;this.H=pc(this.c,this.C?-1:48,4,262144);this.I=lc(this.c,function(){var a;a=-1;e.f.length&&(a=e.f.shift()&255,e.w&&97<=a&&122>a&&(a-=32),oc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&nc(c,e.H))});this.D=pc(this.c,this.C?-1:52,4,262144);this.Y=lc(this.c,function(){e.b|=128;e.b&64&&nc(c,e.D)});ob(b,this,If,this.C?64832+8*(this.C-1)-65392:0);qb(b,this.reset.bind(this));B(this)}; +h.ad=function(a){if(!this.g){var b=Rc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ja(c[0]);if(d!=this.La)return;c=Ja(c[1]);if(this.g=ya(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.u);if(this.s=e.receiveData){this.u=a;this.G=e.receiveStatus;this.status("Connected "+this.Ma+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ga=function(a,b){if(!b)if(this.ad(this.u),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +h.fa=function(a){return a?this.save():!0};h.reset=function(){Jf(this)};h.save=function(){var a=new G(this);a.set(0,[this.o,this.a,this.b,this.f]);return a.data()};h.restore=function(a){return Jf(this,a[0])};function Jf(a,b){b||(b=[0,8192,128,a.f]);b=ja(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.f=b.next().value;return!0} +h.Sb=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.m%a,this.T&&(b=" ".slice(0,c)));this.L&&!this.m&&c&&(b=String.fromCharCode(this.L)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.m+=c}}else if(null!= +this.i){if(10==a||1024<=this.i.length)this.Z(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}oc(this.c,this.Y,1E3/Math.round(this.aa/10));this.b&=-129};var Hf="buffer",Kf={},If=(Kf[65392]=[null,null,W.prototype.Je,W.prototype.Vf,"RCSR"],Kf[65394]=[null,null,W.prototype.Ie,W.prototype.Uf,"RBUF"],Kf[65396]=[null,null,W.prototype.pf,W.prototype.zg,"XCSR"],Kf[65398]=[null,null,W.prototype.nf,W.prototype.yg,"XBUF"],Kf); +Xa(function(){for(var a=A(document,z,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.l[b]=c,!0;case "readTape":e=Of;case "loadTape":return e||(e=Pf),this.l[b]=c,c.onclick= +function(){var a=d.l.listTapes;a&&Qf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.D){c.parentNode.removeChild(c);break}this.l[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Qf(d,D(b,!0),b,Pf,a)}return!1};return!0;case Rf:return this.l[b]=c,!0}return!1}; +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;this.u=Sf(a);var e=this;if(a=Lf(this,Rc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.s=pc(this.c,56,4,4096);this.H=lc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.mc.indexOf("/api/v1/dump")&&(e=Ea(c),f="json"==e||"gz"==e?encodeURI(c):Na()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!E(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.S;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ta(a.Ma,e,f),(e=Ma(e,f))&&cg(a,b,c,d,e.O,e.ca,e.ba)); +a.j.Ta=!1;a.b&&(a.b--,a.b||B(a));$f(a)})}function Vf(a,b,c,d){if((a=a.l.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ea(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Fa(c,"/")&&(d="dir"),f=Na()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Mb?"":e)+"&format=json"));return!!E(f, +null,!0,function(b,c,d){kg(a,b,c,d)})} +function kg(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.S;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.na+'" (error '+d+": "+b+")",f);else{ta(a.controller.Ma,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)u(k[0]);else{a.J=k.length;a.R=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.V=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var y=l.bytes;if(void 0!==y&&y.length){for(var x=m<<2,ca=y.length;ca>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.la?f=a.sa+a.la&&(a.la+=f-(a.sa+a.la)+1):(a.sa=f,a.la=1);d[f]=d[f]&~(255<g)break;e|=g<g)break;e|=g<=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ +h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.B("Unable to restore disk '"+this.na+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=ig(this,a++);)lg(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function lg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var cg=0;function Q(a){r.call(this,"RK11",a,0,65536);this.w=mg(this,a.autoMount);this.o=0;this.f=Array(8);this.C=!Pa("Mobi")&&window&&"FileReader"in window;this.h=[];this.Ia=null;this.u=this.b=this.a=this.m=this.i=this.g=this.s=0}n(Q,r); -function mg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Q.prototype; -h.ha=function(a,b,c){var d=this;switch(b){case "listDisks":return this.l[b]=c,c.onchange=function(){var a=d.l.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.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.l[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&ng(d,a)}, -!0;case "loadDisk":return this.l[b]=c,c.onclick=function(){var a=d.l.listDisks;a&&a.options&&og(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.l[b]=c,c.onclick=function(){var a,b=d.l.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.f.length||!(a=d.f[b])?d.B("Unable to boot the selected drive"):a.P?(bd(d.c,0,!0),(a=d.tc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.C){c.parentNode.removeChild(c); -break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.f&&((a=d.f[E(a.value)||0])?(a=a.P)?(a=Sa(kg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.C)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;og(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;if(a=mg(this,Nc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);pg(this);this.Ia=lc(this.c,144,5,65536);lb(b,this,qg);nb(b,this.reset.bind(this));rg(this,"None",sg,!0);this.C&&rg(this,"Local Disk",tg);rg(this,"Remote Disk",ug);vg(this)||D(this)}; -h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){this.h=[];for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";ng(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){pg(this)}; -h.save=function(){var a=new H(this);a.set(0,[this.u,this.b,this.a,this.m,this.i,this.g,this.s,xg(this)]);return a.data()};h.restore=function(a){return pg(this,a[0])}; -function pg(a,b){b||(b=[2368,0,128,0,0,0,0]);var c=ia(b);a.u=c.next().value;a.b=c.next().value;a.a=c.next().value;a.m=c.next().value;a.i=c.next().value;a.g=c.next().value;a.s=c.next().value;b[7]&&(a.h=b[7]);for(b=0;bg||9e||e>=a.f.length)a.B("Unable to load the selected drive");else if(c)if(c==tg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==ug){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}zg(a,e,b,c,!1,d)}else wg(a,e)} -function zg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,wg(a,b,!0),k.Ua?a.B("RK11 busy"):(k.Ua=!0,e&&(k.Ta=!0,a.o++),k.ya=!!f,fg(new bg(a,k,"preload"),c,d,f,a.Mc)&&g++));return g} -h.Mc=function(a,b,c,d,e){a.Ua=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Ha)),b=null);if(b){a.P=b;a.na=c;a.X=d;a:{var f;for(f=0;f=a.J){m=64;break}p=a.seek(b,c,d+1);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}var x,w;if(0>(x=a.read(p,t++))||0>(w=a.read(p,t++))){m=32;break}if(!k&&(Hb(this.v,md(this.c,f),x|w<<8),ic(this.v))){m=1024;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Nc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.P;var p=null,t;a||(m=128,e=0);for(;e;){var x=Jb(this.v,md(this.c,f));if(ic(this.v)){m=1024;break}if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1,!0);if(!p){m=4096;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}if(k){var w,Y;if(0>(w=a.read(p,t++))||0>(Y=a.read(p,t++))){m=32;break}if(x!=(w|Y<<8)){m=1;break}}else if(!a.write(p,t++,x&255)||!a.write(p,t++,x>>8)){m=32;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Lc=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&-49|f>>12&48;this.m=65536-e&65535;this.g=this.g&-16|d&15;this.b|=a;Ag(this);return!0};function Ag(a){a.a&=-32769;a.b&&(a.b|=32768,a.a|=32768,a.b&32736&&(a.a|=16384))}h.Ud=function(){return this.u};h.df=function(){};h.Vd=function(){return this.b};h.ef=function(){};h.Rd=function(){return this.a&61438}; -h.af=function(a){this.a=this.a&-3968|a&3967;if(this.a&1){a=!0;var b,c,d=(this.g&57344)>>13,e=this.f[d],f,g,k,l,m,p;this.a&=-8321;this.b&=-4;switch(c=this.a&14){case 0:this.b=this.g=0;this.a=128;break;case 10:case 4:b=this.tc;case 6:case 2:b||(b=this.Nc);f=(this.g&8160)>>5;g=(this.g&16)>>4;k=this.g&15;l=65536-this.m&65535;m=(this.a&48)<<12|this.i;p=this.a&2048?0:2;if(f>=e.J){this.b|=64;break}if(k>=e.M){this.b|=32;break}a=b.call(this,e,f,g,k,l,m,p,6<=c,this.Lc.bind(this));break;case 8:f=(this.g&8160)>> -5;f'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=E(c.value);null!=a&&Dg(d,a)}, -!0;case "loadDisk":return this.l[b]=c,c.onclick=function(){var a=d.l.listDisks;a&&a.options&&Eg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.l[b]=c,c.onclick=function(){var a,b=d.l.listDrives,b=b&&E(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.P?(bd(d.c,0,!0),(a=d.uc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.u){c.parentNode.removeChild(c); -break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.b&&((a=d.b[E(a.value)||0])?(a=a.P)?(a=Sa(kg(a),a.Jb.replace(".json",".img")),v(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.u)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Eg(d,F(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.D=d;if(a=Cg(this,Nc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.s[e]=a[e]);Fg(this);this.Ia=lc(this.c,112,5,131072);lb(b,this,Gg);nb(b,this.reset.bind(this));Hg(this,"None",Ig,!0);this.u&&Hg(this,"Local Disk",Jg);Hg(this,"Remote Disk",Kg);Lg(this)||D(this)}; -h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Dg(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){Fg(this)};h.save=function(){return(new H(this)).data()}; -h.restore=function(a){return Fg(this,a[0])};function Lg(a,b){b||(a.o=0);for(var c in a.s){var d=a.s[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.l.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==Jg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Kg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=F(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ng(a,e,b,c,!1,d)}else Mg(a,e)} -function Ng(a,b,c,d,e,f){var g=-1,k=a.b[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,Mg(a,b,!0),k.Ua?a.B("RL11 busy"):(k.Ua=!0,e&&(k.Ta=!0,a.o++),k.ya=!!f,fg(new bg(a,k,"preload"),c,d,f,a.Pc)&&g++));return g}h.Pc=function(a,b,c,d,e){a.Ua=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Ha)),b=null);b?(a.P=b,a.na=c,a.X=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Ha),a.Ta||e),this.A&&Uc(this.A)):a.ya=!1;a.Ta&&(a.Ta=!1,--this.o||D(this));Dg(this,a.Ha)}; -function Hg(a,b,c,d){if((a=a.l.listDisks)&&a.options){for(var e=0;e(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}Hb(this.v,md(this.c,f),p|t<<8);if(ic(this.v)){k=8192;break}f+=2;e--;if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Qc=function(a,b,c,d,e,f,g){var k=0;a=a.P;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Jb(this.v,md(this.c,f));if(ic(this.v)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Oc=function(a,b,c,d,e,f){this.m=f&65535;this.a=this.a&-49|f>>12&48;this.h=f>>16&63;this.g=this.f=b<<7|(c?64:0)|d&63;this.i=65536-e&65535;a&&(this.a=this.a|a|32768);return!0};h.Zd=function(){return this.a&65535}; -h.jf=function(a){this.a=this.a&-1023|a&1022;this.h=this.h&60|(a&48)>>4;if(!(this.a&128)){a=!0;var b,c=this.b[(this.a&768)>>8],d=c.P,e,f,g;this.a&=-2;switch(this.a&14){case 4:this.i&8&&(this.a&=63);this.i=c.status|this.g&64|(d&&512==d.J?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.g=this.f&4?this.g+b:this.g-b,this.f=this.g=this.g&65408|c);break;case 8:this.i=this.g;break;case 12:b=this.uc;case 10:b||(b=this.Qc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.J||g>=d.M? -this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Oc.bind(this)))}a&&(this.a|=129,this.a&64&&N(this.c,this.Ia))}};h.Xd=function(){return this.m};h.gf=function(a){this.m=a&65534};h.$d=function(){return this.f};h.kf=function(a){this.f=a};h.ae=function(){return this.i};h.lf=function(a){this.i=a};h.Yd=function(){return this.h};h.hf=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4}; -var Ig="",Jg="?",Kg="??",Og={},Gg=(Og[63744]=[null,null,P.prototype.Zd,P.prototype.jf,"RLCS"],Og[63746]=[null,null,P.prototype.Xd,P.prototype.gf,"RLBA"],Og[63748]=[null,null,P.prototype.$d,P.prototype.kf,"RLDA"],Og[63750]=[null,null,P.prototype.ae,P.prototype.lf,"RLMP"],Og[63752]=[null,null,P.prototype.Yd,P.prototype.hf,"RLBE"],Og); -function Pg(a,b,c){r.call(this,"Computer",a,0,33554432);this.j.S=!1;this.G=null;Qg(this,b);this.C=Nc(this,"autoPower",a,6);this.g=0;this.K=+a.busWidth||+a.buswidth;this.u=this.s=this.w=null;this.o=this.I=!1;this.i=this.h=null;this.H=this.m=this.F=!1;this.L=Nc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Rg(this);if(this.c=wa("CPU",this.id)){this.D=wa("Debugger",this.id);this.v=new Nb({id:this.La+".bus",busWidth:this.K},this.c,this.D);var d,e=y(this.id);if((this.f=wa("Panel",this.id))&&this.f.bb)for(b= -0;b\nLicense: GPL version 3 or later ");this.Z("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bSg){if(Tg(d,this.u)){this.h=new H(this,"1.32.2",bh);Tg(this.h)&&(ch(this,d),a=fh,gh(this.h));this.h.set(Zg,Ia());hh(this.h);var e=this.a&&!this.o;if(a==$g||ua("Click OK to restore the previous "+cb+" machine state, or CANCEL to reset the machine.")){if(c=Yg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Tg(d,g):("error"==f&&"no machine state"!= -g?(this.B("Error: "+g),"unable to verify user"==g&&(Oa(ih,""),this.b=null)):this.Z(f+": "+g),gh(d),Tg(d)?(c=Yg(d),e=!0):c=!1))}e&&Wg(this,c?d:null)}else a==fh&&d.clear()}else Wg(this);delete this.u;delete this.i}e=y(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.S=!0;var d=this.l.power;d&&(d.textContent="Shutdown");this.c&&(jh(this,this.c,b,c,a),Fb(this,-2),this.c.da());this.F&&(ch(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; -function ch(a,b){if(ua("There may be a problem with your "+cb+" machine.\n\nTo help us diagnose it, click OK to send this "+cb+" machine state to http://www.pcjs.org.")){var c=a.L;a=a.b||"";b=b.toString();var d={};d.app=cb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;G("http://www.pcjs.org/api/v1/report",d,!0)}} -function kh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new H(a,"1.32.2"),g=new H(a,"1.32.2",Xg),k=Ia();g.set(Zg,k);f.set(Zg,k);f.set(lh,"1.32.2");f.set(mh,window?window.location.href:null);f.set(nh,window?window.navigator.userAgent:"");a.c&&a.c.fa&&(c&&(b&&(a.c.j.da=a.c.j.N),I(a.c)),d=a.c.fa(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.S=!1,!1===d&&(e=null)));for(var k=y(a.id),l=0;l=d||30<=(c.hc+=d))&&(e.textContent=c.j.N?c.Ma.toFixed(2)+"Mhz":"Stopped",c.hc=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.j.N;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]:0'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=C(c.value);null!=a&&sg(d, +a)},!0;case "loadDisk":return this.l[b]=c,c.onclick=function(){var a=d.l.listDisks;a&&a.options&&tg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.l[b]=c,c.onclick=function(){var a,b=d.l.listDrives,b=b&&C(b.value);null==b||0>b||b>=d.f.length||!(a=d.f[b])?d.B("Unable to boot the selected drive"):a.P?(fd(d.c,0,!0),(a=d.fc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.C){c.parentNode.removeChild(c); +break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.f&&((a=d.f[C(a.value)||0])?(a=a.P)?(a=Va(og(a),a.Tb.replace(".json",".img")),u(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.C)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;tg(d,D(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;if(a=rg(this,Rc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);this.qb();this.Ja=pc(this.c,this.G.Md,this.G.vd,this.Jc);ob(b,this,this.I);qb(b,this.reset.bind(this));ug(this,"None",vg,!0);this.C&&ug(this,"Local Disk",wg);ug(this,"Remote Disk",xg);yg(this)||B(this)}; +h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){this.h=[];for(a=0;ag||9e||e>=a.f.length)a.B("Unable to load the selected drive");else if(c)if(c==wg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==xg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=D(c);a.status("Attempting to load "+c+' as "'+b+'"')}Cg(a,e,b,c,!1,d)}else zg(a,e)} +function Cg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,zg(a,b,!0),k.Va?a.B(a.type+" busy"):(k.Va=!0,e&&(k.Ua=!0,a.o++),k.za=!!f,jg(new fg(a,k,"preload"),c,d,f,a.sd)&&g++));return g} +h.sd=function(a,b,c,d,e){a.Va=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.Ia)),b=null);if(b){a.P=b;a.na=c;a.X=d;a:{var f;for(f=0;f=a.J){m=Y.Hb;break}p=a.seek(b,c,d+1);if(!p){m=Y.Tc;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}var y,x;if(0>(y=a.read(p,t++))||0>(x=a.read(p,t++))){m=Y.Ib;break}if(!k&&(Kb(this.v,qd(this.c,f),y|x<<8),kc(this.v))){m=Y.Lc;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Cc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.P;var p=null,t;a||(m=Y.Kc,e=0);for(;e;){var y=Mb(this.v,qd(this.c,f));if(kc(this.v)){m=Y.Lc;break}if(!p){if(b>=a.J){m=Y.Hb;break}p=a.seek(b,c,d+1,!0);if(!p){m=Y.Tc;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}if(k){var x,ca;if(0>(x=a.read(p,t++))||0>(ca=a.read(p,t++))){m=Y.Ib;break}if(y!=(x|ca<<8)){m=Y.Nd;break}}else if(!a.write(p,t++,y&255)||!a.write(p,t++,y>>8)){m=Y.Ib;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.yd=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&~X.Xa|f>>16-X.xa.Xa&X.Xa;this.m=65536-e&65535;this.g=this.g&~Z.nc|d&Z.nc;this.b|=a;Fg(this);return!0};function Fg(a){a.a&=~X.Dc;a.b&&(a.b|=Y.pd,a.a|=X.Dc,a.b&Y.jc&&(a.a|=X.jc))}h.Oe=function(){return this.u};h.$f=function(){};h.Pe=function(){return this.b};h.ag=function(){};h.Le=function(){return this.a&X.Fd}; +h.Xf=function(a){this.a=this.a&~X.Wc|a&X.Wc;if(this.a&X.Ec){a=!0;var b,c,d=(this.g&Z.dc)>>Z.xa.dc,e=this.f[d],f,g,k,l,m,p;this.a&=~(X.pb|X.oc);this.b&=~Y.Hd;switch(c=this.a&X.Gb){case Gg.jd:this.b=this.g=0;this.a=X.pb;break;case Gg.wd:case Gg.xd:b=this.fc;case Gg.Vc:case Gg.Od:b||(b=this.Cc);f=(this.g&Z.ob)>>Z.xa.ob;g=(this.g&Z.kc)>>Z.xa.kc;k=this.g&Z.nc;l=65536-this.m&65535;m=(this.a&X.Xa)<<16-X.xa.Xa|this.i;p=this.a&X.td?0:2;if(f>=e.J){this.b|=Y.Hb;break}if(k>=e.M){this.b|=Y.Ib;break}a=b.call(this, +e,f,g,k,l,m,p,c>=Gg.Vc,this.yd.bind(this));break;case Gg.Id:f=(this.g&Z.ob)>>Z.xa.ob;f'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=C(c.value);null!=a&&Jg(d,a)}, +!0;case "loadDisk":return this.l[b]=c,c.onclick=function(){var a=d.l.listDisks;a&&a.options&&Kg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.l[b]=c,c.onclick=function(){var a,b=d.l.listDrives,b=b&&C(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.P?(fd(d.c,0,!0),(a=d.Qc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.u){c.parentNode.removeChild(c); +break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.b&&((a=d.b[C(a.value)||0])?(a=a.P)?(a=Va(og(a),a.Tb.replace(".json",".img")),u(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.u)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Kg(d,D(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;if(a=Ig(this,Rc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.s[e]=a[e]);Lg(this);this.Ja=pc(this.c,112,5,131072);ob(b,this,Mg);qb(b,this.reset.bind(this));Ng(this,"None",Og,!0);this.u&&Ng(this,"Local Disk",Pg);Ng(this,"Remote Disk",Qg);Rg(this)||B(this)}; +h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Jg(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){Lg(this)};h.save=function(){return(new G(this)).data()}; +h.restore=function(a){return Lg(this,a[0])};function Rg(a,b){b||(a.o=0);for(var c in a.s){var d=a.s[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.l.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==Pg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Qg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=D(c);a.status("Attempting to load "+c+' as "'+b+'"')}Tg(a,e,b,c,!1,d)}else Sg(a,e)} +function Tg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,Sg(a,b,!0),k.Va?a.B("RL11 busy"):(k.Va=!0,e&&(k.Ua=!0,a.o++),k.za=!!f,jg(new fg(a,k,"preload"),c,d,f,a.Dd)&&g++));return g}h.Dd=function(a,b,c,d,e){a.Va=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Ia)),b=null);b?(a.P=b,a.na=c,a.X=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Ia),a.Ua||e),this.A&&Yc(this.A)):a.za=!1;a.Ua&&(a.Ua=!1,--this.o||B(this));Jg(this,a.Ia)}; +function Ng(a,b,c,d){if((a=a.l.listDisks)&&a.options){for(var e=0;e(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}Kb(this.v,qd(this.c,f),p|t<<8);if(kc(this.v)){k=8192;break}f+=2;e--;if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +h.Ed=function(a,b,c,d,e,f,g){var k=0;a=a.P;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Mb(this.v,qd(this.c,f));if(kc(this.v)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; +h.Cd=function(a,b,c,d,e,f){this.m=f&65535;this.a=this.a&-49|f>>12&48;this.h=f>>16&63;this.g=this.f=b<<7|(c?64:0)|d&63;this.i=65536-e&65535;a&&(this.a=this.a|a|32768);return!0};h.Te=function(){return this.a&65535}; +h.eg=function(a){this.a=this.a&-1023|a&1022;this.h=this.h&60|(a&48)>>4;if(!(this.a&128)){a=!0;var b,c=this.b[(this.a&768)>>8],d=c.P,e,f,g;this.a&=-2;switch(this.a&14){case 4:this.i&8&&(this.a&=63);this.i=c.status|this.g&64|(d&&512==d.J?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.g=this.f&4?this.g+b:this.g-b,this.f=this.g=this.g&65408|c);break;case 8:this.i=this.g;break;case 12:b=this.Qc;case 10:b||(b=this.Ed),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.J||g>=d.M? +this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Cd.bind(this)))}a&&(this.a|=129,this.a&64&&nc(this.c,this.Ja))}};h.Re=function(){return this.m};h.cg=function(a){this.m=a&65534};h.Ue=function(){return this.f};h.fg=function(a){this.f=a};h.Ve=function(){return this.i};h.gg=function(a){this.i=a};h.Se=function(){return this.h};h.dg=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4}; +var Og="",Pg="?",Qg="??",Ug={},Mg=(Ug[63744]=[null,null,N.prototype.Te,N.prototype.eg,"RLCS"],Ug[63746]=[null,null,N.prototype.Re,N.prototype.cg,"RLBA"],Ug[63748]=[null,null,N.prototype.Ue,N.prototype.fg,"RLDA"],Ug[63750]=[null,null,N.prototype.Ve,N.prototype.gg,"RLMP"],Ug[63752]=[null,null,N.prototype.Se,N.prototype.dg,"RLBE"],Ug); +function Vg(a,b,c){q.call(this,"Computer",a,33554432);this.j.S=!1;this.G=null;Wg(this,b);this.C=Rc(this,"autoPower",a,6);this.g=0;this.K=+a.busWidth||+a.buswidth;this.u=this.s=this.w=null;this.o=this.I=!1;this.i=this.h=null;this.H=this.m=this.D=!1;this.L=Rc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Xg(this);if(this.c=za("CPU",this.id)){this.F=za("Debugger",this.id);this.v=new Qb({id:this.Ma+".bus",busWidth:this.K},this.c,this.F);var d,e=xa(this.id);if((this.f=za("Panel",this.id))&&this.f.eb)for(b= +0;b\nLicense: GPL version 3 or later ");this.Z("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bYg){if(Zg(d,this.u)){this.h=new G(this,"1.32.2",hh);Zg(this.h)&&(ih(this,d),a=lh,mh(this.h));this.h.set(eh,La());nh(this.h);var e=this.a&&!this.o;if(a==fh||wa("Click OK to restore the previous "+fb+" machine state, or CANCEL to reset the machine.")){if(c=dh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Zg(d,g):("error"==f&&"no machine state"!= +g?(this.B("Error: "+g),"unable to verify user"==g&&(Ra(oh,""),this.b=null)):this.Z(f+": "+g),mh(d),Zg(d)?(c=dh(d),e=!0):c=!1))}e&&bh(this,c?d:null)}else a==lh&&d.clear()}else bh(this);delete this.u;delete this.i}e=xa(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.S=!0;var d=this.l.power;d&&(d.textContent="Shutdown");this.c&&(ph(this,this.c,b,c,a),Ib(this,-2),this.c.da());this.D&&(ih(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; +function ih(a,b){if(wa("There may be a problem with your "+fb+" machine.\n\nTo help us diagnose it, click OK to send this "+fb+" machine state to http://www.pcjs.org.")){var c=a.L;a=a.b||"";b=b.toString();var d={};d.app=fb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;E("http://www.pcjs.org/api/v1/report",d,!0)}} +function qh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new G(a,"1.32.2"),g=new G(a,"1.32.2",ch),k=La();g.set(eh,k);f.set(eh,k);f.set(rh,"1.32.2");f.set(sh,window?window.location.href:null);f.set(th,window?window.navigator.userAgent:"");a.c&&a.c.fa&&(c&&(b&&(a.c.j.da=a.c.j.N),H(a.c)),d=a.c.fa(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.S=!1,!1===d&&(e=null)));for(var k=xa(a.id),l=0;l=d||30<=(c.xc+=d))&&(e.textContent=c.j.N?c.Na.toFixed(2)+"Mhz":"Stopped",c.xc=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.j.N;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");G(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);vh(a,b,c)}})}else c(a,null)} -function wh(a,b,c,d){function e(a){if(void 0===k){var b=g&&C(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ea(a))}function f(a){e("Error: "+a);l&&(--sh||Ya(!0));l=!1}var g,k,l=!0;sh++;sa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?th(c,null,null,!1,e,function(d,l){l?(ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--sh||Ya(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--sh||Ya(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?th(b,a,d,!0,e,m):uh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(x){f(x.message)}return l}window.embedPDP11=function(a,b,c,d){Ya(!1);return wh(a,b,c,d)};window.findMachineComponent=function(a,b){return wa(b,a+".machine")};window.enableEvents=Ya;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map +h.ha=function(a,b,c){var d=this;switch(b){case "power":return this.l[b]=c,c.onclick=function(){d.g||(d.j.S?qh(d,!1,!0):ah(d,d.Ab))},!0;case "reset":return this.l[b]=c,c.onclick=function(){if(d.j.S&&!d.g)if(d.a&&!d.s){var a=wa("Click OK to save changes to this "+fb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");qh(d,a,!0);!a&&d.w?window&&window.location.reload():(a||(d.m=!0),d.Ab(Yg),d.m=!1)}else d.reset(),d.c&&d.c.da()},!0;case "save":if(Fa(Na(),"pcjs.org"))c.parentNode.removeChild(c);else return this.l[b]= +c,c.onclick=function(){var a=Xg(d,!0);if(a){var b=!!(d.a&&!d.s||d.w),c=qh(d,b);b?uh(d,a,c):d.B("Resume disabled, machine state not saved")}},!0}return!1};function Xg(a,b){var c=a.b;c||((c=Qa(oh),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=wh(a,c))||a.B("The user ID is invalid.")):b&&a.B("Browser local storage is not available"));return c} +function wh(a,b){a.b=null;b=E(Na()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ra(oh,b.data),a.b=b.data)}catch(d){u(d.message+" ("+c+")")}return a.b}function $g(a){var b=null;a.b&&(b=Na()+"/api/v1/user?req=load&user="+a.b+"&state="+xh(a,"1.32.2"));return b} +function uh(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=xh(a,"1.32.2");d.data=c;b=E(Na()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");E(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);Bh(a,b,c)}})}else c(a,null)} +function Ch(a,b,c,d){function e(a){if(void 0===k){var b=g&&A(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ga(a))}function f(a){e("Error: "+a);l&&(--yh||ab(!0));l=!1}var g,k,l=!0;yh++;ua[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?zh(c,null,null,!1,e,function(d,l){l?(ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--yh||ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--yh||ab(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?zh(b,a,d,!0,e,m):Ah(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(y){f(y.message)}return l}window.embedPDP11=function(a,b,c,d){ab(!1);return Ch(a,b,c,d)};window.findMachineComponent=function(a,b){return za(b,a+".machine")};window.enableEvents=ab;window.sendEvent=cb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map From a70ab3dcc8cd957682a1397c862509e1b60ef71d Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Sat, 28 Jan 2017 14:10:43 -0800 Subject: [PATCH 10/15] The RL11 controller subclasses the new DriveController class now, too --- modules/pdp11/lib/defines.js | 2 + modules/pdp11/lib/drive.js | 87 ++- modules/pdp11/lib/rl11.js | 982 ++--------------------------- versions/pdpjs/1.32.2/pdp11-dbg.js | 679 ++++++++++---------- versions/pdpjs/1.32.2/pdp11.js | 492 +++++++-------- 5 files changed, 692 insertions(+), 1550 deletions(-) diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 2ef09fad6..e6e6c45a9 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -771,6 +771,7 @@ var PDP11 = { RL11: { // RL11 Disk Controller PRI: 5, VEC: 0o160, + DRIVES: 4, // maximum of 4 drives RLCS: { // 174400: Control Status Register DRDY: 0x0001, // Drive Ready (R/O) FUNC: 0x000E, // Function Code (F2,F1,F0) (R/W) @@ -876,6 +877,7 @@ var PDP11 = { }; PDP11.RK11.RK05 = [203, 2, 12, 512, PDP11.RK11.RKDS.RK05 | PDP11.RK11.RKDS.SOK | PDP11.RK11.RKDS.RRDY]; +PDP11.RL11.RL02K = [512, 2, 40, 256, PDP11.RL11.RLMP.GS_ST.LOCKON | PDP11.RL11.RLMP.GS_BH | PDP11.RL11.RLMP.GS_HO]; PDP11.ACCESS.READ_WORD = PDP11.ACCESS.WORD | PDP11.ACCESS.READ; // formerly READ_MODE (2) PDP11.ACCESS.READ_BYTE = PDP11.ACCESS.BYTE | PDP11.ACCESS.READ; // formerly READ_MODE (2) | BYTE_MODE (1) diff --git a/modules/pdp11/lib/drive.js b/modules/pdp11/lib/drive.js index 8fde0dba6..b34ee3390 100644 --- a/modules/pdp11/lib/drive.js +++ b/modules/pdp11/lib/drive.js @@ -48,6 +48,31 @@ if (NODE) { */ var Config; +/** + * Since the Closure Compiler treats ES6 classes as @struct rather than @dict by default, + * it deters us from defining named properties on our components; eg: + * + * this['exports'] = {...} + * + * results in an error: + * + * Cannot do '[]' access on a struct + * + * So, in order to define 'exports', we must override the @struct assumption by annotating + * the class as @unrestricted (or @dict). Note that this must be done both here and in the + * Component class, because otherwise the Compiler won't allow us to *reference* the named + * property either. + * + * TODO: Consider marking ALL our classes unrestricted, because otherwise it forces us to + * define every single property the class uses in its constructor, which results in a fair + * bit of redundant initialization, since many properties aren't (and don't need to be) fully + * initialized until the appropriate init(), reset(), restore(), etc. function is called. + * + * The upside, however, may be that since the structure of the class is completely defined by + * the constructor, JavaScript engines may be able to optimize and run more efficiently. + * + * @unrestricted + */ class DriveController extends Component { /** * DriveController(type, parms, bitsMessage, configDC) @@ -96,6 +121,10 @@ class DriveController extends Component { this.aDiskHistory = []; this.irq = null; + + this['exports'] = { + 'selectDrive': this.selectDrive + }; } /** @@ -860,15 +889,20 @@ class DriveController extends Component { /** * displayDisk(iDrive, fUpdateDrive) * + * This ensures that the selected disk matches the drive's sDiskPath property, and if fUpdateDrive is set, + * it also ensures that the selected drive matches the specified drive number. + * * @this {DriveController} * @param {number} iDrive (unvalidated) * @param {boolean} [fUpdateDrive] is true to update the drive list to match the specified drive (eg, the auto-mount case) + * @return {boolean} true if successful, false if not */ displayDisk(iDrive, fUpdateDrive) { /* * First things first: validate iDrive. */ + var fSuccess = false; if (iDrive >= 0 && iDrive < this.aDrives.length) { var drive = this.aDrives[iDrive]; var controlDisks = this.bindings["listDisks"]; @@ -878,34 +912,67 @@ class DriveController extends Component { */ if (controlDisks && controlDrives && controlDisks.options && controlDrives.options) { /* - * Next, make sure the drive whose disk we're updating is the currently selected drive. + * Next, update the drive if the caller has requested it. */ var i; + if (fUpdateDrive) { + this.assert(iDrive == drive.iDrive); + for (i = 0; i < controlDrives.options.length; i++) { + if (Str.parseInt(controlDrives.options[i].value, 10) == drive.iDrive) { + if (controlDrives.selectedIndex != i) { + controlDrives.selectedIndex = i; + } + fSuccess = true; + break; + } + } + } + /* + * Next, make sure the drive whose disk we're updating is the currently selected drive. + */ var iDriveSelected = Str.parseInt(controlDrives.value, 10); - var sTargetPath = (drive.fLocal? DriveController.SOURCE.LOCAL : drive.sDiskPath); + var sTargetPath = (drive.fLocal? RL11.SOURCE.LOCAL : drive.sDiskPath); if (!isNaN(iDriveSelected) && iDriveSelected == iDrive) { for (i = 0; i < controlDisks.options.length; i++) { if (controlDisks.options[i].value == sTargetPath) { if (controlDisks.selectedIndex != i) { controlDisks.selectedIndex = i; } + fSuccess = true; break; } } if (i == controlDisks.options.length) controlDisks.selectedIndex = 0; } - if (fUpdateDrive) { - for (i = 0; i < controlDrives.options.length; i++) { - if (Str.parseInt(controlDrives.options[i].value, 10) == drive.iDrive) { - if (controlDrives.selectedIndex != i) { - controlDrives.selectedIndex = i; - } - break; - } + } + } + return fSuccess; + } + + /** + * selectDrive(sDrive) + * + * Used to programmatically select a drive by name. + * + * @this {DriveController} + * @param {number} sDrive + * @return {boolean} true if successful, false if not + */ + selectDrive(sDrive) + { + var controlDrives = this.bindings["listDrives"]; + if (controlDrives && controlDrives.options) { + var nDrives = controlDrives.options.length; + for (var i = 0; i < nDrives; i++) { + if (controlDrives.options[i].innerHTML == sDrive) { + var iDrive = Str.parseInt(controlDrives.options[i].value, 10); + if (iDrive >= 0) { + return this.displayDisk(iDrive, true); } } } } + return false; } /** diff --git a/modules/pdp11/lib/rl11.js b/modules/pdp11/lib/rl11.js index 20d9412d9..fb1134b76 100644 --- a/modules/pdp11/lib/rl11.js +++ b/modules/pdp11/lib/rl11.js @@ -34,41 +34,12 @@ if (NODE) { var Str = require("../../shared/es6/strlib"); - var Web = require("../../shared/es6/weblib"); - var DiskAPI = require("../../shared/es6/diskapi"); - var Component = require("../../shared/es6/component"); - var State = require("../../shared/es6/state"); var PDP11 = require("./defines"); var MessagesPDP11 = require("./messages"); - var DiskPDP11 = require("./disk"); + var DriveController = require("./drive"); } -/** - * Since the Closure Compiler treats ES6 classes as @struct rather than @dict by default, - * it deters us from defining named properties on our components; eg: - * - * this['exports'] = {...} - * - * results in an error: - * - * Cannot do '[]' access on a struct - * - * So, in order to define 'exports', we must override the @struct assumption by annotating - * the class as @unrestricted (or @dict). Note that this must be done both here and in the - * Component class, because otherwise the Compiler won't allow us to *reference* the named - * property either. - * - * TODO: Consider marking ALL our classes unrestricted, because otherwise it forces us to - * define every single property the class uses in its constructor, which results in a fair - * bit of redundant initialization, since many properties aren't (and don't need to be) fully - * initialized until the appropriate init(), reset(), restore(), etc. function is called. - * - * The upside, however, may be that since the structure of the class is completely defined by - * the constructor, JavaScript engines may be able to optimize and run more efficiently. - * - * @unrestricted - */ -class RL11 extends Component { +class RL11 extends DriveController { /** * RL11(parms) * @@ -89,928 +60,62 @@ class RL11 extends Component { */ constructor(parms) { - super("RL11", parms, MessagesPDP11.RL11); + super("RL11", parms, MessagesPDP11.RL11, PDP11.RL11, PDP11.RL11.RL02K, RL11.UNIBUS_IOTABLE); /* - * We preliminarily parse and record any 'autoMount' object now, but we no longer process it - * until initBus(), because the Computer's getMachineParm() service may have an override for us. - */ - this.configMount = this.parseConfig(parms['autoMount']); - this.cAutoMount = 0; - - /* - * The RL11 has two Drive Select bits, representing up to four drives. - */ - this.nDrives = 4; - this.aDrives = new Array(this.nDrives); - this.fLocalDisks = (!Web.isMobile() && window && 'FileReader' in window); - this.sDiskSource = RL11.SOURCE.NONE; - - this.irq = null; - - /* - * Define all the properties to be initialized by initController() + * Define all the registers required for this controller. */ this.regRLCS = this.regRLBA = this.regRLDA = this.tmpRLDA = this.regRLMP = this.regRLBE = 0; - - this['exports'] = { - 'selectDrive': this.selectDrive - }; } /** - * parseConfig(config) + * initController(aRegs, aHistory) * * @this {RL11} - * @param {*} config - * @return {*} + * @param {Array} [aRegs] + * @param {Array} [aHistory] + * @return {boolean} true if successful, false if failure */ - parseConfig(config) + initController(aRegs, aHistory) { - if (config && typeof config == "string") { - try { - /* - * The most likely source of any exception will be right here, where we're parsing - * this JSON-encoded data. - */ - config = eval("(" + config + ")"); - } catch (e) { - Component.error(this.type + " auto-mount error: " + e.message + " (" + config + ")"); - config = null; - } - } - return config || {}; - } - - /** - * setBinding(sType, sBinding, control, sValue) - * - * @this {RL11} - * @param {string|null} sType is the type of the HTML control (eg, "button", "list", "text", etc) - * @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) - * @param {string} [sValue] optional data value - * @return {boolean} true if binding was successful, false if unrecognized binding request - */ - setBinding(sType, sBinding, control, sValue) - { - var rl11 = this; - - switch (sBinding) { - - case "listDisks": - this.bindings[sBinding] = control; - - control.onchange = function onChangeListDisks(event) { - var controlDesc = rl11.bindings["descDisk"]; - var controlOption = control.options && control.options[control.selectedIndex]; - if (controlDesc && controlOption) { - var dataValue = {}; - var sValue = controlOption.getAttribute("data-value"); - if (sValue) { - try { - dataValue = eval("(" + sValue + ")"); - } catch (e) { - Component.error("RL11 option error: " + e.message); - } - } - var sHTML = dataValue['desc']; - if (sHTML === undefined) sHTML = ""; - var sHRef = dataValue['href']; - if (sHRef !== undefined) sHTML = "" + sHTML + ""; - controlDesc.innerHTML = sHTML; - } - }; - return true; - - case "descDisk": - case "listDrives": - this.bindings[sBinding] = control; - /* - * I tried going with onclick instead of onchange, so that if you wanted to confirm what's - * loaded in a particular drive, you could click the drive control without having to change it. - * However, that doesn't seem to work for all browsers, so I've reverted to onchange. - */ - control.onchange = function onChangeListDrives(event) { - var iDrive = Str.parseInt(control.value, 10); - if (iDrive != null) rl11.displayDisk(iDrive); - }; - return true; - - case "loadDisk": - this.bindings[sBinding] = control; - - control.onclick = function onClickLoadDrive(event) { - var controlDisks = rl11.bindings["listDisks"]; - if (controlDisks && controlDisks.options) { - var sDiskName = controlDisks.options[controlDisks.selectedIndex].text; - var sDiskPath = controlDisks.value; - rl11.loadSelectedDrive(sDiskName, sDiskPath); - } - }; - return true; - - case "bootDisk": - this.bindings[sBinding] = control; - - control.onclick = function onClickBootDisk(event) { - rl11.bootSelectedDisk(); - }; - return true; - - case "saveDisk": - /* - * Yes, technically, this feature does not require "Local disk support" (which is really a reference - * to FileReader support), but since fLocalDisks is also false for all mobile devices, and since there - * is an "orthogonality" to disabling both features in tandem, let's just let it slide, OK? - */ - if (!this.fLocalDisks) { - if (DEBUG) this.log("Local disk support not available"); - /* - * We could also simply hide the control; eg: - * - * control.style.display = "none"; - * - * but removing the control altogether seems better. - */ - control.parentNode.removeChild(/** @type {Node} */ (control)); - return false; - } - - this.bindings[sBinding] = control; - - control.onclick = function onClickSaveDrive(event) { - var controlDrives = rl11.bindings["listDrives"]; - if (controlDrives && controlDrives.options && rl11.aDrives) { - var iDriveSelected = Str.parseInt(controlDrives.value, 10) || 0; - var drive = rl11.aDrives[iDriveSelected]; - if (drive) { - /* - * Note the similarity (and hence factoring opportunity) between this code and the HDC's "saveHD*" binding. - */ - var disk = drive.disk; - if (disk) { - if (DEBUG) rl11.println("saving disk " + disk.sDiskPath + "..."); - var sAlert = Web.downloadFile(disk.encodeAsBase64(), "octet-stream", true, disk.sDiskFile.replace(".json", ".img")); - Component.alertUser(sAlert); - } else { - rl11.notice("No disk loaded in drive."); - } - } else { - rl11.notice("No disk drive selected."); - } - } - }; - return true; - - case "mountDisk": - if (!this.fLocalDisks) { - if (DEBUG) this.log("Local disk support not available"); - /* - * We could also simply hide the control; eg: - * - * control.style.display = "none"; - * - * but removing the control altogether seems better. - */ - control.parentNode.removeChild(/** @type {Node} */ (control)); - return false; - } - - this.bindings[sBinding] = control; - - /* - * Enable "Mount" button only if a file is actually selected - */ - control.addEventListener('change', function() { - var fieldset = control.children[0]; - var files = fieldset.children[0].files; - var submit = fieldset.children[1]; - submit.disabled = !files.length; - }); - - control.onsubmit = function(event) { - var file = event.currentTarget[1].files[0]; - if (file) { - var sDiskPath = file.name; - var sDiskName = Str.getBaseName(sDiskPath, true); - rl11.loadSelectedDrive(sDiskName, sDiskPath, file); - } - /* - * Prevent reloading of web page after form submission - */ - return false; - }; - return true; - - default: - break; - } - return false; - } - - /** - * initBus(cmp, bus, cpu, dbg) - * - * @this {RL11} - * @param {ComputerPDP11} cmp - * @param {BusPDP11} bus - * @param {CPUStatePDP11} cpu - * @param {DebuggerPDP11} dbg - */ - initBus(cmp, bus, cpu, dbg) - { - this.cmp = cmp; - this.bus = bus; - this.cpu = cpu; - this.dbg = dbg; - - var configMount = this.parseConfig(this.cmp.getMachineParm('autoMount')); - - /* - * Add only drives from the machine-wide autoMount configuration that match drives managed by this component. - */ - if (configMount) { - for (var sDrive in configMount) { - if (sDrive.substr(0, 2) != this.type.substr(0, 2)) continue; - this.configMount[sDrive] = configMount[sDrive]; - } + if (!aRegs) { + aRegs = [(RL11.RLCS.DRDY | RL11.RLCS.CRDY), 0, 0, 0, 0, 0]; } /* - * If we didn't need auto-mount support, we could defer controller initialization until we received - * a powerUp() notification, at which point reset() would call initController(), or restore() would restore - * the controller; in that case, all we'd need to do here is call setReady(). + * ES6 ALERT: A handy destructuring assignment, which makes it easy to perform the inverse + * of what saveController() does when it collects a bunch of object properties into an array. */ - this.initController(); + [ + this.regRLCS, + this.regRLBA, + this.regRLDA, + this.tmpRLDA, + this.regRLMP, + this.regRLBE + ] = aRegs; - this.irq = this.cpu.addIRQ(RL11.VEC, RL11.PRI, MessagesPDP11.RL11); - - bus.addIOTable(this, RL11.UNIBUS_IOTABLE); - bus.addResetHandler(this.reset.bind(this)); - - this.addDisk("None", RL11.SOURCE.NONE, true); - if (this.fLocalDisks) this.addDisk("Local Disk", RL11.SOURCE.LOCAL); - this.addDisk("Remote Disk", RL11.SOURCE.REMOTE); - - if (!this.autoMount()) this.setReady(); - } - - /** - * getDriveName(iDrive) - * - * @this {RL11} - * @param {number} iDrive - * @return {string} - */ - getDriveName(iDrive) - { - return "RL" + iDrive; - } - - /** - * getDriveNumber(sDrive) - * - * @this {RL11} - * @param {string} sDrive - * @return {number} (0-3, or -1 if error) - */ - getDriveNumber(sDrive) - { - var iDrive = -1; - if (sDrive) { - iDrive = sDrive.charCodeAt(sDrive.length - 1) - 0x30; - if (iDrive < 0 || iDrive > 9) iDrive = -1; - } - return iDrive; - } - - /** - * powerUp(data, fRepower) - * - * @this {RL11} - * @param {Object|null} data - * @param {boolean} [fRepower] - * @return {boolean} true if successful, false if failure - */ - powerUp(data, fRepower) - { - if (!fRepower) { - if (!data) { - this.reset(); - if (this.cmp.fReload) { - /* - * If the computer's fReload flag is set, we're required to toss all currently - * loaded disks and remount all disks specified in the auto-mount configuration. - */ - this.unloadAllDrives(true); - this.autoMount(true); - } - } else { - if (!this.restore(data)) return false; - } - /* - * Populate the HTML controls to match the actual (well, um, specified) number of floppy drives. - */ - var controlDrives; - if ((controlDrives = this.bindings['listDrives'])) { - while (controlDrives.firstChild) { - controlDrives.removeChild(controlDrives.firstChild); - } - controlDrives.value = ""; - for (var iDrive = 0; iDrive < this.nDrives; iDrive++) { - var controlOption = document.createElement("option"); - controlOption.value = iDrive; - controlOption.text = this.getDriveName(iDrive); - controlDrives.appendChild(controlOption); - } - if (this.nDrives > 0) { - controlDrives.value = "0"; - this.displayDisk(0); - } - } - } - return true; - } - - /** - * powerDown(fSave, fShutdown) - * - * @this {RL11} - * @param {boolean} [fSave] - * @param {boolean} [fShutdown] - * @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure - */ - powerDown(fSave, fShutdown) - { - return fSave? this.save() : true; - } - - /** - * reset() - * - * @this {RL11} - */ - reset() - { - this.initController(); - } - - /** - * save() - * - * This implements save support for the RL11 component. - * - * @this {RL11} - * @return {Object} - */ - save() - { - var state = new State(this); - // state.set(0, this.saveController()); - return state.data(); - } - - /** - * restore(data) - * - * This implements restore support for the RL11 component. - * - * @this {RL11} - * @param {Object} data - * @return {boolean} true if successful, false if failure - */ - restore(data) - { - return this.initController(data[0]); + return super.initController(aRegs, aHistory); } /** * saveController() * - * TODO: Implement. + * Basically, the inverse of initController(). * * @this {RL11} * @return {Array} */ saveController() { - return []; - } - - /** - * autoMount(fRemount) - * - * @this {RL11} - * @param {boolean} [fRemount] is true if we're remounting all auto-mounted disks - * @return {boolean} true if one or more disk images are being auto-mounted, false if none - */ - autoMount(fRemount) - { - if (!fRemount) this.cAutoMount = 0; - for (var sDrive in this.configMount) { - var configDrive = this.configMount[sDrive]; - var sDiskPath = configDrive['path'] || ""; - var sDiskName = configDrive['name'] || this.findDisk(sDiskPath); - if (sDiskPath && sDiskName) { - var iDrive = this.getDriveNumber(sDrive); - if (iDrive >= 0 && iDrive < this.aDrives.length) { - if (!this.loadDrive(iDrive, sDiskName, sDiskPath, true) && fRemount) { - this.setReady(false); - } - continue; - } - } - this.notice("Incorrect auto-mount settings for drive " + sDrive + " (" + JSON.stringify(configDrive) + ")"); - } - return !!this.cAutoMount; - } - - /** - * loadSelectedDrive(sDiskName, sDiskPath, file) - * - * @this {RL11} - * @param {string} sDiskName - * @param {string} sDiskPath - * @param {File} [file] is set if there's an associated File object - */ - loadSelectedDrive(sDiskName, sDiskPath, file) - { - var controlDrives = this.bindings["listDrives"]; - var iDrive = controlDrives && Str.parseInt(controlDrives.value, 10); - - if (iDrive === undefined || iDrive < 0 || iDrive >= this.aDrives.length) { - this.notice("Unable to load the selected drive"); - return; - } - - if (!sDiskPath) { - this.unloadDrive(iDrive); - return; - } - - if (sDiskPath == RL11.SOURCE.LOCAL) { - this.notice('Use "Choose File" and "Mount" to select and load a local disk.'); - return; - } - - /* - * If the special RL11.SOURCE.REMOTE path is selected, then we want to prompt the user for a URL. - * Oh, and make sure we pass an empty string as the 2nd parameter to prompt(), so that IE won't display - * "undefined" -- because after all, undefined and "undefined" are EXACTLY the same thing, right? - * - * TODO: This is literally all I've done to support remote disk images. There's probably more - * I should do, like dynamically updating "listDisks" to include new entries, and adding new entries - * to the save/restore data. - */ - if (sDiskPath == RL11.SOURCE.REMOTE) { - sDiskPath = window.prompt("Enter the URL of a remote disk image.", "") || ""; - if (!sDiskPath) return; - sDiskName = Str.getBaseName(sDiskPath); - this.status("Attempting to load " + sDiskPath + " as \"" + sDiskName + "\""); - this.sDiskSource = RL11.SOURCE.REMOTE; - } - else { - this.sDiskSource = sDiskPath; - } - - this.loadDrive(iDrive, sDiskName, sDiskPath, false, file); - } - - /** - * bootSelectedDisk() - * - * @this {RL11} - */ - bootSelectedDisk() - { - var drive; - var controlDrives = this.bindings["listDrives"]; - var iDrive = controlDrives && Str.parseInt(controlDrives.value, 10); - - if (iDrive == null || iDrive < 0 || iDrive >= this.aDrives.length || !(drive = this.aDrives[iDrive])) { - this.notice("Unable to boot the selected drive"); - return; - } - if (!drive.disk) { - this.notice("Load a disk into the drive first"); - return; - } - /* - * NOTE: We're calling setReset() BEFORE reading the boot code in order to eliminate any side-effects - * of the previous state of either the controller OR the CPU; for example, we don't want any previous MMU - * or UNIBUS Map registers affecting the simulated readData() call. Also, some boot code (eg, RSTS/E) - * expects the controller to be in a READY state; since setReset() triggers a call to our reset() handler, - * a READY state is assured, and the readData() call shouldn't do anything to change that. - */ - this.cpu.setReset(0, true); - var err = this.readData(drive, 0, 0, 0, 512, 0x0000); - if (err) { - this.notice("Unable to read the boot sector (" + err + ")"); - } - } - - /** - * loadDrive(iDrive, sDiskName, sDiskPath, fAutoMount, file) - * - * NOTE: If sDiskPath is already loaded, nothing needs to be done. - * - * @this {RL11} - * @param {number} iDrive - * @param {string} sDiskName - * @param {string} sDiskPath - * @param {boolean} [fAutoMount] - * @param {File} [file] is set if there's an associated File object - * @return {number} 1 if disk loaded, 0 if queued up (or busy), -1 if already loaded - */ - loadDrive(iDrive, sDiskName, sDiskPath, fAutoMount, file) - { - var nResult = -1; - var drive = this.aDrives[iDrive]; - - if (drive.sDiskPath.toLowerCase() != sDiskPath.toLowerCase()) { - - nResult++; - this.unloadDrive(iDrive, true); - - if (drive.fBusy) { - this.notice("RL11 busy"); - } - else { - // this.status("disk queued: " + sDiskName); - drive.fBusy = true; - if (fAutoMount) { - drive.fAutoMount = true; - this.cAutoMount++; - if (this.messageEnabled()) this.printMessage("auto-loading disk: " + sDiskName); - } - drive.fLocal = !!file; - var disk = new DiskPDP11(this, drive, DiskAPI.MODE.PRELOAD); - if (disk.load(sDiskName, sDiskPath, file, this.finishLoadDrive)) { - nResult++; - } - } - } - return nResult; - } - - /** - * finishLoadDrive(drive, disk, sDiskName, sDiskPath, fAutoMount) - * - * The disk parameter is set if the disk was successfully loaded, null if not. - * - * @this {RL11} - * @param {Object} drive - * @param {DiskPDP11} disk - * @param {string} sDiskName - * @param {string} sDiskPath - * @param {boolean} [fAutoMount] - */ - finishLoadDrive(drive, disk, sDiskName, sDiskPath, fAutoMount) - { - drive.fBusy = false; - - if (disk) { - /* - * TODO: While this is a perfectly reasonable thing to do, one wonders if the Disk object shouldn't - * have done this itself, since we passed our Drive object to it (it already knows the drive's limits). - */ - if (disk.nCylinders > drive.nCylinders || disk.nHeads > drive.nHeads /* || disk.nSectors > drive.nSectors */) { - this.notice("Disk \"" + sDiskName + "\" too large for drive " + this.getDriveName(drive.iDrive)); - disk = null; - } - } - - if (disk) { - drive.disk = disk; - drive.sDiskName = sDiskName; - drive.sDiskPath = sDiskPath; - - /* - * Adding local disk image names to the disk list seems like a nice idea, but it's too confusing, - * because then it looks like the "Mount" button should be able to (re)load them, and that can NEVER - * happen, for security reasons; local disk images can ONLY be loaded via the "Mount" button after - * the user has selected them via the "Choose File" button. - * - * this.addDisk(sDiskName, sDiskPath); - * - * So we're going to take a different approach: when displayDisk() is asked to display the name - * of a local disk image, it will map all such disks to "Local Disk", and any attempt to "Mount" such - * a disk, will essentially result in a "Disk not found" error. - */ - // this.addDiskHistory(sDiskName, sDiskPath, disk); - - /* - * For a local disk (ie, one loaded via mountDrive()), the disk.restore() performed by addDiskHistory() - * may have altered the disk geometry, so refresh the disk info. - */ - // aDiskInfo = disk.info(); - - /* - * Clearly, a successful mount implies a disk change, and I suppose that, technically, an *unsuccessful* - * mount should imply the same, but what would the real-world analog be? Inserting a piece of cardboard - * instead of an actual disk? In any case, if we can do the user a favor by pretending (as far as the - * disk change line is concerned) that an unsuccessful mount never happened, let's do it. - * - * Successful unmounts are a different story, however; those *do* trigger a change. See unloadDrive(). - */ - // this.regInput |= FDC.REG_INPUT.DISK_CHANGE; - - /* - * With the addition of notify(), users are now "alerted" whenever a disk has finished loading; - * notify() is selective about its output, using print() if a print window is open, alert() otherwise. - */ - this.notice("Loaded disk \"" + sDiskName + "\" in drive " + this.getDriveName(drive.iDrive), drive.fAutoMount || fAutoMount); - - /* - * Since you usually want the Computer to have focus again after loading a new disk, let's try automatically - * updating the focus after a successful load. - */ - if (this.cmp) this.cmp.setFocus(); - } - else { - drive.fLocal = false; - } - - if (drive.fAutoMount) { - drive.fAutoMount = false; - if (!--this.cAutoMount) this.setReady(); - } - - this.displayDisk(drive.iDrive); - } - - /** - * addDisk(sName, sPath, fTop) - * - * @this {RL11} - * @param {string} sName - * @param {string} sPath - * @param {boolean} [fTop] (default is bottom) - */ - addDisk(sName, sPath, fTop) - { - var controlDisks = this.bindings["listDisks"]; - if (controlDisks && controlDisks.options) { - for (var i = 0; i < controlDisks.options.length; i++) { - if (controlDisks.options[i].value == sPath) return; - } - var controlOption = document.createElement("option"); - controlOption.text = sName; - controlOption.value = sPath; - if (fTop && controlDisks.childNodes[0]) { - controlDisks.insertBefore(controlOption, controlDisks.childNodes[0]); - } else { - controlDisks.appendChild(controlOption); - } - } - } - - /** - * findDisk(sPath) - * - * This is used to deal with mount requests (eg, autoMount) that supply a path without a name; - * if we can find the path in the "listDisks" control, then we return the associated disk name. - * - * @this {RL11} - * @param {string} sPath - * @return {string|null} - */ - findDisk(sPath) - { - var controlDisks = this.bindings["listDisks"]; - if (controlDisks && controlDisks.options) { - for (var i = 0; i < controlDisks.options.length; i++) { - var control = controlDisks.options[i]; - if (control.value == sPath) return control.text; - } - } - return Str.getBaseName(sPath, true); - } - - /** - * displayDisk(iDrive, fUpdateDrive) - * - * This ensures that the selected disk matches the drive's sDiskPath property, and if fUpdateDrive is set, - * it also ensures that the selected drive matches the specified drive number. - * - * @this {RL11} - * @param {number} iDrive - * @param {boolean} [fUpdateDrive] is true to update the drive list to match the specified drive (eg, the auto-mount case) - * @return {boolean} true if successful, false if not - */ - displayDisk(iDrive, fUpdateDrive) - { - /* - * First things first: validate iDrive. - */ - var fSuccess = false; - if (iDrive >= 0 && iDrive < this.aDrives.length) { - var drive = this.aDrives[iDrive]; - var controlDisks = this.bindings["listDisks"]; - var controlDrives = this.bindings["listDrives"]; - /* - * Next, make sure controls for both drives and disks exist. - */ - if (controlDisks && controlDrives && controlDisks.options && controlDrives.options) { - /* - * Next, update the drive if the caller has requested it. - */ - var i; - if (fUpdateDrive) { - this.assert(iDrive == drive.iDrive); - for (i = 0; i < controlDrives.options.length; i++) { - if (Str.parseInt(controlDrives.options[i].value, 10) == drive.iDrive) { - if (controlDrives.selectedIndex != i) { - controlDrives.selectedIndex = i; - } - fSuccess = true; - break; - } - } - } - /* - * Next, make sure the drive whose disk we're updating is the currently selected drive. - */ - var iDriveSelected = Str.parseInt(controlDrives.value, 10); - var sTargetPath = (drive.fLocal? RL11.SOURCE.LOCAL : drive.sDiskPath); - if (!isNaN(iDriveSelected) && iDriveSelected == iDrive) { - for (i = 0; i < controlDisks.options.length; i++) { - if (controlDisks.options[i].value == sTargetPath) { - if (controlDisks.selectedIndex != i) { - controlDisks.selectedIndex = i; - } - fSuccess = true; - break; - } - } - if (i == controlDisks.options.length) controlDisks.selectedIndex = 0; - } - } - } - return fSuccess; - } - - /** - * selectDrive(sDrive) - * - * Used to programmatically select a drive by name. - * - * @this {RL11} - * @param {number} sDrive - * @return {boolean} true if successful, false if not - */ - selectDrive(sDrive) - { - var controlDrives = this.bindings["listDrives"]; - if (controlDrives && controlDrives.options) { - var nDrives = controlDrives.options.length; - for (var i = 0; i < nDrives; i++) { - if (controlDrives.options[i].innerHTML == sDrive) { - var iDrive = Str.parseInt(controlDrives.options[i].value, 10); - if (iDrive >= 0) { - return this.displayDisk(iDrive, true); - } - } - } - } - return false; - } - - /** - * unloadDrive(iDrive, fLoading) - * - * @this {RL11} - * @param {number} iDrive - * @param {boolean} [fLoading] - */ - unloadDrive(iDrive, fLoading) - { - var drive = this.aDrives[iDrive]; - - if (drive.disk || fLoading === false) { - - /* - * Before we toss the disk's information, capture any deltas that may have occurred. - */ - // this.updateDiskHistory(drive.sDiskName, drive.sDiskPath, drive.disk); - - drive.sDiskName = ""; - drive.sDiskPath = ""; - drive.disk = null; - drive.fLocal = false; - - // this.regInput |= FDC.REG_INPUT.DISK_CHANGE; - - if (!fLoading) { - this.notice("Drive " + this.getDriveName(iDrive) + " unloaded", fLoading); - this.sDiskSource = RL11.SOURCE.NONE; - this.displayDisk(iDrive); - } - } - } - - /** - * unloadAllDrives(fDiscard) - * - * @this {RL11} - * @param {boolean} fDiscard to discard all disk history before unloading - */ - unloadAllDrives(fDiscard) - { - // if (fDiscard) this.aDiskHistory = []; - - for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { - this.unloadDrive(iDrive, true); - } - } - - /** - * initController(data) - * - * @this {RL11} - * @param {Array} [data] - * @return {boolean} true if successful, false if failure - */ - initController(data) - { - var i = 0; - if (!data) data = []; - this.regRLCS = data[i++] || (RL11.RLCS.DRDY | RL11.RLCS.CRDY); - this.regRLBA = data[i++] || 0; - this.regRLDA = data[i++] || 0; - this.tmpRLDA = data[i++] || 0; - this.regRLMP = data[i++] || 0; - this.regRLBE = data[i] || 0; - - var fSuccess = true; - for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { - var drive = this.aDrives[iDrive]; - if (drive === undefined) { - drive = this.aDrives[iDrive] = {}; - } - if (!this.initDrive(drive, iDrive)) { - fSuccess = false; - } - } - return fSuccess; - } - - /** - * initDrive(drive, iDrive, data) - * - * TODO: Consider a separate Drive class that any drive controller can use, since there's a lot of commonality - * between the drive objects created by disk controllers. This will clean up overall drive management and allow - * us to factor out some common Drive methods. - * - * @this {RL11} - * @param {Object} drive - * @param {number} iDrive - * @param {Array|undefined} [data] - * @return {boolean} true if successful, false if failure - */ - initDrive(drive, iDrive, data) - { - var i = 0; - var fSuccess = true; - - drive.iDrive = iDrive; - drive.name = this.idComponent; - drive.fBusy = drive.fLocal = false; - - /* - * NOTE: We initialize the following drive properties to their MAXIMUMs; disks may have - * these or SMALLER values (subject to the limits of what the controller supports, of course). - */ - drive.nCylinders = 512; - drive.nHeads = 2; - drive.nSectors = 40; - drive.cbSector = 256; - drive.fRemovable = true; - - /* - * The next group of properties are set by various controller command sequences. - */ - drive.bHead = 0; - drive.bCylinder = 0; - drive.bSector = 1; - drive.bSectorEnd = drive.nSectors; // aka EOT - drive.nBytes = drive.cbSector; - - /* - * The next group of properties are managed by worker functions (eg, doRead()) to maintain state across DMA requests. - */ - drive.ibSector = 0; - drive.sector = null; - - if (!drive.disk) drive.sDiskPath = ""; // ensure this is initialized to a default that displayDisk() can deal with - - /* - * Default drive status bits returned via the controller's Get Status command via the RLMP register - */ - drive.status = RL11.RLMP.GS_ST.LOCKON | RL11.RLMP.GS_BH | RL11.RLMP.GS_HO; - - return fSuccess; + return [ + this.regRLCS, + this.regRLBA, + this.regRLDA, + this.tmpRLDA, + this.regRLMP, + this.regRLBE + ]; } /** @@ -1093,7 +198,7 @@ class RL11 extends Component { if (this.messageEnabled()) this.printMessage(this.type + ": " + sFunc + "(" + iCylinder + ":" + iHead + ":" + iSector + ") " + Str.toOct(addr) + "--" + Str.toOct(addr + (nWords << 1)), true, true); - fInterrupt = fnReadWrite.call(this, drive, iCylinder, iHead, iSector, nWords, addr, this.doneReadWrite.bind(this)); + fInterrupt = fnReadWrite.call(this, drive, iCylinder, iHead, iSector, nWords, addr, 2, false, this.doneReadWrite.bind(this)); break; default: @@ -1107,7 +212,7 @@ class RL11 extends Component { } /** - * readData(drive, iCylinder, iHead, iSector, nWords, addr, done) + * readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) * * @this {RL11} * @param {Object} drive @@ -1116,10 +221,12 @@ class RL11 extends Component { * @param {number} iSector * @param {number} nWords * @param {number} addr + * @param {number} inc (normally 2, unless inhibited, in which case it's 0) + * @param {boolean} [fCheck] * @param {function(...)} [done] * @return {boolean|number} true if complete, false if queued (or if no done() is supplied, the error code, if any) */ - readData(drive, iCylinder, iHead, iSector, nWords, addr, done) + readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) { var err = 0; var checksum = 0; @@ -1190,7 +297,7 @@ class RL11 extends Component { } /** - * writeData(drive, iCylinder, iHead, iSector, nWords, addr, done) + * writeData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) * * @this {RL11} * @param {Object} drive @@ -1199,10 +306,12 @@ class RL11 extends Component { * @param {number} iSector * @param {number} nWords * @param {number} addr + * @param {number} inc (normally 2, unless inhibited, in which case it's 0) + * @param {boolean} [fCheck] * @param {function(...)} [done] * @return {boolean|number} true if complete, false if queued (or if no done() is supplied, the error code, if any) */ - writeData(drive, iCylinder, iHead, iSector, nWords, addr, done) + writeData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) { var err = 0; var checksum = 0; @@ -1427,20 +536,9 @@ class RL11 extends Component { } } -/* - * There's nothing super special about these values, except that NONE should be falsey and the others should not. - */ -RL11.SOURCE = { - NONE: "", - LOCAL: "?", - REMOTE: "??" -}; - /* * Alias RL11 definitions as class constants */ -RL11.PRI = PDP11.RL11.PRI; -RL11.VEC = PDP11.RL11.VEC; RL11.RLCS = PDP11.RL11.RLCS; // 174400: Control Status Register RL11.RLBA = PDP11.RL11.RLBA; // 174402: Bus Address Register RL11.RLDA = PDP11.RL11.RLDA; // 174404: Disk Address Register diff --git a/versions/pdpjs/1.32.2/pdp11-dbg.js b/versions/pdpjs/1.32.2/pdp11-dbg.js index 382b11114..d6cf7ed0c 100644 --- a/versions/pdpjs/1.32.2/pdp11-dbg.js +++ b/versions/pdpjs/1.32.2/pdp11-dbg.js @@ -15,6 +15,7 @@ http://pcjs.org/modules/pdp11/lib/keyboard.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/pc11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/rk11.js (C) Jeff Parsons 2012-2017 + http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/es6/state.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/es6/embed.js (C) Jeff Parsons 2012-2017 @@ -29,356 +30,344 @@ http://pcjs.org/modules/pdp11/lib/serial.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/disk.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/drive.js (C) Jeff Parsons 2012-2017 - http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/es6/debugger.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2017 */ var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var ea=0;function da(a){return"jscomp_symbol_"+(a||"")+ea++} -function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ga(this)}});fa=function(){}}function ga(a){var b=0;return ia(function(){return b":62,"?":63,"@":64,Zc:65,lh:66,nh:67,Lh:68,E:69,Qh:70,Sh:71,Th:72,Uh:73,Vh:74,Wh:75,Xh:76,Yh:77,Zh:78,$h:79,bi:80,Q:81,di:82,ei:83,ii:84,ki:85,li:86,mi:87,ri:88,si:89,Ae:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,ti:97,ui:98,vi:99,d:100,e:101,wi:102,xi:103,yi:104,zi:105,Ci:106,k:107,Di:108,Ei:109,n:110,Fi:111,p:112,q:113,r:114,Gi:115,t:116,Ii:117,Ji:118,Ki:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Zd:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.pd=b.comment;this.we=b;this.exports={};this.C=this.bindings={};a=this.id.indexOf(".");0>a?this.nb=this.id:(this.ob=this.id.substr(0,a),this.nb=this.id.substr(a+1));this.A={ready:!1,gb:!1,Qc:!1,fa:!1,error:!1};this.rc=null;this.A.error=!1;this.ia=c||0;this.G=this.f=this.D=this.J=this.Pa=null;va.push(this)}function wa(a,b,c){xa[a]&&b&&(xa[a][b]=c)} -function ya(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function za(a){var b=!1;window&&(b=window.confirm(a));return b}function Ba(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b":62,"?":63,"@":64,nd:65,Fh:66,Ih:67,gi:68,E:69,mi:70,oi:71,Bi:72,Di:73,Ei:74,Fi:75,Gi:76,Ji:77,Li:78,Ni:79,Qi:80,Q:81,Si:82,Ui:83,bj:84,dj:85,fj:86,gj:87,kj:88,lj:89,We:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,mj:97,nj:98,qj:99,d:100,e:101,rj:102,sj:103,tj:104,uj:105,yj:106,k:107,zj:108,Aj:109,n:110,Bj:111,p:112,q:113,r:114,Cj:115,t:116,Fj:117,Gj:118,Hj:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,ne:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Cd=b.comment;this.Te=b;this.exports={};this.H=this.bindings={};a=this.id.indexOf(".");0>a?this.Fb=this.id:(this.pb=this.id.substr(0,a),this.Fb=this.id.substr(a+1));this.A={ready:!1,jb:!1,$c:!1,ca:!1,error:!1};this.zc=null;this.A.error=!1;this.fa=c||0;this.F=this.f=this.C=this.K=this.Qa=null;ua.push(this)}function va(a,b,c){xa[a]&&b&&(xa[a][b]=c)} +function ya(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function za(a){var b=!1;window&&(b=window.confirm(a));return b}function Aa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=1,f--;return d}function F(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d} -function Qa(a){var b=2,c="";b?10=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function Ra(a){return H(a,4,!0)} -function Sa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Wa[a]})}function Xa(a,b){return(a+" ").slice(0,b)} -function ab(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Wa={"&":"&","<":"<",">":">",'"':""","'":"'"},bb={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; -function cb(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function eb(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, +function La(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=1,f--;return d}function E(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d} +function Ra(a){var b=2,c="";b?10=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function Sa(a){return F(a,4,!0)} +function Ta(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Xa[a]})}function Ya(a,b){return(a+" ").slice(0,b)} +function Za(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Xa={"&":"&","<":"<",">":">",'"':""","'":"'"},$a={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function ab(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function fb(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function fb(a,b){var c,d={ca:null,ha:null,Ba:null,Aa:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Ba=g.load;d.Aa=g.exec;if(e=g.bytes)d.ca=e;else if(e=g.words)for(d.ca=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ca=Array(4*e.length),f=c=0;c>8&255,d.ca[f++]=e[c]>>16&255,d.ca[f++]=e[c]>>24&255;else d.ca=g;d.ha=g.symbols;d.ca.length?1==d.ca.length&&(v(d.ca[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.wa=g.load;d.va=g.exec;if(e=g.bytes)d.aa=e;else if(e=g.words)for(d.aa=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.aa=Array(4*e.length),f=c=0;c>8&255,d.aa[f++]=e[c]>>16&255,d.aa[f++]=e[c]>>24&255;else d.aa=g;d.ea=g.symbols;d.aa.length?1==d.aa.length&&(v(d.aa[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.b["S"+a]=[0,0,!1,!1,this.Te,a];this.G=this.f=this.D=this.J=null;A(this)}p(Wb,q);h=Wb.prototype; -h.reset=function(a){this.stop();a&&Yb(this,this.Sa=0)}; -h.sa=function(a,b,c,d){if(this.J&&this.J.sa(a,b,c,d)||this.f&&this.f.sa(a,b,c,d)||this.G&&this.G.sa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.C[b]=c,this.u++,!0;default:return"led"==a||"rled"==a?(this.C[b]=c,this.i[b]=d?1:0,this.u++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.C[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, -b){return function(){Zb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){$b(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Zb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){$b(a,b)}}(this,b),!0):q.prototype.sa.call(this,a,b,c,d)}};h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;ac(b,this,bc);cc(b,this.reset.bind(this));dc(this);ec(this)}; -h.ya=function(a,b){if(!b)if(this.M&&fc(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.save=function(){var a=new I(this);a.set(0,[this.ga,this.Sa,this.Ta]);return a.data()};h.restore=function(a){if(a=a[0])gc(this,this.ga=a[0]),Yb(this,this.Sa=a[1]),hc(this,a[2]);return!0};function ic(a,b,c){if(a=a.C[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function dc(a,b){for(var c in a.i)ic(a,c,null!=b?b:a.i[c])} -function jc(a,b,c){if(a=a.C[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function ec(a){for(var b in a.b)jc(a,b,a.b[b][1])}function kc(a,b,c,d){if(a.C[b]){var e=a.G&&a.G.Ca||8;c=c||0;c=8==e?F(c,d):H(c,d);a.C[b].textContent!=c&&(a.C[b].textContent=c)}}function Zb(a,b){var c=a.b[b];jc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=lc&&(a.H=b==mc,a.I=b==nc)} -function $b(a,b){var c=a.b[b];c[2]&&c[3]&&(jc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Re=function(a){a||this.f.A.T||(a=this.f,a.D.reset(),oc(a),this.b[pc]&&this.b[pc][1]&&qc(this.f))};h.Se=function(){};h.Ne=function(a){a||this.f.ba()}; -h.Le=function(a){if(!a&&!this.f.A.T)if(this.b[pc]&&this.b[pc][1])qc(this.f);else{if((a=this.G)&&!Ia(a,!0))Na(a,!0),rc(a,0,null),Na(a,!1);else try{var b=this.f.jc(1);0=a.f.ka?8:16,c=65472<=a.ga&&a.ga<65472+b,b=c?1:2,c=c?15:a.D.I;a.b[lc]&&a.b[lc][1]||(b=-b);gc(a,a.ga&~c|a.ga+b&c)} -function gc(a,b){a.ga=b&a.D.I;if(a.B!==a.ga){a.B=a.ga;b=a.B;for(var c=0;22>c;c++)Lc(a,"A"+c,b&1<c;c++)Lc(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.H=this.M/this.j|0;this.U=this.H-1;this.Ma=[];this.ma=0;this.F=!1;this.N=[];this.Be=[Rc,Sc,Tc,Uc];this.b=this.u=[];this.B=this.L=this.w=this.P=this.R=0;a=new K(this);Vc(a,this.G);this.b=Array(this.H);this.u=Array(this.H);for(b=0;b>>this.g;this.L=0;this.w=this.I;A(this)}p(Pc,q);function Yc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.u[a.R]=a.b[a.P])}}h=Pc.prototype;h.reset=function(){for(var a=0;a>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.K)return l.Kb+=l.K-f,l.K=f,!0;if(f>=l.K+l.Kb){n=l.size-(f-m);n>g&&(n=g);l.Kb=f-l.K+n;f=m+a.j;g-=n;k++;continue}}return $c(ad,f,g)}f=new K(a,f,n,a.j,d,e);Vc(f,a.G,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+bd[d]+" at "+F(b)),!0):$c(cd,b,c)}h.$c=function(a){return this.u[(a&this.w)>>>this.g].xb(a&this.i,a)}; -h.ic=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Lb||b!=this.i?this.u[c].na(b,a):this.u[c++].xb(b,a)|this.u[c&this.U].xb(0,a+1)<<8};h.ad=function(a,b){this.u[(a&this.w)>>>this.g].zb(a&this.i,b,a)};h.Ob=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Lb||c!=this.i?this.u[d].Ab(c,b,a):(this.u[d++].zb(c,b&255,a),this.u[d&this.U].zb(0,b>>8&255,a+1))};function dd(a,b){return a.b[(b&a.I)>>>a.g]} -function Jc(a,b){var c;a.F=!1;a.ma++;var d=b&a.i,e=dd(a,b);Lb||d!=a.i?c=e.B(d,b):c=e.j(d,b)|dd(a,b+1).j(0,b+1)<<8;a.ma--;return c}function ed(a,b,c){a.F=!1;a.ma++;dd(a,b).D(b&a.i,c&255,b);a.ma--}function wc(a,b,c){a.F=!1;a.ma++;var d=b&a.i,e=dd(a,b);Lb||d!=a.i?e.F(d,c&65535,b):(e.D(d,c&255,b),dd(a,b+1).D(0,c>>8&255,b+1));a.ma--} -function Zc(a){for(var b=0,c=[],d=0;da.f.ka)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Ma[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&B(this.f,16|e[5])&&C(this.f,e[4]+".readByte("+M(this.f,b)+"): "+M(this.f,c),!0,!d.ma),c;d.La(b,16,3);c=255;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to byte @"+M(this.f,b)+": "+M(this.f,c),!0,!d.ma);return c} -function Sc(a,b,c){var d=!1,e=this.controller,f=e.Ma[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ma[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&B(this.f,16|f[5])&&C(this.f,f[4]+".writeByte("+M(this.f,c)+","+M(this.f,b)+")",!0,!e.ma):(e.La(c,16,5),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to byte @"+M(this.f,c)+": "+M(this.f, -b),!0,!e.ma))}function Tc(a,b){var c=-1,d=this.controller;a=d.Ma[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".readWord("+M(this.f,b)+"): "+M(this.f,c),!0,!d.ma),c;d.La(b,16,2);c=65535;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to word @"+M(this.f,b)+": "+M(this.f,c),!0,!d.ma);return c} -function Uc(a,b,c){var d=!1,e=this.controller;a=e.Ma[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".writeWord("+M(this.f,c)+","+M(this.f,b)+")",!0,!e.ma):(e.La(c,16,4),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to word @"+M(this.f,c)+": "+M(this.f,b),!0,!e.ma))}function N(a){q.call(this,"Device",a,256);this.b={Za:128,Xc:-1}}p(N,q);h=N.prototype; -h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.G=d;var e=this;this.b.Xc=kd(c,function(){e.b.Za|=128;e.b.Za&64&&ld(e.f,e.b.ib);e.J&&J(e.J,1);md(e.f,e.b.Xc,1E3/60)});this.b.ib=nd(c,64,6,524288);ac(b,this,od);cc(b,this.reset.bind(this));d&&pd(d,64,function(a){var b=e.f;rd(e,"KIPDR",b.B[0],0,a[0]);rd(e,"KDPDR",b.B[0],8,a[0]);rd(e,"KIPAR",b.M[0],0,a[0]);rd(e,"KDPAR",b.M[0],8,a[0],!0);rd(e,"SIPDR",b.B[1],0,a[0]);rd(e,"SDPDR",b.B[1],8,a[0]);rd(e,"SIPAR",b.M[1],0,a[0]);rd(e,"SDPAR",b.M[1],8,a[0], -!0);rd(e,"UIPDR",b.B[3],0,a[0]);rd(e,"UDPDR",b.B[3],8,a[0]);rd(e,"UIPAR",b.M[3],0,a[0]);rd(e,"UDPAR",b.M[3],8,a[0],!0);b.V&32&&rd(e,"UNIMAP",b.Fa,-1,a[0])});A(this)};function rd(a,b,c,d,e,f){a=a.G;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Fa[a>>1];return a&1?b>>16:b&65535};h.bh=function(a,b){b=b>>1&63;var c=b>>1;this.f.Fa[c]=b&1?this.f.Fa[c]&65535|(a&63)<<16:this.f.Fa[c]&-65536|a&65534};h.Mf=function(a){return this.f.B[1][a>>1&7]};h.Vg=function(a,b){this.f.B[1][b>>1&7]=a&65295};h.Kf=function(a){return this.f.B[1][(a>>1&7)+8]};h.Tg=function(a,b){this.f.B[1][(b>>1&7)+8]=a&65295};h.Lf=function(a){return this.f.M[1][a>>1&7]}; -h.Ug=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.Jf=function(a){return this.f.M[1][(a>>1&7)+8]};h.Sg=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.df=function(a){return this.f.B[0][a>>1&7]};h.qg=function(a,b){this.f.B[0][b>>1&7]=a&65295};h.bf=function(a){return this.f.B[0][(a>>1&7)+8]};h.og=function(a,b){this.f.B[0][(b>>1&7)+8]=a&65295};h.cf=function(a){return this.f.M[0][a>>1&7]};h.pg=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.B[0][b]&=65295}; -h.af=function(a){return this.f.M[0][(a>>1&7)+8]};h.ng=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.B[0][b]&=65295};h.Sf=function(a){return this.f.B[3][a>>1&7]};h.ah=function(a,b){this.f.B[3][b>>1&7]=a&65295};h.Qf=function(a){return this.f.B[3][(a>>1&7)+8]};h.Zg=function(a,b){this.f.B[3][(b>>1&7)+8]=a&65295};h.Rf=function(a){return this.f.M[3][a>>1&7]};h.$g=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Pf=function(a){return this.f.M[3][(a>>1&7)+8]}; -h.Yg=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Ib=function(a){a&=7;return this.f.w&2048?this.f.pa[a]:this.f.g[a]};h.Mb=function(a,b){b&=7;this.f.w&2048?this.f.pa[b]=a:this.f.g[b]=a};h.qf=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.zg=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.tf=function(){return this.f.g[7]};h.Cg=function(a){this.f.g[7]=a};h.Jb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.pa[a]}; -h.Nb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.pa[b]=a};h.rf=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Ag=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.sf=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Bg=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.$e=function(a){return this.f.fc[a-65504>>1]};h.mg=function(a,b){this.f.fc[b-65504>>1]=a};h.Od=function(a){return 65520==a?(fd(this.D)>>6)-1:0}; -h.Td=function(){};h.Of=function(){return 1};h.Xg=function(){};h.Ze=function(){return this.f.R};h.lg=function(){this.f.R=0};h.ff=function(){return this.f.cc};h.sg=function(a,b){b&1||(a&=255);this.f.cc=a};h.lf=function(a,b){return b?0:this.f.Va};h.vg=function(a){yd(this.f,a)};h.Nf=function(a,b){return b?0:this.f.za&65280};h.Wg=function(a){this.f.za=a|255};h.pf=function(){return zd(this.f)};h.yg=function(a){Ad(this.f,a)};h.Sd=function(a,b){B(this)&&C(this,"writeIgnored("+F(b)+"): "+F(a),!0,!0)}; -var O={},od=(O[61568]=[null,null,N.prototype.Tf,N.prototype.bh,"UNIMAP",64,1170],O[62592]=[null,null,N.prototype.Mf,N.prototype.Vg,"SIPDR",8,1145,64],O[62608]=[null,null,N.prototype.Kf,N.prototype.Tg,"SDPDR",8,1145,64],O[62624]=[null,null,N.prototype.Lf,N.prototype.Ug,"SIPAR",8,1145,64],O[62640]=[null,null,N.prototype.Jf,N.prototype.Sg,"SDPAR",8,1145,64],O[62656]=[null,null,N.prototype.df,N.prototype.qg,"KIPDR",8,1140,64],O[62672]=[null,null,N.prototype.bf,N.prototype.og,"KDPDR",8,1145,64],O[62688]= -[null,null,N.prototype.cf,N.prototype.pg,"KIPAR",8,1140,64],O[62704]=[null,null,N.prototype.af,N.prototype.ng,"KDPAR",8,1145,64],O[62798]=[null,null,N.prototype.kf,N.prototype.ug,"MMR3",1,1145,64],O[65382]=[null,null,N.prototype.ef,N.prototype.rg,"LKS"],O[65402]=[null,null,N.prototype.gf,N.prototype.tg,"MMR0",1,1140,64],O[65404]=[null,null,N.prototype.hf,N.prototype.Sd,"MMR1",1,1145,64],O[65406]=[null,null,N.prototype.jf,N.prototype.Sd,"MMR2",1,1140,64],O[65408]=[null,null,N.prototype.Sf,N.prototype.ah, -"UIPDR",8,1140,64],O[65424]=[null,null,N.prototype.Qf,N.prototype.Zg,"UDPDR",8,1145,64],O[65440]=[null,null,N.prototype.Rf,N.prototype.$g,"UIPAR",8,1140,64],O[65456]=[null,null,N.prototype.Pf,N.prototype.Yg,"UDPAR",8,1145,64],O[65472]=[null,null,N.prototype.Ib,N.prototype.Mb,"R0SET0"],O[65473]=[null,null,N.prototype.Ib,N.prototype.Mb,"R1SET0"],O[65474]=[null,null,N.prototype.Ib,N.prototype.Mb,"R2SET0"],O[65475]=[null,null,N.prototype.Ib,N.prototype.Mb,"R3SET0"],O[65476]=[null,null,N.prototype.Ib, -N.prototype.Mb,"R4SET0"],O[65477]=[null,null,N.prototype.Ib,N.prototype.Mb,"R5SET0"],O[65478]=[null,null,N.prototype.qf,N.prototype.zg,"R6KERNEL"],O[65479]=[null,null,N.prototype.tf,N.prototype.Cg,"R7KERNEL"],O[65480]=[null,null,N.prototype.Jb,N.prototype.Nb,"R0SET1",1,1145],O[65481]=[null,null,N.prototype.Jb,N.prototype.Nb,"R1SET1",1,1145],O[65482]=[null,null,N.prototype.Jb,N.prototype.Nb,"R2SET1",1,1145],O[65483]=[null,null,N.prototype.Jb,N.prototype.Nb,"R3SET1",1,1145],O[65484]=[null,null,N.prototype.Jb, -N.prototype.Nb,"R4SET1",1,1145],O[65485]=[null,null,N.prototype.Jb,N.prototype.Nb,"R5SET1",1,1145],O[65486]=[null,null,N.prototype.rf,N.prototype.Ag,"R6SUPER",1,1145],O[65487]=[null,null,N.prototype.sf,N.prototype.Bg,"R6USER",1,1145],O[65504]=[null,null,N.prototype.$e,N.prototype.mg,"CTRL",8,1170],O[65520]=[null,null,N.prototype.Od,N.prototype.Td,"LSIZE",1,1170],O[65522]=[null,null,N.prototype.Od,N.prototype.Td,"HSIZE",1,1170],O[65524]=[null,null,N.prototype.Of,N.prototype.Xg,"SYSID",1,1170],O[65526]= -[null,null,N.prototype.Ze,N.prototype.lg,"ERR",1,1170],O[65528]=[null,null,N.prototype.ff,N.prototype.sg,"MBR",1,1170],O[65530]=[null,null,N.prototype.lf,N.prototype.vg,"PIR"],O[65532]=[null,null,N.prototype.Nf,N.prototype.Wg,"SLR"],O[65534]=[null,null,N.prototype.pf,N.prototype.yg,"PSW"],O); -yb(function(){for(var a=y(document,x,"device"),b=0;b>1),this.b=new Int32Array(this.u,0,this.size>>2),Gd(this,Hd?Id:Rd);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.Xe=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.Zf=function(a,b){Kb&&a&1&&this.C.La(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8}; -h.jg=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Xa=!0};h.Ve=function(a,b){this.f&&null!=this.K&&Yd(this.f,this.K+a);return this.j(a,b)};h.Vf=function(a,b){this.f&&null!=this.K&&Yd(this.f,this.K+a,2);return this.B(a,b)}; -h.hg=function(a,b,c){this.f&&null!=this.K&&Zd(this.f,this.K+a);this.J?this.Lb(0,b,c):this.D(a,b,c)};h.eh=function(a,b,c){this.f&&null!=this.K&&Zd(this.f,this.K+a,2);this.J?this.Lb(0,b,c):this.F(a,b,c)};h.Ue=function(a){return this.g[a]};h.We=function(a,b){a=this.g[a];this.f&&B(this.f,32)&&C(this.f,"Memory.readByte("+M(this.f,b)+"): "+M(this.f,a),!0);return a};h.Uf=function(a,b){Kb&&a&1&&this.C.La(b,64,2);return this.w.getUint16(a,!0)}; -h.Yf=function(a,b){Kb&&a&1&&this.C.La(b,64,2);a=!Lb&&a&1?this.g[a]|this.g[a+1]<<8:this.H[a>>1];this.f&&B(this.f,32)&&C(this.f,"Memory.readWord("+M(this.f,b)+"): "+M(this.f,a),!0);return a};h.gg=function(a,b){this.g[a]=b;this.Xa=!0};h.ig=function(a,b,c){this.g[a]=b;this.Xa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeByte("+M(this.f,c)+","+M(this.f,b)+")",!0)};h.dh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);this.w.setUint16(a,b,!0);this.Xa=!0}; -h.fh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);!Lb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.H[a>>1]=b;this.Xa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeWord("+M(this.f,c)+","+M(this.f,b)+")",!0)};var Ed=0,gd=1,Fd=2,Xc=4,bd=["NONE","RAM","ROM","VID","H/W"],Dd=0,Td=[],Sd=[K.prototype.Xe,K.prototype.jg,K.prototype.Zf,K.prototype.gh],Wd=[K.prototype.Ve,K.prototype.hg,K.prototype.Vf,K.prototype.eh]; -if(Gb)var Rd=[K.prototype.Ue,K.prototype.gg,K.prototype.Uf,K.prototype.dh],Id=[K.prototype.We,K.prototype.ig,K.prototype.Yf,K.prototype.fh];var $d;if(Gb){var ae=new ArrayBuffer(2);(new DataView(ae)).setUint16(0,256,!0);$d=256===(new Uint16Array(ae))[0]}else $d=!1;var Hd=$d; -function be(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Cc=0;this.zc=b;this.eb=c;this.Kc=Math.round(this.zc/1E4)/100;this.qb=this.Kc*this.eb;this.Lc=this.Zb=this.ub=this.Ac=0;this.A.T=this.A.vc=!1;this.A.va=a.autoStart;"string"==typeof this.A.va&&(this.A.va="true"==this.A.va);this.A.Db=!1;this.Xb=this.Fb=0;this.Yb=+a.csStart;this.Eb=+a.csInterval;this.Gb=+a.csStop;this.ja=[];this.ud=this.cg.bind(this);this.fb=this.Ia=this.cb=this.b=this.la=this.Ha=this.Wb=this.bb=this.Hb= -this.Mc=this.pb=0;this.ua=null;A(this)}p(be,q);h=be.prototype;h.wa=function(a,b,c,d){this.J=a;this.D=b;this.G=d;this.ua=a.i;for(a=0;a=a.Fb&&(a.Fb+=a.Eb,c=!0);0<=a.Gb&&a.Gb<=je(a)&&(a.Eb=a.Gb=-1,fe(a),a.ba(),c=!0);c&&a.v(je(a)+" cycles: checksum="+H(a.Xb))}} -h.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.C[b]=c,!0;case "run":return this.C[b]=c,c.onclick=function(){var a;if(a=d.J)if(a=d.J,a.A.fa)a=!0;else{var b=null,c,k=Ba(a.id);for(c=0;ca.pb/a.qb?b=1:d=!0;a.eb=b;b=a.Kc*a.eb;if(a.qb!=b){a.qb=b;b=a.qb.toFixed(2)+"Mhz";var e=a.C.setSpeed;e&&(e.textContent=b);a.v("target speed: "+b)}c&&a.J&&ne(a.J)}tc(a,a.Ia);a.Ia=0;a.Ha=ya();a.bb=0;le(a);return d}function kd(a,b){var c=a.ja.length;a.ja.push([-1,b]);return c}function md(a,b,c,d){0<=b&&ba.ja[b][0])&&(c=a.zc*a.eb/1E3*c|0,a.A.T&&(c+=oe(a)),a.ja[b][0]=c)} -function pe(a,b){for(var c=a.ja.length-1;0<=c;c--){var d=a.ja[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function qe(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function oe(a,b){var c=a.cb-=a.b;a.b=a.la=0;b&&(a.cb=0);return c} -h.cg=function(){if(this.A.T){this.Ac>=this.zc&&le(this,!0);this.Hb=0;this.Wb=ya();if(this.bb){var a=this.Wb-this.bb;a>this.Lc&&(this.Ha+=a,this.Ha>this.Wb&&(this.Ha=this.Wb))}try{do{var b=pe(this,this.A.Db?1:this.Zb);try{this.jc(b)}catch(e){if("number"!=typeof e)throw e;}b=oe(this,!0);this.Hb+=b;this.Ia+=b;uc(this,b);sc(this,b);this.ub-=b;if(0>=this.ub){this.ub+=this.Zb;++this.Mc>=re&&(this.J&&J(this.J,void 0),this.Mc=0);break}}while(this.A.T)}catch(e){this.ba();this.J&&this.J.stop(ya(),je(this)); -Fa(this,e.stack||e.message);return}if(this.A.T){a=setTimeout;b=this.ud;this.bb=ya();var c=this.Lc;this.Hb&&(c=Math.round(c*this.Hb/this.Zb));var c=c-(this.bb-this.Wb),d=this.bb-this.Ha;d&&(this.pb=Math.round(this.Ia/(10*d))/100,864E5<=d&&(this.fb=0,ke(this)));if(0>c||this.pbc&&(this.Ha-=c),c=0;this.Ac+=this.Hb;this.bb+=c;a(b,c)}}}; -function qc(a,b){if(!Ga(a))if(a.A.T)a.v(a.toString()+" busy");else{ke(a);a.A.T=!0;a.A.vc=!0;var c=a.C.run;c&&(c.textContent="Halt");a.J&&(b&&ne(a.J,!0),a.J.start(a.Ha,je(a)));a.G||a.status("Started");setTimeout(a.ud,0)}}h.jc=function(){return 0};h.ba=function(a){var b=!1;if(this.A.T){oe(this);tc(this,this.Ia);this.Ia=0;this.A.T=!1;if(b=this.C.run)b.textContent="Run";this.J&&this.J.stop(ya(),je(this));b=!0;this.G||this.status("Stopped")}this.A.complete=a;return b};var me=30,re=15,ce=["power","reset"]; -function se(a){var b=+a.model||1170;be.call(this,a,6666667);this.ka=b;this.od=+a.addrReset||0;this.Ua=this.w=this.N=this.F=this.H=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Fa=this.fc=[];this.$a=this.P=this.ld=this.rb=this.lb=this.sb=this.ab=this.R=this.cc=this.Va=this.za=this.U=this.dc=this.ec=this.V=this.i=0;this.qd=[4,2,0,1];this.gc=0;this.rd=255;1120>=this.ka?(this.kd=te.bind(this),this.Cb=this.Fe,this.gc=8,this.rd=-1,this.yd=255,this.xd=0):(this.kd=ue.bind(this),this.Cb=this.Ge, -this.yd=~(1792|(1140>=this.ka?2048:0))&65535,this.xd=1140e.yb&&(e.yb=c,c+=4)}return be.prototype.ya.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.ka);this.A.T&&this.ba();this.F=65536;this.H=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.od,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535, -65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.fc=[0,0,0,0,0,0,0,0];this.N=0;this.Ua=-1;this.u=this.j=this.yc=this.X=this.Z=this.i=this.cc=0;oc(this);ee(this);this.A.error=!1;be.prototype.reset.call(this)};function oc(a){a.U=0;a.dc=0;a.ec=0;a.V=0;a.R=0;a.Va=0;a.za=255;a.rb=0;a.lb=0;a.sb=0;a.ab=262143;a.$a=a.g[7];a.P=0;a.S=null;a.D&&(ve(a),a.ld=fd(a.D))} -function ve(a){a.Sb=a.Ec;a.Tb=a.Fc;a.wc=a.Gc;a.Ub=a.Jc;a.ac&&(a.Sb=a.Hd,a.Tb=a.Md);a.bc&&(a.wc=a.Qd,a.Ub=a.Rd);a.rb?(a.Ga=65536,a.mb=a.V&16?4186112:253952,a.Ea=a.Ld,a.na=a.ac?a.Xf:a.Vc,a.Ab=a.bc?a.ih:a.Yc,Yc(a.D,a.V&16?22:18)):(a.Ga=0,a.mb=57344,a.Ea=a.Ie,a.na=a.ac?a.Wf:a.Pd,a.Ab=a.bc?a.hh:a.Ud,Yc(a.D,16))}function td(a){var b=a.U;b&57344||(b=b&-3199|a.lb<<5|a.sb<<1);return b} -function ud(a,b){b&=-3073;if(a.U!=b){b&57344&&!(a.U&57344)&&(a.dc=a.P>>16&65535,a.ec=a.P&65535);a.U=b;a.lb=(b&96)>>5;a.sb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.rb!=c&&(a.rb=c,ve(a))}}function vd(a){a.U&57344||(a.dc=a.P>>16&65535);a=a.dc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function wd(a){a.U&57344||(a.ec=a.P&65535);return a.ec}function xd(a,b){1170>a.ka&&(b&=-49);a.V!=b&&(a.V=b,a.ab=b&16?4194303:262143,ve(a))} -function we(a,b,c){a.od=b;xe(a,b);Ad(a,0);a.D.reset();oc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.T||qc(a)}else a.G&&a.A.fa?a.ba()||(ge(a.G),J(a.J,-1)):!1===c&&a.ba();!a.A.T&&a.ua&&a.ua.stop()}h.Id=function(){return 0}; -h.save=function(){var a=new I(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Fa,this.fc,this.R,this.cc,this.Va,this.za,this.lb,this.sb,this.$a,this.i,this.P,this.Ua,this.hc,this.kc]);a.set(1,[zd(this),td(this),vd(this),wd(this),this.V]);a.set(2,[this.fb,this.eb,this.A.va]);a.set(3,ye(this));a.set(4,qe(this));return a.data()}; -h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Fa=b.next().value;this.fc=b.next().value;this.R=b.next().value;this.cc=b.next().value;this.Va=b.next().value;this.za=b.next().value;this.lb=b.next().value;this.sb=b.next().value;this.$a=b.next().value;this.i=b.next().value;this.P=b.next().value;this.Ua=b.next().value;this.hc=b.next().value;this.kc=b.next().value;b=a[1];Ad(this,b[0]);ud(this,b[1]); -this.dc=b[2];this.ec=b[3];xd(this,b[4]);b=a[2];this.fb=b[0];ke(this,b[1]);this.A.va=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function xe(a,b){a.g[7]=b&65535}function nd(a,b,c,d){b={yb:b,jb:c,message:d||0,name:Ob[b],next:null};a.Vb.push(b);return b}function Ee(a,b){var c=a.S;if(c==b)a.S=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.S&&(a.i|=1)} -function ld(a,b){if(b){if(b!=a.S){var c=a.S;if(!c||c.jb<=b.jb)b.next=c,a.S=b;else{do{var d=c.next;if(!d||d.jb<=b.jb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&B(a,b.message|8)&&C(a,"setIRQ(vector="+F(b.yb)+",priority="+b.jb+")",!0,!0)}}function sd(a,b){b&&(Ee(a,b),b.message&&B(a,b.message|8)&&C(a,"clearIRQ(vector="+F(b.yb)+",priority="+b.jb+")",!0,!0))}function ye(a){var b=[];for(a=a.S;a;)b.push(a.yb),a=a.next;return b} -function Fe(a){return a.i&64?(a.ta(168,64,-6),!0):a.i&32?(a.ta(4,32,-5),!0):a.i&16?(a.ta(12,16,-7),!0):!1}function zd(a){return a.w=a.w&63728|Ce(a)|Be(a)|Ae(a)|ze(a)}function Ad(a,b){b&=a.yd;a.I=b<<12;a.L=~b&4;a.H=b<<14;a.F=b<<16;if((b^a.w)&a.xd)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.N=b>>14&3;c=a.w>>14&3;a.N!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.N]);a.w=b;a.i&=-3;a.i|=a.S?2:1}function yd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.Va=b} -h.Da=function(a){this.I=this.L=a;this.H=0};h.kb=function(a,b){this.I=this.L=this.F=a;this.H=b||0};function Ge(a,b){a.I=a.L=a.F=b;a.H=a.I^a.F>>1}function He(a,b,c,d){a.I=a.L=a.F=b;a.H=(c^d)&(d^b)} -h.ta=function(a,b,c){if(!this.oa){0>this.Ua?this.Ua=zd(this):this.N||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.R|=4,this.g[6]=a=4);if(-1!=c){this.P=a|4143316992;this.N=0;var d=this.na(a|this.Ga),e=this.na(a+2&65535|this.Ga);Ad(this,e&-12289|this.Ua>>2&12288);Ie(this,this.Ua);Ie(this,this.g[7]);xe(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Ua=-1;this.hc=c;this.kc=a;-1==c&&this.ba();if(-4<=c)throw a;}}; -function Je(a){var b=Ke(a),c=Ke(a);a.w&49152&&(c=c&-225|a.w&63712);xe(a,b);Ad(a,c);a.i&=-17}function Le(a,b){var c=b>>13&31;31>c&&(b=a.V&32?a.Fa[c]+(b&8191)&4194303:b&-3932161);return b} -function Me(a,b,c){var d=[];if(c){c=Le(a,b);var e=b>>13&31;d.push(c);d.push(e);a.V&32&&(d.push(a.Fa[e]),d.push(b&8191))}else if(a.rb){var e=a.N<<1,f=b>>13;7>13;a.V&a.qd[a.N]||(d&=7);e=a.B[a.N][d];f=(a.M[a.N][d]<<6)+(b&8191)&a.ab;3932160<=f&&(f=Le(a,f));if(a.oa)return f;f>=a.ld&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.B[a.N][d]=e;if(f!=(4194170&a.ab)||a.N)a.lb=a.N,a.sb=d;g&&(g&57344&&(0<=a.Ua&&(g|=128),a.U&57344||(g|=a.U&4096|a.lb<<5|a.sb<<1,ud(a,a.U&-61695|g&61694)),a.ta(168,64,-2)),a.U&61440||!(f<(4191360&a.ab)||f>(4194239&a.ab))||(a.U|=4096,a.U&512&&(a.i|=64)));return f}function Ke(a){var b=a.na(a.g[6]|a.Ga);a.g[6]=a.g[6]+2&65535;return b}function Ie(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.P=a.P&65535|(a.P&-65536)<<8|16121856;a.i&256||a.Cb(4,-2,c);a.Ab(c,b)} -function Ne(a,b,c,d){var e,f,g=d&8?0:a.Ga;switch(b){case 0:return a.ta(4,0,-3),0;case 1:return 6==c&&a.Cb(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Cb(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Cb(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(De(a,2)),e=e+a.g[c]&65535,6==c&&a.Cb(d, -0,e),a.b-=6,e|g;case 7:return e=a.na(De(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ga),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.P=a.P&65535|(a.P&-65536)<<8|(f<<3&248|c)<<16;return e}h.Fe=function(a,b,c){!this.N&&0>=b&&c<=this.za&&(this.i|=32)};h.Ge=function(a,b,c){this.N||(65534<=c&&(c|=-65536),a&4&&c<=this.za&&(c<=this.za-32?this.ta(4,0,-4):(this.R|=8,this.i|=32)))};h.Hd=function(a){this.G&&Yd(this.G,a,1);return this.Ec(a)};h.Md=function(a){this.G&&Yd(this.G,a,2);return this.Fc(a)}; -h.Qd=function(a,b){this.G&&Zd(this.G,a,1);this.Gc(a,b)};h.Rd=function(a,b){this.G&&Zd(this.G,a,2);this.Jc(a,b)};function Kc(a,b){a.oa++;b=a.D.ic(xc(a,b,2));a.oa--;return b}function Oe(a,b){(b?--a.bc:--a.ac)||ve(a)}h.Ie=function(a,b,c){return Ne(this,a,b,c)};h.Ld=function(a,b,c){return xc(this,Ne(this,a,b,c),c)};h.Pd=function(a){return this.D.ic(this.$a=a)};h.Wf=function(a){this.G&&Yd(this.G,a,2);return this.Pd(a)};h.Vc=function(a){return this.D.ic(this.$a=xc(this,a,2))}; -h.Xf=function(a){this.G&&Yd(this.G,a,2);return this.Vc(a)};h.Ud=function(a,b){this.D.Ob(this.$a=a,b)};h.hh=function(a,b){this.G&&Zd(this.G,a,2);this.Ud(a,b)};h.Yc=function(a,b){this.D.Ob(this.$a=xc(this,a,4),b)};h.ih=function(a,b){this.G&&Zd(this.G,a,2);this.Yc(a,b)};function Pe(a,b,c){var d=a.j=b&7;(b=a.u=(b&56)>>3)?(d=Ne(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.N=a.w>>12&3,c=a.na(d|c&a.Ga),a.N=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} -function Qe(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=Ne(a,b,e,4),c&65536||(e&=65535),a.N=a.w>>12&3,e=xc(a,e|c&65536,4),a.N=a.w>>14&3,a.Ub(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Re(a,b){b>>=6;var c=a.Z=b&7;return(b=a.X=(b&56)>>3)?a.Sb(a.Ea(b,c,3)):a.g[c+a.gc]&a.rd}function Se(a,b){var c;b>>=6;var d=a.Z=b&7;(b=a.X=(b&56)>>3)?c=a.Tb(a.Ea(b,d,2)):c=a.g[d+a.gc];return c}function Te(a,b){var c=a.j=b&7;b=a.u=(b&56)>>3;return Ne(a,b,c,8)} -function Ue(a,b){var c=a.j=b&7;return(b=a.u=(b&56)>>3)?a.Sb(a.Ea(b,c,3)):a.g[c]&255}function Ve(a,b){var c,d=a.j=b&7;(b=a.u=(b&56)>>3)?c=a.Tb(a.Ea(b,d,2)):c=a.g[d];return c}function We(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.yc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.wc(e,d.call(a,c,a.Sb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} -function S(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,6),a.Ub(e,d.call(a,0>c?a.g[-c-1]:c,a.Tb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function sf(a,b,c,d,e){var f=a.j=b&7;(b=a.u=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.wc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} -function tf(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Ub(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} -h.jc=function(a){this.A.complete=!0;var b=this.G?uf(this.G)?1:this.A.vc?-1:0:0,c=a?this.A.vc?0:1:-1;this.A.vc=!1;this.cb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(vf(this.G,this.g[7],c)){this.ba();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.Va&224)>>5,f=this.S&&this.S.jb>e?this.S:null;f&&(d=f.yb,e=f.jb);e>(this.w&224)>>5?(this.i&8&&(De(this,2),this.i&=-9),this.ta(d,0,-10),e=!0):e=!1;e&&(f&&Ee(this,f),a=!0);this.S||this.Va||(this.i&=-3)}else this.i& -1&&this.i++;if(a){if(this.i&4&&vf(this.G,this.g[7],c)){this.ba();break}if(0>c)break}if(this.i&112&&Fe(this)){if(this.i&4&&vf(this.G,this.g[7],c)){this.ba();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.kd(f)}while(0>1|b<<16;Ge(this,a);return a&65535}function Bf(a,b){a=b&128|b>>1|b<<8;Ge(this,a<<8);return a&255}function Cf(a,b){a=b&~a;this.Da(a);return a}function Df(a,b){a=b&~a;this.Da(a<<8);return a} -function Ef(a,b){a|=b;this.Da(a);return a}function Ff(a,b){a|=b;this.Da(a<<8);return a}function Gf(a,b){a=~b|65536;this.kb(a);return a&65535}function Hf(a,b){a=~b|256;this.kb(a<<8);return a&255}function If(a,b){this.I=this.L=a=b-a;this.H=b&(b^a);return a&65535}function Jf(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.H=b&(b^c);return a&255}function Kf(a,b){this.I=this.L=a=b+a;this.H=a&(b^a);return a&65535}function Lf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.H=c&(b<<8^c);return a&255} -function Mf(a,b){a=-b;this.kb(a,a&b&32768);return a&65535}function Nf(a,b){a=-b;this.kb(a<<8,(a&b&128)<<8);return a&255}function Of(a,b){a=b<<1|this.F>>16&1;Ge(this,a);return a&65535}function Pf(a,b){a=b<<1|this.F>>16&1;Ge(this,a<<8);return a&255}function Qf(a,b){a=(this.F&65536|b)>>1|b<<16;Ge(this,a);return a&65535}function Rf(a,b){a=((this.F&65536)>>8|b)>>1|b<<8;Ge(this,a<<8);return a&255}function Sf(a,b){var c=b-a;He(this,c,a,b);return c&65535} -function Tf(a,b){var c=b-a;He(this,c<<8,a<<8,b<<8);return c&255}function Uf(a,b){this.I=this.L=b&65280;this.H=this.F=0;return(b<<8|b>>8)&65535}function Vf(a,b){a^=b;this.Da(a);return a&65535}function Wf(a){S(this,a,Se(this,a),wf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} -function Xf(a){var b=Ve(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.F=this.H=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.H=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.u?6:7)+b} -function Yf(a){var b=Ve(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&=63;if(b&32){b=64-b;32>b-1;this.F=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.u?6:7)+b}function Zf(a){R(this,a,!ze(this))}function $f(a){R(this,a,ze(this))} -function ag(a){S(this,a,Se(this,a),Cf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function bg(a){We(this,a,Re(this,a),Df);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function cg(a){S(this,a,Se(this,a),Ef);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function dg(a){We(this,a,Re(this,a),Ff);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} -function eg(a){var b=Se(this,a);a=Ve(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function fg(a){var b=Re(this,a);a=Ue(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function gg(a){R(this,a,Be(this))}function hg(a){R(this,a,!Ce(this)==!Ae(this))}function ig(a){R(this,a,!Be(this)&&!Ce(this)==!Ae(this))}function jg(a){R(this,a,!ze(this)&&!Be(this))} -function kg(a){R(this,a,Be(this)||!Ce(this)!=!Ae(this))}function lg(a){R(this,a,ze(this)||Be(this))}function mg(a){R(this,a,!Ce(this)!=!Ae(this))}function ng(a){R(this,a,Ce(this))}function og(a){R(this,a,!Be(this))}function pg(a){R(this,a,!Ce(this))}function qg(){this.ta(12,0,-9)}function rg(a){R(this,a,!0)}function sg(a){R(this,a,!Ae(this))}function tg(a){R(this,a,Ae(this))}function ug(a){a&1&&(this.F=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} -function vg(a){var b=Se(this,a);a=Ve(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;He(this,c,a,b);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function wg(a){var b=Re(this,a);a=Ue(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);He(this,c,a,b);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} -function xg(a){var b=Ve(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.H=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.H=32768,this.F=65536,this.b-=7}function yg(){this.ta(24,0,-9);this.b-=20} -function zg(){this.w&49152?(this.R|=128,this.ta(4,0,-8)):(this.ua&&1120==this.ka&&this.ua.setData(this.g[0],!0),this.G?Ag(this.G):this.ba());this.b-=7}function Bg(){this.ta(16,0,-9);this.b-=20}var Cg=[0,7,7,10,7,11,9,13];function Dg(a){this.la=this.b;xe(this,Te(this,a));this.b=this.la-Cg[this.u]}var Eg=[0,14,14,17,14,18,16,20];function Fg(a){this.la=this.b;var b=Te(this,a);a=a>>6&7;Ie(this,this.g[a]);this.g[a]=this.g[7];xe(this,b);this.b=this.la-Eg[this.u]} -var Gg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Hg(a){var b=Se(this,a);this.la=this.b;tf(this,a,b,this.Da);this.b=this.la-Gg[(this.X?8:0)+this.u]+(7!=this.j||this.u?0:2)}function Ig(a){var b=Re(this,a);sf(this,a,b,65535,this.Da);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Jg=[7,13,13,17,14,18,17,21]; -function Kg(a){var b=Ve(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.H=0;this.F=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)xe(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Rg(a){S(this,a,Se(this,a),Sf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Sg(a){S(this,a,0,Uf);this.b-=this.u?9:3+(7==this.j?2:0)}function Tg(){this.ta(28,0,-9)} -function Ug(){this.ua&&(this.ua.Wc(this.g[7],!0),this.ua.setData(this.g[0],!0));this.i|=8;De(this,-2);this.b-=3}function Vg(a){S(this,a,this.g[(a>>6&7)+this.gc],Vf);this.b-=this.u?9:3+(7==this.j?2:0)}function T(a){var b;if(b=this.G)b=this.G,B(b,1)?(C(b,"undefined opcode "+M(b,a),!0,!0),b=Ag(b)):b=!1;b||this.ta(8,0,-9)}function te(a){Wg[a>>12].call(this,a)}function Xg(a){Yg[a>>6&3].call(this,a)}function Zg(a){$g[a>>6&3].call(this,a)}function ah(a){bh[a>>6&3].call(this,a)} -function ch(a){dh[a&15].call(this,a)}function eh(a){fh[a&15].call(this,a)}function gh(a){hh[a>>6&3].call(this,a)}function ih(a){jh[a>>6&3].call(this,a)}function kh(a){lh[a>>6&3].call(this,a)} -var Wg=[function(a){mh[a>>8&15].call(this,a)},Hg,vg,eg,ag,cg,Wf,T,function(a){nh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Rg,T],mh=[function(a){oh[a>>4&15].call(this,a)},rg,og,gg,hg,mg,ig,kg,Fg,Fg,Xg,Zg,ah,T,T,T],Yg=[function(a){tf(this,a,0,this.kb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,0,Gf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,1,Kf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,1,If);this.b-=this.u?9:3+(7==this.j?2:0)}],$g=[function(a){S(this,a,0,Mf); -this.b-=this.u?11:6},function(a){S(this,a,ze(this)?1:0,wf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,ze(this)?1:0,Sf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=Ve(this,a);this.kb(a);this.b-=this.u?4:3+(7==this.j?2:0)}],bh=[function(a){S(this,a,0,Qf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,0,Of);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,0,Af);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,0,yf);this.b-=this.u?9:3+(7==this.j?2:0)}],oh= -[function(a){ph[a&15].call(this,a)},T,T,T,Dg,Dg,Dg,Dg,Ng,T,ch,eh,Sg,Sg,Sg,Sg],ph=[zg,Ug,Og,qg,Bg,Mg,T,T,T,T,T,T,T,T,T,T],dh=[Lg,function(){this.F=0;this.b-=5},function(){this.H=0;this.b-=5},ug,function(){this.L=1;this.b-=5},ug,ug,ug,function(){this.I=0;this.b-=5},ug,ug,ug,ug,ug,ug,ug],fh=[Lg,function(){this.F=65536;this.b-=5},function(){this.H=32768;this.b-=5},Pg,function(){this.L=0;this.b-=5},Pg,Pg,Pg,function(){this.I=32768;this.b-=5},Pg,Pg,Pg,Pg,Pg,Pg,Pg],nh=[pg,ng,jg,lg,sg,tg,Zf,$f,yg,Tg,gh,ih, -kh,T,T,T],hh=[function(a){sf(this,a,0,255,this.kb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,0,Hf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,1,Lf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,1,Jf);this.b-=this.u?9:3+(7==this.j?2:0)}],jh=[function(a){We(this,a,0,Nf);this.b-=this.u?11:6},function(a){We(this,a,ze(this)?1:0,xf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,ze(this)?1:0,Tf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=Ue(this, -a);this.kb(a<<8);this.b-=this.u?4:3+(7==this.j?2:0)}],lh=[function(a){We(this,a,0,Rf);this.b-=this.u?9+(this.yc&1):3+(7==this.j?2:0)},function(a){We(this,a,0,Pf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,0,Bf);this.b-=this.u?9+(this.yc&1):3+(7==this.j?2:0)},function(a){We(this,a,0,zf);this.b-=this.u?9:3+(7==this.j?2:0)}];function ue(a){qh[a>>12].call(this,a)} -var qh=[function(a){rh[a>>8&15].call(this,a)},Hg,vg,eg,ag,cg,Wf,function(a){sh[a>>8&15].call(this,a)},function(a){th[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Rg,T],rh=[function(a){uh[a>>4&15].call(this,a)},rg,og,gg,hg,mg,ig,kg,Fg,Fg,Xg,Zg,ah,function(a){vh[a>>6&3].call(this,a)},T,T],vh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.na(a|this.Ga);xe(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Pe(this,a,0);this.Da(a);Ie(this,a);this.b-=11},function(a){var b=Ke(this); -this.la=this.b;this.Da(b);Qe(this,a,0,b);this.b=this.la-Jg[this.u]},function(a){tf(this,a,Ce(this)?65535:0,this.Da);this.b-=this.u?9:3+(7==this.j?2:0)}],uh=[function(a){wh[a&15].call(this,a)},T,T,T,Dg,Dg,Dg,Dg,Ng,function(a){!(a&8)||1145>this.ka?T.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},ch,eh,Sg,Sg,Sg,Sg],wh=[zg,Ug,function(){Je(this);this.i|=this.w&16;this.b-=13},qg,Bg,Mg,Og,function(a){T.call(this,a)},T,T,T,T,T,T,T,T],sh=[Kg,Kg,xg,xg,Xf,Xf,Yf,Yf, -Vg,Vg,T,T,T,T,Qg,Qg],th=[pg,ng,jg,lg,sg,tg,Zf,$f,yg,Tg,gh,ih,kh,function(a){1145>this.ka?T.call(this,a):xh[a>>6&3].call(this,a)},T,T],xh=[function(a){T.call(this,a)},function(a){a=Pe(this,a,65536);this.Da(a);Ie(this,a);this.b-=11},function(a){var b=Ke(this);this.la=this.b;this.Da(b);Qe(this,a,65536,b);this.b=this.la-Jg[this.u]},function(a){T.call(this,a)}]; -function yh(a){q.call(this,"ROM",a,128);this.ha=this.g=null;this.u=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Sa(this.j);if(this.j){a=this.j;var b=Ta(this.B);"json"!=b&&"hex"!=b&&(a=gb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;eb(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(wa(c.ob,a,b),(a=fb(a,b))?(c.g=a.ca,c.ha=a.ha):c.j=null);zh(c)})}}p(yh,q); -h=yh.prototype;h.wa=function(a,b,c,d){this.D=b;this.f=c;this.G=d;zh(this)};h.ya=function(){this.ha&&(this.G&&Ah(this.G,this.id,this.u,this.b,this.ha),delete this.ha);return!0};h.xa=function(){return!0}; -function zh(a){if(!Ha(a)){if(a.j){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Fa(a,"ROM size ("+H(a.g.length,8,!0)+") does not match specified size ("+H(a.b,8,!0)+")");else{var b;a:{b=a.u;if(57344<=b&&b<57344+Qc){var c={},c=(c[b]=[yh.prototype.If,yh.prototype.Rg,null,null,null,a.b>>1],c);if(ac(a.D,a,c)){a.status("Added "+a.b+"-byte ROM at "+F(b));b=a.w=!0;break a}}else if(Wc(a.D,b,a.b,Fd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){C(a,"invalid block at offset "+Ra(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,E=r-=6;0=b.length){C(a,"insufficient data for block at offset "+Ra(n),4096); -break}m+=b[l++]&255;if(m&255){C(a,"invalid checksum ("+H(m,2,!0)+") for block at offset "+Ra(n),4096);break}if(E)for(C(a,"loading "+Ra(E)+" bytes at "+Ra(u)+"-"+Ra(u+E),4096);E--;)ed(a.D,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&C(a,"starting address: "+Ra(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=ta.Zc&&c<=ta.Ae&&(b=c-(ta.Zc-ta.Wd));b&&(a.preventDefault&&a.preventDefault(),d.sc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ta.Yd&&(b=ta.Xd);d.sc(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); -a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.sc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;var e=this;this.R=nd(this.f,this.M?-1:48,4,262144);this.S=kd(this.f,function(){var a;a=-1;e.i.length&&(a=e.i.shift()&255,C(e,"receiveByte("+H(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),md(e.f,e.S,1E3/Math.round(e.U/10)));0<=a&&(e.F=a,e.b&128?e.F|=49152:e.b|=128,e.b&64&&ld(c,e.R))});this.N=nd(this.f,this.M?-1:52,4,262144);this.X=kd(this.f,function(){e.g|=128;e.g&64&&ld(c,e.N)});ac(b,this,Hh,this.M?64832+8*(this.M-1)-65392:0);cc(b,this.reset.bind(this)); -A(this)};h.Nd=function(a){if(!this.j){var b=de(this.J,"connection");if(b){var c=b.split("->");if(2==c.length){var d=ab(c[0]);if(d!=this.nb)return;c=ab(c[1]);if(this.j=Ca(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.H=e.receiveData){this.I=a;this.P=e.receiveStatus;this.status("Connected "+this.ob+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -h.ya=function(a,b){if(!b)if(this.Nd(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Ih(this)};h.save=function(){var a=new I(this);a.set(0,[this.F,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Ih(this,a[0])};function Ih(a,b){b||(b=[0,8192,128,a.i]);b=ja(b);a.F=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0} -h.sc=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Xa("",c)));this.V&&!this.B&&c&&(b=String.fromCharCode(this.V)+b);this.u.value+=b;this.u.scrollTop=this.u.scrollHeight;this.B+=c}}else if(null!=this.w){if(10== -a||1024<=this.w.length)this.v(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}md(this.f,this.X,1E3/Math.round(this.Z/10));this.g&=-129};var Gh="buffer",Jh={},Hh=(Jh[65392]=[null,null,Fh.prototype.vf,Fh.prototype.Eg,"RCSR"],Jh[65394]=[null,null,Fh.prototype.uf,Fh.prototype.Dg,"RBUF"],Jh[65396]=[null,null,Fh.prototype.ag,Fh.prototype.kh,"XCSR"],Jh[65398]=[null,null,Fh.prototype.$f,Fh.prototype.jh,"XBUF"],Jh); -yb(function(){for(var a=y(document,x,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.C[b]=c,!0;case "readTape":e=Nh;case "loadTape":return e||(e=Oh),this.C[b]=c,c.onclick= -function(){var a=d.C.listTapes;a&&Ph(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.N){c.parentNode.removeChild(c);break}this.C[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ph(d,Sa(b,!0),b,Oh,a)}return!1};return!0;case Qh:return this.C[b]=c,!0}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;this.I=Rh(a);var e=this;if(a=Kh(this,de(this.J,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.H=nd(this.f,56,4,4096);this.R=kd(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=Ta(c),f="json"==e||"gz"==e?encodeURI(c):gb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!eb(f,null,!0,function(e,f,g){var k=0>g&&!!a.J&&!a.J.A.fa;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(wa(a.ob,e,f),(e=fb(e,f))&&bi(a,b,c,d,e.ca,e.Ba, -e.Aa));a.A.gb=!1;a.g&&(a.g--,a.g||A(a));Zh(a)})}function Uh(a,b,c,d){if((a=a.C.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.Y);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ua(c,"/")&&(d="dir"),f=gb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.qc?"":e)+"&format=json"));return!!eb(f, -null,!0,function(b,c,d){ji(a,b,c,d)})} -function ji(a,b,c,d){var e=null,f=0>d&&!!a.J&&!a.J.A.fa;a.j=!1;if(d)a.controller.O('Unable to load disk "'+a.Na+'" (error '+d+": "+b+")",f);else{wa(a.controller.ob,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.Y=k.length;a.ea=k[0].length;a.aa=k[0][0].length;var l=k[0][0][0];a.qa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;E>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ja?f=a.Ra+a.Ja&&(a.Ja+=f-(a.Ra+a.Ja)+1):(a.Ra=f,a.Ja=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Na+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=li(this,a++);)oi(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function oi(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var fi=0;function pi(a,b,c,d,e,f){q.call(this,a,b,c);this.L=qi(this,b.autoMount);this.F=0;this.P=d;this.R=e;this.S=f;this.N=d.ce;this.i=Array(this.N);this.M=!mb("Mobi")&&window&&"FileReader"in window;this.u=[];this.ib=null}p(pi,q); -function qi(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=pi.prototype; -h.sa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.C[b]=c,c.onchange=function(){var a=d.C.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v(d.type+" option error: "+k.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.C[b]=c,c.onchange=function(){var a=Oa(c.value,10);null!=a&& -ri(d,a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&si(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&Oa(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.O("Unable to boot the selected drive"):a.da?(we(d.f,0,!0),(a=d.Dc(a,0,0,0,512,0,2))&&d.O("Unable to read the boot sector ("+a+")")):d.O("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c); -break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.i&&((a=d.i[Oa(a.value,10)||0])?(a=a.da)?(a=ub(ni(a),a.uc.replace(".json",".img")),v(a)):d.O("No disk loaded in drive."):d.O("No disk drive selected."))};return!0;case "mountDisk":if(this.M)return this.C[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;si(d,Sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=qi(this,de(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.L[e]=a[e]);this.Rb();this.ib=nd(this.f,this.P.xe,this.P.he,this.ia);ac(b,this,this.S);cc(b,this.reset.bind(this));Mi(this,"None",Oi,!0);this.M&&Mi(this,"Local Disk",Pi);Mi(this,"Remote Disk",Qi);Ri(this)||A(this)}; -h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){this.u=[];for(a=0;ag||9e||e>=a.i.length)a.O("Unable to load the selected drive");else if(c)if(c==Pi)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Qi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Vi(a,e,b,c,!1,d)}else Si(a,e)} -function Vi(a,b,c,d,e,f){var g=-1,k=a.i[b];k.ra.toLowerCase()!=d.toLowerCase()&&(g++,Si(a,b,!0),k.wb?a.O(a.type+" busy"):(k.wb=!0,e&&(k.vb=!0,a.F++,B(a)&&C(a,"auto-loading disk: "+c)),k.Ya=!!f,ii(new ei(a,k,"preload"),c,d,f,a.ee)&&g++));return g} -h.ee=function(a,b,c,d,e){a.wb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.O('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.hb)),b=null);if(b){a.da=b;a.Na=c;a.ra=d;a:{var f;for(f=0;f=a.Y){m=V.mc;break}n=a.seek(b,c,d+1);if(!n){m=V.vd;break}r=0;++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=V.nc;break}if(!k&&(wc(this.D,Le(this.f,f),u|t<<8),jd(this.D))){m=V.nd;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.fd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var n=null,r;a||(m=V.md,e=0);for(;e;){var u=Jc(this.D,Le(this.f,f));if(jd(this.D)){m=V.nd;break}if(!n){if(b>=a.Y){m=V.mc;break}n=a.seek(b,c,d+1,!0);if(!n){m=V.vd;break}r=0;++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=V.nc;break}if(u!=(t|E<<8)){m=V.ye;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=V.nc;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.ke=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&~U.Bb|f>>16-U.Wa.Bb&U.Bb;this.B=65536-e&65535;this.j=this.j&~Yi.Nc|d&Yi.Nc;this.g|=a;Zi(this);return!0};function Zi(a){a.b&=~U.gd;a.g&&(a.g|=V.ae,a.b|=U.gd,a.g&V.Hc&&(a.b|=U.Hc),B(a)&&C(a,a.type+": ERROR: "+F(a.g)))}h.Af=function(){return this.I};h.Jg=function(){};h.Bf=function(){return this.g};h.Kg=function(){};h.xf=function(){return this.b&U.re}; -h.Gg=function(a){this.b=this.b&~U.Ad|a&U.Ad;if(this.b&U.hd){a=!0;var b,c,d="",e=(this.j&Yi.Bc)>>Yi.Wa.Bc,f=this.i[e],g,k,l,m,n,r;this.b&=~(U.Qb|U.Oc);this.g&=~V.te;switch(c=this.b&U.lc){case $i.Vd:B(this)&&C(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=U.Qb;break;case $i.ie:d="RCHK";case $i.je:d||(d="READ"),b=this.Dc;case $i.zd:d||(d="WCHK");case $i.ze:d||(d="WRITE");b||(b=this.fd);g=(this.j&Yi.Pb)>>Yi.Wa.Pb;k=(this.j&Yi.Ic)>>Yi.Wa.Ic;l=this.j&Yi.Nc;m=65536-this.B&65535;n=(this.b&U.Bb)<< -16-U.Wa.Bb|this.w;r=this.b&U.fe?0:2;B(this)&&C(this,this.type+": "+d+"("+g+":"+k+":"+l+") "+F(n)+"--"+F(n+(m<<1)),!0,!0);if(g>=f.Y){this.g|=V.mc;break}if(l>=f.aa){this.g|=V.nc;break}a=b.call(this,f,g,k,l,m,n,r,c>=$i.zd,this.ke.bind(this));break;case $i.ue:g=(this.j&Yi.Pb)>>Yi.Wa.Pb;B(this)&&C(this,this.type+": SEEK("+g+")",!0);g'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.C[b]=c,c.onchange=function(){var a=Oa(c.value,10);null!=a&&cj(d, -a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&dj(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&Oa(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.O("Unable to boot the selected drive"):a.da?(we(d.f,0,!0),(a=d.sd(a,0,0,0,512,0))&&d.O("Unable to read the boot sector ("+a+")")):d.O("Load a disk into the drive first")},!0;case "saveDisk":if(!this.I){c.parentNode.removeChild(c); -break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.g&&((a=d.g[Oa(a.value,10)||0])?(a=a.da)?(a=ub(ni(a),a.uc.replace(".json",".img")),v(a)):d.O("No disk loaded in drive."):d.O("No disk drive selected."))};return!0;case "mountDisk":if(this.I)return this.C[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;dj(d,Sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=bj(this,de(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.H[e]=a[e]);ej(this);this.ib=nd(this.f,112,5,131072);ac(b,this,fj);cc(b,this.reset.bind(this));gj(this,"None",hj,!0);this.I&&gj(this,"Local Disk",ij);gj(this,"Remote Disk",jj);kj(this)||A(this)}; -h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";cj(this,0)}}return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){ej(this)};h.save=function(){return(new I(this)).data()}; -h.restore=function(a){return ej(this,a[0])};function kj(a,b){b||(a.F=0);for(var c in a.H){var d=a.H[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.C.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.O("Unable to load the selected drive");else if(c)if(c==ij)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==jj){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}mj(a,e,b,c,!1,d)}else lj(a,e)} -function mj(a,b,c,d,e,f){var g=-1,k=a.g[b];k.ra.toLowerCase()!=d.toLowerCase()&&(g++,lj(a,b,!0),k.wb?a.O("RL11 busy"):(k.wb=!0,e&&(k.vb=!0,a.F++,B(a)&&C(a,"auto-loading disk: "+c)),k.Ya=!!f,ii(new ei(a,k,"preload"),c,d,f,a.pe)&&g++));return g} -h.pe=function(a,b,c,d,e){a.wb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.hb)),b=null);b?(a.da=b,a.Na=c,a.ra=d,this.O('Loaded disk "'+c+'" in drive '+("RL"+a.hb),a.vb||e),this.J&&ne(this.J)):a.Ya=!1;a.vb&&(a.vb=!1,--this.F||A(this));cj(this,a.hb)}; -function gj(a,b,c,d){if((a=a.C.listDisks)&&a.options){for(var e=0;e(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}wc(this.D,Le(this.f,f),n|r<<8);if(jd(this.D)){k=8192;break}f+=2;e--;if(m>=a.qa&&(l=null,++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.qe=function(a,b,c,d,e,f,g){var k=0;a=a.da;var l=null,m;a||(k=5120,e=0);for(;e;){var n=Jc(this.D,Le(this.f,f));if(jd(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.qa&&(l=null,++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.oe=function(a,b,c,d,e,f){this.B=f&65535;this.b=this.b&-49|f>>12&48;this.u=f>>16&63;this.j=this.i=b<<7|(c?64:0)|d&63;this.w=65536-e&65535;a&&(this.b=this.b|a|32768);return!0};h.Ff=function(){return this.b&65535}; -h.Og=function(a){this.b=this.b&-1023|a&1022;this.u=this.u&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c="",d=this.g[(this.b&768)>>8],e=d.da,f,g,k;this.b&=-2;switch(this.b&14){case 4:this.w&8&&(this.b&=63);this.w=d.status|this.j&64|(e&&512==e.Y?128:0);break;case 6:1==(this.i&3)&&(b=this.i&65408,c=(this.i&16)<<2,this.j=this.i&4?this.j+b:this.j-b,this.i=this.j=this.j&65408|c);break;case 8:this.w=this.j;break;case 12:c="READ",b=this.sd;case 10:c||(c="WRITE"),b||(b=this.qe),f=this.i>>7,g=this.i&64?1:0,k= -this.i&63,!e||f>=e.Y||k>=e.aa?this.b|=37888:(a=65536-this.w&65535,e=(this.u&63)<<16|this.B,B(this)&&C(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+F(e)+"--"+F(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.oe.bind(this)))}a&&(this.b|=129,this.b&64&&ld(this.f,this.ib))}};h.Df=function(){return this.B};h.Mg=function(a){this.B=a&65534};h.Gf=function(){return this.i};h.Pg=function(a){this.i=a};h.Hf=function(){return this.w};h.Qg=function(a){this.w=a};h.Ef=function(){return this.u}; -h.Ng=function(a){this.u=a&63;this.b=this.b&-49|(this.u&3)<<4};var hj="",ij="?",jj="??",nj={},fj=(nj[63744]=[null,null,Cd.prototype.Ff,Cd.prototype.Og,"RLCS"],nj[63746]=[null,null,Cd.prototype.Df,Cd.prototype.Mg,"RLBA"],nj[63748]=[null,null,Cd.prototype.Gf,Cd.prototype.Pg,"RLDA"],nj[63750]=[null,null,Cd.prototype.Hf,Cd.prototype.Qg,"RLMP"],nj[63752]=[null,null,Cd.prototype.Ef,Cd.prototype.Ng,"RLBE"],nj); -function oj(a){q.call(this,"Debugger",a);this.Ca=+a.base||16;this.ja=!1;this.w=0;this.P=!1;this.u=-1;this.j=[];this.U={}}p(oj,q);oj.prototype.Jd=function(){return-1};oj.prototype.Kd=function(){}; -function pj(a,b,c,d){if(c)if(b){0>a.u&&a.j.length&&(a.u=0);if(0>a.u||b!=a.j[a.u])a.j.splice(0,0,b),a.u=0;a.u--}else a.P?b="end":b=a.j[a.u+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ab(b.substring(c,f))),c=f+1}}return a} -function qj(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +function Ab(a){if(Bb)try{for(var b=0;ba;a++)this.b["S"+a]=[0,0,!1,!1,this.pf,a];this.F=this.f=this.C=this.K=null;y(this)}p(Rb,q);h=Rb.prototype; +h.reset=function(a){this.stop();a&&Zb(this,this.Ta=0)}; +h.ta=function(a,b,c,d){if(this.K&&this.K.ta(a,b,c,d)||this.f&&this.f.ta(a,b,c,d)||this.F&&this.F.ta(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.H[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.H[b]=c,this.i[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.H[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, +b){return function(){$b(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){ac(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){$b(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){ac(a,b)}}(this,b),!0):q.prototype.ta.call(this,a,b,c,d)}};h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;bc(b,this,cc);dc(b,this.reset.bind(this));ec(this);fc(this)}; +h.Ca=function(a,b){if(!b)if(this.M&&gc(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};h.Ba=function(a){return a?this.save():!0};h.save=function(){var a=new G(this);a.set(0,[this.da,this.Ta,this.Ua]);return a.data()};h.restore=function(a){if(a=a[0])hc(this,this.da=a[0]),Zb(this,this.Ta=a[1]),ic(this,a[2]);return!0};function jc(a,b,c){if(a=a.H[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ec(a,b){for(var c in a.i)jc(a,c,null!=b?b:a.i[c])} +function kc(a,b,c){if(a=a.H[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function fc(a){for(var b in a.b)kc(a,b,a.b[b][1])}function lc(a,b,c,d){if(a.H[b]){var e=a.F&&a.F.Aa||8;c=c||0;c=8==e?E(c,d):F(c,d);a.H[b].textContent!=c&&(a.H[b].textContent=c)}}function $b(a,b){var c=a.b[b];kc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=mc&&(a.G=b==nc,a.I=b==oc)} +function ac(a,b){var c=a.b[b];c[2]&&c[3]&&(kc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.mf=function(a){a||this.f.A.T||(a=this.f,a.C.reset(),pc(a),this.b[qc]&&this.b[qc][1]&&rc(this.f))};h.nf=function(){};h.hf=function(a){a||this.f.Z()}; +h.ff=function(a){if(!a&&!this.f.A.T)if(this.b[qc]&&this.b[qc][1])rc(this.f);else{if((a=this.F)&&!Ja(a,!0))Ka(a,!0),sc(a,0,null),Ka(a,!1);else try{var b=this.f.pc(1);0=a.f.ia?8:16,c=65472<=a.da&&a.da<65472+b,b=c?1:2,c=c?15:a.C.I;a.b[mc]&&a.b[mc][1]||(b=-b);hc(a,a.da&~c|a.da+b&c)} +function hc(a,b){a.da=b&a.C.I;if(a.B!==a.da){a.B=a.da;b=a.B;for(var c=0;22>c;c++)Bc(a,"A"+c,b&1<c;c++)Bc(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.G=this.M/this.j|0;this.U=this.G-1;this.Ma=[];this.la=0;this.D=!1;this.N=[];this.Xe=[Sc,Tc,Uc,Vc];this.b=this.v=[];this.B=this.L=this.w=this.O=this.P=0;a=new J(this);Wc(a,this.F);this.b=Array(this.G);this.v=Array(this.G);for(b=0;b>>this.g;this.L=0;this.w=this.I;y(this)}p(Qc,q);function Zc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.v[a.P]=a.b[a.O])}}h=Qc.prototype;h.reset=function(){for(var a=0;a>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.J)return l.Ob+=l.J-f,l.J=f,!0;if(f>=l.J+l.Ob){n=l.size-(f-m);n>g&&(n=g);l.Ob=f-l.J+n;f=m+a.j;g-=n;k++;continue}}return ad(bd,f,g)}f=new J(a,f,n,a.j,d,e);Wc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+cd[d]+" at "+E(b)),!0):ad(dd,b,c)}h.od=function(a){return this.v[(a&this.w)>>>this.g].yb(a&this.i,a)}; +h.oc=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Lb||b!=this.i?this.v[c].na(b,a):this.v[c++].yb(b,a)|this.v[c&this.U].yb(0,a+1)<<8};h.pd=function(a,b){this.v[(a&this.w)>>>this.g].Ab(a&this.i,b,a)};h.Sb=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Lb||c!=this.i?this.v[d].Bb(c,b,a):(this.v[d++].Ab(c,b&255,a),this.v[d&this.U].Ab(0,b>>8&255,a+1))};function ed(a,b){return a.b[(b&a.I)>>>a.g]} +function zc(a,b){var c;a.D=!1;a.la++;var d=b&a.i,e=ed(a,b);Lb||d!=a.i?c=e.B(d,b):c=e.K(d,b)|ed(a,b+1).K(0,b+1)<<8;a.la--;return c}function fd(a,b,c){a.D=!1;a.la++;ed(a,b).F(b&a.i,c&255,b);a.la--}function xc(a,b,c){a.D=!1;a.la++;var d=b&a.i,e=ed(a,b);Lb||d!=a.i?e.D(d,c&65535,b):(e.F(d,c&255,b),ed(a,b+1).F(0,c>>8&255,b+1));a.la--} +function $c(a){for(var b=0,c=[],d=0;da.f.ia)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Ma[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&A(this.f,16|e[5])&&D(this.f,e[4]+".readByte("+K(this.f,b)+"): "+K(this.f,c),!0,!d.la),c;d.La(b,16,3);c=255;this.f&&A(this.f,16)&&D(this.f,"warning: unconverted read access to byte @"+K(this.f,b)+": "+K(this.f,c),!0,!d.la);return c} +function Tc(a,b,c){var d=!1,e=this.controller,f=e.Ma[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ma[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&A(this.f,16|f[5])&&D(this.f,f[4]+".writeByte("+K(this.f,c)+","+K(this.f,b)+")",!0,!e.la):(e.La(c,16,5),this.f&&A(this.f,16)&&D(this.f,"warning: unconverted write access to byte @"+K(this.f,c)+": "+K(this.f, +b),!0,!e.la))}function Uc(a,b){var c=-1,d=this.controller;a=d.Ma[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&A(this.f,16|a[5])&&D(this.f,a[4]+".readWord("+K(this.f,b)+"): "+K(this.f,c),!0,!d.la),c;d.La(b,16,2);c=65535;this.f&&A(this.f,16)&&D(this.f,"warning: unconverted read access to word @"+K(this.f,b)+": "+K(this.f,c),!0,!d.la);return c} +function Vc(a,b,c){var d=!1,e=this.controller;a=e.Ma[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&A(this.f,16|a[5])&&D(this.f,a[4]+".writeWord("+K(this.f,c)+","+K(this.f,b)+")",!0,!e.la):(e.La(c,16,4),this.f&&A(this.f,16)&&D(this.f,"warning: unconverted write access to word @"+K(this.f,c)+": "+K(this.f,b),!0,!e.la))}function M(a){q.call(this,"Device",a,256);this.b={ab:128,ld:-1}}p(M,q);h=M.prototype; +h.za=function(a,b,c,d){this.C=b;this.K=a;this.f=c;this.F=d;var e=this;this.b.ld=ld(c,function(){e.b.ab|=128;e.b.ab&64&&md(e.f,e.b.Lb);e.K&&I(e.K,1);nd(e.f,e.b.ld,1E3/60)});this.b.Lb=od(c,64,6,524288);bc(b,this,pd);dc(b,this.reset.bind(this));d&&qd(d,64,function(a){var b=e.f;rd(e,"KIPDR",b.B[0],0,a[0]);rd(e,"KDPDR",b.B[0],8,a[0]);rd(e,"KIPAR",b.M[0],0,a[0]);rd(e,"KDPAR",b.M[0],8,a[0],!0);rd(e,"SIPDR",b.B[1],0,a[0]);rd(e,"SDPDR",b.B[1],8,a[0]);rd(e,"SIPAR",b.M[1],0,a[0]);rd(e,"SDPAR",b.M[1],8,a[0], +!0);rd(e,"UIPDR",b.B[3],0,a[0]);rd(e,"UDPDR",b.B[3],8,a[0]);rd(e,"UIPAR",b.M[3],0,a[0]);rd(e,"UDPAR",b.M[3],8,a[0],!0);b.V&32&&rd(e,"UNIMAP",b.Fa,-1,a[0])});y(this)};function rd(a,b,c,d,e,f){a=a.F;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Fa[a>>1];return a&1?b>>16:b&65535};h.wh=function(a,b){b=b>>1&63;var c=b>>1;this.f.Fa[c]=b&1?this.f.Fa[c]&65535|(a&63)<<16:this.f.Fa[c]&-65536|a&65534};h.gg=function(a){return this.f.B[1][a>>1&7]};h.ph=function(a,b){this.f.B[1][b>>1&7]=a&65295};h.eg=function(a){return this.f.B[1][(a>>1&7)+8]};h.nh=function(a,b){this.f.B[1][(b>>1&7)+8]=a&65295};h.fg=function(a){return this.f.M[1][a>>1&7]}; +h.oh=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.dg=function(a){return this.f.M[1][(a>>1&7)+8]};h.mh=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.Af=function(a){return this.f.B[0][a>>1&7]};h.Kg=function(a,b){this.f.B[0][b>>1&7]=a&65295};h.yf=function(a){return this.f.B[0][(a>>1&7)+8]};h.Ig=function(a,b){this.f.B[0][(b>>1&7)+8]=a&65295};h.zf=function(a){return this.f.M[0][a>>1&7]};h.Jg=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.B[0][b]&=65295}; +h.xf=function(a){return this.f.M[0][(a>>1&7)+8]};h.Hg=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.B[0][b]&=65295};h.mg=function(a){return this.f.B[3][a>>1&7]};h.vh=function(a,b){this.f.B[3][b>>1&7]=a&65295};h.kg=function(a){return this.f.B[3][(a>>1&7)+8]};h.th=function(a,b){this.f.B[3][(b>>1&7)+8]=a&65295};h.lg=function(a){return this.f.M[3][a>>1&7]};h.uh=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.jg=function(a){return this.f.M[3][(a>>1&7)+8]}; +h.sh=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Mb=function(a){a&=7;return this.f.w&2048?this.f.pa[a]:this.f.g[a]};h.Qb=function(a,b){b&=7;this.f.w&2048?this.f.pa[b]=a:this.f.g[b]=a};h.Lf=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.Tg=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.Of=function(){return this.f.g[7]};h.Wg=function(a){this.f.g[7]=a};h.Nb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.pa[a]}; +h.Rb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.pa[b]=a};h.Mf=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Ug=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.Nf=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Vg=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.wf=function(a){return this.f.lc[a-65504>>1]};h.Gg=function(a,b){this.f.lc[b-65504>>1]=a};h.ce=function(a){return 65520==a?(gd(this.C)>>6)-1:0}; +h.he=function(){};h.ig=function(){return 1};h.rh=function(){};h.vf=function(){return this.f.P};h.Fg=function(){this.f.P=0};h.Cf=function(){return this.f.ic};h.Mg=function(a,b){b&1||(a&=255);this.f.ic=a};h.Hf=function(a,b){return b?0:this.f.Za};h.Pg=function(a){zd(this.f,a)};h.hg=function(a,b){return b?0:this.f.ua&65280};h.qh=function(a){this.f.ua=a|255};h.Kf=function(){return Ad(this.f)};h.Sg=function(a){Bd(this.f,a)};h.ge=function(a,b){A(this)&&D(this,"writeIgnored("+E(b)+"): "+E(a),!0,!0)}; +var N={},pd=(N[61568]=[null,null,M.prototype.ng,M.prototype.wh,"UNIMAP",64,1170],N[62592]=[null,null,M.prototype.gg,M.prototype.ph,"SIPDR",8,1145,64],N[62608]=[null,null,M.prototype.eg,M.prototype.nh,"SDPDR",8,1145,64],N[62624]=[null,null,M.prototype.fg,M.prototype.oh,"SIPAR",8,1145,64],N[62640]=[null,null,M.prototype.dg,M.prototype.mh,"SDPAR",8,1145,64],N[62656]=[null,null,M.prototype.Af,M.prototype.Kg,"KIPDR",8,1140,64],N[62672]=[null,null,M.prototype.yf,M.prototype.Ig,"KDPDR",8,1145,64],N[62688]= +[null,null,M.prototype.zf,M.prototype.Jg,"KIPAR",8,1140,64],N[62704]=[null,null,M.prototype.xf,M.prototype.Hg,"KDPAR",8,1145,64],N[62798]=[null,null,M.prototype.Gf,M.prototype.Og,"MMR3",1,1145,64],N[65382]=[null,null,M.prototype.Bf,M.prototype.Lg,"LKS"],N[65402]=[null,null,M.prototype.Df,M.prototype.Ng,"MMR0",1,1140,64],N[65404]=[null,null,M.prototype.Ef,M.prototype.ge,"MMR1",1,1145,64],N[65406]=[null,null,M.prototype.Ff,M.prototype.ge,"MMR2",1,1140,64],N[65408]=[null,null,M.prototype.mg,M.prototype.vh, +"UIPDR",8,1140,64],N[65424]=[null,null,M.prototype.kg,M.prototype.th,"UDPDR",8,1145,64],N[65440]=[null,null,M.prototype.lg,M.prototype.uh,"UIPAR",8,1140,64],N[65456]=[null,null,M.prototype.jg,M.prototype.sh,"UDPAR",8,1145,64],N[65472]=[null,null,M.prototype.Mb,M.prototype.Qb,"R0SET0"],N[65473]=[null,null,M.prototype.Mb,M.prototype.Qb,"R1SET0"],N[65474]=[null,null,M.prototype.Mb,M.prototype.Qb,"R2SET0"],N[65475]=[null,null,M.prototype.Mb,M.prototype.Qb,"R3SET0"],N[65476]=[null,null,M.prototype.Mb, +M.prototype.Qb,"R4SET0"],N[65477]=[null,null,M.prototype.Mb,M.prototype.Qb,"R5SET0"],N[65478]=[null,null,M.prototype.Lf,M.prototype.Tg,"R6KERNEL"],N[65479]=[null,null,M.prototype.Of,M.prototype.Wg,"R7KERNEL"],N[65480]=[null,null,M.prototype.Nb,M.prototype.Rb,"R0SET1",1,1145],N[65481]=[null,null,M.prototype.Nb,M.prototype.Rb,"R1SET1",1,1145],N[65482]=[null,null,M.prototype.Nb,M.prototype.Rb,"R2SET1",1,1145],N[65483]=[null,null,M.prototype.Nb,M.prototype.Rb,"R3SET1",1,1145],N[65484]=[null,null,M.prototype.Nb, +M.prototype.Rb,"R4SET1",1,1145],N[65485]=[null,null,M.prototype.Nb,M.prototype.Rb,"R5SET1",1,1145],N[65486]=[null,null,M.prototype.Mf,M.prototype.Ug,"R6SUPER",1,1145],N[65487]=[null,null,M.prototype.Nf,M.prototype.Vg,"R6USER",1,1145],N[65504]=[null,null,M.prototype.wf,M.prototype.Gg,"CTRL",8,1170],N[65520]=[null,null,M.prototype.ce,M.prototype.he,"LSIZE",1,1170],N[65522]=[null,null,M.prototype.ce,M.prototype.he,"HSIZE",1,1170],N[65524]=[null,null,M.prototype.ig,M.prototype.rh,"SYSID",1,1170],N[65526]= +[null,null,M.prototype.vf,M.prototype.Fg,"ERR",1,1170],N[65528]=[null,null,M.prototype.Cf,M.prototype.Mg,"MBR",1,1170],N[65530]=[null,null,M.prototype.Hf,M.prototype.Pg,"PIR"],N[65532]=[null,null,M.prototype.hg,M.prototype.qh,"SLR"],N[65534]=[null,null,M.prototype.Kf,M.prototype.Sg,"PSW"],N); +yb(function(){for(var a=x(document,w,"device"),b=0;b>1),this.b=new Int32Array(this.v,0,this.size>>2),Hd(this,Id?Jd:Kd);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.tf=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.tg=function(a,b){Kb&&a&1&&this.C.La(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8}; +h.Dg=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.$a=!0};h.rf=function(a,b){this.f&&null!=this.J&&Zd(this.f,this.J+a);return this.K(a,b)};h.pg=function(a,b){this.f&&null!=this.J&&Zd(this.f,this.J+a,2);return this.B(a,b)}; +h.Bg=function(a,b,c){this.f&&null!=this.J&&$d(this.f,this.J+a);this.j?this.Pb(0,b,c):this.F(a,b,c)};h.yh=function(a,b,c){this.f&&null!=this.J&&$d(this.f,this.J+a,2);this.j?this.Pb(0,b,c):this.D(a,b,c)};h.qf=function(a){return this.g[a]};h.sf=function(a,b){a=this.g[a];this.f&&A(this.f,32)&&D(this.f,"Memory.readByte("+K(this.f,b)+"): "+K(this.f,a),!0);return a};h.og=function(a,b){Kb&&a&1&&this.C.La(b,64,2);return this.w.getUint16(a,!0)}; +h.sg=function(a,b){Kb&&a&1&&this.C.La(b,64,2);a=!Lb&&a&1?this.g[a]|this.g[a+1]<<8:this.G[a>>1];this.f&&A(this.f,32)&&D(this.f,"Memory.readWord("+K(this.f,b)+"): "+K(this.f,a),!0);return a};h.Ag=function(a,b){this.g[a]=b;this.$a=!0};h.Cg=function(a,b,c){this.g[a]=b;this.$a=!0;this.f&&A(this.f,32)&&D(this.f,"Memory.writeByte("+K(this.f,c)+","+K(this.f,b)+")",!0)};h.xh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);this.w.setUint16(a,b,!0);this.$a=!0}; +h.zh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);!Lb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.G[a>>1]=b;this.$a=!0;this.f&&A(this.f,32)&&D(this.f,"Memory.writeWord("+K(this.f,c)+","+K(this.f,b)+")",!0)};var Fd=0,hd=1,Gd=2,Yc=4,cd=["NONE","RAM","ROM","VID","H/W"],Ed=0,Ud=[],Ld=[J.prototype.tf,J.prototype.Dg,J.prototype.tg,J.prototype.Ah],Xd=[J.prototype.rf,J.prototype.Bg,J.prototype.pg,J.prototype.yh]; +if(Gb)var Kd=[J.prototype.qf,J.prototype.Ag,J.prototype.og,J.prototype.xh],Jd=[J.prototype.sf,J.prototype.Cg,J.prototype.sg,J.prototype.zh];var ae;if(Gb){var be=new ArrayBuffer(2);(new DataView(be)).setUint16(0,256,!0);ae=256===(new Uint16Array(be))[0]}else ae=!1;var Id=ae; +function ce(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Kc=0;this.Ic=b;this.hb=c;this.Sc=Math.round(this.Ic/1E4)/100;this.sb=this.Sc*this.hb;this.Tc=this.dc=this.vb=this.Jc=0;this.A.T=this.A.Dc=!1;this.A.sa=a.autoStart;"string"==typeof this.A.sa&&(this.A.sa="true"==this.A.sa);this.A.Gb=!1;this.bc=this.Ib=0;this.cc=+a.csStart;this.Hb=+a.csInterval;this.Jb=+a.csStop;this.ha=[];this.Id=this.xg.bind(this);this.ib=this.Ia=this.gb=this.b=this.ja=this.Ha=this.ac=this.fb=this.Kb= +this.Uc=this.rb=0;this.ra=null;y(this)}p(ce,q);h=ce.prototype;h.za=function(a,b,c,d){this.K=a;this.C=b;this.F=d;this.ra=a.i;for(a=0;a=a.Ib&&(a.Ib+=a.Hb,c=!0);0<=a.Jb&&a.Jb<=ke(a)&&(a.Hb=a.Jb=-1,ge(a),a.Z(),c=!0);c&&a.u(ke(a)+" cycles: checksum="+F(a.bc))}} +h.ta=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.H[b]=c,!0;case "run":return this.H[b]=c,c.onclick=function(){var a;if(a=d.K)if(a=d.K,a.A.ca)a=!0;else{var b=null,c,k=Aa(a.id);for(c=0;ca.rb/a.sb?b=1:d=!0;a.hb=b;b=a.Sc*a.hb;if(a.sb!=b){a.sb=b;b=a.sb.toFixed(2)+"Mhz";var e=a.H.setSpeed;e&&(e.textContent=b);a.u("target speed: "+b)}c&&a.K&&oe(a.K)}uc(a,a.Ia);a.Ia=0;a.Ha=ya();a.fb=0;me(a);return d}function ld(a,b){var c=a.ha.length;a.ha.push([-1,b]);return c}function nd(a,b,c,d){0<=b&&ba.ha[b][0])&&(c=a.Ic*a.hb/1E3*c|0,a.A.T&&(c+=pe(a)),a.ha[b][0]=c)} +function qe(a,b){for(var c=a.ha.length-1;0<=c;c--){var d=a.ha[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function re(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function pe(a,b){var c=a.gb-=a.b;a.b=a.ja=0;b&&(a.gb=0);return c} +h.xg=function(){if(this.A.T){this.Jc>=this.Ic&&me(this,!0);this.Kb=0;this.ac=ya();if(this.fb){var a=this.ac-this.fb;a>this.Tc&&(this.Ha+=a,this.Ha>this.ac&&(this.Ha=this.ac))}try{do{var b=qe(this,this.A.Gb?1:this.dc);try{this.pc(b)}catch(e){if("number"!=typeof e)throw e;}b=pe(this,!0);this.Kb+=b;this.Ia+=b;vc(this,b);tc(this,b);this.vb-=b;if(0>=this.vb){this.vb+=this.dc;++this.Uc>=se&&(this.K&&I(this.K,void 0),this.Uc=0);break}}while(this.A.T)}catch(e){this.Z();this.K&&this.K.stop(ya(),ke(this)); +Ga(this,e.stack||e.message);return}if(this.A.T){a=setTimeout;b=this.Id;this.fb=ya();var c=this.Tc;this.Kb&&(c=Math.round(c*this.Kb/this.dc));var c=c-(this.fb-this.ac),d=this.fb-this.Ha;d&&(this.rb=Math.round(this.Ia/(10*d))/100,864E5<=d&&(this.ib=0,le(this)));if(0>c||this.rbc&&(this.Ha-=c),c=0;this.Jc+=this.Kb;this.fb+=c;a(b,c)}}}; +function rc(a,b){if(!Ha(a))if(a.A.T)a.u(a.toString()+" busy");else{le(a);a.A.T=!0;a.A.Dc=!0;var c=a.H.run;c&&(c.textContent="Halt");a.K&&(b&&oe(a.K,!0),a.K.start(a.Ha,ke(a)));a.F||a.status("Started");setTimeout(a.Id,0)}}h.pc=function(){return 0};h.Z=function(a){var b=!1;if(this.A.T){pe(this);uc(this,this.Ia);this.Ia=0;this.A.T=!1;if(b=this.H.run)b.textContent="Run";this.K&&this.K.stop(ya(),ke(this));b=!0;this.F||this.status("Stopped")}this.A.complete=a;return b};var ne=30,se=15,de=["power","reset"]; +function te(a){var b=+a.model||1170;ce.call(this,a,6666667);this.ia=b;this.Bd=+a.addrReset||0;this.Ya=this.w=this.N=this.D=this.G=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Fa=this.lc=[];this.cb=this.O=this.zd=this.tb=this.ub=this.mb=this.eb=this.P=this.ic=this.Za=this.ua=this.U=this.jc=this.kc=this.V=this.i=0;this.Ed=[4,2,0,1];this.mc=0;this.Fd=255;1120>=this.ia?(this.yd=ue.bind(this),this.Eb=this.$e,this.mc=8,this.Fd=-1,this.Md=255,this.Ld=0):(this.yd=ve.bind(this),this.Eb=this.af, +this.Md=~(1792|(1140>=this.ia?2048:0))&65535,this.Ld=1140e.zb&&(e.zb=c,c+=4)}return ce.prototype.Ca.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.ia);this.A.T&&this.Z();this.D=65536;this.G=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Bd,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, +65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.lc=[0,0,0,0,0,0,0,0];this.N=0;this.Ya=-1;this.v=this.j=this.Hc=this.X=this.Y=this.i=this.ic=0;pc(this);fe(this);this.A.error=!1;ce.prototype.reset.call(this)};function pc(a){a.U=0;a.jc=0;a.kc=0;a.V=0;a.P=0;a.Za=0;a.ua=255;a.tb=0;a.ub=0;a.mb=0;a.eb=262143;a.cb=a.g[7];a.O=0;a.R=null;a.C&&(we(a),a.zd=gd(a.C))} +function we(a){a.Xb=a.Lc;a.Yb=a.Mc;a.Ec=a.Nc;a.Zb=a.Qc;a.fc&&(a.Xb=a.Vd,a.Yb=a.$d);a.gc&&(a.Ec=a.ee,a.Zb=a.fe);a.tb?(a.Ga=65536,a.ob=a.V&16?4186112:253952,a.Ea=a.Zd,a.na=a.fc?a.rg:a.gd,a.Bb=a.gc?a.Ch:a.md,Zc(a.C,a.V&16?22:18)):(a.Ga=0,a.ob=57344,a.Ea=a.df,a.na=a.fc?a.qg:a.de,a.Bb=a.gc?a.Bh:a.ie,Zc(a.C,16))}function td(a){var b=a.U;b&57344||(b=b&-3199|a.ub<<5|a.mb<<1);return b} +function vd(a,b){b&=-3073;if(a.U!=b){b&57344&&!(a.U&57344)&&(a.jc=a.O>>16&65535,a.kc=a.O&65535);a.U=b;a.ub=(b&96)>>5;a.mb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.tb!=c&&(a.tb=c,we(a))}}function wd(a){a.U&57344||(a.jc=a.O>>16&65535);a=a.jc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xd(a){a.U&57344||(a.kc=a.O&65535);return a.kc}function yd(a,b){1170>a.ia&&(b&=-49);a.V!=b&&(a.V=b,a.eb=b&16?4194303:262143,we(a))} +function xe(a,b,c){a.Bd=b;ye(a,b);Bd(a,0);a.C.reset();pc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.T||rc(a)}else a.F&&a.A.ca?a.Z()||(he(a.F),I(a.K,-1)):!1===c&&a.Z();!a.A.T&&a.ra&&a.ra.stop()}h.Wd=function(){return 0}; +h.save=function(){var a=new G(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Fa,this.lc,this.P,this.ic,this.Za,this.ua,this.ub,this.mb,this.cb,this.i,this.O,this.Ya,this.nc,this.qc]);a.set(1,[Ad(this),td(this),wd(this),xd(this),this.V]);a.set(2,[this.ib,this.hb,this.A.sa]);a.set(3,ze(this));a.set(4,re(this));return a.data()}; +h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Fa=b.next().value;this.lc=b.next().value;this.P=b.next().value;this.ic=b.next().value;this.Za=b.next().value;this.ua=b.next().value;this.ub=b.next().value;this.mb=b.next().value;this.cb=b.next().value;this.i=b.next().value;this.O=b.next().value;this.Ya=b.next().value;this.nc=b.next().value;this.qc=b.next().value;b=a[1];Bd(this,b[0]);vd(this,b[1]); +this.jc=b[2];this.kc=b[3];yd(this,b[4]);b=a[2];this.ib=b[0];le(this,b[1]);this.A.sa=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function ye(a,b){a.g[7]=b&65535}function od(a,b,c,d){b={zb:b,kb:c,message:d||0,name:Pb[b],next:null};a.$b.push(b);return b}function Fe(a,b){var c=a.R;if(c==b)a.R=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.R&&(a.i|=1)} +function md(a,b){if(b){if(b!=a.R){var c=a.R;if(!c||c.kb<=b.kb)b.next=c,a.R=b;else{do{var d=c.next;if(!d||d.kb<=b.kb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&A(a,b.message|8)&&D(a,"setIRQ(vector="+E(b.zb)+",priority="+b.kb+")",!0,!0)}}function sd(a,b){b&&(Fe(a,b),b.message&&A(a,b.message|8)&&D(a,"clearIRQ(vector="+E(b.zb)+",priority="+b.kb+")",!0,!0))}function ze(a){var b=[];for(a=a.R;a;)b.push(a.zb),a=a.next;return b} +function Ge(a){return a.i&64?(a.qa(168,64,-6),!0):a.i&32?(a.qa(4,32,-5),!0):a.i&16?(a.qa(12,16,-7),!0):!1}function Ad(a){return a.w=a.w&63728|De(a)|Ce(a)|Be(a)|Ae(a)}function Bd(a,b){b&=a.Md;a.I=b<<12;a.L=~b&4;a.G=b<<14;a.D=b<<16;if((b^a.w)&a.Ld)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.N=b>>14&3;c=a.w>>14&3;a.N!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.N]);a.w=b;a.i&=-3;a.i|=a.R?2:1}function zd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.Za=b} +h.Da=function(a){this.I=this.L=a;this.G=0};h.lb=function(a,b){this.I=this.L=this.D=a;this.G=b||0};function He(a,b){a.I=a.L=a.D=b;a.G=a.I^a.D>>1}function Ie(a,b,c,d){a.I=a.L=a.D=b;a.G=(c^d)&(d^b)} +h.qa=function(a,b,c){if(!this.oa){0>this.Ya?this.Ya=Ad(this):this.N||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.P|=4,this.g[6]=a=4);if(-1!=c){this.O=a|4143316992;this.N=0;var d=this.na(a|this.Ga),e=this.na(a+2&65535|this.Ga);Bd(this,e&-12289|this.Ya>>2&12288);Je(this,this.Ya);Je(this,this.g[7]);ye(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Ya=-1;this.nc=c;this.qc=a;-1==c&&this.Z();if(-4<=c)throw a;}}; +function Ke(a){var b=Le(a),c=Le(a);a.w&49152&&(c=c&-225|a.w&63712);ye(a,b);Bd(a,c);a.i&=-17}function Me(a,b){var c=b>>13&31;31>c&&(b=a.V&32?a.Fa[c]+(b&8191)&4194303:b&-3932161);return b} +function Ne(a,b,c){var d=[];if(c){c=Me(a,b);var e=b>>13&31;d.push(c);d.push(e);a.V&32&&(d.push(a.Fa[e]),d.push(b&8191))}else if(a.tb){var e=a.N<<1,f=b>>13;7>13;a.V&a.Ed[a.N]||(d&=7);e=a.B[a.N][d];f=(a.M[a.N][d]<<6)+(b&8191)&a.eb;3932160<=f&&(f=Me(a,f));if(a.oa)return f;f>=a.zd&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.B[a.N][d]=e;if(f!=(4194170&a.eb)||a.N)a.ub=a.N,a.mb=d;g&&(g&57344&&(0<=a.Ya&&(g|=128),a.U&57344||(g|=a.U&4096|a.ub<<5|a.mb<<1,vd(a,a.U&-61695|g&61694)),a.qa(168,64,-2)),a.U&61440||!(f<(4191360&a.eb)||f>(4194239&a.eb))||(a.U|=4096,a.U&512&&(a.i|=64)));return f}function Le(a){var b=a.na(a.g[6]|a.Ga);a.g[6]=a.g[6]+2&65535;return b}function Je(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.O=a.O&65535|(a.O&-65536)<<8|16121856;a.i&256||a.Eb(4,-2,c);a.Bb(c,b)} +function Oe(a,b,c,d){var e,f,g=d&8?0:a.Ga;switch(b){case 0:return a.qa(4,0,-3),0;case 1:return 6==c&&a.Eb(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Eb(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Eb(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,6==c&&a.Eb(d, +0,e),a.b-=6,e|g;case 7:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ga),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.O=a.O&65535|(a.O&-65536)<<8|(f<<3&248|c)<<16;return e}h.$e=function(a,b,c){!this.N&&0>=b&&c<=this.ua&&(this.i|=32)};h.af=function(a,b,c){this.N||(65534<=c&&(c|=-65536),a&4&&c<=this.ua&&(c<=this.ua-32?this.qa(4,0,-4):(this.P|=8,this.i|=32)))};h.Vd=function(a){this.F&&Zd(this.F,a,1);return this.Lc(a)};h.$d=function(a){this.F&&Zd(this.F,a,2);return this.Mc(a)}; +h.ee=function(a,b){this.F&&$d(this.F,a,1);this.Nc(a,b)};h.fe=function(a,b){this.F&&$d(this.F,a,2);this.Qc(a,b)};function Ac(a,b){a.oa++;b=a.C.oc(yc(a,b,2));a.oa--;return b}function Pe(a,b){(b?--a.gc:--a.fc)||we(a)}h.df=function(a,b,c){return Oe(this,a,b,c)};h.Zd=function(a,b,c){return yc(this,Oe(this,a,b,c),c)};h.de=function(a){return this.C.oc(this.cb=a)};h.qg=function(a){this.F&&Zd(this.F,a,2);return this.de(a)};h.gd=function(a){return this.C.oc(this.cb=yc(this,a,2))}; +h.rg=function(a){this.F&&Zd(this.F,a,2);return this.gd(a)};h.ie=function(a,b){this.C.Sb(this.cb=a,b)};h.Bh=function(a,b){this.F&&$d(this.F,a,2);this.ie(a,b)};h.md=function(a,b){this.C.Sb(this.cb=yc(this,a,4),b)};h.Ch=function(a,b){this.F&&$d(this.F,a,2);this.md(a,b)};function Qe(a,b,c){var d=a.j=b&7;(b=a.v=(b&56)>>3)?(d=Oe(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.N=a.w>>12&3,c=a.na(d|c&a.Ga),a.N=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} +function Re(a,b,c,d){a.O=a.O&65535|1441792;var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=Oe(a,b,e,4),c&65536||(e&=65535),a.N=a.w>>12&3,e=yc(a,e|c&65536,4),a.N=a.w>>14&3,a.Zb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Se(a,b){b>>=6;var c=a.Y=b&7;return(b=a.X=(b&56)>>3)?a.Xb(a.Ea(b,c,3)):a.g[c+a.mc]&a.Fd}function Te(a,b){var c;b>>=6;var d=a.Y=b&7;(b=a.X=(b&56)>>3)?c=a.Yb(a.Ea(b,d,2)):c=a.g[d+a.mc];return c}function Ue(a,b){var c=a.j=b&7;b=a.v=(b&56)>>3;return Oe(a,b,c,8)} +function Ve(a,b){var c=a.j=b&7;return(b=a.v=(b&56)>>3)?a.Xb(a.Ea(b,c,3)):a.g[c]&255}function We(a,b){var c,d=a.j=b&7;(b=a.v=(b&56)>>3)?c=a.Yb(a.Ea(b,d,2)):c=a.g[d];return c}function sf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Hc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.Ec(e,d.call(a,c,a.Xb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} +function R(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,6),a.Zb(e,d.call(a,0>c?a.g[-c-1]:c,a.Yb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function tf(a,b,c,d,e){var f=a.j=b&7;(b=a.v=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.Ec(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} +function uf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Zb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} +h.pc=function(a){this.A.complete=!0;var b=this.F?vf(this.F)?1:this.A.Dc?-1:0:0,c=a?this.A.Dc?0:1:-1;this.A.Dc=!1;this.gb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(wf(this.F,this.g[7],c)){this.Z();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.Za&224)>>5,f=this.R&&this.R.kb>e?this.R:null;f&&(d=f.zb,e=f.kb);e>(this.w&224)>>5?(this.i&8&&(Ee(this,2),this.i&=-9),this.qa(d,0,-10),e=!0):e=!1;e&&(f&&Fe(this,f),a=!0);this.R||this.Za||(this.i&=-3)}else this.i& +1&&this.i++;if(a){if(this.i&4&&wf(this.F,this.g[7],c)){this.Z();break}if(0>c)break}if(this.i&112&&Ge(this)){if(this.i&4&&wf(this.F,this.g[7],c)){this.Z();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.O=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.yd(f)}while(0>1|b<<16;He(this,a);return a&65535}function Cf(a,b){a=b&128|b>>1|b<<8;He(this,a<<8);return a&255}function Df(a,b){a=b&~a;this.Da(a);return a}function Ef(a,b){a=b&~a;this.Da(a<<8);return a} +function Ff(a,b){a|=b;this.Da(a);return a}function Gf(a,b){a|=b;this.Da(a<<8);return a}function Hf(a,b){a=~b|65536;this.lb(a);return a&65535}function If(a,b){a=~b|256;this.lb(a<<8);return a&255}function Jf(a,b){this.I=this.L=a=b-a;this.G=b&(b^a);return a&65535}function Kf(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.G=b&(b^c);return a&255}function Lf(a,b){this.I=this.L=a=b+a;this.G=a&(b^a);return a&65535}function Mf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.G=c&(b<<8^c);return a&255} +function Nf(a,b){a=-b;this.lb(a,a&b&32768);return a&65535}function Of(a,b){a=-b;this.lb(a<<8,(a&b&128)<<8);return a&255}function Pf(a,b){a=b<<1|this.D>>16&1;He(this,a);return a&65535}function Qf(a,b){a=b<<1|this.D>>16&1;He(this,a<<8);return a&255}function Rf(a,b){a=(this.D&65536|b)>>1|b<<16;He(this,a);return a&65535}function Sf(a,b){a=((this.D&65536)>>8|b)>>1|b<<8;He(this,a<<8);return a&255}function Tf(a,b){var c=b-a;Ie(this,c,a,b);return c&65535} +function Uf(a,b){var c=b-a;Ie(this,c<<8,a<<8,b<<8);return c&255}function Vf(a,b){this.I=this.L=b&65280;this.G=this.D=0;return(b<<8|b>>8)&65535}function Wf(a,b){a^=b;this.Da(a);return a&65535}function Xf(a){R(this,a,Te(this,a),xf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function Yf(a){var b=We(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.D=this.G=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.G=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.v?6:7)+b} +function Zf(a){var b=We(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.D=this.G=0;b&=63;if(b&32){b=64-b;32>b-1;this.D=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.v?6:7)+b}function $f(a){P(this,a,!Ae(this))}function ag(a){P(this,a,Ae(this))} +function bg(a){R(this,a,Te(this,a),Df);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function cg(a){sf(this,a,Se(this,a),Ef);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function dg(a){R(this,a,Te(this,a),Ff);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function eg(a){sf(this,a,Se(this,a),Gf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function fg(a){var b=Te(this,a);a=We(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function gg(a){var b=Se(this,a);a=Ve(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function hg(a){P(this,a,Ce(this))}function ig(a){P(this,a,!De(this)==!Be(this))}function jg(a){P(this,a,!Ce(this)&&!De(this)==!Be(this))}function kg(a){P(this,a,!Ae(this)&&!Ce(this))} +function lg(a){P(this,a,Ce(this)||!De(this)!=!Be(this))}function mg(a){P(this,a,Ae(this)||Ce(this))}function ng(a){P(this,a,!De(this)!=!Be(this))}function og(a){P(this,a,De(this))}function pg(a){P(this,a,!Ce(this))}function qg(a){P(this,a,!De(this))}function rg(){this.qa(12,0,-9)}function sg(a){P(this,a,!0)}function tg(a){P(this,a,!Be(this))}function ug(a){P(this,a,Be(this))}function vg(a){a&1&&(this.D=0);a&2&&(this.G=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} +function wg(a){var b=Te(this,a);a=We(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Ie(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function xg(a){var b=Se(this,a);a=Ve(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Ie(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} +function yg(a){var b=We(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.D=this.G=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.G=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.G=32768,this.D=65536,this.b-=7}function zg(){this.qa(24,0,-9);this.b-=20} +function Ag(){this.w&49152?(this.P|=128,this.qa(4,0,-8)):(this.ra&&1120==this.ia&&this.ra.setData(this.g[0],!0),this.F?Bg(this.F):this.Z());this.b-=7}function Cg(){this.qa(16,0,-9);this.b-=20}var Dg=[0,7,7,10,7,11,9,13];function Eg(a){this.ja=this.b;ye(this,Ue(this,a));this.b=this.ja-Dg[this.v]}var Fg=[0,14,14,17,14,18,16,20];function Gg(a){this.ja=this.b;var b=Ue(this,a);a=a>>6&7;Je(this,this.g[a]);this.g[a]=this.g[7];ye(this,b);this.b=this.ja-Fg[this.v]} +var Hg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ig(a){var b=Te(this,a);this.ja=this.b;uf(this,a,b,this.Da);this.b=this.ja-Hg[(this.X?8:0)+this.v]+(7!=this.j||this.v?0:2)}function Jg(a){var b=Se(this,a);tf(this,a,b,65535,this.Da);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Kg=[7,13,13,17,14,18,17,21]; +function Lg(a){var b=We(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.G=0;this.D=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)ye(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Sg(a){R(this,a,Te(this,a),Tf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Tg(a){R(this,a,0,Vf);this.b-=this.v?9:3+(7==this.j?2:0)}function Ug(){this.qa(28,0,-9)} +function Vg(){this.ra&&(this.ra.kd(this.g[7],!0),this.ra.setData(this.g[0],!0));this.i|=8;Ee(this,-2);this.b-=3}function Wg(a){R(this,a,this.g[(a>>6&7)+this.mc],Wf);this.b-=this.v?9:3+(7==this.j?2:0)}function S(a){var b;if(b=this.F)b=this.F,A(b,1)?(D(b,"undefined opcode "+K(b,a),!0,!0),b=Bg(b)):b=!1;b||this.qa(8,0,-9)}function ue(a){Xg[a>>12].call(this,a)}function Yg(a){Zg[a>>6&3].call(this,a)}function $g(a){ah[a>>6&3].call(this,a)}function bh(a){ch[a>>6&3].call(this,a)} +function dh(a){eh[a&15].call(this,a)}function fh(a){gh[a&15].call(this,a)}function hh(a){ih[a>>6&3].call(this,a)}function jh(a){kh[a>>6&3].call(this,a)}function lh(a){mh[a>>6&3].call(this,a)} +var Xg=[function(a){nh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Xf,S,function(a){oh[a>>8&15].call(this,a)},Jg,xg,gg,cg,eg,Sg,S],nh=[function(a){ph[a>>4&15].call(this,a)},sg,pg,hg,ig,ng,jg,lg,Gg,Gg,Yg,$g,bh,S,S,S],Zg=[function(a){uf(this,a,0,this.lb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Hf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,1,Lf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,1,Jf);this.b-=this.v?9:3+(7==this.j?2:0)}],ah=[function(a){R(this,a,0,Nf); +this.b-=this.v?11:6},function(a){R(this,a,Ae(this)?1:0,xf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,Ae(this)?1:0,Tf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=We(this,a);this.lb(a);this.b-=this.v?4:3+(7==this.j?2:0)}],ch=[function(a){R(this,a,0,Rf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Pf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Bf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,zf);this.b-=this.v?9:3+(7==this.j?2:0)}],ph= +[function(a){qh[a&15].call(this,a)},S,S,S,Eg,Eg,Eg,Eg,Og,S,dh,fh,Tg,Tg,Tg,Tg],qh=[Ag,Vg,Pg,rg,Cg,Ng,S,S,S,S,S,S,S,S,S,S],eh=[Mg,function(){this.D=0;this.b-=5},function(){this.G=0;this.b-=5},vg,function(){this.L=1;this.b-=5},vg,vg,vg,function(){this.I=0;this.b-=5},vg,vg,vg,vg,vg,vg,vg],gh=[Mg,function(){this.D=65536;this.b-=5},function(){this.G=32768;this.b-=5},Qg,function(){this.L=0;this.b-=5},Qg,Qg,Qg,function(){this.I=32768;this.b-=5},Qg,Qg,Qg,Qg,Qg,Qg,Qg],oh=[qg,og,kg,mg,tg,ug,$f,ag,zg,Ug,hh,jh, +lh,S,S,S],ih=[function(a){tf(this,a,0,255,this.lb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,0,If);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,1,Mf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,1,Kf);this.b-=this.v?9:3+(7==this.j?2:0)}],kh=[function(a){sf(this,a,0,Of);this.b-=this.v?11:6},function(a){sf(this,a,Ae(this)?1:0,yf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,Ae(this)?1:0,Uf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=Ve(this, +a);this.lb(a<<8);this.b-=this.v?4:3+(7==this.j?2:0)}],mh=[function(a){sf(this,a,0,Sf);this.b-=this.v?9+(this.Hc&1):3+(7==this.j?2:0)},function(a){sf(this,a,0,Qf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,0,Cf);this.b-=this.v?9+(this.Hc&1):3+(7==this.j?2:0)},function(a){sf(this,a,0,Af);this.b-=this.v?9:3+(7==this.j?2:0)}];function ve(a){rh[a>>12].call(this,a)} +var rh=[function(a){sh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Xf,function(a){th[a>>8&15].call(this,a)},function(a){uh[a>>8&15].call(this,a)},Jg,xg,gg,cg,eg,Sg,S],sh=[function(a){vh[a>>4&15].call(this,a)},sg,pg,hg,ig,ng,jg,lg,Gg,Gg,Yg,$g,bh,function(a){wh[a>>6&3].call(this,a)},S,S],wh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.na(a|this.Ga);ye(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Qe(this,a,0);this.Da(a);Je(this,a);this.b-=11},function(a){var b=Le(this); +this.ja=this.b;this.Da(b);Re(this,a,0,b);this.b=this.ja-Kg[this.v]},function(a){uf(this,a,De(this)?65535:0,this.Da);this.b-=this.v?9:3+(7==this.j?2:0)}],vh=[function(a){xh[a&15].call(this,a)},S,S,S,Eg,Eg,Eg,Eg,Og,function(a){!(a&8)||1145>this.ia?S.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},dh,fh,Tg,Tg,Tg,Tg],xh=[Ag,Vg,function(){Ke(this);this.i|=this.w&16;this.b-=13},rg,Cg,Ng,Pg,function(a){S.call(this,a)},S,S,S,S,S,S,S,S],th=[Lg,Lg,yg,yg,Yf,Yf,Zf,Zf, +Wg,Wg,S,S,S,S,Rg,Rg],uh=[qg,og,kg,mg,tg,ug,$f,ag,zg,Ug,hh,jh,lh,function(a){1145>this.ia?S.call(this,a):yh[a>>6&3].call(this,a)},S,S],yh=[function(a){S.call(this,a)},function(a){a=Qe(this,a,65536);this.Da(a);Je(this,a);this.b-=11},function(a){var b=Le(this);this.ja=this.b;this.Da(b);Re(this,a,65536,b);this.b=this.ja-Kg[this.v]},function(a){S.call(this,a)}]; +function zh(a){q.call(this,"ROM",a,128);this.ea=this.g=null;this.v=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Ta(this.j);if(this.j){a=this.j;var b=Ua(this.B);"json"!=b&&"hex"!=b&&(a=hb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;fb(a,null,!0,function(a,b,f){f?(c.S("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(va(c.pb,a,b),(a=gb(a,b))?(c.g=a.aa,c.ea=a.ea):c.j=null);Ah(c)})}}p(zh,q); +h=zh.prototype;h.za=function(a,b,c,d){this.C=b;this.f=c;this.F=d;Ah(this)};h.Ca=function(){this.ea&&(this.F&&Bh(this.F,this.id,this.v,this.b,this.ea),delete this.ea);return!0};h.Ba=function(){return!0}; +function Ah(a){if(!Ia(a)){if(a.j){if(!a.g||!a.C)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Ga(a,"ROM size ("+F(a.g.length,8,!0)+") does not match specified size ("+F(a.b,8,!0)+")");else{var b;a:{b=a.v;if(57344<=b&&b<57344+Rc){var c={},c=(c[b]=[zh.prototype.cg,zh.prototype.lh,null,null,null,a.b>>1],c);if(bc(a.C,a,c)){a.status("Added "+a.b+"-byte ROM at "+E(b));b=a.w=!0;break a}}else if(Xc(a.C,b,a.b,Gd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){D(a,"invalid block at offset "+Sa(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,C=r-=6;0=b.length){D(a,"insufficient data for block at offset "+Sa(n),4096); +break}m+=b[l++]&255;if(m&255){D(a,"invalid checksum ("+F(m,2,!0)+") for block at offset "+Sa(n),4096);break}if(C)for(D(a,"loading "+Sa(C)+" bytes at "+Sa(u)+"-"+Sa(u+C),4096);C--;)fd(a.C,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&D(a,"starting address: "+Sa(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=ta.nd&&c<=ta.We&&(b=c-(ta.nd-ta.ke));b&&(a.preventDefault&&a.preventDefault(),d.Bc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ta.me&&(b=ta.le);d.Bc(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Bc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;var e=this;this.P=od(this.f,this.M?-1:48,4,262144);this.R=ld(this.f,function(){var a;a=-1;e.i.length&&(a=e.i.shift()&255,D(e,"receiveByte("+F(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),nd(e.f,e.R,1E3/Math.round(e.U/10)));0<=a&&(e.D=a,e.b&128?e.D|=49152:e.b|=128,e.b&64&&md(c,e.P))});this.N=od(this.f,this.M?-1:52,4,262144);this.X=ld(this.f,function(){e.g|=128;e.g&64&&md(c,e.N)});bc(b,this,Ih,this.M?64832+8*(this.M-1)-65392:0);dc(b,this.reset.bind(this)); +y(this)};h.ae=function(a){if(!this.j){var b=ee(this.K,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Za(c[0]);if(d!=this.Fb)return;c=Za(c[1]);if(this.j=Ba(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.G=e.receiveData){this.I=a;this.O=e.receiveStatus;this.status("Connected "+this.pb+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +h.Ca=function(a,b){if(!b)if(this.ae(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.Ba=function(a){return a?this.save():!0};h.reset=function(){Jh(this)};h.save=function(){var a=new G(this);a.set(0,[this.D,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Jh(this,a[0])};function Jh(a,b){b||(b=[0,8192,128,a.i]);b=ja(b);a.D=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0} +h.Bc=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Ya("",c)));this.V&&!this.B&&c&&(b=String.fromCharCode(this.V)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.B+=c}}else if(null!=this.w){if(10== +a||1024<=this.w.length)this.u(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}nd(this.f,this.X,1E3/Math.round(this.Y/10));this.g&=-129};var Hh="buffer",Kh={},Ih=(Kh[65392]=[null,null,Gh.prototype.Qf,Gh.prototype.Yg,"RCSR"],Kh[65394]=[null,null,Gh.prototype.Pf,Gh.prototype.Xg,"RBUF"],Kh[65396]=[null,null,Gh.prototype.vg,Gh.prototype.Eh,"XCSR"],Kh[65398]=[null,null,Gh.prototype.ug,Gh.prototype.Dh,"XBUF"],Kh); +yb(function(){for(var a=x(document,w,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.H[b]=c,!0;case "readTape":e=Oh;case "loadTape":return e||(e=Ph),this.H[b]=c,c.onclick= +function(){var a=d.H.listTapes;a&&Qh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.N){c.parentNode.removeChild(c);break}this.H[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Qh(d,Ta(b,!0),b,Ph,a)}return!1};return!0;case Rh:return this.H[b]=c,!0}return!1}; +h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;this.I=Sh(a);var e=this;if(a=Lh(this,ee(this.K,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.G=od(this.f,56,4,4096);this.P=ld(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=Ua(c),f="json"==e||"gz"==e?encodeURI(c):hb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!fb(f,null,!0,function(e,f,g){var k=0>g&&!!a.K&&!a.K.A.ca;g?a.S('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(va(a.pb,e,f),(e=gb(e,f))&&ci(a,b,c,d,e.aa,e.wa, +e.va));a.A.jb=!1;a.g&&(a.g--,a.g||y(a));$h(a)})}function Vh(a,b,c,d){if((a=a.H.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ba);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ua(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Va(c,"/")&&(d="dir"),f=hb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.dd?"":e)+"&format=json"));return!!fb(f, +null,!0,function(b,c,d){ki(a,b,c,d)})} +function ki(a,b,c,d){var e=null,f=0>d&&!!a.K&&!a.K.A.ca;a.j=!1;if(d)a.controller.S('Unable to load disk "'+a.bb+'" (error '+d+": "+b+")",f);else{va(a.controller.pb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)v(k[0]);else{a.ba=k.length;a.ma=k[0].length;a.ga=k[0][0].length;var l=k[0][0][0];a.xa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,C=u.length;C>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ja?f=a.Sa+a.Ja&&(a.Ja+=f-(a.Sa+a.Ja)+1):(a.Sa=f,a.Ja=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.S("Unable to restore disk '"+this.bb+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=mi(this,a++);)Ii(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function Ii(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var gi=0;function Ji(a,b,c,d,e,f){q.call(this,a,b,c);this.L=Ki(this,b.autoMount);this.G=0;this.O=d;this.P=e;this.R=f;this.N=d.rd;this.i=Array(this.N);this.M=!mb("Mobi")&&window&&"FileReader"in window;this.v=[];this.Lb=null;this.exports={selectDrive:this.yg}}p(Ji,q); +function Ki(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Ji.prototype; +h.ta=function(a,b,c){var d=this;switch(b){case "listDisks":return this.H[b]=c,c.onchange=function(){var a=d.H.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v(d.type+" option error: "+k.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.H[b]=c,c.onchange=function(){var a=La(c.value,10);null!=a&& +Li(d,a)},!0;case "loadDisk":return this.H[b]=c,c.onclick=function(){var a=d.H.listDisks;a&&a.options&&Mi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.H[b]=c,c.onclick=function(){var a,b=d.H.listDrives,b=b&&La(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.S("Unable to boot the selected drive"):a.ya?(xe(d.f,0,!0),(a=d.hc(a,0,0,0,512,0,2))&&d.S("Unable to read the boot sector ("+a+")")):d.S("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c); +break}this.H[b]=c;c.onclick=function(){var a=d.H.listDrives;if(a&&a.options&&d.i)if(a=d.i[La(a.value,10)||0])if(a=a.ya){var b;b="";for(var c=0,k;k=mi(a,c++);)for(var l=0,m=k.length;lg||9e||e>=a.i.length)a.S("Unable to load the selected drive");else if(c)if(c==Pi)a.S('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Qi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Ta(c);a.status("Attempting to load "+c+' as "'+b+'"')}Vi(a,e,b,c,!1,d)}else Si(a,e)} +function Vi(a,b,c,d,e,f){var g=-1,k=a.i[b];k.Na.toLowerCase()!=d.toLowerCase()&&(g++,Si(a,b,!0),k.cd?a.S(a.type+" busy"):(k.cd=!0,e&&(k.bd=!0,a.G++,A(a)&&D(a,"auto-loading disk: "+c)),k.yc=!!f,ji(new fi(a,k,"preload"),c,d,f,a.cf)&&g++));return g} +h.cf=function(a,b,c,d,e){a.cd=!1;b&&(b.ba>a.ba||b.ma>a.ma)&&(this.S('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.Ac)),b=null);if(b){a.ya=b;a.bb=c;a.Na=d;a:{var f;for(f=0;f=a.ba){m=U.rc;break}n=a.seek(b,c,d+1);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=U.sc;break}if(!k&&(xc(this.C,Me(this.f,f),u|t<<8),kd(this.C))){m=U.Vb;break}r>=a.xa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Fc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ya;var n=null,r;a||(m=U.Ad,e=0);for(;e;){var u=zc(this.C,Me(this.f,f));if(kd(this.C)){m=U.Vb;break}if(!n){if(b>=a.ba){m=U.rc;break}n=a.seek(b,c,d+1,!0);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}if(k){var t,C;if(0>(t=a.read(n,r++))||0>(C=a.read(n,r++))){m=U.sc;break}if(u!=(t|C<<8)){m=U.Od;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=U.sc;break}r>=a.xa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Ce=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&~T.Db|f>>16-T.ka.Db&T.Db;this.B=65536-e&65535;this.j=this.j&~Yi.Xc|d&Yi.Xc;this.g|=a;Zi(this);return!0};function Zi(a){a.b&=~T.Ub;a.g&&(a.g|=U.pe,a.b|=T.Ub,a.g&U.Oc&&(a.b|=T.Oc),A(a)&&D(a,a.type+": ERROR: "+E(a.g)))}h.Vf=function(){return this.I};h.dh=function(){};h.Wf=function(){return this.g};h.eh=function(){};h.Sf=function(){return this.b&T.Wc}; +h.$g=function(a){this.b=this.b&~T.qb|a&T.qb;if(this.b&T.vd){a=!0;var b,c,d="",e=(this.j&Yi.nb)>>Yi.ka.nb,f=this.i[e],g,k,l,m,n,r;this.b&=~(T.Wa|T.Yc);this.g&=~U.Ne;switch(c=this.b&T.Pa){case $i.je:A(this)&&D(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=T.Wa;break;case $i.ye:d="RCHK";case $i.Ae:d||(d="READ"),b=this.hc;case $i.Zc:d||(d="WCHK");case $i.Ve:d||(d="WRITE");b||(b=this.Fc);g=(this.j&Yi.Tb)>>Yi.ka.Tb;k=(this.j&Yi.Pc)>>Yi.ka.Pc;l=this.j&Yi.Xc;m=65536-this.B&65535;n=(this.b&T.Db)<< +16-T.ka.Db|this.w;r=this.b&T.we?0:2;A(this)&&D(this,this.type+": "+d+"("+g+":"+k+":"+l+") "+E(n)+"--"+E(n+(m<<1)),!0,!0);if(g>=f.ba){this.g|=U.rc;break}if(l>=f.ga){this.g|=U.sc;break}a=b.call(this,f,g,k,l,m,n,r,c>=$i.Zc,this.Ce.bind(this));break;case $i.xc:g=(this.j&Yi.Tb)>>Yi.ka.Tb;A(this)&&D(this,this.type+": SEEK("+g+")",!0);g(n=a.read(k,m++))||0>(r=a.read(k,m++))){g=cj.Xa;break}xc(this.C,Me(this.f,f),n|r<<8);if(kd(this.C)){g=cj.Vb;break}f+=2;e--;if(m>=a.xa&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ba)))){g=cj.Xa;break}}return l?l(g,b,c,d,e,f):g}; +h.Fc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.ya;k=null;var m;a||(g=cj.Xa,e=0);for(;e;){var n=zc(this.C,Me(this.f,f));if(kd(this.C)){g=cj.Vb;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=cj.Xa;break}m=0}if(!a.write(k,m++,n&255)||!a.write(k,m++,n>>8)){g=cj.Xa;break}if(m>=a.xa&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ba)))){g=cj.Xa;break}}return l?l(g,b,c,d,e,f):g}; +h.He=function(a,b,c,d,e,f){this.D=f&65535;this.b=this.b&~V.Va|f>>16-V.ka.Va&V.Va;this.w=f>>16&dj.Vc;this.j=this.g=b<>V.ka.Va;if(!(this.b&V.Wa)){a=!0;var b,c="",d=this.i[(this.b&V.nb)>>V.ka.nb],e=d.ya,f,g,k;this.b&=~V.Cb;switch(this.b&V.Pa){case fj.Re:this.B&gj.wd&&(this.b&=V.Cb|V.Pa|V.Va);this.B=d.status|this.j&ej.wc|(e&&512==e.ba?gj.te:0);break;case fj.xc:(this.g&ej.se)==ej.Oe&&(b=this.g&ej.Wb,c=(this.g&ej.Qe)<<2,this.j=this.g&ej.Pe?this.j+b:this.j-b,this.g=this.j=this.j&ej.Wb|c);break;case fj.Be:this.B=this.j;break;case fj.ze:c="READ",b=this.hc; +case fj.Ue:c||(c="WRITE"),b||(b=this.Fc),f=this.g>>ej.ka.Wb,g=this.g&ej.wc?1:0,k=this.g&ej.Hd,!e||f>=e.ba||k>=e.ga?this.b=this.b|cj.Xa|V.Ub:(a=65536-this.B&65535,e=(this.w&dj.Vc)<<16|this.D,A(this)&&D(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+E(e)+"--"+E(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,2,!1,this.He.bind(this)))}a&&(this.b=this.b|V.Cb|V.Wa,this.b&V.Rc&&md(this.f,this.Lb))}};h.Yf=function(){return this.D};h.gh=function(a){this.D=a&hj.qb};h.ag=function(){return this.g}; +h.jh=function(a){this.g=a};h.bg=function(){return this.B};h.kh=function(a){this.B=a};h.Zf=function(){return this.w};h.hh=function(a){this.w=a&dj.Vc;this.b=this.b&~V.Va|(this.w&3)<a.v&&a.j.length&&(a.v=0);if(0>a.v||b!=a.j[a.v])a.j.splice(0,0,b),a.v=0;a.v--}else a.O?b="end":b=a.j[a.v+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(Za(b.substring(c,f))),c=f+1}}return a} +function lj(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function rj(a,b,c){var d;if(b){b=sj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=H(c,0,!0)+" "+c+". "+F(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.v((null!=b?b+": ":"")+d);return e} -function wj(a,b){if(b)return vj(a,b,a.U[b]);var c=0;for(b in a.U)vj(a,b,a.U[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function xj(a){oj.call(this,a);this.Ea=!1;this.ja=!0;this.H=W();this.za=W();this.N=W();this.B=[];this.g=this.L=this.F=[];yj(this);this.R=this.Z=0;this.i=[];this.oa=void 0;zj(this);this.G=this;this.ka={};this.ia=this.Ed=0;this.S=null;this.M=[];Aj(this,a.messages);this.ua=a.commands;this.Ha=Bj;this.W=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.X=this.la=0;this.b=this.V=null;var b=this;window?void 0===window[x]&&(window[x]=function(a){return ie(b,a)}):void 0===global[x]&&(global[x]= -function(a){return ie(b,a)})}p(xj,oj);function Cj(a){a=a&&a.K;null==a&&(a=-1);return a}function W(a,b,c){return{K:void 0===a?null:a,Ka:void 0===b?!1:b,Qa:!1,Ca:c}}h=xj.prototype;h.Wc=function(a,b){a.K=b;a.Qa=!1;a.Ca=void 0;return a};function Dj(a){return[a.K,a.Ka,a.Ca,a.Qa,a.tc]}function Ej(a,b){var c=W(b[0],b[1],b[2]);c.Qa=b[3];b[4]&&(c.Bd=pj(a,c.tc=b[4]));return c} -h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.b=a.i;(a=de(a,"messages"))&&Aj(this,a);1140>this.f.ka&&(this.W=this.W.concat(Fj));1145>this.f.ka&&(this.W=this.W.concat(Gj));pd(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=Cj(Hj(d,c));if(-1===a){d.v("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.v("blockid physical blockaddr used size type");d.v("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.v("..."): -(c=n.type,m=bd[c],n&&d.v(H(n.id,8)+" %"+H(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -h.Kd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Nj:b=zd(this.f);break;case Oj:b=c.Va;break;case Pj:b=c.R;break;case Qj:b=c.za&65280;break;case Rj:b=td(c);break;case Sj:b=vd(c);break;case Tj:b=wd(c);break;case Uj:b=c.V;break;case Vj:d&&(b=d.ga);break;case Wj:d&&(b=d.Sa);break;case Xj:d&&Mc(d)&&(b=d.Ta)}}return b}; -h.message=function(a,b){b&&(a+=" @"+Kj(this,W(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.ia&1073741824)this.M.push(a);else{var c;if(this.ia&-2147483648&&this.f&&(c=this.f.A.T)||Ia(this,!0))this.ba(),c&&(a+=" (cpu halted)");this.v(a);this.f&&(a=this.f,oe(a),a.ub=0,a.J&&J(a.J,void 0))}}; -function zj(a){var b;if(!uf(a))a.i&&a.i.length&&a.v("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Yj);for(b=0;b>8;a.v("trapped to "+M(a,c&255,1)+" ("+(0>d?Mb[-d]:M(a,d))+")")}a.H=W(a.f.g[7]);b&&1!=a.I?ck(a):dk(a)}}function ak(a,b){var c;(c=!a.f||!Ha(a.f))||(c=a.f,c.A.fa?c=!0:(c.v(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.T?(b||a.v("cpu busy or unavailable, command ignored"),!1):!Ga(a.f)}h.ya=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; -h.xa=function(a,b){b&&this.v(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){zj(this);this.X=0;this.S=null;this.w=0;this.H=W(this.f.g[7]);this.A.T=!1;ek(this);a||ge(this)};h.save=function(){var a=new I(this);a.set(0,Dj(this.H));a.set(1,Dj(this.N));a.set(2,[this.j,this.P,this.ia]);a.set(3,this.B);return a.data()}; -h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=Ej(this,a[b++]),this.N=Ej(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.ia|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.v("running");this.A.T=!0;this.Fa=a;this.Ga=b}; -h.stop=function(a,b){if(this.A.T){this.A.T=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Kc(a.f,b)),65535!=(d&65535)&&(a.Wc(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function Ag(a){var b=a.f;if(b.A.T)throw xe(b,a.f.P&65535),a.ba(),-1;return!1}function Yd(a,b,c){fk(a,b,c||1,a.L)&&a.ba(!1)}function Zd(a,b,c){fk(a,b,c||1,a.F)&&a.ba(!1)} -function yj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Oe(a.f,!1);a.L=["br"];if(a.F)for(b=1;b>>c.g],!0)):Oe(a.f,!0);a.F=["bw"];a.la=0;a.Z=0} -h.tb=function(a,b,c){var d=!0;c||gk(this,a,b,!1,!0);if(a!=this.g){var e=Cj(b);if(-1===e)this.v("invalid address: "+Kj(this,b)),d=!1;else{var f=a==this.F;65535>>g.g].tb(e&g.i,f)}else e=this.f,(f?e.bc++:e.ac++)||ve(e)}}d&&(a.push(b),c?b.Qa=!0:(hk(this,a,a.length-1,"set"),zj(this)));return d}; -function gk(a,b,c,d,e){var f=!1;c=Cj(c);for(var g=1;g>>d.g],b)):Oe(a.f,b));k.Qa||zj(a);break}}return f}function ik(a,b){for(var c=1;c>23)&65535,z=M(t,u);else if(D==ok)u=u.K-((f&63)<<1)&65535,z=M(t,u);else if(D==pk)z=M(t,f&7,1);else if(D==qk)z=M(t,f&63,1);else if(D==rk)z=M(t,f&255,1);else if(D=f&E,E&sk&&(D>>=6,E>>=6),E&Y){var E=null,G=D& -tk;switch(D&uk){case 0:z=Mj(G);break;case 8:z="@"+Mj(G);E=vk(t,t.f.g[G]);break;case 16:7>G?z="("+Mj(G)+")+":(D=t.Oa(u,2),z="#"+M(t,D,0,!0));break;case 24:7>G?z="@("+Mj(G)+")+":(D=t.Oa(u,2),z="@#"+M(t,D,0,!0),E=vk(t,D));break;case 32:z="-("+Mj(G)+")";break;case 40:z="@-("+Mj(G)+")";break;case 48:D=t.Oa(u,2);z=M(t,D,0,!0)+"("+Mj(G)+")";7==G&&(z=M(t,D=D+u.K&65535),E=vk(t,D));break;case 56:D=t.Oa(u,2),z="@"+M(t,D)+"("+Mj(G)+")",7==G&&(z="@"+M(t,D=D+u.K&65535),E=vk(t,Kc(t.f,D)))}E&&(z=[z,E])}t=z;if(!t|| -!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.mb&&b=c.B&&(b=c.Ma[b&id])&&(a=b[4]);return a}function wk(a,b){switch(b){case "N":a=Ce(a.f);break;case "Z":a=Be(a.f);break;case "V":a=Ae(a.f);break;case "C":a=ze(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} -function Z(a,b){var c="",d=a.f;if(8>b)c=Mj(b),c+="="+M(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+M(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+M(a,d.W[b-16]);else switch(b){case Nj:c="PS="+M(a,zd(d));break;case Oj:c="PI="+M(a,d.Va);break;case Pj:c="ER="+M(a,d.R);break;case Qj:c="SL="+M(a,d.za&65280);break;case Rj:c="M0="+M(a,td(d));break;case Sj:c="M1="+M(a,vd(d));break;case Tj:c="M2="+M(a,wd(d));break;case Uj:c="M3="+M(a,d.V);break;case Vj:a.b&&(c="AR="+M(a,a.b.ga,3));break;case Wj:a.b&&(c="DR="+ -M(a,a.b.Sa));break;case Xj:a.b&&Mc(a.b)&&(c="SR="+M(a,a.b.Ta,3))}c&&(c+=" ");return c}function xk(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Nj)+Z(a,Oj)+Z(a,Qj);d+=wk(a,"T")+wk(a,"N")+wk(a,"Z")+wk(a,"V")+wk(a,"C");b&&(b=d,c=""+(Z(a,Rj)+Z(a,Sj)),c+=Z(a,Tj)+Z(a,Uj)+Z(a,Pj),c=c+"\n"+(Z(a,Xj)+Z(a,Vj)+Z(a,Wj)),d=b+("\n"+c));return d}h.Fd=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=cb(n,l,a.Fd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({Hi:b,K:c,Ke:d,ha:e,Cd:f})}function yk(a,b,c){var d=[],e=Cj(b)>>>0;for(b=0;b>>0,k=f.Ke;if(e>=g&&eb)){e.g[b]= -g&65535;break}a.v("unknown register: "+f);return}J(a.J);a.v("updated registers:")}}a.v(xk(a,d));c&&(a.H=W(e.g[7]),dk(a,Kj(a,a.H)))}}function Ck(a,b){b=ab(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.v(m)}k[3]&&(g=k[3],f=null);f=kk(a,b,g,f);a.v(f);a.H=b;e-=b.K-l;c++}}} -function jk(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.v(bk+b):(a.P&&(a.v("ended assemble at "+Kj(a,a.N)),a.H=a.N,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(Ha(a)&&0n||"z"Ka.length&&(a.v("note: only "+Ka.length+" available"),ua=Ka.length);Aa-=ua;0>Aa&&(null==Ka[Ka.length-1].K?(ua=Aa+ua,Aa=0):Aa+=Ka.length);var $e=[];"call"==xi&&(yc=1E5,$e=["CALL"]);for(void 0!==wi&&a.v(ua+" instructions earlier:");0=Ka.length&&(Aa=0);a.oa=ua;zi++;yc--}}zi||(a.v("no "+yi+"history available"),a.oa=void 0)}else{var ha=Hj(a,Ja);if(ha)if("da"==Ya){var af=ha.Ka||65535L.length?(2nb&&(nb=0);65536ef?String.fromCharCode(ef):"."),Ld=Ld>>8}pb&&(pb+="\n");pb=bf?pb+(qb+","):pb+(Ja+": "+qb+(Kd?"":" "+df))}pb&&a.v(pb);a.za=ha;a.Ca=fl}}}}break;case "e":if("else"== -g[0])break;var Tb,ff,gf,hf,jf=g[0],kf=g[1];"eb"==jf?(Tb=1,ff=255,gf=a.cd,hf=a.dd):"e"==jf||"ew"==jf?(Tb=2,ff=65535,gf=a.Oa,hf=a.de):kf=null;if(null==kf)a.v("edit memory commands:"),a.v("\teb [a] [...] edit bytes at address a"),a.v("\tew [a] [...] edit words at address a");else{var Md=Hj(a,kf);if(Md)for(var Nd=2;Ndnf;){for(var rb=null,jl=256;65536>Ec.K>>>0;){of.K=a.Oa(Ec,2);if(null==Ec.K||!jl--)break;if(!(of.K&1)){for(var kl=a,Od=of,Ei=null,Fc=Od.K,Fi=Fc,pf=1;6>=pf&&Fc;pf++){if(2> ";yb(function(){for(var a=y(document,x,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.v("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bKk){if(Lk(d,this.I)){this.u=new I(this,"1.32.2",Uk);Lk(this.u)&&(Vk(this,d),a=Wk,Xk(this.u));this.u.set(Rk,db());Yk(this.u);var e=this.b&&!this.F;if(a==Sk||za("Click OK to restore the previous "+Hb+" machine state, or CANCEL to reset the machine.")){if(c=Qk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Lk(d,g):("error"==f&&"no machine state"!= -g?(this.O("Error: "+g),"unable to verify user"==g&&(kb(Zk,""),this.g=null)):this.v(f+": "+g),Xk(d),Lk(d)?(c=Qk(d),e=!0):c=!1))}e&&Ok(this,c?d:null)}else a==Wk&&d.clear()}else Ok(this);delete this.I;delete this.w}e=Ba(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.A.fa=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.f&&($k(this,this.f,b,c,a),J(this,-2),this.f.va());this.N&&(Vk(this,b),b.clear());!c&&this.u&&(this.u.clear(),delete this.u);this.j=0}; -function Vk(a,b){if(za("There may be a problem with your "+Hb+" machine.\n\nTo help us diagnose it, click OK to send this "+Hb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Hb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;eb("http://www.pcjs.org/api/v1/report",d,!0)}} -function Ek(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new I(a,"1.32.2"),g=new I(a,"1.32.2",Pk),k=db();g.set(Rk,k);f.set(Rk,k);f.set(al,"1.32.2");f.set(bl,window?window.location.href:null);f.set(el,window?window.navigator.userAgent:"");a.f&&a.f.xa&&(c&&(b&&(a.f.A.va=a.f.A.T),a.f.ba()),d=a.f.xa(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.fa=!1,!1===d&&(e=null)));for(var k=Ba(a.id),l=0;l=d||30<=(c.Cc+=d))&&(e.textContent=c.A.T?c.pb.toFixed(2)+"Mhz":"Stopped",c.Cc=0)}if(a.i&&(a=a.i,b=b||0,a.u)){c=a.f.A.T;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;eb?a.ga=a.f.g[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");eb(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);vl(a,b,c)}})}else c(a,null)} -function wl(a,b,c,d){function e(a){if(void 0===k){var b=g&&y(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Va(a))}function f(a){e("Error: "+a);l&&(--sl||Cb(!0));l=!1}var g,k,l=!0;sl++;xa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?tl(c,null,null,!1,e,function(d,l){l?(wa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--sl||Cb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--sl||Cb(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?tl(b,a,d,!0,e,m):ul(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Cb(!1);return wl(a,b,c,d)};window.findMachineComponent=function(a,b){return Da(b,a+".machine")};window.enableEvents=Cb;window.sendEvent=Eb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11-dbg.map +function mj(a,b,c){var d;if(b){b=nj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=F(c,0,!0)+" "+c+". "+E(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.u((null!=b?b+": ":"")+d);return e} +function rj(a,b){if(b)return qj(a,b,a.U[b]);var c=0;for(b in a.U)qj(a,b,a.U[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; +function sj(a){jj.call(this,a);this.Ea=!1;this.ha=!0;this.G=W();this.ua=W();this.N=W();this.B=[];this.g=this.L=this.D=[];tj(this);this.P=this.Y=0;this.i=[];this.oa=void 0;uj(this);this.F=this;this.ia={};this.fa=this.Sd=0;this.R=null;this.M=[];vj(this,a.messages);this.ra=a.commands;this.Ha=wj;this.W=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.X=this.ja=0;this.b=this.V=null;var b=this;window?void 0===window[w]&&(window[w]=function(a){return je(b,a)}):void 0===global[w]&&(global[w]= +function(a){return je(b,a)})}p(sj,jj);function xj(a){a=a&&a.J;null==a&&(a=-1);return a}function W(a,b,c){return{J:void 0===a?null:a,Ka:void 0===b?!1:b,Ra:!1,Aa:c}}h=sj.prototype;h.kd=function(a,b){a.J=b;a.Ra=!1;a.Aa=void 0;return a};function yj(a){return[a.J,a.Ka,a.Aa,a.Ra,a.Cc]}function zj(a,b){var c=W(b[0],b[1],b[2]);c.Ra=b[3];b[4]&&(c.Pd=kj(a,c.Cc=b[4]));return c} +h.za=function(a,b,c,d){this.C=b;this.K=a;this.f=c;this.b=a.i;(a=ee(a,"messages"))&&vj(this,a);1140>this.f.ia&&(this.W=this.W.concat(Aj));1145>this.f.ia&&(this.W=this.W.concat(Bj));qd(this,16,function(a){a:{var b=d.C.b,c=a[0],e=a=0,l=b.length;if(c){a=xj(Cj(d,c));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.C.g;l=1}d.u("blockid physical blockaddr used size type");d.u("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.u("..."): +(c=n.type,m=cd[c],n&&d.u(F(n.id,8)+" %"+F(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} +h.Yd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Ij:b=Ad(this.f);break;case Jj:b=c.Za;break;case Kj:b=c.P;break;case Lj:b=c.ua&65280;break;case Mj:b=td(c);break;case Nj:b=wd(c);break;case Oj:b=xd(c);break;case Pj:b=c.V;break;case Qj:d&&(b=d.da);break;case Rj:d&&(b=d.Ta);break;case Sj:d&&Nc(d)&&(b=d.Ua)}}return b}; +h.message=function(a,b){b&&(a+=" @"+Fj(this,W(this.f.O&65535)));if(!this.R||a!=this.R)if(this.R=a,this.fa&1073741824)this.M.push(a);else{var c;if(this.fa&-2147483648&&this.f&&(c=this.f.A.T)||Ja(this,!0))this.Z(),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,pe(a),a.vb=0,a.K&&I(a.K,void 0))}}; +function uj(a){var b;if(!vf(a))a.i&&a.i.length&&a.u("instruction history buffer freed"),a.P=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Tj);for(b=0;b>8;a.u("trapped to "+K(a,c&255,1)+" ("+(0>d?Mb[-d]:K(a,d))+")")}a.G=W(a.f.g[7]);b&&1!=a.I?Xj(a):Yj(a)}}function Vj(a,b){var c;(c=!a.f||!Ia(a.f))||(c=a.f,c.A.ca?c=!0:(c.u(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.T?(b||a.u("cpu busy or unavailable, command ignored"),!1):!Ha(a.f)}h.Ca=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; +h.Ba=function(a,b){b&&this.u(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){uj(this);this.X=0;this.R=null;this.w=0;this.G=W(this.f.g[7]);this.A.T=!1;Zj(this);a||he(this)};h.save=function(){var a=new G(this);a.set(0,yj(this.G));a.set(1,yj(this.N));a.set(2,[this.j,this.O,this.fa]);a.set(3,this.B);return a.data()}; +h.restore=function(a){var b=0;void 0!==a[2]&&(this.G=zj(this,a[b++]),this.N=zj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.O=a[b][1],this.fa|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.u("running");this.A.T=!0;this.Fa=a;this.Ga=b}; +h.stop=function(a,b){if(this.A.T){this.A.T=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Ac(a.f,b)),65535!=(d&65535)&&(a.kd(a.i[a.P],b),++a.P==a.i.length&&(a.P=0)));return!1}function Bg(a){var b=a.f;if(b.A.T)throw ye(b,a.f.O&65535),a.Z(),-1;return!1}function Zd(a,b,c){ak(a,b,c||1,a.L)&&a.Z(!1)}function $d(a,b,c){ak(a,b,c||1,a.D)&&a.Z(!1)} +function tj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Pe(a.f,!1);a.L=["br"];if(a.D)for(b=1;b>>c.g],!0)):Pe(a.f,!0);a.D=["bw"];a.ja=0;a.Y=0} +h.wb=function(a,b,c){var d=!0;c||bk(this,a,b,!1,!0);if(a!=this.g){var e=xj(b);if(-1===e)this.u("invalid address: "+Fj(this,b)),d=!1;else{var f=a==this.D;65535>>g.g].wb(e&g.i,f)}else e=this.f,(f?e.gc++:e.fc++)||we(e)}}d&&(a.push(b),c?b.Ra=!0:(ck(this,a,a.length-1,"set"),uj(this)));return d}; +function bk(a,b,c,d,e){var f=!1;c=xj(c);for(var g=1;g>>d.g],b)):Pe(a.f,b));k.Ra||uj(a);break}}return f}function dk(a,b){for(var c=1;c>23)&65535,z=K(t,u);else if(B==jk)u=u.J-((f&63)<<1)&65535,z=K(t,u);else if(B==kk)z=K(t,f&7,1);else if(B==lk)z=K(t,f&63,1);else if(B==mk)z=K(t,f&255,1);else if(B=f&C,C&nk&&(B>>=6,C>>=6),C&Y){var C=null,H=B& +ok;switch(B&pk){case 0:z=Hj(H);break;case 8:z="@"+Hj(H);C=qk(t,t.f.g[H]);break;case 16:7>H?z="("+Hj(H)+")+":(B=t.Oa(u,2),z="#"+K(t,B,0,!0));break;case 24:7>H?z="@("+Hj(H)+")+":(B=t.Oa(u,2),z="@#"+K(t,B,0,!0),C=qk(t,B));break;case 32:z="-("+Hj(H)+")";break;case 40:z="@-("+Hj(H)+")";break;case 48:B=t.Oa(u,2);z=K(t,B,0,!0)+"("+Hj(H)+")";7==H&&(z=K(t,B=B+u.J&65535),C=qk(t,B));break;case 56:B=t.Oa(u,2),z="@"+K(t,B)+"("+Hj(H)+")",7==H&&(z="@"+K(t,B=B+u.J&65535),C=qk(t,Ac(t.f,B)))}C&&(z=[z,C])}t=z;if(!t|| +!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.ob&&b=c.B&&(b=c.Ma[b&jd])&&(a=b[4]);return a}function rk(a,b){switch(b){case "N":a=De(a.f);break;case "Z":a=Ce(a.f);break;case "V":a=Be(a.f);break;case "C":a=Ae(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} +function Z(a,b){var c="",d=a.f;if(8>b)c=Hj(b),c+="="+K(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+K(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+K(a,d.W[b-16]);else switch(b){case Ij:c="PS="+K(a,Ad(d));break;case Jj:c="PI="+K(a,d.Za);break;case Kj:c="ER="+K(a,d.P);break;case Lj:c="SL="+K(a,d.ua&65280);break;case Mj:c="M0="+K(a,td(d));break;case Nj:c="M1="+K(a,wd(d));break;case Oj:c="M2="+K(a,xd(d));break;case Pj:c="M3="+K(a,d.V);break;case Qj:a.b&&(c="AR="+K(a,a.b.da,3));break;case Rj:a.b&&(c="DR="+ +K(a,a.b.Ta));break;case Sj:a.b&&Nc(a.b)&&(c="SR="+K(a,a.b.Ua,3))}c&&(c+=" ");return c}function sk(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Ij)+Z(a,Jj)+Z(a,Lj);d+=rk(a,"T")+rk(a,"N")+rk(a,"Z")+rk(a,"V")+rk(a,"C");b&&(b=d,c=""+(Z(a,Mj)+Z(a,Nj)),c+=Z(a,Oj)+Z(a,Pj)+Z(a,Kj),c=c+"\n"+(Z(a,Sj)+Z(a,Qj)+Z(a,Rj)),d=b+("\n"+c));return d}h.Td=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=ab(n,l,a.Td);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({Dj:b,J:c,ef:d,ea:e,Qd:f})}function tk(a,b,c){var d=[],e=xj(b)>>>0;for(b=0;b>>0,k=f.ef;if(e>=g&&eb)){e.g[b]= +g&65535;break}a.u("unknown register: "+f);return}I(a.K);a.u("updated registers:")}}a.u(sk(a,d));c&&(a.G=W(e.g[7]),Yj(a,Fj(a,a.G)))}}function xk(a,b){b=Za(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.u(m)}k[3]&&(g=k[3],f=null);f=fk(a,b,g,f);a.u(f);a.G=b;e-=b.J-l;c++}}} +function ek(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(Wj+b):(a.O&&(a.u("ended assemble at "+Fj(a,a.N)),a.G=a.N,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.R=null;if(Ia(a)&&0n||"z"Na.length&&(a.u("note: only "+Na.length+" available"),wa=Na.length);Ca-=wa;0>Ca&&(null==Na[Na.length-1].J?(wa=Ca+wa,Ca=0):Ca+=Na.length);var $e=[];"call"==ri&&(Cc=1E5,$e=["CALL"]);for(void 0!==qi&&a.u(wa+" instructions earlier:");0=Na.length&&(Ca=0);a.oa=wa;ti++;Cc--}}ti||(a.u("no "+si+"history available"),a.oa=void 0)}else{var ia=Cj(a,Ma);if(ia)if("da"==cb){var af=ia.Ka||65535L.length?(2rb&&(rb=0);65536ef?String.fromCharCode(ef):"."),Od=Od>>8}tb&&(tb+="\n");tb=bf?tb+(ub+","):tb+(Ma+": "+ub+(Nd?"":" "+df))}tb&&a.u(tb);a.ua=ia;a.Aa=al}}}}break;case "e":if("else"== +g[0])break;var Wb,ff,gf,hf,jf=g[0],kf=g[1];"eb"==jf?(Wb=1,ff=255,gf=a.sd,hf=a.td):"e"==jf||"ew"==jf?(Wb=2,ff=65535,gf=a.Oa,hf=a.re):kf=null;if(null==kf)a.u("edit memory commands:"),a.u("\teb [a] [...] edit bytes at address a"),a.u("\tew [a] [...] edit words at address a");else{var Pd=Cj(a,kf);if(Pd)for(var Qd=2;Qdnf;){for(var vb=null,el=256;65536>Ic.J>>>0;){of.J=a.Oa(Ic,2);if(null==Ic.J||!el--)break;if(!(of.J&1)){for(var fl=a,Rd=of,yi=null,Jc=Rd.J,zi=Jc,pf=1;6>=pf&&Jc;pf++){if(2> ";yb(function(){for(var a=x(document,w,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.u("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bFk){if(Gk(d,this.G)){this.v=new G(this,"1.32.2",Pk);Gk(this.v)&&(Qk(this,d),a=Rk,Sk(this.v));this.v.set(Mk,bb());Tk(this.v);var e=this.b&&!this.B;if(a==Nk||za("Click OK to restore the previous "+Hb+" machine state, or CANCEL to reset the machine.")){if(c=Lk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Gk(d,g):("error"==f&&"no machine state"!= +g?(this.S("Error: "+g),"unable to verify user"==g&&(lb(Uk,""),this.g=null)):this.u(f+": "+g),Sk(d),Gk(d)?(c=Lk(d),e=!0):c=!1))}e&&Jk(this,c?d:null)}else a==Rk&&d.clear()}else Jk(this);delete this.G;delete this.w}e=Aa(this.id);for(f=0;fa[1];a=a[2];this.P=!0;this.A.ca=!0;var d=this.H.power;d&&(d.textContent="Shutdown");this.f&&(Vk(this,this.f,b,c,a),I(this,-2),this.f.sa());this.N&&(Qk(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0}; +function Qk(a,b){if(za("There may be a problem with your "+Hb+" machine.\n\nTo help us diagnose it, click OK to send this "+Hb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Hb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;fb("http://www.pcjs.org/api/v1/report",d,!0)}} +function zk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new G(a,"1.32.2"),g=new G(a,"1.32.2",Kk),k=bb();g.set(Mk,k);f.set(Mk,k);f.set(Wk,"1.32.2");f.set(Xk,window?window.location.href:null);f.set($k,window?window.navigator.userAgent:"");a.f&&a.f.Ba&&(c&&(b&&(a.f.A.sa=a.f.A.T),a.f.Z()),d=a.f.Ba(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.ca=!1,!1===d&&(e=null)));for(var k=Aa(a.id),l=0;l=d||30<=(c.Kc+=d))&&(e.textContent=c.A.T?c.rb.toFixed(2)+"Mhz":"Stopped",c.Kc=0)}if(a.i&&(a=a.i,b=b||0,a.v)){c=a.f.A.T;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;eb?a.da=a.f.g[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");fb(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);ql(a,b,c)}})}else c(a,null)} +function rl(a,b,c,d){function e(a){if(void 0===k){var b=g&&x(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Wa(a))}function f(a){e("Error: "+a);l&&(--nl||Cb(!0));l=!1}var g,k,l=!0;nl++;xa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?ol(c,null,null,!1,e,function(d,l){l?(va(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--nl||Cb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--nl||Cb(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ol(b,a,d,!0,e,m):pl(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Cb(!1);return rl(a,b,c,d)};window.findMachineComponent=function(a,b){return Da(b,a+".machine")};window.enableEvents=Cb;window.sendEvent=Eb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11-dbg.map diff --git a/versions/pdpjs/1.32.2/pdp11.js b/versions/pdpjs/1.32.2/pdp11.js index 486323bcb..c5e301ca6 100644 --- a/versions/pdpjs/1.32.2/pdp11.js +++ b/versions/pdpjs/1.32.2/pdp11.js @@ -15,6 +15,7 @@ http://pcjs.org/modules/pdp11/lib/keyboard.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/pc11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/rk11.js (C) Jeff Parsons 2012-2017 + http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/es6/state.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/es6/embed.js (C) Jeff Parsons 2012-2017 @@ -29,267 +30,252 @@ http://pcjs.org/modules/pdp11/lib/serial.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/disk.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/drive.js (C) Jeff Parsons 2012-2017 - http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/es6/debugger.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2017 */ -var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function da(){da=function(){};ba.Symbol||(ba.Symbol=ea)}var fa=0;function ea(a){return"jscomp_symbol_"+(a||"")+fa++} -function ga(){da();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ha(this)}});ga=function(){}}function ha(a){var b=0;return ia(function(){return b":62,"?":63,"@":64,zc:65,Ag:66,Cg:67,$g:68,E:69,fh:70,hh:71,ih:72,jh:73,kh:74,lh:75,mh:76,nh:77,oh:78,ph:79,rh:80,Q:81,th:82,uh:83,yh:84,Ah:85,Bh:86,Ch:87,Gh:88,Hh:89,Pd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ih:97,Jh:98,Kh:99,d:100,e:101,Lh:102,Mh:103,Nh:104,Oh:105,Rh:106,k:107,Sh:108,Th:109,n:110,Uh:111,p:112,q:113,r:114,Vh:115,t:116,Wh:117,Xh:118,Yh:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,nd:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Mc=b.comment;this.Kd=b;this.exports={};this.l=this.bindings={};a=this.id.indexOf(".");0>a?this.La=this.id:(this.Ma=this.id.substr(0,a),this.La=this.id.substr(a+1));this.j={ready:!1,Ta:!1,qc:!1,S:!1,error:!1};this.Nb=null;this.j.error=!1;this.Jc=c||0;this.F=this.c=this.v=this.A=this.eb=null;r.push(this)}function ta(a,b,c){ua[a]&&b&&(ua[a][b]=c)} +var ra={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},sa={Vg:0,zd:1,$g:2,ah:3,bh:4,dh:5,eh:6,fh:7,Oc:8,gh:9,Ad:10,hh:11,ih:12,Bd:13,jh:14,kh:15,lh:16,mh:17,nh:18,oh:19,ph:20,qh:21,rh:22,sh:23,th:24,uh:25,vh:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42, +"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Nc:65,Ug:66,Xg:67,wh:68,E:69,Ch:70,Eh:71,Qh:72,Sh:73,Th:74,Uh:75,Vh:76,Yh:77,$h:78,bi:79,ei:80,Q:81,gi:82,ii:83,ri:84,ti:85,vi:86,wi:87,Ai:88,Bi:89,ke:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ci:97,Di:98,Gi:99,d:100,e:101,Hi:102,Ii:103,Ji:104,Ki:105,Oi:106,k:107,Pi:108,Qi:109,n:110,Ri:111,p:112,q:113,r:114,Si:115,t:116,Ui:117,Vi:118,Wi:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,Cd:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Zc=b.comment;this.ge=b;this.exports={};this.m=this.bindings={};a=this.id.indexOf(".");0>a?this.ab=this.id:(this.Na=this.id.substr(0,a),this.ab=this.id.substr(a+1));this.j={ready:!1,Va:!1,Ac:!1,P:!1,error:!1};this.Vb=null;this.j.error=!1;this.Xc=c||0;this.F=this.c=this.u=this.A=this.hb=null;r.push(this)}function ta(a,b,c){ua[a]&&b&&(ua[a][b]=c)} function va(){return Date.now()||+new Date}function u(a){window&&window.alert(a)}function wa(a){var b=!1;window&&(b=window.confirm(a));return b}function xa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=3;return""+c}function Da(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} -function D(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Ha[a]})}function Ja(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} -var Ha={"&":"&","<":"<",">":">",'"':""","'":"'"},Ka={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; -function La(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function E(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, +function Ca(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return""+c}function Ea(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} +function Fa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Ja[a]})}function Ka(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} +var Ja={"&":"&","<":"<",">":">",'"':""","'":"'"},La={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function Na(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function Oa(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function Ma(a,b){var c,d={O:null,ka:null,ca:null,ba:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ca=g.load;d.ba=g.exec;if(e=g.bytes)d.O=e;else if(e=g.words)for(d.O=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.O=Array(4*e.length),f=c=0;c>8&255,d.O[f++]=e[c]>>16&255,d.O[f++]=e[c]>>24&255;else d.O=g;d.ka=g.symbols;d.O.length?1==d.O.length&&(u(d.O[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.a["S"+a]=[0,0,!1,!1,this.ie,a];this.F=this.c=this.v=this.A=null;B(this)}n(jb,q);h=jb.prototype; -h.reset=function(a){this.stop();a&&lb(this,this.f=0)}; -h.ha=function(a,b,c,d){if(this.A&&this.A.ha(a,b,c,d)||this.c&&this.c.ha(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.l[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.l[b]=c,this.h[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.l[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){mb(a, -b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){nb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){mb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){nb(a,b)}}(this,b),!0):q.prototype.ha.call(this,a,b,c,d)}};h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;ob(b,this,pb);qb(b,this.reset.bind(this));rb(this);sb(this)};h.ga=function(a,b){if(!b)if(this.G&&tb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0}; -h.fa=function(a){return a?this.save():!0};h.save=function(){var a=new G(this);a.set(0,[this.U,this.f,this.b]);return a.data()};h.restore=function(a){if(a=a[0])ub(this,this.U=a[0]),lb(this,this.f=a[1]),vb(this,a[2]);return!0};function wb(a,b,c){if(a=a.l[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function rb(a,b){for(var c in a.h)wb(a,c,null!=b?b:a.h[c])}function xb(a,b,c){if(a=a.l[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} -function sb(a){for(var b in a.a)xb(a,b,a.a[b][1])}function yb(a,b,c,d){if(a.l[b]){var e=a.F&&a.F.h||8;c=c||0;c=8==e?Ca(c,d):Da(c,d);a.l[b].textContent!=c&&(a.l[b].textContent=c)}}function mb(a,b){var c=a.a[b];xb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=zb&&(a.w=b==Ab,a.C=b==Bb)}function nb(a,b){var c=a.a[b];c[2]&&c[3]&&(xb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.ge=function(a){a||this.c.j.N||(a=this.c,a.v.reset(),Cb(a),this.a[Db]&&this.a[Db][1]&&Eb(this.c))};h.he=function(){}; -h.ce=function(a){a||H(this.c)};h.ae=function(a){if(!a&&!this.c.j.N)if(this.a[Db]&&this.a[Db][1])Eb(this.c);else{a=this.F;var b;if(b=a)a.j.Ta&&(a.j.qc=!0),b=!a.j.Ta;if(b)Ba(a,!0),a.f(0,null),Ba(a,!1);else try{var c=this.c.bc(1);0=a.c.pa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.v.u;a.a[zb]&&a.a[zb][1]||(b=-b);ub(a,a.U&~c|a.U+b&c)}function ub(a,b){a.U=b&a.v.u;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Nb(a,"A"+c,b&1<c;c++)Nb(a,"D"+c,b&1<c;c++)a.a["S"+c][1]=b&1<>2;this.f=this.g-1;this.s=this.D/this.g|0;this.L=this.s-1;this.Ha=[];this.m=0;this.o=!1;this.G=[];this.Qd=[Sb,Tb,Ub,Vb];this.a=this.b=[];this.C=this.w=this.i=this.H=this.I=0;a=new I(this);Wb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.u;B(this)}n(Qb,q);function Zb(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Qb.prototype;h.reset=function(){for(var a=0;a>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Sa)return l.Bb+=l.Sa-f,l.Sa=f,!0;if(f>=l.Sa+l.Bb){p=l.size-(f-m);p>g&&(p=g);l.Bb=f-l.Sa+p;f=m+a.g;g-=p;k++;continue}}return ac(bc,f,g)}f=new I(a,f,p,a.g,d,e);Wb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+cc[d]+" at "+Ca(b)),!0):ac(dc,b,c)}h.gd=function(a){return this.b[(a&this.i)>>>this.h].hb(a&this.f,a)}; -h.Eb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return hb||b!=this.f?this.b[c].W(b,a):this.b[c++].hb(b,a)|this.b[c&this.L].hb(0,a+1)<<8};h.hd=function(a,b){this.b[(a&this.i)>>>this.h].kb(a&this.f,b,a)};h.Fb=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;hb||c!=this.f?this.b[d].nb(c,b,a):(this.b[d++].kb(c,b&255,a),this.b[d&this.L].kb(0,b>>8&255,a+1))};function ec(a,b){return a.a[(b&a.u)>>>a.h]} -function Mb(a,b){var c;a.o=!1;a.m++;var d=b&a.f,e=ec(a,b);hb||d!=a.f?c=e.F(d,b):c=e.i(d,b)|ec(a,b+1).i(0,b+1)<<8;a.m--;return c}function fc(a,b,c){a.o=!1;a.m++;ec(a,b).l(b&a.f,c&255,b);a.m--}function Kb(a,b,c){a.o=!1;a.m++;var d=b&a.f,e=ec(a,b);hb||d!=a.f?e.m(d,c&65535,b):(e.l(d,c&255,b),ec(a,b+1).l(0,c>>8&255,b+1));a.m--} -function $b(a){for(var b=0,c=[],d=0;da.c.pa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],y=g[5]||1,x=0;x>8:e[2](f)&255):f&1&&(e=d.Ha[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255} -function Tb(a,b,c){var d=!1,e=this.controller,f=e.Ha[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ha[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function Ub(a,b){var c=-1,d=this.controller;a=d.Ha[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535} -function Vb(a,b,c){var d=!1,e=this.controller;a=e.Ha[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function L(a){q.call(this,"Device",a,256);this.a={Aa:128,vc:-1}}n(L,q);h=L.prototype;h.ea=function(a,b,c,d){this.v=b;this.A=a;this.c=c;this.F=d;var e=this;this.a.vc=lc(c,function(){e.a.Aa|=128;e.a.Aa&64&&nc(e.c,e.a.Ja);e.A&&Ib(e.A,1);oc(e.c,e.a.vc,1E3/60)});this.a.Ja=pc(c,64,6,524288);ob(b,this,qc);qb(b,this.reset.bind(this));B(this)}; -h.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){this.a.Aa=128;oc(this.c,this.a.vc,1E3/60,!0)};h.save=function(){var a=new G(this);a.set(0,[this.a.Aa]);return a.data()};h.restore=function(a){a=ja(a[0]);this.a.Aa=a.next().value;return!0};h.ue=function(){return this.a.Aa};h.If=function(a){this.a.Aa=a&192;this.a.Aa&64||(a=this.a.Ja)&&rc(this.c,a)};h.we=function(){return sc(this.c)}; -h.Kf=function(a){tc(this.c,a&-129|this.c.K&128)};h.xe=function(){return uc(this.c)};h.ye=function(){return vc(this.c)};h.ze=function(){return this.c.qa};h.Lf=function(a){wc(this.c,a)};h.gf=function(a){a=a>>1&63;var b=this.c.Ga[a>>1];return a&1?b>>16:b&65535};h.sg=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ga[c]=b&1?this.c.Ga[c]&65535|(a&63)<<16:this.c.Ga[c]&-65536|a&65534};h.$e=function(a){return this.c.s[1][a>>1&7]};h.lg=function(a,b){this.c.s[1][b>>1&7]=a&65295}; -h.Ye=function(a){return this.c.s[1][(a>>1&7)+8]};h.jg=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.Ze=function(a){return this.c.H[1][a>>1&7]};h.kg=function(a,b){b=b>>1&7;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.Xe=function(a){return this.c.H[1][(a>>1&7)+8]};h.ig=function(a,b){b=(b>>1&7)+8;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.te=function(a){return this.c.s[0][a>>1&7]};h.Hf=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.re=function(a){return this.c.s[0][(a>>1&7)+8]}; -h.Ff=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.se=function(a){return this.c.H[0][a>>1&7]};h.Gf=function(a,b){b=b>>1&7;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.qe=function(a){return this.c.H[0][(a>>1&7)+8]};h.Ef=function(a,b){b=(b>>1&7)+8;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.ff=function(a){return this.c.s[3][a>>1&7]};h.rg=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.df=function(a){return this.c.s[3][(a>>1&7)+8]};h.pg=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295}; -h.ef=function(a){return this.c.H[3][a>>1&7]};h.qg=function(a,b){b=b>>1&7;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.cf=function(a){return this.c.H[3][(a>>1&7)+8]};h.og=function(a,b){b=(b>>1&7)+8;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.ib=function(a){a&=7;return this.c.i&2048?this.c.ra[a]:this.c.b[a]};h.lb=function(a,b){b&=7;this.c.i&2048?this.c.ra[b]=a:this.c.b[b]=a};h.Ee=function(){return this.c.i&49152?this.c.ja[0]:this.c.b[6]};h.Qf=function(a){this.c.i&49152?this.c.ja[0]=a:this.c.b[6]=a}; -h.He=function(){return this.c.b[7]};h.Tf=function(a){this.c.b[7]=a};h.jb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.ra[a]};h.mb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.ra[b]=a};h.Fe=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[1]};h.Rf=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[1]=a};h.Ge=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[3]};h.Sf=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[3]=a}; -h.pe=function(a){return this.c.zb[a-65504>>1]};h.Df=function(a,b){this.c.zb[b-65504>>1]=a};h.bd=function(a){return 65520==a?(gc(this.v)>>6)-1:0};h.ed=function(){};h.bf=function(){return 1};h.ng=function(){};h.oe=function(){return this.c.G};h.Cf=function(){this.c.G=0};h.ve=function(){return this.c.wb};h.Jf=function(a,b){b&1||(a&=255);this.c.wb=a};h.Ae=function(a,b){return b?0:this.c.Ra};h.Mf=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Ra=a}; -h.af=function(a,b){return b?0:this.c.Fa&65280};h.mg=function(a){this.c.Fa=a|255};h.De=function(){return xc(this.c)};h.Pf=function(a){yc(this.c,a)};h.dd=function(){}; -var M={},qc=(M[61568]=[null,null,L.prototype.gf,L.prototype.sg,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.$e,L.prototype.lg,"SIPDR",8,1145,64],M[62608]=[null,null,L.prototype.Ye,L.prototype.jg,"SDPDR",8,1145,64],M[62624]=[null,null,L.prototype.Ze,L.prototype.kg,"SIPAR",8,1145,64],M[62640]=[null,null,L.prototype.Xe,L.prototype.ig,"SDPAR",8,1145,64],M[62656]=[null,null,L.prototype.te,L.prototype.Hf,"KIPDR",8,1140,64],M[62672]=[null,null,L.prototype.re,L.prototype.Ff,"KDPDR",8,1145,64],M[62688]= -[null,null,L.prototype.se,L.prototype.Gf,"KIPAR",8,1140,64],M[62704]=[null,null,L.prototype.qe,L.prototype.Ef,"KDPAR",8,1145,64],M[62798]=[null,null,L.prototype.ze,L.prototype.Lf,"MMR3",1,1145,64],M[65382]=[null,null,L.prototype.ue,L.prototype.If,"LKS"],M[65402]=[null,null,L.prototype.we,L.prototype.Kf,"MMR0",1,1140,64],M[65404]=[null,null,L.prototype.xe,L.prototype.dd,"MMR1",1,1145,64],M[65406]=[null,null,L.prototype.ye,L.prototype.dd,"MMR2",1,1140,64],M[65408]=[null,null,L.prototype.ff,L.prototype.rg, -"UIPDR",8,1140,64],M[65424]=[null,null,L.prototype.df,L.prototype.pg,"UDPDR",8,1145,64],M[65440]=[null,null,L.prototype.ef,L.prototype.qg,"UIPAR",8,1140,64],M[65456]=[null,null,L.prototype.cf,L.prototype.og,"UDPAR",8,1145,64],M[65472]=[null,null,L.prototype.ib,L.prototype.lb,"R0SET0"],M[65473]=[null,null,L.prototype.ib,L.prototype.lb,"R1SET0"],M[65474]=[null,null,L.prototype.ib,L.prototype.lb,"R2SET0"],M[65475]=[null,null,L.prototype.ib,L.prototype.lb,"R3SET0"],M[65476]=[null,null,L.prototype.ib, -L.prototype.lb,"R4SET0"],M[65477]=[null,null,L.prototype.ib,L.prototype.lb,"R5SET0"],M[65478]=[null,null,L.prototype.Ee,L.prototype.Qf,"R6KERNEL"],M[65479]=[null,null,L.prototype.He,L.prototype.Tf,"R7KERNEL"],M[65480]=[null,null,L.prototype.jb,L.prototype.mb,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.jb,L.prototype.mb,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.jb,L.prototype.mb,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.jb,L.prototype.mb,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.jb, -L.prototype.mb,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.jb,L.prototype.mb,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Fe,L.prototype.Rf,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Ge,L.prototype.Sf,"R6USER",1,1145],M[65504]=[null,null,L.prototype.pe,L.prototype.Df,"CTRL",8,1170],M[65520]=[null,null,L.prototype.bd,L.prototype.ed,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.bd,L.prototype.ed,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.bf,L.prototype.ng,"SYSID",1,1170],M[65526]= -[null,null,L.prototype.oe,L.prototype.Cf,"ERR",1,1170],M[65528]=[null,null,L.prototype.ve,L.prototype.Jf,"MBR",1,1170],M[65530]=[null,null,L.prototype.Ae,L.prototype.Mf,"PIR"],M[65532]=[null,null,L.prototype.af,L.prototype.mg,"SLR"],M[65534]=[null,null,L.prototype.De,L.prototype.Pf,"PSW"],M); -Xa(function(){for(var a=A(document,z,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),Dc(this,Ec?Fc:Gc);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.me=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.mf=function(a,b){gb&&a&1&&J(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; -h.Af=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.ya=!0};h.ke=function(a,b){return this.i(a,b)};h.jf=function(a,b){return this.F(a,b)};h.yf=function(a,b,c){this.A?this.Db(0,0,c):this.l(a,b,c)};h.ug=function(a,b,c){this.A?this.Db(0,0,c):this.m(a,b,c)};h.je=function(a){return this.a[a]}; -h.le=function(a){return this.a[a]};h.hf=function(a,b){gb&&a&1&&J(this.b,b,64);return this.v.getUint16(a,!0)};h.lf=function(a,b){gb&&a&1&&J(this.b,b,64);return!hb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.xf=function(a,b){this.a[a]=b;this.ya=!0};h.zf=function(a,b){this.a[a]=b;this.ya=!0};h.tg=function(a,b,c){gb&&a&1&&J(this.b,c,64);this.v.setUint16(a,b,!0);this.ya=!0};h.vg=function(a,b,c){gb&&a&1&&J(this.b,c,64);!hb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.ya=!0}; -var Bc=0,hc=1,Cc=2,Yb=4,cc=["NONE","RAM","ROM","VID","H/W"],Ac=0,Jc=[],Ic=[I.prototype.me,I.prototype.Af,I.prototype.mf,I.prototype.wg],Mc=[I.prototype.ke,I.prototype.yf,I.prototype.jf,I.prototype.ug];if(eb)var Gc=[I.prototype.je,I.prototype.xf,I.prototype.hf,I.prototype.tg],Fc=[I.prototype.le,I.prototype.zf,I.prototype.lf,I.prototype.vg];var Nc;if(eb){var Oc=new ArrayBuffer(2);(new DataView(Oc)).setUint16(0,256,!0);Nc=256===(new Uint16Array(Oc))[0]}else Nc=!1;var Ec=Nc; -function Pc(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.xc=0;this.Xb=b;this.Qa=c;this.gc=Math.round(this.Xb/1E4)/100;this.Za=this.gc*this.Qa;this.hc=this.vb=this.bb=this.Yb=0;this.j.N=this.j.uc=!1;this.j.da=a.autoStart;"string"==typeof this.j.da&&(this.j.da="true"==this.j.da);this.j.Lb=!1;this.Vb=this.ab=0;this.Wb=+a.csStart;this.tb=+a.csInterval;this.ub=+a.csStop;this.Y=[];this.Oc=this.rf.bind(this);this.Ea=this.va=this.Da=this.a=this.aa=this.ua=this.sb=this.Ca=this.cb= -this.ic=this.Na=0;this.ma=null;B(this)}n(Pc,q);h=Pc.prototype;h.ea=function(a,b,c,d){this.A=a;this.v=b;this.F=d;this.ma=a.f;for(a=0;a=a.ab&&(a.ab+=a.tb,c=!0);0<=a.ub&&a.ub<=Uc(a)&&(a.tb=a.ub=-1,Tc(a),H(a),c=!0);c&&a.Z(Uc(a)+" cycles: checksum="+Da(a.Vb))}} -h.ha=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.l[b]=c,!0;case "run":return this.l[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.S)a=!0;else{var b=null,c,k=xa(a.id);for(c=0;ca.Na/a.Za&&(b=1);a.Qa=b;b=a.gc*a.Qa;if(a.Za!=b){a.Za=b;b=a.Za.toFixed(2)+"Mhz";var d=a.l.setSpeed;d&&(d.textContent=b);a.Z("target speed: "+b)}c&&a.A&&Yc(a.A)}Gb(a,a.va);a.va=0;a.ua=va();a.Ca=0;Wc(a)}function lc(a,b){var c=a.Y.length;a.Y.push([-1,b]);return c}function oc(a,b,c,d){0<=b&&ba.Y[b][0])&&(c=a.Xb*a.Qa/1E3*c|0,a.j.N&&(c+=Zc(a)),a.Y[b][0]=c)}function $c(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Zc(a,b){var c=a.Da-=a.a;a.a=a.aa=0;b&&(a.Da=0);return c} -h.rf=function(){if(this.j.N){this.Yb>=this.Xb&&Wc(this,!0);this.cb=0;this.sb=va();if(this.Ca){var a=this.sb-this.Ca;a>this.hc&&(this.ua+=a,this.ua>this.sb&&(this.ua=this.sb))}try{do{for(var b,c=this.j.Lb?1:this.vb,d=this.Y.length-1;0<=d;d--){var e=this.Y[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.bc(b)}catch(f){if("number"!=typeof f)throw f;}b=Zc(this,!0);this.cb+=b;this.va+=b;Hb(this,b);Fb(this,b);this.bb-=b;if(0>=this.bb){this.bb+=this.vb;++this.ic>=ad&&(this.A&&Ib(this.A,void 0),this.ic=0);break}}while(this.j.N)}catch(f){H(this); -this.A&&this.A.stop(va(),Uc(this));a=f.stack||f.message;this.j.error=!0;this.B(a);return}if(this.j.N){a=setTimeout;b=this.Oc;this.Ca=va();c=this.hc;this.cb&&(c=Math.round(c*this.cb/this.vb));c-=this.Ca-this.sb;if(d=this.Ca-this.ua)this.Na=Math.round(this.va/(10*d))/100,864E5<=d&&(this.Ea=0,Vc(this));if(0>c||this.Nac&&(this.ua-=c),c=0;this.Yb+=this.cb;this.Ca+=c;a(b,c)}}}; -function Eb(a){var b;a.j.error?(a.Z(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.N)a.Z(a.toString()+" busy");else{Vc(a);a.j.N=!0;a.j.uc=!0;if(b=a.l.run)b.textContent="Halt";a.A&&a.A.start(a.ua,Uc(a));a.F||a.status("Started");setTimeout(a.Oc,0)}}h.bc=function(){return 0};function H(a){var b=!1;if(a.j.N){Zc(a);Gb(a,a.va);a.va=0;a.j.N=!1;if(b=a.l.run)b.textContent="Run";a.A&&a.A.stop(va(),Uc(a));b=!0;a.F||a.status("Stopped")}a.j.complete=void 0;return b}var Xc=30,ad=15,Qc=["power","reset"]; -function bd(a){var b=+a.model||1170;Pc.call(this,a,6666667);this.pa=b;this.Ic=+a.addrReset||0;this.wa=this.i=this.C=this.u=this.m=this.o=this.w=0;this.b=this.ra=this.ja=[];this.H=this.s=this.Ga=this.zb=[];this.Ba=this.D=this.Hc=this.$a=this.Oa=this.Pa=this.Wa=this.G=this.wb=this.Ra=this.Fa=this.K=this.xb=this.yb=this.qa=this.g=0;this.Jd=[4,2,0,1];this.Zb=0;this.Nc=255;1120>=this.pa?(this.Gc=cd.bind(this),this.Ya=this.Ud,this.Zb=8,this.Nc=-1,this.Sc=255,this.Pc=0):(this.Gc=dd.bind(this),this.Ya=this.Vd, -this.Sc=~(1792|(1140>=this.pa?2048:0))&65535,this.Pc=1140e.Cb&&(e.Cb=c,c+=4)}return Pc.prototype.ga.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.pa);this.j.N&&H(this);this.u=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.Ic,-1,-2,-3,-4,-5,-6,-7,-8];this.ra=[0,0,0,0,0,0];this.ja=[0,0,0,0];this.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, -65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ga=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.zb=[0,0,0,0,0,0,0,0];this.C=0;this.wa=-1;this.h=this.f=this.Ub=this.L=this.T=this.g=this.wb=0;Cb(this);Sc(this);this.j.error=!1;Pc.prototype.reset.call(this)};function Cb(a){a.K=0;a.xb=0;a.yb=0;a.qa=0;a.G=0;a.Ra=0;a.Fa=255;a.$a=0;a.Oa=0;a.Pa=0;a.Wa=262143;a.Ba=a.b[7];a.D=0;a.I=null;a.v&&(ed(a),a.Hc=gc(a.v))} -function ed(a){a.Pb=a.yc;a.Qb=a.$b;a.ac=a.cc;a.Rb=a.ec;a.$a?(a.ta=65536,a.Ob=a.qa&16?4186112:253952,a.oa=a.$c,a.W=a.cd,a.nb=a.fd,Zb(a.v,a.qa&16?22:18)):(a.ta=0,a.Ob=57344,a.oa=a.Yd,a.W=a.kf,a.nb=a.xg,Zb(a.v,16))}function sc(a){var b=a.K;b&57344||(b=b&-3199|a.Oa<<5|a.Pa<<1);return b}function tc(a,b){b&=-3073;if(a.K!=b){b&57344&&!(a.K&57344)&&(a.xb=a.D>>16&65535,a.yb=a.D&65535);a.K=b;a.Oa=(b&96)>>5;a.Pa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.$a!=c&&(a.$a=c,ed(a))}} -function uc(a){a.K&57344||(a.xb=a.D>>16&65535);a=a.xb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function vc(a){a.K&57344||(a.yb=a.D&65535);return a.yb}function wc(a,b){1170>a.pa&&(b&=-49);a.qa!=b&&(a.qa=b,a.Wa=b&16?4194303:262143,ed(a))}function fd(a,b,c){a.Ic=b;P(a,b);yc(a,0);a.v.reset();Cb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.N||Eb(a)}else a.F&&a.j.S?H(a)||(a.F.g(),Ib(a.A,-1)):!1===c&&H(a);!a.j.N&&a.ma&&a.ma.stop()}h.Zc=function(){return 0}; -h.save=function(){var a=new G(this);a.set(0,[this.b,this.ra,this.ja,this.H,this.s,this.Ga,this.zb,this.G,this.wb,this.Ra,this.Fa,this.Oa,this.Pa,this.Ba,this.g,this.D,this.wa,this.lc,this.mc]);a.set(1,[xc(this),sc(this),uc(this),vc(this),this.qa]);a.set(2,[this.Ea,this.Qa,this.j.da]);a.set(3,gd(this));a.set(4,$c(this));return a.data()}; -h.restore=function(a){var b=ja(a[0]);this.b=b.next().value;this.ra=b.next().value;this.ja=b.next().value;this.H=b.next().value;this.s=b.next().value;this.Ga=b.next().value;this.zb=b.next().value;this.G=b.next().value;this.wb=b.next().value;this.Ra=b.next().value;this.Fa=b.next().value;this.Oa=b.next().value;this.Pa=b.next().value;this.Ba=b.next().value;this.g=b.next().value;this.D=b.next().value;this.wa=b.next().value;this.lc=b.next().value;this.mc=b.next().value;b=a[1];yc(this,b[0]);tc(this,b[1]); -this.xb=b[2];this.yb=b[3];wc(this,b[4]);b=a[2];this.Ea=b[0];Vc(this,b[1]);this.j.da=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function P(a,b){a.b[7]=b&65535}function pc(a,b,c,d){b={Cb:b,gb:c,message:d||0,name:ib[b],next:null};a.rb.push(b);return b}function rc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.g|=1)}function nc(a,b){if(b){if(b!=a.I){var c=a.I;if(!c||c.gb<=b.gb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.gb<=b.gb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}} -function gd(a){var b=[];for(a=a.I;a;)b.push(a.Cb),a=a.next;return b}function kd(a){return a.g&64?(K(a,168,64,-6),!0):a.g&32?(K(a,4,32,-5),!0):a.g&16?(K(a,12,16,-7),!0):!1}function xc(a){return a.i=a.i&63728|id(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|hd(a)}function yc(a,b){b&=a.Sc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.u=b<<16;if((b^a.i)&a.Pc)for(var c=a.ra.length;0<=--c;){var d=a.b[c];a.b[c]=a.ra[c];a.ra[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.ja[c]=a.b[6],a.b[6]=a.ja[a.C]);a.i=b;a.g&=-3;a.g|=a.I?2:1} -h.ia=function(a){this.w=this.o=a;this.m=0};h.Ka=function(a,b){this.w=this.o=this.u=a;this.m=b||0};function ld(a,b){a.w=a.o=a.u=b;a.m=a.w^a.u>>1}function md(a,b,c,d){a.w=a.o=a.u=b;a.m=(c^d)&(d^b)} -function K(a,b,c,d){if(!a.fb){0>a.wa?a.wa=xc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.D=b|4143316992;a.C=0;var e=a.W(b|a.ta),f=a.W(b+2&65535|a.ta);yc(a,f&-12289|a.wa>>2&12288);nd(a,a.wa);nd(a,a.b[7]);P(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.lc=d;a.mc=b;-1==d&&H(a);if(-4<=d)throw b;}}function od(a){var b=pd(a),c=pd(a);a.i&49152&&(c=c&-225|a.i&63712);P(a,b);yc(a,c);a.g&=-17} -function qd(a,b){var c=b>>13&31;31>c&&(b=a.qa&32?a.Ga[c]+(b&8191)&4194303:b&-3932161);return b} -function Lb(a,b,c){var d,e,f;if(!(c&a.$a))return f=b&65535,57344<=f&&(f|=a.Ob),f;d=b>>13;a.qa&a.Jd[a.C]||(d&=7);e=a.s[a.C][d];f=(a.H[a.C][d]<<6)+(b&8191)&a.Wa;3932160<=f&&(f=qd(a,f));if(a.fb)return f;f>=a.Hc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.s[a.C][d]=e;if(f!=(4194170&a.Wa)||a.C)a.Oa=a.C,a.Pa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.K&57344||(g|=a.K&4096|a.Oa<<5|a.Pa<<1,tc(a,a.K&-61695|g&61694)),K(a,168,64,-2)),a.K&61440||!(f<(4191360&a.Wa)||f>(4194239&a.Wa))||(a.K|=4096,a.K&512&&(a.g|=64)));return f}function pd(a){var b=a.W(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function nd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.D=a.D&65535|(a.D&-65536)<<8|16121856;a.g&256||a.Ya(4,-2,c);a.nb(c,b)} -function rd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return K(a,4,0,-3),0;case 1:return 6==c&&a.Ya(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Ya(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Ya(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.W(e)|g;a.a-=8;break;case 6:return e=a.W(jd(a,2)),e=e+a.b[c]&65535,6==c&&a.Ya(d,0, -e),a.a-=6,e|g;case 7:return e=a.W(jd(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.ta),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.D=a.D&65535|(a.D&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ud=function(a,b,c){!this.C&&0>=b&&c<=this.Fa&&(this.g|=32)};h.Vd=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Fa&&(c<=this.Fa-32?K(this,4,0,-4):(this.G|=8,this.g|=32)))};h.Xd=function(a){return this.yc(a)};h.Zd=function(a){return this.$b(a)};h.uf=function(a,b){this.cc(a,b)};h.wf=function(a,b){this.ec(a,b)}; -h.Yd=function(a,b,c){return rd(this,a,b,c)};h.$c=function(a,b,c){return Lb(this,rd(this,a,b,c),c)};h.kf=function(a){return this.v.Eb(this.Ba=a)};h.cd=function(a){return this.v.Eb(this.Ba=Lb(this,a,2))};h.xg=function(a,b){this.v.Fb(this.Ba=a,b)};h.fd=function(a,b){this.v.Fb(this.Ba=Lb(this,a,4),b)}; -function sd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=rd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.W(d|c&a.ta),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.ja[a.i>>12&3];return c}function td(a,b,c,d){a.D=a.D&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=rd(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=Lb(a,e|c&65536,4),a.C=a.i>>14&3,a.Rb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.ja[a.i>>12&3]=d} -function ud(a,b){b>>=6;var c=a.T=b&7;return(b=a.L=(b&56)>>3)?a.Pb(a.oa(b,c,3)):a.b[c+a.Zb]&a.Nc}function vd(a,b){var c;b>>=6;var d=a.T=b&7;(b=a.L=(b&56)>>3)?c=a.Qb(a.oa(b,d,2)):c=a.b[d+a.Zb];return c}function wd(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return rd(a,b,c,8)}function xd(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Pb(a.oa(b,c,3)):a.b[c]&255}function yd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Qb(a.oa(b,d,2)):c=a.b[d];return c} -function R(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Ub=a.oa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.ac(e,d.call(a,c,a.Pb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function S(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,6),a.Rb(e,d.call(a,0>c?a.b[-c-1]:c,a.Qb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} -function zd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.oa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.ac(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function Ad(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Rb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} -h.bc=function(a){this.j.complete=!0;var b=a?this.j.uc?0:1:-1;this.j.uc=!1;this.Da=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Ra&224)>>5,e=this.I&&this.I.gb>d?this.I:null;e&&(c=e.Cb,d=e.gb);d>(this.i&224)>>5?(this.g&8&&(jd(this,2),this.g&=-9),K(this,c,0,-10),d=!0):d=!1;d&&(e&&rc(this,e),a=!0);this.I||this.Ra||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.F.b(this.b[7],b)){H(this);break}if(0>b)break}if(this.g&112&&kd(this)){if(this.g& -4&&this.F.b(this.b[7],b)){H(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.D=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.Gc(e)}while(0>1|b<<16;ld(this,a);return a&65535}function Gd(a,b){a=b&128|b>>1|b<<8;ld(this,a<<8);return a&255}function Hd(a,b){a=b&~a;this.ia(a);return a}function Id(a,b){a=b&~a;this.ia(a<<8);return a}function Jd(a,b){a|=b;this.ia(a);return a}function Kd(a,b){a|=b;this.ia(a<<8);return a} -function Ld(a,b){a=~b|65536;this.Ka(a);return a&65535}function Md(a,b){a=~b|256;this.Ka(a<<8);return a&255}function Nd(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function Od(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function Pd(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function Qd(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function Rd(a,b){a=-b;this.Ka(a,a&b&32768);return a&65535} -function Sd(a,b){a=-b;this.Ka(a<<8,(a&b&128)<<8);return a&255}function Td(a,b){a=b<<1|this.u>>16&1;ld(this,a);return a&65535}function Ud(a,b){a=b<<1|this.u>>16&1;ld(this,a<<8);return a&255}function Vd(a,b){a=(this.u&65536|b)>>1|b<<16;ld(this,a);return a&65535}function Wd(a,b){a=((this.u&65536)>>8|b)>>1|b<<8;ld(this,a<<8);return a&255}function Xd(a,b){var c=b-a;md(this,c,a,b);return c&65535}function Yd(a,b){var c=b-a;md(this,c<<8,a<<8,b<<8);return c&255} -function Zd(a,b){this.w=this.o=b&65280;this.m=this.u=0;return(b<<8|b>>8)&65535}function $d(a,b){a^=b;this.ia(a);return a&65535}function ae(a){S(this,a,vd(this,a),Bd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} -function be(a){var b=yd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.u=this.m=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} -function ce(a){var b=yd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&=63;if(b&32){b=64-b;32>b-1;this.u=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function de(a){Q(this,a,!hd(this))}function ee(a){Q(this,a,hd(this))} -function fe(a){S(this,a,vd(this,a),Hd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ge(a){R(this,a,ud(this,a),Id);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function he(a){S(this,a,vd(this,a),Jd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ie(a){R(this,a,ud(this,a),Kd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} -function je(a){var b=vd(this,a);a=yd(this,a);this.ia((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function ke(a){var b=ud(this,a);a=xd(this,a);this.ia(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function le(a){Q(this,a,this.o&65535?0:4)}function me(a){Q(this,a,!id(this)==!(this.m&32768))}function ne(a){Q(this,a,!!(this.o&65535)&&!id(this)==!(this.m&32768))} -function oe(a){Q(this,a,!hd(this)&&!!(this.o&65535))}function pe(a){Q(this,a,(this.o&65535?0:4)||!id(this)!=!(this.m&32768))}function qe(a){Q(this,a,hd(this)||(this.o&65535?0:4))}function re(a){Q(this,a,!id(this)!=!(this.m&32768))}function se(a){Q(this,a,id(this))}function te(a){Q(this,a,!!(this.o&65535))}function ue(a){Q(this,a,!id(this))}function ve(){K(this,12,0,-9)}function we(a){Q(this,a,!0)}function xe(a){Q(this,a,!(this.m&32768))}function ye(a){Q(this,a,this.m&32768?2:0)} -function T(a){a&1&&(this.u=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function ze(a){var b=vd(this,a);a=yd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;md(this,c,a,b);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function Ae(a){var b=ud(this,a);a=xd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);md(this,c,a,b);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)} -function Be(a){var b=yd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.u=65536,this.a-=7}function Ce(){K(this,24,0,-9);this.a-=20} -function De(){this.i&49152?(this.G|=128,K(this,4,0,-8)):(this.ma&&1120==this.pa&&this.ma.setData(this.b[0],!0),this.F?this.F.i():H(this));this.a-=7}function Ee(){K(this,16,0,-9);this.a-=20}var Fe=[0,7,7,10,7,11,9,13];function Ge(a){this.aa=this.a;P(this,wd(this,a));this.a=this.aa-Fe[this.h]}var He=[0,14,14,17,14,18,16,20];function Ie(a){this.aa=this.a;var b=wd(this,a);a=a>>6&7;nd(this,this.b[a]);this.b[a]=this.b[7];P(this,b);this.a=this.aa-He[this.h]} -var Je=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ke(a){var b=vd(this,a);this.aa=this.a;Ad(this,a,b,this.ia);this.a=this.aa-Je[(this.L?8:0)+this.h]+(7!=this.f||this.h?0:2)}function Le(a){var b=ud(this,a);zd(this,a,b,65535,this.ia);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}var Me=[7,13,13,17,14,18,17,21]; -function Ne(a){var b=yd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.m=0;this.u=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)P(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Te(a){S(this,a,vd(this,a),Xd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Ue(a){S(this,a,0,Zd);this.a-=this.h?9:3+(7==this.f?2:0)}function Ve(){K(this,28,0,-9)} -function We(){this.ma&&(this.ma.U=this.b[7],this.ma.setData(this.b[0],!0));this.g|=8;jd(this,-2);this.a-=3}function Xe(a){S(this,a,this.b[(a>>6&7)+this.Zb],$d);this.a-=this.h?9:3+(7==this.f?2:0)}function V(){K(this,8,0,-9)}function cd(a){Ye[a>>12].call(this,a)}function Ze(a){$e[a>>6&3].call(this,a)}function af(a){bf[a>>6&3].call(this,a)}function cf(a){df[a>>6&3].call(this,a)}function ef(a){ff[a&15].call(this,a)}function gf(a){hf[a&15].call(this,a)}function jf(a){kf[a>>6&3].call(this,a)} -function lf(a){mf[a>>6&3].call(this,a)}function nf(a){of[a>>6&3].call(this,a)} -var Ye=[function(a){pf[a>>8&15].call(this,a)},Ke,ze,je,fe,he,ae,V,function(a){qf[a>>8&15].call(this,a)},Le,Ae,ke,ge,ie,Te,V],pf=[function(a){rf[a>>4&15].call(this,a)},we,te,le,me,re,ne,pe,Ie,Ie,Ze,af,cf,V,V,V],$e=[function(a){Ad(this,a,0,this.Ka);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ld);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Pd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Nd);this.a-=this.h?9:3+(7==this.f?2:0)}],bf=[function(a){S(this,a,0,Rd); -this.a-=this.h?11:6},function(a){S(this,a,hd(this)?1:0,Bd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,hd(this)?1:0,Xd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=yd(this,a);this.Ka(a);this.a-=this.h?4:3+(7==this.f?2:0)}],df=[function(a){S(this,a,0,Vd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Fd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Dd);this.a-=this.h?9:3+(7==this.f?2:0)}],rf= -[function(a){sf[a&15].call(this,a)},V,V,V,Ge,Ge,Ge,Ge,Qe,V,ef,gf,Ue,Ue,Ue,Ue],sf=[De,We,Re,ve,Ee,Pe,V,V,V,V,V,V,V,V,V,V],ff=[Oe,function(){this.u=0;this.a-=5},function(){this.m=0;this.a-=5},T,function(){this.o=1;this.a-=5},T,T,T,function(){this.w=0;this.a-=5},T,T,T,T,T,T,T],hf=[Oe,function(){this.u=65536;this.a-=5},function(){this.m=32768;this.a-=5},U,function(){this.o=0;this.a-=5},U,U,U,function(){this.w=32768;this.a-=5},U,U,U,U,U,U,U],qf=[ue,se,oe,qe,xe,ye,de,ee,Ce,Ve,jf,lf,nf,V,V,V],kf=[function(a){zd(this, -a,0,255,this.Ka);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Md);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Qd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Od);this.a-=this.h?9:3+(7==this.f?2:0)}],mf=[function(a){R(this,a,0,Sd);this.a-=this.h?11:6},function(a){R(this,a,hd(this)?1:0,Cd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,hd(this)?1:0,Yd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=xd(this,a);this.Ka(a<<8);this.a-=this.h?4:3+ -(7==this.f?2:0)}],of=[function(a){R(this,a,0,Wd);this.a-=this.h?9+(this.Ub&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ud);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Gd);this.a-=this.h?9+(this.Ub&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)}];function dd(a){tf[a>>12].call(this,a)} -var tf=[function(a){uf[a>>8&15].call(this,a)},Ke,ze,je,fe,he,ae,function(a){vf[a>>8&15].call(this,a)},function(a){wf[a>>8&15].call(this,a)},Le,Ae,ke,ge,ie,Te,V],uf=[function(a){xf[a>>4&15].call(this,a)},we,te,le,me,re,ne,pe,Ie,Ie,Ze,af,cf,function(a){yf[a>>6&3].call(this,a)},V,V],yf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.ta);P(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=sd(this,a,0);this.ia(a);nd(this,a);this.a-=11},function(a){var b=pd(this);this.aa= -this.a;this.ia(b);td(this,a,0,b);this.a=this.aa-Me[this.h]},function(a){Ad(this,a,id(this)?65535:0,this.ia);this.a-=this.h?9:3+(7==this.f?2:0)}],xf=[function(a){zf[a&15].call(this,a)},V,V,V,Ge,Ge,Ge,Ge,Qe,function(a){!(a&8)||1145>this.pa?K(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},ef,gf,Ue,Ue,Ue,Ue],zf=[De,We,function(){od(this);this.g|=this.i&16;this.a-=13},ve,Ee,Pe,Re,function(){K(this,8,0,-9)},V,V,V,V,V,V,V,V],vf=[Ne,Ne,Be,Be,be,be,ce,ce,Xe,Xe,V, -V,V,V,Se,Se],wf=[ue,se,oe,qe,xe,ye,de,ee,Ce,Ve,jf,lf,nf,function(a){1145>this.pa?K(this,8,0,-9):Af[a>>6&3].call(this,a)},V,V],Af=[function(){K(this,8,0,-9)},function(a){a=sd(this,a,65536);this.ia(a);nd(this,a);this.a-=11},function(a){var b=pd(this);this.aa=this.a;this.ia(b);td(this,a,65536,b);this.a=this.aa-Me[this.h]},function(){K(this,8,0,-9)}]; -function Bf(a){q.call(this,"ROM",a,128);this.ka=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=D(this.g);if(this.g){a=this.g;var b=Ea(this.m);"json"!=b&&"hex"!=b&&(a=Na()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;E(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ta(c.Ma,a,b),(a=Ma(a,b))?(c.b=a.O,c.ka=a.ka):c.g=null);Cf(c)})}}n(Bf,q);h=Bf.prototype; -h.ea=function(a,b,c,d){this.v=b;this.c=c;this.F=d;Cf(this)};h.ga=function(){this.ka&&(this.F&&this.F.a(this.id,this.h,this.a,this.ka),delete this.ka);return!0};h.fa=function(){return!0}; -function Cf(a){if(!Aa(a)){if(a.g){if(!a.b||!a.v)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+Da(a.b.length,8,!0)+") does not match specified size ("+Da(a.a,8,!0)+")";a.j.error=!0;a.B(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Rb){var c={},c=(c[b]=[Bf.prototype.We,Bf.prototype.hg,null,null,null,a.a>>1],c);if(ob(a.v,a,c)){a.status("Added "+a.a+"-byte ROM at "+Ca(b));b=a.i=!0;break a}}else if(Xb(a.v,b,a.a,Cc)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),y=l,x=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(x)for(;x--;)fc(a.v,t++,b[y++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< -b.length;e++)fc(a.v,c+e,b[e]);k=!0}if(k){if(null==d||g)H(a.c),f=!1;null!=d&&fd(a.c,d,f)}return k}Xa(function(){for(var a=A(document,z,"ram"),b=0;b=sa.zc&&c<=sa.Pd&&(b=c-(sa.zc-sa.kd));b&&(a.preventDefault&&a.preventDefault(),d.Sb(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==sa.md&&(b=sa.ld);d.Sb(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); -a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Sb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;var e=this;this.H=pc(this.c,this.C?-1:48,4,262144);this.I=lc(this.c,function(){var a;a=-1;e.f.length&&(a=e.f.shift()&255,e.w&&97<=a&&122>a&&(a-=32),oc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&nc(c,e.H))});this.D=pc(this.c,this.C?-1:52,4,262144);this.Y=lc(this.c,function(){e.b|=128;e.b&64&&nc(c,e.D)});ob(b,this,If,this.C?64832+8*(this.C-1)-65392:0);qb(b,this.reset.bind(this));B(this)}; -h.ad=function(a){if(!this.g){var b=Rc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ja(c[0]);if(d!=this.La)return;c=Ja(c[1]);if(this.g=ya(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.u);if(this.s=e.receiveData){this.u=a;this.G=e.receiveStatus;this.status("Connected "+this.Ma+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ga=function(a,b){if(!b)if(this.ad(this.u),!a)this.reset();else if(!this.restore(a))return!1;return!0}; -h.fa=function(a){return a?this.save():!0};h.reset=function(){Jf(this)};h.save=function(){var a=new G(this);a.set(0,[this.o,this.a,this.b,this.f]);return a.data()};h.restore=function(a){return Jf(this,a[0])};function Jf(a,b){b||(b=[0,8192,128,a.f]);b=ja(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.f=b.next().value;return!0} -h.Sb=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.m%a,this.T&&(b=" ".slice(0,c)));this.L&&!this.m&&c&&(b=String.fromCharCode(this.L)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.m+=c}}else if(null!= -this.i){if(10==a||1024<=this.i.length)this.Z(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}oc(this.c,this.Y,1E3/Math.round(this.aa/10));this.b&=-129};var Hf="buffer",Kf={},If=(Kf[65392]=[null,null,W.prototype.Je,W.prototype.Vf,"RCSR"],Kf[65394]=[null,null,W.prototype.Ie,W.prototype.Uf,"RBUF"],Kf[65396]=[null,null,W.prototype.pf,W.prototype.zg,"XCSR"],Kf[65398]=[null,null,W.prototype.nf,W.prototype.yg,"XBUF"],Kf); -Xa(function(){for(var a=A(document,z,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.l[b]=c,!0;case "readTape":e=Of;case "loadTape":return e||(e=Pf),this.l[b]=c,c.onclick= -function(){var a=d.l.listTapes;a&&Qf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.D){c.parentNode.removeChild(c);break}this.l[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Qf(d,D(b,!0),b,Pf,a)}return!1};return!0;case Rf:return this.l[b]=c,!0}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;this.u=Sf(a);var e=this;if(a=Lf(this,Rc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.s=pc(this.c,56,4,4096);this.H=lc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.mc.indexOf("/api/v1/dump")&&(e=Ea(c),f="json"==e||"gz"==e?encodeURI(c):Na()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!E(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.S;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ta(a.Ma,e,f),(e=Ma(e,f))&&cg(a,b,c,d,e.O,e.ca,e.ba)); -a.j.Ta=!1;a.b&&(a.b--,a.b||B(a));$f(a)})}function Vf(a,b,c,d){if((a=a.l.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ea(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Fa(c,"/")&&(d="dir"),f=Na()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Mb?"":e)+"&format=json"));return!!E(f, -null,!0,function(b,c,d){kg(a,b,c,d)})} -function kg(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.S;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.na+'" (error '+d+": "+b+")",f);else{ta(a.controller.Ma,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)u(k[0]);else{a.J=k.length;a.R=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.V=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var y=l.bytes;if(void 0!==y&&y.length){for(var x=m<<2,ca=y.length;ca>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.la?f=a.sa+a.la&&(a.la+=f-(a.sa+a.la)+1):(a.sa=f,a.la=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.B("Unable to restore disk '"+this.na+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=mg(this,a++);)pg(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function pg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var gg=0;function qg(a,b,c,d,e,f){q.call(this,a,b,c);this.w=rg(this,b.autoMount);this.o=0;this.G=d;this.H=e;this.I=f;this.D=d.rd;this.f=Array(this.D);this.C=!Sa("Mobi")&&window&&"FileReader"in window;this.h=[];this.Ja=null}n(qg,q); -function rg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){u(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=qg.prototype; -h.ha=function(a,b,c){var d=this;switch(b){case "listDisks":return this.l[b]=c,c.onchange=function(){var a=d.l.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){u(d.type+" option error: "+k.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.l[b]=c,c.onchange=function(){var a=C(c.value);null!=a&&sg(d, -a)},!0;case "loadDisk":return this.l[b]=c,c.onclick=function(){var a=d.l.listDisks;a&&a.options&&tg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.l[b]=c,c.onclick=function(){var a,b=d.l.listDrives,b=b&&C(b.value);null==b||0>b||b>=d.f.length||!(a=d.f[b])?d.B("Unable to boot the selected drive"):a.P?(fd(d.c,0,!0),(a=d.fc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.C){c.parentNode.removeChild(c); -break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.f&&((a=d.f[C(a.value)||0])?(a=a.P)?(a=Va(og(a),a.Tb.replace(".json",".img")),u(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.C)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;tg(d,D(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;if(a=rg(this,Rc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);this.qb();this.Ja=pc(this.c,this.G.Md,this.G.vd,this.Jc);ob(b,this,this.I);qb(b,this.reset.bind(this));ug(this,"None",vg,!0);this.C&&ug(this,"Local Disk",wg);ug(this,"Remote Disk",xg);yg(this)||B(this)}; -h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){this.h=[];for(a=0;ag||9e||e>=a.f.length)a.B("Unable to load the selected drive");else if(c)if(c==wg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==xg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=D(c);a.status("Attempting to load "+c+' as "'+b+'"')}Cg(a,e,b,c,!1,d)}else zg(a,e)} -function Cg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,zg(a,b,!0),k.Va?a.B(a.type+" busy"):(k.Va=!0,e&&(k.Ua=!0,a.o++),k.za=!!f,jg(new fg(a,k,"preload"),c,d,f,a.sd)&&g++));return g} -h.sd=function(a,b,c,d,e){a.Va=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.Ia)),b=null);if(b){a.P=b;a.na=c;a.X=d;a:{var f;for(f=0;f=a.J){m=Y.Hb;break}p=a.seek(b,c,d+1);if(!p){m=Y.Tc;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}var y,x;if(0>(y=a.read(p,t++))||0>(x=a.read(p,t++))){m=Y.Ib;break}if(!k&&(Kb(this.v,qd(this.c,f),y|x<<8),kc(this.v))){m=Y.Lc;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Cc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.P;var p=null,t;a||(m=Y.Kc,e=0);for(;e;){var y=Mb(this.v,qd(this.c,f));if(kc(this.v)){m=Y.Lc;break}if(!p){if(b>=a.J){m=Y.Hb;break}p=a.seek(b,c,d+1,!0);if(!p){m=Y.Tc;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}if(k){var x,ca;if(0>(x=a.read(p,t++))||0>(ca=a.read(p,t++))){m=Y.Ib;break}if(y!=(x|ca<<8)){m=Y.Nd;break}}else if(!a.write(p,t++,y&255)||!a.write(p,t++,y>>8)){m=Y.Ib;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.yd=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&~X.Xa|f>>16-X.xa.Xa&X.Xa;this.m=65536-e&65535;this.g=this.g&~Z.nc|d&Z.nc;this.b|=a;Fg(this);return!0};function Fg(a){a.a&=~X.Dc;a.b&&(a.b|=Y.pd,a.a|=X.Dc,a.b&Y.jc&&(a.a|=X.jc))}h.Oe=function(){return this.u};h.$f=function(){};h.Pe=function(){return this.b};h.ag=function(){};h.Le=function(){return this.a&X.Fd}; -h.Xf=function(a){this.a=this.a&~X.Wc|a&X.Wc;if(this.a&X.Ec){a=!0;var b,c,d=(this.g&Z.dc)>>Z.xa.dc,e=this.f[d],f,g,k,l,m,p;this.a&=~(X.pb|X.oc);this.b&=~Y.Hd;switch(c=this.a&X.Gb){case Gg.jd:this.b=this.g=0;this.a=X.pb;break;case Gg.wd:case Gg.xd:b=this.fc;case Gg.Vc:case Gg.Od:b||(b=this.Cc);f=(this.g&Z.ob)>>Z.xa.ob;g=(this.g&Z.kc)>>Z.xa.kc;k=this.g&Z.nc;l=65536-this.m&65535;m=(this.a&X.Xa)<<16-X.xa.Xa|this.i;p=this.a&X.td?0:2;if(f>=e.J){this.b|=Y.Hb;break}if(k>=e.M){this.b|=Y.Ib;break}a=b.call(this, -e,f,g,k,l,m,p,c>=Gg.Vc,this.yd.bind(this));break;case Gg.Id:f=(this.g&Z.ob)>>Z.xa.ob;f'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=C(c.value);null!=a&&Jg(d,a)}, -!0;case "loadDisk":return this.l[b]=c,c.onclick=function(){var a=d.l.listDisks;a&&a.options&&Kg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.l[b]=c,c.onclick=function(){var a,b=d.l.listDrives,b=b&&C(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.P?(fd(d.c,0,!0),(a=d.Qc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.u){c.parentNode.removeChild(c); -break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.b&&((a=d.b[C(a.value)||0])?(a=a.P)?(a=Va(og(a),a.Tb.replace(".json",".img")),u(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.u)return this.l[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Kg(d,D(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;if(a=Ig(this,Rc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.s[e]=a[e]);Lg(this);this.Ja=pc(this.c,112,5,131072);ob(b,this,Mg);qb(b,this.reset.bind(this));Ng(this,"None",Og,!0);this.u&&Ng(this,"Local Disk",Pg);Ng(this,"Remote Disk",Qg);Rg(this)||B(this)}; -h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Jg(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){Lg(this)};h.save=function(){return(new G(this)).data()}; -h.restore=function(a){return Lg(this,a[0])};function Rg(a,b){b||(a.o=0);for(var c in a.s){var d=a.s[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.l.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==Pg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Qg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=D(c);a.status("Attempting to load "+c+' as "'+b+'"')}Tg(a,e,b,c,!1,d)}else Sg(a,e)} -function Tg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,Sg(a,b,!0),k.Va?a.B("RL11 busy"):(k.Va=!0,e&&(k.Ua=!0,a.o++),k.za=!!f,jg(new fg(a,k,"preload"),c,d,f,a.Dd)&&g++));return g}h.Dd=function(a,b,c,d,e){a.Va=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Ia)),b=null);b?(a.P=b,a.na=c,a.X=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Ia),a.Ua||e),this.A&&Yc(this.A)):a.za=!1;a.Ua&&(a.Ua=!1,--this.o||B(this));Jg(this,a.Ia)}; -function Ng(a,b,c,d){if((a=a.l.listDisks)&&a.options){for(var e=0;e(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}Kb(this.v,qd(this.c,f),p|t<<8);if(kc(this.v)){k=8192;break}f+=2;e--;if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Ed=function(a,b,c,d,e,f,g){var k=0;a=a.P;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Mb(this.v,qd(this.c,f));if(kc(this.v)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Cd=function(a,b,c,d,e,f){this.m=f&65535;this.a=this.a&-49|f>>12&48;this.h=f>>16&63;this.g=this.f=b<<7|(c?64:0)|d&63;this.i=65536-e&65535;a&&(this.a=this.a|a|32768);return!0};h.Te=function(){return this.a&65535}; -h.eg=function(a){this.a=this.a&-1023|a&1022;this.h=this.h&60|(a&48)>>4;if(!(this.a&128)){a=!0;var b,c=this.b[(this.a&768)>>8],d=c.P,e,f,g;this.a&=-2;switch(this.a&14){case 4:this.i&8&&(this.a&=63);this.i=c.status|this.g&64|(d&&512==d.J?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.g=this.f&4?this.g+b:this.g-b,this.f=this.g=this.g&65408|c);break;case 8:this.i=this.g;break;case 12:b=this.Qc;case 10:b||(b=this.Ed),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.J||g>=d.M? -this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Cd.bind(this)))}a&&(this.a|=129,this.a&64&&nc(this.c,this.Ja))}};h.Re=function(){return this.m};h.cg=function(a){this.m=a&65534};h.Ue=function(){return this.f};h.fg=function(a){this.f=a};h.Ve=function(){return this.i};h.gg=function(a){this.i=a};h.Se=function(){return this.h};h.dg=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4}; -var Og="",Pg="?",Qg="??",Ug={},Mg=(Ug[63744]=[null,null,N.prototype.Te,N.prototype.eg,"RLCS"],Ug[63746]=[null,null,N.prototype.Re,N.prototype.cg,"RLBA"],Ug[63748]=[null,null,N.prototype.Ue,N.prototype.fg,"RLDA"],Ug[63750]=[null,null,N.prototype.Ve,N.prototype.gg,"RLMP"],Ug[63752]=[null,null,N.prototype.Se,N.prototype.dg,"RLBE"],Ug); -function Vg(a,b,c){q.call(this,"Computer",a,33554432);this.j.S=!1;this.G=null;Wg(this,b);this.C=Rc(this,"autoPower",a,6);this.g=0;this.K=+a.busWidth||+a.buswidth;this.u=this.s=this.w=null;this.o=this.I=!1;this.i=this.h=null;this.H=this.m=this.D=!1;this.L=Rc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Xg(this);if(this.c=za("CPU",this.id)){this.F=za("Debugger",this.id);this.v=new Qb({id:this.Ma+".bus",busWidth:this.K},this.c,this.F);var d,e=xa(this.id);if((this.f=za("Panel",this.id))&&this.f.eb)for(b= -0;b\nLicense: GPL version 3 or later ");this.Z("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bYg){if(Zg(d,this.u)){this.h=new G(this,"1.32.2",hh);Zg(this.h)&&(ih(this,d),a=lh,mh(this.h));this.h.set(eh,La());nh(this.h);var e=this.a&&!this.o;if(a==fh||wa("Click OK to restore the previous "+fb+" machine state, or CANCEL to reset the machine.")){if(c=dh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Zg(d,g):("error"==f&&"no machine state"!= -g?(this.B("Error: "+g),"unable to verify user"==g&&(Ra(oh,""),this.b=null)):this.Z(f+": "+g),mh(d),Zg(d)?(c=dh(d),e=!0):c=!1))}e&&bh(this,c?d:null)}else a==lh&&d.clear()}else bh(this);delete this.u;delete this.i}e=xa(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.S=!0;var d=this.l.power;d&&(d.textContent="Shutdown");this.c&&(ph(this,this.c,b,c,a),Ib(this,-2),this.c.da());this.D&&(ih(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; -function ih(a,b){if(wa("There may be a problem with your "+fb+" machine.\n\nTo help us diagnose it, click OK to send this "+fb+" machine state to http://www.pcjs.org.")){var c=a.L;a=a.b||"";b=b.toString();var d={};d.app=fb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;E("http://www.pcjs.org/api/v1/report",d,!0)}} -function qh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new G(a,"1.32.2"),g=new G(a,"1.32.2",ch),k=La();g.set(eh,k);f.set(eh,k);f.set(rh,"1.32.2");f.set(sh,window?window.location.href:null);f.set(th,window?window.navigator.userAgent:"");a.c&&a.c.fa&&(c&&(b&&(a.c.j.da=a.c.j.N),H(a.c)),d=a.c.fa(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.S=!1,!1===d&&(e=null)));for(var k=xa(a.id),l=0;l=d||30<=(c.xc+=d))&&(e.textContent=c.j.N?c.Na.toFixed(2)+"Mhz":"Stopped",c.xc=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.j.N;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]:0b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.aa=g.load;d.Z=g.exec;if(e=g.bytes)d.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;c>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=g;d.ga=g.symbols;d.M.length?1==d.M.length&&(u(d.M[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.a["S"+a]=[0,0,!1,!1,this.De,a];this.F=this.c=this.u=this.A=null;B(this)}n(lb,q);h=lb.prototype; +h.reset=function(a){this.stop();a&&nb(this,this.g=0)}; +h.ka=function(a,b,c,d){if(this.A&&this.A.ka(a,b,c,d)||this.c&&this.c.ka(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.m[b]=c,this.l++,!0;default:return"led"==a||"rled"==a?(this.m[b]=c,this.h[b]=d?1:0,this.l++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.m[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ob(a, +b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){pb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ob(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){pb(a,b)}}(this,b),!0):q.prototype.ka.call(this,a,b,c,d)}};h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;qb(b,this,rb);sb(b,this.reset.bind(this));tb(this);ub(this)};h.ja=function(a,b){if(!b)if(this.D&&vb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0}; +h.ia=function(a){return a?this.save():!0};h.save=function(){var a=new E(this);a.set(0,[this.U,this.g,this.b]);return a.data()};h.restore=function(a){if(a=a[0])wb(this,this.U=a[0]),nb(this,this.g=a[1]),xb(this,a[2]);return!0};function yb(a,b,c){if(a=a.m[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function tb(a,b){for(var c in a.h)yb(a,c,null!=b?b:a.h[c])}function zb(a,b,c){if(a=a.m[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} +function ub(a){for(var b in a.a)zb(a,b,a.a[b][1])}function Ab(a,b,c,d){if(a.m[b]){var e=a.F&&a.F.h||8;c=c||0;c=8==e?Da(c,d):Ea(c,d);a.m[b].textContent!=c&&(a.m[b].textContent=c)}}function ob(a,b){var c=a.a[b];zb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=Bb&&(a.w=b==Cb,a.B=b==Db)}function pb(a,b){var c=a.a[b];c[2]&&c[3]&&(zb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Be=function(a){a||this.c.j.L||(a=this.c,a.u.reset(),Eb(a),this.a[Fb]&&this.a[Fb][1]&&Gb(this.c))};h.Ce=function(){}; +h.xe=function(a){a||F(this.c)};h.ve=function(a){if(!a&&!this.c.j.L)if(this.a[Fb]&&this.a[Fb][1])Gb(this.c);else{a=this.F;var b;if(b=a)a.j.Va&&(a.j.Ac=!0),b=!a.j.Va;if(b)Ba(a,!0),a.g(0,null),Ba(a,!1);else try{var c=this.c.kc(1);0=a.c.pa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.u.v;a.a[Bb]&&a.a[Bb][1]||(b=-b);wb(a,a.U&~c|a.U+b&c)}function wb(a,b){a.U=b&a.u.v;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Pb(a,"A"+c,b&1<c;c++)Pb(a,"D"+c,b&1<c;c++)a.a["S"+c][1]=b&1<>2;this.g=this.f-1;this.s=this.C/this.f|0;this.K=this.s-1;this.Ka=[];this.l=0;this.o=!1;this.D=[];this.le=[Ub,Vb,Wb,Xb];this.a=this.b=[];this.B=this.w=this.i=this.H=this.I=0;a=new G(this);Yb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.v;B(this)}n(Sb,q);function ac(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Sb.prototype;h.reset=function(){for(var a=0;a>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ua)return l.Hb+=l.Ua-f,l.Ua=f,!0;if(f>=l.Ua+l.Hb){p=l.size-(f-m);p>g&&(p=g);l.Hb=f-l.Ua+p;f=m+a.f;g-=p;k++;continue}}return cc(dc,f,g)}f=new G(a,f,p,a.f,d,e);Yb(f,l);a.a[k++]=f;f=m+a.f;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+ec[d]+" at "+Da(b)),!0):cc(fc,b,c)}h.wd=function(a){return this.b[(a&this.i)>>>this.h].lb(a&this.g,a)}; +h.Kb=function(a){var b=a&this.g,c=(a&this.i)>>>this.h;return jb||b!=this.g?this.b[c].V(b,a):this.b[c++].lb(b,a)|this.b[c&this.K].lb(0,a+1)<<8};h.xd=function(a,b){this.b[(a&this.i)>>>this.h].ob(a&this.g,b,a)};h.Lb=function(a,b){var c=a&this.g,d=(a&this.i)>>>this.h;jb||c!=this.g?this.b[d].rb(c,b,a):(this.b[d++].ob(c,b&255,a),this.b[d&this.K].ob(0,b>>8&255,a+1))};function gc(a,b){return a.a[(b&a.v)>>>a.h]} +function Ob(a,b){var c;a.o=!1;a.l++;var d=b&a.g,e=gc(a,b);jb||d!=a.g?c=e.l(d,b):c=e.i(d,b)|gc(a,b+1).i(0,b+1)<<8;a.l--;return c}function hc(a,b,c){a.o=!1;a.l++;gc(a,b).m(b&a.g,c&255,b);a.l--}function Mb(a,b,c){a.o=!1;a.l++;var d=b&a.g,e=gc(a,b);jb||d!=a.g?e.F(d,c&65535,b):(e.m(d,c&255,b),gc(a,b+1).m(0,c>>8&255,b+1));a.l--} +function bc(a){for(var b=0,c=[],d=0;da.c.pa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],z=g[5]||1,y=0;y>8:e[2](f)&255):f&1&&(e=d.Ka[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;H(d,b,16);return 255} +function Vb(a,b,c){var d=!1,e=this.controller,f=e.Ka[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ka[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||H(e,c,16)}function Wb(a,b){var c=-1,d=this.controller;a=d.Ka[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;H(d,b,16);return 65535} +function Xb(a,b,c){var d=!1,e=this.controller;a=e.Ka[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||H(e,c,16)}function J(a){q.call(this,"Device",a,256);this.a={Ca:128,Jc:-1}}n(J,q);h=J.prototype;h.ha=function(a,b,c,d){this.u=b;this.A=a;this.c=c;this.F=d;var e=this;this.a.Jc=nc(c,function(){e.a.Ca|=128;e.a.Ca&64&&oc(e.c,e.a.jb);e.A&&Kb(e.A,1);qc(e.c,e.a.Jc,1E3/60)});this.a.jb=rc(c,64,6,524288);qb(b,this,sc);sb(b,this.reset.bind(this));B(this)}; +h.ja=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){this.a.Ca=128;qc(this.c,this.a.Jc,1E3/60,!0)};h.save=function(){var a=new E(this);a.set(0,[this.a.Ca]);return a.data()};h.restore=function(a){a=ja(a[0]);this.a.Ca=a.next().value;return!0};h.Pe=function(){return this.a.Ca};h.bg=function(a){this.a.Ca=a&192;this.a.Ca&64||(a=this.a.jb)&&tc(this.c,a)};h.Re=function(){return uc(this.c)}; +h.dg=function(a){vc(this.c,a&-129|this.c.J&128)};h.Se=function(){return wc(this.c)};h.Te=function(){return xc(this.c)};h.Ue=function(){return this.c.qa};h.eg=function(a){yc(this.c,a)};h.Df=function(a){a=a>>1&63;var b=this.c.Ja[a>>1];return a&1?b>>16:b&65535};h.Mg=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ja[c]=b&1?this.c.Ja[c]&65535|(a&63)<<16:this.c.Ja[c]&-65536|a&65534};h.wf=function(a){return this.c.s[1][a>>1&7]};h.Fg=function(a,b){this.c.s[1][b>>1&7]=a&65295}; +h.uf=function(a){return this.c.s[1][(a>>1&7)+8]};h.Dg=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.vf=function(a){return this.c.H[1][a>>1&7]};h.Eg=function(a,b){b=b>>1&7;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.tf=function(a){return this.c.H[1][(a>>1&7)+8]};h.Cg=function(a,b){b=(b>>1&7)+8;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.Oe=function(a){return this.c.s[0][a>>1&7]};h.ag=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.Me=function(a){return this.c.s[0][(a>>1&7)+8]}; +h.Zf=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.Ne=function(a){return this.c.H[0][a>>1&7]};h.$f=function(a,b){b=b>>1&7;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.Le=function(a){return this.c.H[0][(a>>1&7)+8]};h.Yf=function(a,b){b=(b>>1&7)+8;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.Cf=function(a){return this.c.s[3][a>>1&7]};h.Lg=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.Af=function(a){return this.c.s[3][(a>>1&7)+8]};h.Jg=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295}; +h.Bf=function(a){return this.c.H[3][a>>1&7]};h.Kg=function(a,b){b=b>>1&7;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.zf=function(a){return this.c.H[3][(a>>1&7)+8]};h.Ig=function(a,b){b=(b>>1&7)+8;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.mb=function(a){a&=7;return this.c.i&2048?this.c.sa[a]:this.c.b[a]};h.pb=function(a,b){b&=7;this.c.i&2048?this.c.sa[b]=a:this.c.b[b]=a};h.Ze=function(){return this.c.i&49152?this.c.fa[0]:this.c.b[6]};h.jg=function(a){this.c.i&49152?this.c.fa[0]=a:this.c.b[6]=a}; +h.bf=function(){return this.c.b[7]};h.mg=function(a){this.c.b[7]=a};h.nb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.sa[a]};h.qb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.sa[b]=a};h.$e=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.fa[1]};h.kg=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.fa[1]=a};h.af=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.fa[3]};h.lg=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.fa[3]=a}; +h.Ke=function(a){return this.c.Eb[a-65504>>1]};h.Xf=function(a,b){this.c.Eb[b-65504>>1]=a};h.rd=function(a){return 65520==a?(ic(this.u)>>6)-1:0};h.ud=function(){};h.yf=function(){return 1};h.Hg=function(){};h.Je=function(){return this.c.D};h.Wf=function(){this.c.D=0};h.Qe=function(){return this.c.Bb};h.cg=function(a,b){b&1||(a&=255);this.c.Bb=a};h.Ve=function(a,b){return b?0:this.c.Sa};h.fg=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.f|=1}b.Sa=a}; +h.xf=function(a,b){return b?0:this.c.Ia&65280};h.Gg=function(a){this.c.Ia=a|255};h.Ye=function(){return zc(this.c)};h.ig=function(a){Ac(this.c,a)};h.td=function(){}; +var K={},sc=(K[61568]=[null,null,J.prototype.Df,J.prototype.Mg,"UNIMAP",64,1170],K[62592]=[null,null,J.prototype.wf,J.prototype.Fg,"SIPDR",8,1145,64],K[62608]=[null,null,J.prototype.uf,J.prototype.Dg,"SDPDR",8,1145,64],K[62624]=[null,null,J.prototype.vf,J.prototype.Eg,"SIPAR",8,1145,64],K[62640]=[null,null,J.prototype.tf,J.prototype.Cg,"SDPAR",8,1145,64],K[62656]=[null,null,J.prototype.Oe,J.prototype.ag,"KIPDR",8,1140,64],K[62672]=[null,null,J.prototype.Me,J.prototype.Zf,"KDPDR",8,1145,64],K[62688]= +[null,null,J.prototype.Ne,J.prototype.$f,"KIPAR",8,1140,64],K[62704]=[null,null,J.prototype.Le,J.prototype.Yf,"KDPAR",8,1145,64],K[62798]=[null,null,J.prototype.Ue,J.prototype.eg,"MMR3",1,1145,64],K[65382]=[null,null,J.prototype.Pe,J.prototype.bg,"LKS"],K[65402]=[null,null,J.prototype.Re,J.prototype.dg,"MMR0",1,1140,64],K[65404]=[null,null,J.prototype.Se,J.prototype.td,"MMR1",1,1145,64],K[65406]=[null,null,J.prototype.Te,J.prototype.td,"MMR2",1,1140,64],K[65408]=[null,null,J.prototype.Cf,J.prototype.Lg, +"UIPDR",8,1140,64],K[65424]=[null,null,J.prototype.Af,J.prototype.Jg,"UDPDR",8,1145,64],K[65440]=[null,null,J.prototype.Bf,J.prototype.Kg,"UIPAR",8,1140,64],K[65456]=[null,null,J.prototype.zf,J.prototype.Ig,"UDPAR",8,1145,64],K[65472]=[null,null,J.prototype.mb,J.prototype.pb,"R0SET0"],K[65473]=[null,null,J.prototype.mb,J.prototype.pb,"R1SET0"],K[65474]=[null,null,J.prototype.mb,J.prototype.pb,"R2SET0"],K[65475]=[null,null,J.prototype.mb,J.prototype.pb,"R3SET0"],K[65476]=[null,null,J.prototype.mb, +J.prototype.pb,"R4SET0"],K[65477]=[null,null,J.prototype.mb,J.prototype.pb,"R5SET0"],K[65478]=[null,null,J.prototype.Ze,J.prototype.jg,"R6KERNEL"],K[65479]=[null,null,J.prototype.bf,J.prototype.mg,"R7KERNEL"],K[65480]=[null,null,J.prototype.nb,J.prototype.qb,"R0SET1",1,1145],K[65481]=[null,null,J.prototype.nb,J.prototype.qb,"R1SET1",1,1145],K[65482]=[null,null,J.prototype.nb,J.prototype.qb,"R2SET1",1,1145],K[65483]=[null,null,J.prototype.nb,J.prototype.qb,"R3SET1",1,1145],K[65484]=[null,null,J.prototype.nb, +J.prototype.qb,"R4SET1",1,1145],K[65485]=[null,null,J.prototype.nb,J.prototype.qb,"R5SET1",1,1145],K[65486]=[null,null,J.prototype.$e,J.prototype.kg,"R6SUPER",1,1145],K[65487]=[null,null,J.prototype.af,J.prototype.lg,"R6USER",1,1145],K[65504]=[null,null,J.prototype.Ke,J.prototype.Xf,"CTRL",8,1170],K[65520]=[null,null,J.prototype.rd,J.prototype.ud,"LSIZE",1,1170],K[65522]=[null,null,J.prototype.rd,J.prototype.ud,"HSIZE",1,1170],K[65524]=[null,null,J.prototype.yf,J.prototype.Hg,"SYSID",1,1170],K[65526]= +[null,null,J.prototype.Je,J.prototype.Wf,"ERR",1,1170],K[65528]=[null,null,J.prototype.Qe,J.prototype.cg,"MBR",1,1170],K[65530]=[null,null,J.prototype.Ve,J.prototype.fg,"PIR"],K[65532]=[null,null,J.prototype.xf,J.prototype.Gg,"SLR"],K[65534]=[null,null,J.prototype.Ye,J.prototype.ig,"PSW"],K); +Za(function(){for(var a=A(document,x,"device"),b=0;b>1),this.c=new Int32Array(this.g,0,this.size>>2),Fc(this,Gc?Hc:Ic);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.He=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.If=function(a,b){ib&&a&1&&H(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; +h.Uf=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.Ba=!0};h.Fe=function(a,b){return this.i(a,b)};h.Ff=function(a,b){return this.l(a,b)};h.Sf=function(a,b,c){this.A?this.Jb(0,0,c):this.m(a,b,c)};h.Og=function(a,b,c){this.A?this.Jb(0,0,c):this.F(a,b,c)};h.Ee=function(a){return this.a[a]}; +h.Ge=function(a){return this.a[a]};h.Ef=function(a,b){ib&&a&1&&H(this.b,b,64);return this.u.getUint16(a,!0)};h.Hf=function(a,b){ib&&a&1&&H(this.b,b,64);return!jb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Rf=function(a,b){this.a[a]=b;this.Ba=!0};h.Tf=function(a,b){this.a[a]=b;this.Ba=!0};h.Ng=function(a,b,c){ib&&a&1&&H(this.b,c,64);this.u.setUint16(a,b,!0);this.Ba=!0};h.Pg=function(a,b,c){ib&&a&1&&H(this.b,c,64);!jb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.Ba=!0}; +var Dc=0,jc=1,Ec=2,$b=4,ec=["NONE","RAM","ROM","VID","H/W"],Cc=0,Lc=[],Kc=[G.prototype.He,G.prototype.Uf,G.prototype.If,G.prototype.Qg],Oc=[G.prototype.Fe,G.prototype.Sf,G.prototype.Ff,G.prototype.Og];if(gb)var Ic=[G.prototype.Ee,G.prototype.Rf,G.prototype.Ef,G.prototype.Ng],Hc=[G.prototype.Ge,G.prototype.Tf,G.prototype.Hf,G.prototype.Pg];var Pc;if(gb){var Qc=new ArrayBuffer(2);(new DataView(Qc)).setUint16(0,256,!0);Pc=256===(new Uint16Array(Qc))[0]}else Pc=!1;var Gc=Pc; +function Rc(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Lc=0;this.ec=b;this.Ra=c;this.nc=Math.round(this.ec/1E4)/100;this.bb=this.nc*this.Ra;this.oc=this.Ab=this.fb=this.fc=0;this.j.L=this.j.Ic=!1;this.j.ba=a.autoStart;"string"==typeof this.j.ba&&(this.j.ba="true"==this.j.ba);this.j.Tb=!1;this.cc=this.eb=0;this.dc=+a.csStart;this.yb=+a.csInterval;this.zb=+a.csStop;this.W=[];this.bd=this.Mf.bind(this);this.Ha=this.za=this.Ga=this.a=this.Y=this.ya=this.xb=this.Fa=this.gb= +this.pc=this.Oa=0;this.ma=null;B(this)}n(Rc,q);h=Rc.prototype;h.ha=function(a,b,c,d){this.A=a;this.u=b;this.F=d;this.ma=a.g;for(a=0;a=a.eb&&(a.eb+=a.yb,c=!0);0<=a.zb&&a.zb<=Wc(a)&&(a.yb=a.zb=-1,Vc(a),F(a),c=!0);c&&a.X(Wc(a)+" cycles: checksum="+Ea(a.cc))}} +h.ka=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.m[b]=c,!0;case "run":return this.m[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.P)a=!0;else{var b=null,c,k=xa(a.id);for(c=0;ca.Oa/a.bb&&(b=1);a.Ra=b;b=a.nc*a.Ra;if(a.bb!=b){a.bb=b;b=a.bb.toFixed(2)+"Mhz";var d=a.m.setSpeed;d&&(d.textContent=b);a.X("target speed: "+b)}c&&a.A&&$c(a.A)}Ib(a,a.za);a.za=0;a.ya=va();a.Fa=0;Yc(a)}function nc(a,b){var c=a.W.length;a.W.push([-1,b]);return c}function qc(a,b,c,d){0<=b&&ba.W[b][0])&&(c=a.ec*a.Ra/1E3*c|0,a.j.L&&(c+=ad(a)),a.W[b][0]=c)}function bd(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ad(a,b){var c=a.Ga-=a.a;a.a=a.Y=0;b&&(a.Ga=0);return c} +h.Mf=function(){if(this.j.L){this.fc>=this.ec&&Yc(this,!0);this.gb=0;this.xb=va();if(this.Fa){var a=this.xb-this.Fa;a>this.oc&&(this.ya+=a,this.ya>this.xb&&(this.ya=this.xb))}try{do{for(var b,c=this.j.Tb?1:this.Ab,d=this.W.length-1;0<=d;d--){var e=this.W[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.kc(b)}catch(f){if("number"!=typeof f)throw f;}b=ad(this,!0);this.gb+=b;this.za+=b;Jb(this,b);Hb(this,b);this.fb-=b;if(0>=this.fb){this.fb+=this.Ab;++this.pc>=cd&&(this.A&&Kb(this.A,void 0),this.pc=0);break}}while(this.j.L)}catch(f){F(this); +this.A&&this.A.stop(va(),Wc(this));a=f.stack||f.message;this.j.error=!0;this.G(a);return}if(this.j.L){a=setTimeout;b=this.bd;this.Fa=va();c=this.oc;this.gb&&(c=Math.round(c*this.gb/this.Ab));c-=this.Fa-this.xb;if(d=this.Fa-this.ya)this.Oa=Math.round(this.za/(10*d))/100,864E5<=d&&(this.Ha=0,Xc(this));if(0>c||this.Oac&&(this.ya-=c),c=0;this.fc+=this.gb;this.Fa+=c;a(b,c)}}}; +function Gb(a){var b;a.j.error?(a.X(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.L)a.X(a.toString()+" busy");else{Xc(a);a.j.L=!0;a.j.Ic=!0;if(b=a.m.run)b.textContent="Halt";a.A&&a.A.start(a.ya,Wc(a));a.F||a.status("Started");setTimeout(a.bd,0)}}h.kc=function(){return 0};function F(a){var b=!1;if(a.j.L){ad(a);Ib(a,a.za);a.za=0;a.j.L=!1;if(b=a.m.run)b.textContent="Run";a.A&&a.A.stop(va(),Wc(a));b=!0;a.F||a.status("Stopped")}a.j.complete=void 0;return b}var Zc=30,cd=15,Sc=["power","reset"]; +function dd(a){var b=+a.model||1170;Rc.call(this,a,6666667);this.pa=b;this.Wc=+a.addrReset||0;this.Aa=this.i=this.B=this.v=this.l=this.o=this.w=0;this.b=this.sa=this.fa=[];this.H=this.s=this.Ja=this.Eb=[];this.Ea=this.C=this.Vc=this.cb=this.Pa=this.Qa=this.Xa=this.D=this.Bb=this.Sa=this.Ia=this.J=this.Cb=this.Db=this.qa=this.f=0;this.fe=[4,2,0,1];this.hc=0;this.$c=255;1120>=this.pa?(this.Uc=ed.bind(this),this.$a=this.oe,this.hc=8,this.$c=-1,this.fd=255,this.cd=0):(this.Uc=fd.bind(this),this.$a=this.pe, +this.fd=~(1792|(1140>=this.pa?2048:0))&65535,this.cd=1140e.Ib&&(e.Ib=c,c+=4)}return Rc.prototype.ja.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.pa);this.j.L&&F(this);this.v=65536;this.l=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.Wc,-1,-2,-3,-4,-5,-6,-7,-8];this.sa=[0,0,0,0,0,0];this.fa=[0,0,0,0];this.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, +65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ja=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Eb=[0,0,0,0,0,0,0,0];this.B=0;this.Aa=-1;this.h=this.g=this.bc=this.K=this.R=this.f=this.Bb=0;Eb(this);Uc(this);this.j.error=!1;Rc.prototype.reset.call(this)};function Eb(a){a.J=0;a.Cb=0;a.Db=0;a.qa=0;a.D=0;a.Sa=0;a.Ia=255;a.cb=0;a.Pa=0;a.Qa=0;a.Xa=262143;a.Ea=a.b[7];a.C=0;a.I=null;a.u&&(gd(a),a.Vc=ic(a.u))} +function gd(a){a.Yb=a.Mc;a.Zb=a.ic;a.jc=a.lc;a.$b=a.mc;a.cb?(a.wa=65536,a.Xb=a.qa&16?4186112:253952,a.oa=a.od,a.V=a.sd,a.rb=a.vd,ac(a.u,a.qa&16?22:18)):(a.wa=0,a.Xb=57344,a.oa=a.te,a.V=a.Gf,a.rb=a.Rg,ac(a.u,16))}function uc(a){var b=a.J;b&57344||(b=b&-3199|a.Pa<<5|a.Qa<<1);return b}function vc(a,b){b&=-3073;if(a.J!=b){b&57344&&!(a.J&57344)&&(a.Cb=a.C>>16&65535,a.Db=a.C&65535);a.J=b;a.Pa=(b&96)>>5;a.Qa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.cb!=c&&(a.cb=c,gd(a))}} +function wc(a){a.J&57344||(a.Cb=a.C>>16&65535);a=a.Cb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xc(a){a.J&57344||(a.Db=a.C&65535);return a.Db}function yc(a,b){1170>a.pa&&(b&=-49);a.qa!=b&&(a.qa=b,a.Xa=b&16?4194303:262143,gd(a))}function hd(a,b,c){a.Wc=b;id(a,b);Ac(a,0);a.u.reset();Eb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.L||Gb(a)}else a.F&&a.j.P?F(a)||(a.F.f(),Kb(a.A,-1)):!1===c&&F(a);!a.j.L&&a.ma&&a.ma.stop()}h.nd=function(){return 0}; +h.save=function(){var a=new E(this);a.set(0,[this.b,this.sa,this.fa,this.H,this.s,this.Ja,this.Eb,this.D,this.Bb,this.Sa,this.Ia,this.Pa,this.Qa,this.Ea,this.f,this.C,this.Aa,this.sc,this.uc]);a.set(1,[zc(this),uc(this),wc(this),xc(this),this.qa]);a.set(2,[this.Ha,this.Ra,this.j.ba]);a.set(3,jd(this));a.set(4,bd(this));return a.data()}; +h.restore=function(a){var b=ja(a[0]);this.b=b.next().value;this.sa=b.next().value;this.fa=b.next().value;this.H=b.next().value;this.s=b.next().value;this.Ja=b.next().value;this.Eb=b.next().value;this.D=b.next().value;this.Bb=b.next().value;this.Sa=b.next().value;this.Ia=b.next().value;this.Pa=b.next().value;this.Qa=b.next().value;this.Ea=b.next().value;this.f=b.next().value;this.C=b.next().value;this.Aa=b.next().value;this.sc=b.next().value;this.uc=b.next().value;b=a[1];Ac(this,b[0]);vc(this,b[1]); +this.Cb=b[2];this.Db=b[3];yc(this,b[4]);b=a[2];this.Ha=b[0];Xc(this,b[1]);this.j.ba=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function id(a,b){a.b[7]=b&65535}function rc(a,b,c,d){b={Ib:b,kb:c,message:d||0,name:kb[b],next:null};a.wb.push(b);return b}function tc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.f|=1)}function oc(a,b){if(b){if(b!=a.I){var c=a.I;if(!c||c.kb<=b.kb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.kb<=b.kb){b.next=d;c.next=b;break}c=d}while(c)}}a.f|=1}} +function jd(a){var b=[];for(a=a.I;a;)b.push(a.Ib),a=a.next;return b}function nd(a){return a.f&64?(I(a,168,64,-6),!0):a.f&32?(I(a,4,32,-5),!0):a.f&16?(I(a,12,16,-7),!0):!1}function zc(a){return a.i=a.i&63728|ld(a)|(a.o&65535?0:4)|(a.l&32768?2:0)|kd(a)}function Ac(a,b){b&=a.fd;a.w=b<<12;a.o=~b&4;a.l=b<<14;a.v=b<<16;if((b^a.i)&a.cd)for(var c=a.sa.length;0<=--c;){var d=a.b[c];a.b[c]=a.sa[c];a.sa[c]=d}a.B=b>>14&3;c=a.i>>14&3;a.B!=c&&(a.fa[c]=a.b[6],a.b[6]=a.fa[a.B]);a.i=b;a.f&=-3;a.f|=a.I?2:1} +h.ea=function(a){this.w=this.o=a;this.l=0};h.La=function(a,b){this.w=this.o=this.v=a;this.l=b||0};function od(a,b){a.w=a.o=a.v=b;a.l=a.w^a.v>>1}function pd(a,b,c,d){a.w=a.o=a.v=b;a.l=(c^d)&(d^b)} +function I(a,b,c,d){if(!a.ib){0>a.Aa?a.Aa=zc(a):a.B||(d=-4);-4==d&&(a.f&256&&(d=-1),a.f|=256,a.D|=4,a.b[6]=b=4);if(-1!=d){a.C=b|4143316992;a.B=0;var e=a.V(b|a.wa),f=a.V(b+2&65535|a.wa);Ac(a,f&-12289|a.Aa>>2&12288);qd(a,a.Aa);qd(a,a.b[7]);id(a,e)}a.a-=5;a.f&=~(c|19);a.f|=129;a.Aa=-1;a.sc=d;a.uc=b;-1==d&&F(a);if(-4<=d)throw b;}}function rd(a){var b=sd(a),c=sd(a);a.i&49152&&(c=c&-225|a.i&63712);id(a,b);Ac(a,c);a.f&=-17} +function td(a,b){var c=b>>13&31;31>c&&(b=a.qa&32?a.Ja[c]+(b&8191)&4194303:b&-3932161);return b} +function Nb(a,b,c){var d,e,f;if(!(c&a.cb))return f=b&65535,57344<=f&&(f|=a.Xb),f;d=b>>13;a.qa&a.fe[a.B]||(d&=7);e=a.s[a.B][d];f=(a.H[a.B][d]<<6)+(b&8191)&a.Xa;3932160<=f&&(f=td(a,f));if(a.ib)return f;f>=a.Vc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.s[a.B][d]=e;if(f!=(4194170&a.Xa)||a.B)a.Pa=a.B,a.Qa=d;g&&(g&57344&&(0<=a.Aa&&(g|=128),a.J&57344||(g|=a.J&4096|a.Pa<<5|a.Qa<<1,vc(a,a.J&-61695|g&61694)),I(a,168,64,-2)),a.J&61440||!(f<(4191360&a.Xa)||f>(4194239&a.Xa))||(a.J|=4096,a.J&512&&(a.f|=64)));return f}function sd(a){var b=a.V(a.b[6]|a.wa);a.b[6]=a.b[6]+2&65535;return b}function qd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.C=a.C&65535|(a.C&-65536)<<8|16121856;a.f&256||a.$a(4,-2,c);a.rb(c,b)} +function ud(a,b,c,d){var e,f,g=d&8?0:a.wa;switch(b){case 0:return I(a,4,0,-3),0;case 1:return 6==c&&a.$a(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.$a(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.$a(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(md(a,2)),e=e+a.b[c]&65535,6==c&&a.$a(d,0, +e),a.a-=6,e|g;case 7:return e=a.V(md(a,2)),e=e+a.b[c]&65535,e=a.V(e|a.wa),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.C=a.C&65535|(a.C&-65536)<<8|(f<<3&248|c)<<16;return e}h.oe=function(a,b,c){!this.B&&0>=b&&c<=this.Ia&&(this.f|=32)};h.pe=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.Ia&&(c<=this.Ia-32?I(this,4,0,-4):(this.D|=8,this.f|=32)))};h.se=function(a){return this.Mc(a)};h.ue=function(a){return this.ic(a)};h.Of=function(a,b){this.lc(a,b)};h.Qf=function(a,b){this.mc(a,b)}; +h.te=function(a,b,c){return ud(this,a,b,c)};h.od=function(a,b,c){return Nb(this,ud(this,a,b,c),c)};h.Gf=function(a){return this.u.Kb(this.Ea=a)};h.sd=function(a){return this.u.Kb(this.Ea=Nb(this,a,2))};h.Rg=function(a,b){this.u.Lb(this.Ea=a,b)};h.vd=function(a,b){this.u.Lb(this.Ea=Nb(this,a,4),b)}; +function vd(a,b,c){var d=a.g=b&7;(b=a.h=(b&56)>>3)?(d=ud(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.B=a.i>>12&3,c=a.V(d|c&a.wa),a.B=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.fa[a.i>>12&3];return c}function wd(a,b,c,d){a.C=a.C&65535|1441792;var e=a.g=b&7;(b=a.h=(b&56)>>3)?(e=ud(a,b,e,4),c&65536||(e&=65535),a.B=a.i>>12&3,e=Nb(a,e|c&65536,4),a.B=a.i>>14&3,a.$b(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.fa[a.i>>12&3]=d} +function xd(a,b){b>>=6;var c=a.R=b&7;return(b=a.K=(b&56)>>3)?a.Yb(a.oa(b,c,3)):a.b[c+a.hc]&a.$c}function yd(a,b){var c;b>>=6;var d=a.R=b&7;(b=a.K=(b&56)>>3)?c=a.Zb(a.oa(b,d,2)):c=a.b[d+a.hc];return c}function zd(a,b){var c=a.g=b&7;b=a.h=(b&56)>>3;return ud(a,b,c,8)}function Ad(a,b){var c=a.g=b&7;return(b=a.h=(b&56)>>3)?a.Yb(a.oa(b,c,3)):a.b[c]&255}function Bd(a,b){var c,d=a.g=b&7;(b=a.h=(b&56)>>3)?c=a.Zb(a.oa(b,d,2)):c=a.b[d];return c} +function O(a,b,c,d){var e=a.g=b&7;(b=a.h=(b&56)>>3)?(e=a.bc=a.oa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.jc(e,d.call(a,c,a.Yb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function P(a,b,c,d){var e=a.g=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,6),a.$b(e,d.call(a,0>c?a.b[-c-1]:c,a.Zb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} +function Cd(a,b,c,d,e){var f=a.g=b&7;(b=a.h=(b&56)>>3)?(d=a.oa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.jc(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function Dd(a,b,c,d){var e=a.g=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.$b(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} +h.kc=function(a){this.j.complete=!0;var b=a?this.j.Ic?0:1:-1;this.j.Ic=!1;this.Ga=this.a=a;this.f=this.f&-5|0;do{if(this.f){if(a=this.f&11)if(a=!1,this.f&2){var c=160,d=(this.Sa&224)>>5,e=this.I&&this.I.kb>d?this.I:null;e&&(c=e.Ib,d=e.kb);d>(this.i&224)>>5?(this.f&8&&(md(this,2),this.f&=-9),I(this,c,0,-10),d=!0):d=!1;d&&(e&&tc(this,e),a=!0);this.I||this.Sa||(this.f&=-3)}else this.f&1&&this.f++;if(a){if(this.f&4&&this.F.b(this.b[7],b)){F(this);break}if(0>b)break}if(this.f&112&&nd(this)){if(this.f& +4&&this.F.b(this.b[7],b)){F(this);break}if(0>b)break}}this.f=this.f&15|this.i&16;a=this.C=this.b[7];e=this.V(a);this.b[7]=a+2&65535;this.Uc(e)}while(0>1|b<<16;od(this,a);return a&65535}function Jd(a,b){a=b&128|b>>1|b<<8;od(this,a<<8);return a&255}function Kd(a,b){a=b&~a;this.ea(a);return a}function Ld(a,b){a=b&~a;this.ea(a<<8);return a}function Md(a,b){a|=b;this.ea(a);return a}function Nd(a,b){a|=b;this.ea(a<<8);return a} +function Od(a,b){a=~b|65536;this.La(a);return a&65535}function Pd(a,b){a=~b|256;this.La(a<<8);return a&255}function Qd(a,b){this.w=this.o=a=b-a;this.l=b&(b^a);return a&65535}function Rd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.l=b&(b^c);return a&255}function Sd(a,b){this.w=this.o=a=b+a;this.l=a&(b^a);return a&65535}function Td(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.l=c&(b<<8^c);return a&255}function Ud(a,b){a=-b;this.La(a,a&b&32768);return a&65535} +function Vd(a,b){a=-b;this.La(a<<8,(a&b&128)<<8);return a&255}function Wd(a,b){a=b<<1|this.v>>16&1;od(this,a);return a&65535}function Xd(a,b){a=b<<1|this.v>>16&1;od(this,a<<8);return a&255}function Yd(a,b){a=(this.v&65536|b)>>1|b<<16;od(this,a);return a&65535}function Zd(a,b){a=((this.v&65536)>>8|b)>>1|b<<8;od(this,a<<8);return a&255}function $d(a,b){var c=b-a;pd(this,c,a,b);return c&65535}function ae(a,b){var c=b-a;pd(this,c<<8,a<<8,b<<8);return c&255} +function be(a,b){this.w=this.o=b&65280;this.l=this.v=0;return(b<<8|b>>8)&65535}function ce(a,b){a^=b;this.ea(a);return a&65535}function de(a){P(this,a,yd(this,a),Ed);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)} +function ee(a){var b=Bd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.v=this.l=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.l=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} +function fe(a){var b=Bd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.l=0;b&=63;if(b&32){b=64-b;32>b-1;this.v=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function ge(a){N(this,a,!kd(this))}function he(a){N(this,a,kd(this))} +function ie(a){P(this,a,yd(this,a),Kd);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}function je(a){O(this,a,xd(this,a),Ld);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}function ke(a){P(this,a,yd(this,a),Md);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}function le(a){O(this,a,xd(this,a),Nd);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)} +function me(a){var b=yd(this,a);a=Bd(this,a);this.ea((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.R&&6<=this.g?1:0):(this.K?4:3)+(7==this.g?2:0)}function ne(a){var b=xd(this,a);a=Ad(this,a);this.ea(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.R&&6<=this.g?1:0):(this.K?4:3)+(7==this.g?2:0)}function oe(a){N(this,a,this.o&65535?0:4)}function pe(a){N(this,a,!ld(this)==!(this.l&32768))}function qe(a){N(this,a,!!(this.o&65535)&&!ld(this)==!(this.l&32768))} +function re(a){N(this,a,!kd(this)&&!!(this.o&65535))}function se(a){N(this,a,(this.o&65535?0:4)||!ld(this)!=!(this.l&32768))}function te(a){N(this,a,kd(this)||(this.o&65535?0:4))}function ue(a){N(this,a,!ld(this)!=!(this.l&32768))}function ve(a){N(this,a,ld(this))}function we(a){N(this,a,!!(this.o&65535))}function xe(a){N(this,a,!ld(this))}function ye(){I(this,12,0,-9)}function ze(a){N(this,a,!0)}function Ae(a){N(this,a,!(this.l&32768))}function Be(a){N(this,a,this.l&32768?2:0)} +function Q(a){a&1&&(this.v=0);a&2&&(this.l=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function Ce(a){var b=yd(this,a);a=Bd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;pd(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.g?1:0):(this.K?4:3)+(7==this.g?2:0)}function De(a){var b=xd(this,a);a=Ad(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);pd(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.g?1:0):(this.K?4:3)+(7==this.g?2:0)} +function Ee(a){var b=Bd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.l=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.l=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.l=32768,this.v=65536,this.a-=7}function Fe(){I(this,24,0,-9);this.a-=20} +function Ge(){this.i&49152?(this.D|=128,I(this,4,0,-8)):(this.ma&&1120==this.pa&&this.ma.setData(this.b[0],!0),this.F?this.F.i():F(this));this.a-=7}function He(){I(this,16,0,-9);this.a-=20}var Ie=[0,7,7,10,7,11,9,13];function Je(a){this.Y=this.a;id(this,zd(this,a));this.a=this.Y-Ie[this.h]}var Ke=[0,14,14,17,14,18,16,20];function Le(a){this.Y=this.a;var b=zd(this,a);a=a>>6&7;qd(this,this.b[a]);this.b[a]=this.b[7];id(this,b);this.a=this.Y-Ke[this.h]}var Me=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function Ne(a){var b=yd(this,a);this.Y=this.a;Dd(this,a,b,this.ea);this.a=this.Y-Me[(this.K?8:0)+this.h]+(7!=this.g||this.h?0:2)}function Oe(a){var b=xd(this,a);Cd(this,a,b,65535,this.ea);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}var Pe=[7,13,13,17,14,18,17,21];function Qe(a){var b=Bd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.l=0;this.v=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)id(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6} +function We(a){P(this,a,yd(this,a),$d);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}function Xe(a){P(this,a,0,be);this.a-=this.h?9:3+(7==this.g?2:0)}function Ye(){I(this,28,0,-9)}function Ze(){this.ma&&(this.ma.U=this.b[7],this.ma.setData(this.b[0],!0));this.f|=8;md(this,-2);this.a-=3}function $e(a){P(this,a,this.b[(a>>6&7)+this.hc],ce);this.a-=this.h?9:3+(7==this.g?2:0)}function S(){I(this,8,0,-9)}function ed(a){af[a>>12].call(this,a)} +function bf(a){cf[a>>6&3].call(this,a)}function df(a){ef[a>>6&3].call(this,a)}function ff(a){gf[a>>6&3].call(this,a)}function hf(a){jf[a&15].call(this,a)}function kf(a){lf[a&15].call(this,a)}function mf(a){nf[a>>6&3].call(this,a)}function of(a){pf[a>>6&3].call(this,a)}function qf(a){rf[a>>6&3].call(this,a)} +var af=[function(a){sf[a>>8&15].call(this,a)},Ne,Ce,me,ie,ke,de,S,function(a){tf[a>>8&15].call(this,a)},Oe,De,ne,je,le,We,S],sf=[function(a){uf[a>>4&15].call(this,a)},ze,we,oe,pe,ue,qe,se,Le,Le,bf,df,ff,S,S,S],cf=[function(a){Dd(this,a,0,this.La);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,0,Od);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,1,Sd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,1,Qd);this.a-=this.h?9:3+(7==this.g?2:0)}],ef=[function(a){P(this,a,0,Ud); +this.a-=this.h?11:6},function(a){P(this,a,kd(this)?1:0,Ed);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,kd(this)?1:0,$d);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){a=Bd(this,a);this.La(a);this.a-=this.h?4:3+(7==this.g?2:0)}],gf=[function(a){P(this,a,0,Yd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,0,Wd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,0,Id);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,0,Gd);this.a-=this.h?9:3+(7==this.g?2:0)}],uf= +[function(a){vf[a&15].call(this,a)},S,S,S,Je,Je,Je,Je,Te,S,hf,kf,Xe,Xe,Xe,Xe],vf=[Ge,Ze,Ue,ye,He,Se,S,S,S,S,S,S,S,S,S,S],jf=[Re,function(){this.v=0;this.a-=5},function(){this.l=0;this.a-=5},Q,function(){this.o=1;this.a-=5},Q,Q,Q,function(){this.w=0;this.a-=5},Q,Q,Q,Q,Q,Q,Q],lf=[Re,function(){this.v=65536;this.a-=5},function(){this.l=32768;this.a-=5},R,function(){this.o=0;this.a-=5},R,R,R,function(){this.w=32768;this.a-=5},R,R,R,R,R,R,R],tf=[xe,ve,re,te,Ae,Be,ge,he,Fe,Ye,mf,of,qf,S,S,S],nf=[function(a){Cd(this, +a,0,255,this.La);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,0,Pd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,1,Td);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,1,Rd);this.a-=this.h?9:3+(7==this.g?2:0)}],pf=[function(a){O(this,a,0,Vd);this.a-=this.h?11:6},function(a){O(this,a,kd(this)?1:0,Fd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,kd(this)?1:0,ae);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){a=Ad(this,a);this.La(a<<8);this.a-=this.h?4:3+ +(7==this.g?2:0)}],rf=[function(a){O(this,a,0,Zd);this.a-=this.h?9+(this.bc&1):3+(7==this.g?2:0)},function(a){O(this,a,0,Xd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,0,Jd);this.a-=this.h?9+(this.bc&1):3+(7==this.g?2:0)},function(a){O(this,a,0,Hd);this.a-=this.h?9:3+(7==this.g?2:0)}];function fd(a){wf[a>>12].call(this,a)} +var wf=[function(a){xf[a>>8&15].call(this,a)},Ne,Ce,me,ie,ke,de,function(a){yf[a>>8&15].call(this,a)},function(a){zf[a>>8&15].call(this,a)},Oe,De,ne,je,le,We,S],xf=[function(a){Af[a>>4&15].call(this,a)},ze,we,oe,pe,ue,qe,se,Le,Le,bf,df,ff,function(a){Bf[a>>6&3].call(this,a)},S,S],Bf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.V(a|this.wa);id(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=vd(this,a,0);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this); +this.Y=this.a;this.ea(b);wd(this,a,0,b);this.a=this.Y-Pe[this.h]},function(a){Dd(this,a,ld(this)?65535:0,this.ea);this.a-=this.h?9:3+(7==this.g?2:0)}],Af=[function(a){Cf[a&15].call(this,a)},S,S,S,Je,Je,Je,Je,Te,function(a){!(a&8)||1145>this.pa?I(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.f|=1,this.f&=-3),this.a-=5)},hf,kf,Xe,Xe,Xe,Xe],Cf=[Ge,Ze,function(){rd(this);this.f|=this.i&16;this.a-=13},ye,He,Se,Ue,function(){I(this,8,0,-9)},S,S,S,S,S,S,S,S],yf=[Qe,Qe,Ee,Ee,ee,ee,fe,fe,$e, +$e,S,S,S,S,Ve,Ve],zf=[xe,ve,re,te,Ae,Be,ge,he,Fe,Ye,mf,of,qf,function(a){1145>this.pa?I(this,8,0,-9):Df[a>>6&3].call(this,a)},S,S],Df=[function(){I(this,8,0,-9)},function(a){a=vd(this,a,65536);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this);this.Y=this.a;this.ea(b);wd(this,a,65536,b);this.a=this.Y-Pe[this.h]},function(){I(this,8,0,-9)}]; +function Ef(a){q.call(this,"ROM",a,128);this.ga=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.g=a.alias;"string"==typeof this.g&&(this.g=eval(this.g));this.f=a.file;this.l=Fa(this.f);if(this.f){a=this.f;var b=Ga(this.l);"json"!=b&&"hex"!=b&&(a=Qa()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Oa(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.f=null):(ta(c.Na,a,b),(a=Pa(a,b))?(c.b=a.M,c.ga=a.ga):c.f=null);Ff(c)})}}n(Ef,q); +h=Ef.prototype;h.ha=function(a,b,c,d){this.u=b;this.c=c;this.F=d;Ff(this)};h.ja=function(){this.ga&&(this.F&&this.F.a(this.id,this.h,this.a,this.ga),delete this.ga);return!0};h.ia=function(){return!0}; +function Ff(a){if(!Aa(a)){if(a.f){if(!a.b||!a.u)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+Ea(a.b.length,8,!0)+") does not match specified size ("+Ea(a.a,8,!0)+")";a.j.error=!0;a.G(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Tb){var c={},c=(c[b]=[Ef.prototype.sf,Ef.prototype.Bg,null,null,null,a.a>>1],c);if(qb(a.u,a,c)){a.status("Added "+a.a+"-byte ROM at "+Da(b));b=a.i=!0;break a}}else if(Zb(a.u,b,a.a,Ec)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),z=l,y=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(y)for(;y--;)hc(a.u,t++,b[z++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< +b.length;e++)hc(a.u,c+e,b[e]);k=!0}if(k){if(null==d||g)F(a.c),f=!1;null!=d&&hd(a.c,d,f)}return k}Za(function(){for(var a=A(document,x,"ram"),b=0;b=sa.Nc&&c<=sa.ke&&(b=c-(sa.Nc-sa.zd));b&&(a.preventDefault&&a.preventDefault(),d.ac(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==sa.Bd&&(b=sa.Ad);d.ac(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ac(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;var e=this;this.H=rc(this.c,this.B?-1:48,4,262144);this.I=nc(this.c,function(){var a;a=-1;e.g.length&&(a=e.g.shift()&255,e.w&&97<=a&&122>a&&(a-=32),qc(e.c,e.I,1E3/Math.round(e.J/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&oc(c,e.H))});this.C=rc(this.c,this.B?-1:52,4,262144);this.W=nc(this.c,function(){e.b|=128;e.b&64&&oc(c,e.C)});qb(b,this,Lf,this.B?64832+8*(this.B-1)-65392:0);sb(b,this.reset.bind(this));B(this)}; +h.pd=function(a){if(!this.f){var b=Tc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ka(c[0]);if(d!=this.ab)return;c=Ka(c[1]);if(this.f=ya(c)){var e=this.f.exports;if(e){var f=e.connect;f&&f.call(this.f,this.v);if(this.s=e.receiveData){this.v=a;this.D=e.receiveStatus;this.status("Connected "+this.Na+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ja=function(a,b){if(!b)if(this.pd(this.v),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +h.ia=function(a){return a?this.save():!0};h.reset=function(){Mf(this)};h.save=function(){var a=new E(this);a.set(0,[this.o,this.a,this.b,this.g]);return a.data()};h.restore=function(a){return Mf(this,a[0])};function Mf(a,b){b||(b=[0,8192,128,a.g]);b=ja(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.g=b.next().value;return!0} +h.ac=function(a){if("number"==typeof a)this.g.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.R||8,c=a-this.l%a,this.R&&(b=" ".slice(0,c)));this.K&&!this.l&&c&&(b=String.fromCharCode(this.K)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.l+=c}}else if(null!= +this.i){if(10==a||1024<=this.i.length)this.X(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}qc(this.c,this.W,1E3/Math.round(this.Y/10));this.b&=-129};var Kf="buffer",Nf={},Lf=(Nf[65392]=[null,null,T.prototype.df,T.prototype.og,"RCSR"],Nf[65394]=[null,null,T.prototype.cf,T.prototype.ng,"RBUF"],Nf[65396]=[null,null,T.prototype.Kf,T.prototype.Tg,"XCSR"],Nf[65398]=[null,null,T.prototype.Jf,T.prototype.Sg,"XBUF"],Nf); +Za(function(){for(var a=A(document,x,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.m[b]=c,!0;case "readTape":e=Rf;case "loadTape":return e||(e=Sf),this.m[b]=c,c.onclick= +function(){var a=d.m.listTapes;a&&Tf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.C){c.parentNode.removeChild(c);break}this.m[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Tf(d,Fa(b,!0),b,Sf,a)}return!1};return!0;case Uf:return this.m[b]=c,!0}return!1}; +h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;this.v=Vf(a);var e=this;if(a=Of(this,Tc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.B[f]=a[f]);this.s=rc(this.c,56,4,4096);this.H=nc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.lc.indexOf("/api/v1/dump")&&(e=Ga(c),f="json"==e||"gz"==e?encodeURI(c):Qa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Oa(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.P;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ta(a.Na,e,f),(e=Pa(e,f))&&fg(a,b,c,d,e.M,e.aa,e.Z)); +a.j.Va=!1;a.b&&(a.b--,a.b||B(a));cg(a)})}function Yf(a,b,c,d){if((a=a.m.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.N);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ga(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ha(c,"/")&&(d="dir"),f=Qa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Dc?"":e)+"&format=json"));return!!Oa(f, +null,!0,function(b,c,d){ng(a,b,c,d)})} +function ng(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.P;a.f=!1;if(d)a.controller.G('Unable to load disk "'+a.Da+'" (error '+d+": "+b+")",f);else{ta(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)u(k[0]);else{a.N=k.length;a.T=k[0].length;a.O=k[0][0].length;var l=k[0][0][0];a.ca=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var z=l.bytes;if(void 0!==z&&z.length){for(var y=m<<2,fa=z.length;fa>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.f)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.la?f=a.ta+a.la&&(a.la+=f-(a.ta+a.la)+1):(a.ta=f,a.la=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.f){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.G("Unable to restore disk '"+this.Da+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=pg(this,a++);)rg(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function rg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var jg=0;function sg(a,b,c,d,e,f){q.call(this,a,b,c);this.w=tg(this,b.autoMount);this.s=0;this.D=d;this.H=e;this.I=f;this.C=d.Pc;this.g=Array(this.C);this.B=!Va("Mobi")&&window&&"FileReader"in window;this.h=[];this.jb=null;this.exports={selectDrive:this.Nf}}n(sg,q); +function tg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){u(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=sg.prototype; +h.ka=function(a,b,c){var d=this;switch(b){case "listDisks":return this.m[b]=c,c.onchange=function(){var a=d.m.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){u(d.type+" option error: "+k.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.m[b]=c,c.onchange=function(){var a=Ca(c.value);null!=a&&ug(d, +a)},!0;case "loadDisk":return this.m[b]=c,c.onclick=function(){var a=d.m.listDisks;a&&a.options&&vg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.m[b]=c,c.onclick=function(){var a,b=d.m.listDrives,b=b&&Ca(b.value);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.G("Unable to boot the selected drive"):a.da?(hd(d.c,0,!0),(a=d.Gb(a,0,0,0,512,0,2))&&d.G("Unable to read the boot sector ("+a+")")):d.G("Load a disk into the drive first")},!0;case "saveDisk":if(!this.B){c.parentNode.removeChild(c); +break}this.m[b]=c;c.onclick=function(){var a=d.m.listDrives;if(a&&a.options&&d.g)if(a=d.g[Ca(a.value)||0])if(a=a.da){var b;b="";for(var c=0,k;k=pg(a,c++);)for(var l=0,m=k.length;lg||9e||e>=a.g.length)a.G("Unable to load the selected drive");else if(c)if(c==yg)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==zg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Fa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Eg(a,e,b,c,!1,d)}else Bg(a,e)} +function Eg(a,b,c,d,e,f){var g=-1,k=a.g[b];k.na.toLowerCase()!=d.toLowerCase()&&(g++,Bg(a,b,!0),k.Cc?a.G(a.type+" busy"):(k.Cc=!0,e&&(k.Bc=!0,a.s++),k.Ub=!!f,mg(new ig(a,k,"preload"),c,d,f,a.re)&&g++));return g} +h.re=function(a,b,c,d,e){a.Cc=!1;b&&(b.N>a.N||b.T>a.T)&&(this.G('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.Wb)),b=null);if(b){a.da=b;a.Da=c;a.na=d;a:{var f;for(f=0;f=a.N){m=V.Mb;break}p=a.seek(b,c,d+1);if(!p){m=V.gd;break}t=0;++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b))}var z,y;if(0>(z=a.read(p,t++))||0>(y=a.read(p,t++))){m=V.Nb;break}if(!k&&(Mb(this.u,td(this.c,f),z|y<<8),mc(this.u))){m=V.ub;break}t>=a.ca&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.gc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var p=null,t;a||(m=V.Yc,e=0);for(;e;){var z=Ob(this.u,td(this.c,f));if(mc(this.u)){m=V.ub;break}if(!p){if(b>=a.N){m=V.Mb;break}p=a.seek(b,c,d+1,!0);if(!p){m=V.gd;break}t=0;++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b))}if(k){var y,fa;if(0>(y=a.read(p,t++))||0>(fa=a.read(p,t++))){m=V.Nb;break}if(z!=(y|fa<<8)){m=V.kd;break}}else if(!a.write(p,t++,z&255)||!a.write(p,t++,z>>8)){m=V.Nb;break}t>=a.ca&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Qd=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&~U.Za|f>>16-U.S.Za&U.Za;this.l=65536-e&65535;this.f=this.f&~W.xc|d&W.xc;this.b|=a;Hg(this);return!0};function Hg(a){a.a&=~U.tb;a.b&&(a.b|=V.Ed,a.a|=U.tb,a.b&V.qc&&(a.a|=U.qc))}h.jf=function(){return this.v};h.tg=function(){};h.kf=function(){return this.b};h.ug=function(){};h.ff=function(){return this.a&U.wc}; +h.qg=function(a){this.a=this.a&~U.Ta|a&U.Ta;if(this.a&U.Rc){a=!0;var b,c,d=(this.f&W.Ma)>>W.S.Ma,e=this.g[d],f,g,k,l,m,p;this.a&=~(U.va|U.yc);this.b&=~V.ae;switch(c=this.a&U.ra){case Ig.yd:this.b=this.f=0;this.a=U.va;break;case Ig.Md:case Ig.Od:b=this.Gb;case Ig.zc:case Ig.je:b||(b=this.gc);f=(this.f&W.sb)>>W.S.sb;g=(this.f&W.rc)>>W.S.rc;k=this.f&W.xc;l=65536-this.l&65535;m=(this.a&U.Za)<<16-U.S.Za|this.i;p=this.a&U.Kd?0:2;if(f>=e.N){this.b|=V.Mb;break}if(k>=e.O){this.b|=V.Nb;break}a=b.call(this, +e,f,g,k,l,m,p,c>=Ig.zc,this.Qd.bind(this));break;case Ig.Sb:f=(this.f&W.sb)>>W.S.sb;f(p=a.read(k,m++))||0>(t=a.read(k,m++))){g=Y.xa;break}Mb(this.u,td(this.c,f),p|t<<8);if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(m>=a.ca&&(k=null,++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.xa;break}}return l?l(g,b,c,d,e,f):g}; +h.gc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.da;k=null;var m;a||(g=Y.xa,e=0);for(;e;){var p=Ob(this.u,td(this.c,f));if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=Y.xa;break}m=0}if(!a.write(k,m++,p&255)||!a.write(k,m++,p>>8)){g=Y.xa;break}if(m>=a.ca&&(k=null,++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.xa;break}}return l?l(g,b,c,d,e,f):g}; +h.Vd=function(a,b,c,d,e,f){this.o=f&65535;this.a=this.a&~X.ua|f>>16-X.S.ua&X.ua;this.i=f>>16&Lg.vc;this.f=this.b=b<>X.S.ua;if(!(this.a&X.va)){a=!0;var b,c=this.g[(this.a&X.Ma)>>X.S.Ma],d=c.da,e,f,g;this.a&=~X.Ya;switch(this.a&X.ra){case Mg.ee:this.l&Ng.Sc&&(this.a&=X.Ya|X.ra|X.ua);this.l=c.status|this.f&Z.Rb|(d&&512==d.N?Ng.Hd:0);break;case Mg.Sb:(this.b&Z.Gd)==Z.be&&(b=this.b&Z.vb,c=(this.b&Z.de)<<2,this.f=this.b&Z.ce?this.f+b:this.f-b,this.b=this.f=this.f&Z.vb|c);break;case Mg.Pd:this.l=this.f;break;case Mg.Nd:b=this.Gb;case Mg.ie:b||(b=this.gc), +e=this.b>>Z.S.vb,f=this.b&Z.Rb?1:0,g=this.b&Z.ed,!d||e>=d.N||g>=d.O?this.a=this.a|Y.xa|X.tb:(a=65536-this.l&65535,d=(this.i&Lg.vc)<<16|this.o,a=b.call(this,c,e,f,g,a,d,2,!1,this.Vd.bind(this)))}a&&(this.a=this.a|X.Ya|X.va,this.a&X.tc&&oc(this.c,this.jb))}};h.mf=function(){return this.o};h.wg=function(a){this.o=a&Og.Ta};h.qf=function(){return this.b};h.zg=function(a){this.b=a};h.rf=function(){return this.l};h.Ag=function(a){this.l=a};h.nf=function(){return this.i}; +h.xg=function(a){this.i=a&Lg.vc;this.a=this.a&~X.ua|(this.i&3)<\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bTg){if(Ug(d,this.s)){this.h=new E(this,"1.32.2",ch);Ug(this.h)&&(dh(this,d),a=gh,hh(this.h));this.h.set($g,Na());ih(this.h);var e=this.a&&!this.l;if(a==ah||wa("Click OK to restore the previous "+hb+" machine state, or CANCEL to reset the machine.")){if(c=Zg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ug(d,g):("error"==f&&"no machine state"!= +g?(this.G("Error: "+g),"unable to verify user"==g&&(Ua(jh,""),this.b=null)):this.X(f+": "+g),hh(d),Ug(d)?(c=Zg(d),e=!0):c=!1))}e&&Xg(this,c?d:null)}else a==gh&&d.clear()}else Xg(this);delete this.s;delete this.i}e=xa(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.P=!0;var d=this.m.power;d&&(d.textContent="Shutdown");this.c&&(kh(this,this.c,b,c,a),Kb(this,-2),this.c.ba());this.C&&(dh(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.f=0}; +function dh(a,b){if(wa("There may be a problem with your "+hb+" machine.\n\nTo help us diagnose it, click OK to send this "+hb+" machine state to http://www.pcjs.org.")){var c=a.K;a=a.b||"";b=b.toString();var d={};d.app=hb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;Oa("http://www.pcjs.org/api/v1/report",d,!0)}} +function lh(a,b,c){var d,e="none";if(a.f)return null;a.f--;var f=new E(a,"1.32.2"),g=new E(a,"1.32.2",Yg),k=Na();g.set($g,k);f.set($g,k);f.set(mh,"1.32.2");f.set(nh,window?window.location.href:null);f.set(oh,window?window.navigator.userAgent:"");a.c&&a.c.ia&&(c&&(b&&(a.c.j.ba=a.c.j.L),F(a.c)),d=a.c.ia(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.P=!1,!1===d&&(e=null)));for(var k=xa(a.id),l=0;l=d||30<=(c.Lc+=d))&&(e.textContent=c.j.L?c.Oa.toFixed(2)+"Mhz":"Stopped",c.Lc=0)}if(a.g&&(a=a.g,b=b||0,a.l)){c=a.c.j.L;d=!!(a.c.f&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");E(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Bh(a,b,c)}})}else c(a,null)} -function Ch(a,b,c,d){function e(a){if(void 0===k){var b=g&&A(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ga(a))}function f(a){e("Error: "+a);l&&(--yh||ab(!0));l=!1}var g,k,l=!0;yh++;ua[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?zh(c,null,null,!1,e,function(d,l){l?(ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--yh||ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--yh||ab(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?zh(b,a,d,!0,e,m):Ah(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(y){f(y.message)}return l}window.embedPDP11=function(a,b,c,d){ab(!1);return Ch(a,b,c,d)};window.findMachineComponent=function(a,b){return za(b,a+".machine")};window.enableEvents=ab;window.sendEvent=cb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map +h.ka=function(a,b,c){var d=this;switch(b){case "power":return this.m[b]=c,c.onclick=function(){d.f||(d.j.P?lh(d,!1,!0):Wg(d,d.Fb))},!0;case "reset":return this.m[b]=c,c.onclick=function(){if(d.j.P&&!d.f)if(d.a&&!d.o){var a=wa("Click OK to save changes to this "+hb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");lh(d,a,!0);!a&&d.v?window&&window.location.reload():(a||(d.B=!0),d.Fb(Tg),d.B=!1)}else d.reset(),d.c&&d.c.ba()},!0;case "save":if(Ha(Qa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.m[b]= +c,c.onclick=function(){var a=Sg(d,!0);if(a){var b=!!(d.a&&!d.o||d.v),c=lh(d,b);b?ph(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1};function Sg(a,b){var c=a.b;c||((c=Ta(jh),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=rh(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c} +function rh(a,b){a.b=null;b=Oa(Qa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ua(jh,b.data),a.b=b.data)}catch(d){u(d.message+" ("+c+")")}return a.b}function Vg(a){var b=null;a.b&&(b=Qa()+"/api/v1/user?req=load&user="+a.b+"&state="+sh(a,"1.32.2"));return b} +function ph(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=sh(a,"1.32.2");d.data=c;b=Oa(Qa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Oa(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);wh(a,b,c)}})}else c(a,null)} +function xh(a,b,c,d){function e(a){if(void 0===k){var b=g&&A(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ia(a))}function f(a){e("Error: "+a);l&&(--th||cb(!0));l=!1}var g,k,l=!0;th++;ua[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?uh(c,null,null,!1,e,function(d,l){l?(ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--th||cb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--th||cb(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?uh(b,a,d,!0,e,m):vh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(z){f(z.message)}return l}window.embedPDP11=function(a,b,c,d){cb(!1);return xh(a,b,c,d)};window.findMachineComponent=function(a,b){return za(b,a+".machine")};window.enableEvents=cb;window.sendEvent=eb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map From d739ffcffd551463284a4f4934e1819f71fe3b92 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Sat, 28 Jan 2017 14:54:47 -0800 Subject: [PATCH 11/15] Forgot to set module.exports for the new DriveController class; the Node pdp11 shell app runs properly again --- modules/pdp11/bin/pdp11 | 4 ++-- modules/pdp11/lib/drive.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/pdp11/bin/pdp11 b/modules/pdp11/bin/pdp11 index f490412e0..f4a2ef054 100644 --- a/modules/pdp11/bin/pdp11 +++ b/modules/pdp11/bin/pdp11 @@ -83,7 +83,7 @@ var aComponents = []; var asComponentsIgnore = ["embed", "save"]; /* - * A few of the components are subclasses of other classes (eg, "cpustate" is a subclass of "cpu"). + * A few of the components are subclasses of other classes (eg, "cpustate" subclasses "cpu"). * In those situations, we "hoist" the subclass constructor into the corresponding superclass, * because it is the name of the superclass that we rely on during machine initialization. */ @@ -91,7 +91,7 @@ var aSubClasses = { "pdp11/lib/cpustate": "pdp11/lib/cpu", "pdp11/lib/debugger": "shared/es6/debugger" }; - + /** * loadComponents(asFiles) * diff --git a/modules/pdp11/lib/drive.js b/modules/pdp11/lib/drive.js index b34ee3390..2ce942841 100644 --- a/modules/pdp11/lib/drive.js +++ b/modules/pdp11/lib/drive.js @@ -1158,3 +1158,5 @@ DriveController.SOURCE = { LOCAL: "?", REMOTE: "??" }; + +if (NODE) module.exports = DriveController; From e7329fc27741543e7216a307b98e1e9a82fb14e5 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Sat, 28 Jan 2017 17:31:46 -0800 Subject: [PATCH 12/15] Updated DriveController to save/restore the currently mounted disk (which may differ from the pre-configured disk if the user mounted a different disk), and cleaned the interfaces up a little --- modules/pcx86/lib/fdc.js | 1 + modules/pdp11/lib/drive.js | 252 ++++++++++----- modules/pdp11/lib/rk11.js | 7 +- modules/pdp11/lib/rl11.js | 7 +- versions/pdpjs/1.32.2/pdp11-dbg.js | 478 +++++++++++++++-------------- versions/pdpjs/1.32.2/pdp11.js | 358 ++++++++++----------- 6 files changed, 609 insertions(+), 494 deletions(-) diff --git a/modules/pcx86/lib/fdc.js b/modules/pcx86/lib/fdc.js index 8d50a7868..11a3ad200 100644 --- a/modules/pcx86/lib/fdc.js +++ b/modules/pcx86/lib/fdc.js @@ -1140,6 +1140,7 @@ FDC.prototype.saveDrives = function() * saveDrive(drive) * * @this {FDC} + * @param {Object} drive * @return {Array} */ FDC.prototype.saveDrive = function(drive) diff --git a/modules/pdp11/lib/drive.js b/modules/pdp11/lib/drive.js index 2ce942841..fee5e1edc 100644 --- a/modules/pdp11/lib/drive.js +++ b/modules/pdp11/lib/drive.js @@ -75,7 +75,7 @@ var Config; */ class DriveController extends Component { /** - * DriveController(type, parms, bitsMessage, configDC) + * DriveController(type, parms, bitsMessage, configDC, configDrive, configIO) * * The DriveController component has the following component-specific (parms) properties: * @@ -85,10 +85,10 @@ class DriveController extends Component { * @param {Object} parms * @param {number} bitsMessage * @param {Config} configDC - * @param {Array} driveInfo - * @param {Object} tableIO + * @param {Array} configDrive + * @param {Object} configIO */ - constructor(type, parms, bitsMessage, configDC, driveInfo, tableIO) + constructor(type, parms, bitsMessage, configDC, configDrive, configIO) { super(type, parms, bitsMessage); @@ -100,8 +100,8 @@ class DriveController extends Component { this.cAutoMount = 0; this.configDC = configDC; - this.driveInfo = driveInfo; - this.tableIO = tableIO; + this.configDrive = configDrive; + this.configIO = configIO; this.nDrives = configDC.DRIVES; this.aDrives = new Array(this.nDrives); @@ -347,15 +347,15 @@ class DriveController extends Component { } /* - * If we didn't need auto-mount support, we could defer controller initialization until we received - * a powerUp() notification, at which point reset() would call initController(), or restore() would restore - * the controller; in that case, all we'd need to do here is call setReady(). + * If we didn't need auto-mount support, we could defer controller and drive initialization until we received + * a powerUp() notification, at which point reset() would call initController(), or restore() would restore the + * controller. */ - this.initController(); + this.reset(); this.irq = this.cpu.addIRQ(this.configDC.VEC, this.configDC.PRI, this.bitsMessage); - bus.addIOTable(this, this.tableIO); + bus.addIOTable(this, this.configIO); bus.addResetHandler(this.reset.bind(this)); this.addDisk("None", DriveController.SOURCE.NONE, true); @@ -465,6 +465,7 @@ class DriveController extends Component { reset() { this.initController(); + this.initDrives(); } /** @@ -479,7 +480,8 @@ class DriveController extends Component { { var state = new State(this); state.set(0, this.saveController()); - state.set(0, this.saveDeltas()); + state.set(1, this.saveHistory()); + state.set(2, this.saveDrives()); return state.data(); } @@ -494,37 +496,25 @@ class DriveController extends Component { */ restore(data) { - return this.initController(data[0], data[1]); + var fSuccess = true; + if (!this.initController(data[0])) fSuccess = false; + if (!this.initHistory(data[1])) fSuccess = false; + if (!this.initDrives(data[2])) fSuccess = false; + return fSuccess; } /** - * initController(aRegs, aHistory) + * initController(aRegs) + * + * Placeholder for subclasses. * * @this {DriveController} * @param {Array} [aRegs] - * @param {Array} [aHistory] * @return {boolean} true if successful, false if failure */ - initController(aRegs, aHistory) + initController(aRegs) { - var fSuccess = true; - - /* - * Initialize the disk history (if available) before initializing the drives, so that any disk deltas can be - * applied to disk images that are already loaded. - */ - if (aHistory) this.aDiskHistory = aHistory; - - for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { - var drive = this.aDrives[iDrive]; - if (drive === undefined) { - drive = this.aDrives[iDrive] = {}; - } - if (!this.initDrive(drive, iDrive, this.driveInfo)) { - fSuccess = false; - } - } - return fSuccess; + return true; } /** @@ -537,42 +527,20 @@ class DriveController extends Component { */ saveController() { + return []; } /** - * saveDeltas() - * - * This returns an array of entries, one for each disk image we've ever mounted, including any deltas; ie: - * - * [name, path, deltas] - * - * aDiskHistory contains exactly that, except that deltas may not be up-to-date for any currently mounted - * disk image(s), so we call updateHistory() for all those disks, and then aDiskHistory is ready to be saved. - * - * @this {DriveController} - * @return {Array} - */ - saveDeltas() - { - for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { - var drive = this.aDrives[iDrive]; - if (drive.disk) { - this.updateDiskHistory(drive.sDiskName, drive.sDiskPath, drive.disk); - } - } - return this.aDiskHistory; - } - - /** - * initDrive(drive, iDrive, driveInfo) + * initDrive(drive, iDrive, configDrive, configDisk) * * @this {DriveController} * @param {Object} drive * @param {number} iDrive - * @param {Array} driveInfo + * @param {Array} configDrive + * @param {Array} [configDisk] * @return {boolean} true if successful, false if failure */ - initDrive(drive, iDrive, driveInfo) + initDrive(drive, iDrive, configDrive, configDisk) { var i = 0; var fSuccess = true; @@ -586,11 +554,11 @@ class DriveController extends Component { * NOTE: We initialize the following drive properties to their MAXIMUMs; disks may have * these or SMALLER values (subject to the limits of what the controller supports, of course). */ - drive.nCylinders = driveInfo[0]; - drive.nHeads = driveInfo[1]; - drive.nSectors = driveInfo[2]; - drive.cbSector = driveInfo[3]; - drive.status = driveInfo[4]; + drive.nCylinders = configDrive[0]; + drive.nHeads = configDrive[1]; + drive.nSectors = configDrive[2]; + drive.cbSector = configDrive[3]; + drive.status = configDrive[4]; /* * The next group of properties are set by various controller command sequences. @@ -607,11 +575,140 @@ class DriveController extends Component { drive.ibSector = 0; drive.sector = null; - if (!drive.disk) drive.sDiskPath = ""; // ensure this is initialized to a default that displayDisk() can deal with + if (!drive.disk) { + drive.sDiskPath = ""; // ensure this is initialized to a default that displayDisk() can deal with + } + if (configDisk) { + var fLocal = configDisk[0]; + var sDiskName = configDisk[1]; + var sDiskPath = configDisk[2]; + /* + * If we're restoring a local disk image, then the entire disk contents should be captured in aDiskHistory, + * so all we have to do is mount a blank disk and let disk.restore() do the rest; ie, there's nothing to + * "load" (it's a purely synchronous operation). + * + * Otherwise, we must call loadDrive(); in the common case, loadDrive() will have already "auto-mounted" + * the disk, so it will return true, and then we restore any deltas to the current image. + * + * However, if loadDrive() returns false, then it has initiated the load for a *different* disk image, + * so we must mark ourselves as "not ready" again, and add another "wait for ready" test in Computer before + * finally powering the CPU. + */ + if (fLocal) { + this.mountDrive(iDrive, sDiskName, sDiskPath); + } + else if (this.loadDrive(iDrive, sDiskName, sDiskPath, true)) { + if (drive.disk) { + if (sDiskPath) { + this.addDiskHistory(sDiskName, sDiskPath, drive.disk); + } else { + if (MAXDEBUG) Component.warning("Disk '" + (drive.disk.sDiskName || sDiskName) + "' not recorded properly in drive " + iDrive); + } + } + } else { + this.setReady(false); + } + } return fSuccess; } + /** + * initDrives(aConfigDisks) + * + * @this {DriveController} + * @param {Array} [aConfigDisks] + * @return {boolean} true if successful, false if failure + */ + initDrives(aConfigDisks) + { + var fSuccess = true; + for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { + var drive = this.aDrives[iDrive]; + if (drive === undefined) { + drive = this.aDrives[iDrive] = {}; + } + var configDisk = aConfigDisks && aConfigDisks[iDrive]; + if (!this.initDrive(drive, iDrive, this.configDrive, configDisk)) { + fSuccess = false; + } + } + return fSuccess; + } + + /** + * saveDrive(drive) + * + * @this {DriveController} + * @param {Object} drive + * @return {Array} + */ + saveDrive(drive) + { + return [ + drive.fLocal, + drive.sDiskName, + drive.sDiskPath + ] + } + + /** + * saveDrives() + * + * @this {DriveController} + * @return {Array} + */ + saveDrives() + { + var data = []; + for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { + data.push(this.saveDrive(this.aDrives[iDrive])); + } + return data; + } + + /** + * initHistory(aHistory) + * + * @this {DriveController} + * @param {Array} [aHistory] + * @return {boolean} true if successful, false if failure + */ + initHistory(aHistory) + { + /* + * Initialize the disk history (if available) before initializing the drives, so that any disk deltas can be + * applied to disk images that are already loaded. + */ + if (aHistory) this.aDiskHistory = aHistory; + + return true; + } + + /** + * saveHistory() + * + * This returns an array of entries, one for each disk image we've ever mounted, including any deltas; ie: + * + * [name, path, deltas] + * + * aDiskHistory contains exactly that, except that deltas may not be up-to-date for any currently mounted + * disk image(s), so we call updateHistory() for all those disks, and then aDiskHistory is ready to be saved. + * + * @this {DriveController} + * @return {Array} + */ + saveHistory() + { + for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { + var drive = this.aDrives[iDrive]; + if (drive.disk) { + this.updateDiskHistory(drive.sDiskName, drive.sDiskPath, drive.disk); + } + } + return this.aDiskHistory; + } + /** * autoMount(fRemount) * @@ -724,6 +821,23 @@ class DriveController extends Component { } } + /** + * mountDrive(iDrive, sDiskName, sDiskPath) + * + * @this {DriveController} + * @param {number} iDrive + * @param {string} sDiskName + * @param {string} sDiskPath + */ + mountDrive(iDrive, sDiskName, sDiskPath) + { + var drive = this.aDrives[iDrive]; + this.unloadDrive(iDrive, true); + drive.fLocal = true; + var disk = new DiskPDP11(this, drive, DiskAPI.MODE.PRELOAD); + this.finishLoadDrive(drive, disk, sDiskName, sDiskPath, true); + } + /** * loadDrive(iDrive, sDiskName, sDiskPath, fAutoMount, file) * @@ -931,7 +1045,7 @@ class DriveController extends Component { * Next, make sure the drive whose disk we're updating is the currently selected drive. */ var iDriveSelected = Str.parseInt(controlDrives.value, 10); - var sTargetPath = (drive.fLocal? RL11.SOURCE.LOCAL : drive.sDiskPath); + var sTargetPath = (drive.fLocal? DriveController.SOURCE.LOCAL : drive.sDiskPath); if (!isNaN(iDriveSelected) && iDriveSelected == iDrive) { for (i = 0; i < controlDisks.options.length; i++) { if (controlDisks.options[i].value == sTargetPath) { @@ -998,8 +1112,6 @@ class DriveController extends Component { drive.disk = null; drive.fLocal = false; - // this.regInput |= FDC.REG_INPUT.DISK_CHANGE; - if (!fLoading) { this.notice("Drive " + this.getDriveName(iDrive) + " unloaded", fLoading); this.sDiskSource = DriveController.SOURCE.NONE; diff --git a/modules/pdp11/lib/rk11.js b/modules/pdp11/lib/rk11.js index 8ce061fd2..dc91e6579 100644 --- a/modules/pdp11/lib/rk11.js +++ b/modules/pdp11/lib/rk11.js @@ -69,14 +69,13 @@ class RK11 extends DriveController { } /** - * initController(aRegs, aHistory) + * initController(aRegs) * * @this {RK11} * @param {Array} [aRegs] - * @param {Array} [aHistory] * @return {boolean} true if successful, false if failure */ - initController(aRegs, aHistory) + initController(aRegs) { if (!aRegs) { aRegs = [(RK11.RKDS.RK05 | RK11.RKDS.SOK | RK11.RKDS.RRDY), 0, (RK11.RKCS.CRDY), 0, 0, 0, 0]; @@ -96,7 +95,7 @@ class RK11 extends DriveController { this.regRKDB ] = aRegs; - return super.initController(aRegs, aHistory); + return true; } /** diff --git a/modules/pdp11/lib/rl11.js b/modules/pdp11/lib/rl11.js index fb1134b76..e5a6fb853 100644 --- a/modules/pdp11/lib/rl11.js +++ b/modules/pdp11/lib/rl11.js @@ -69,14 +69,13 @@ class RL11 extends DriveController { } /** - * initController(aRegs, aHistory) + * initController(aRegs) * * @this {RL11} * @param {Array} [aRegs] - * @param {Array} [aHistory] * @return {boolean} true if successful, false if failure */ - initController(aRegs, aHistory) + initController(aRegs) { if (!aRegs) { aRegs = [(RL11.RLCS.DRDY | RL11.RLCS.CRDY), 0, 0, 0, 0, 0]; @@ -95,7 +94,7 @@ class RL11 extends DriveController { this.regRLBE ] = aRegs; - return super.initController(aRegs, aHistory); + return true; } /** diff --git a/versions/pdpjs/1.32.2/pdp11-dbg.js b/versions/pdpjs/1.32.2/pdp11-dbg.js index d6cf7ed0c..770375ba3 100644 --- a/versions/pdpjs/1.32.2/pdp11-dbg.js +++ b/versions/pdpjs/1.32.2/pdp11-dbg.js @@ -36,15 +36,15 @@ var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var ea=0;function da(a){return"jscomp_symbol_"+(a||"")+ea++} function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ga(this)}});fa=function(){}}function ga(a){var b=0;return ha(function(){return b":62,"?":63,"@":64,nd:65,Fh:66,Ih:67,gi:68,E:69,mi:70,oi:71,Bi:72,Di:73,Ei:74,Fi:75,Gi:76,Ji:77,Li:78,Ni:79,Qi:80,Q:81,Si:82,Ui:83,bj:84,dj:85,fj:86,gj:87,kj:88,lj:89,We:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,mj:97,nj:98,qj:99,d:100,e:101,rj:102,sj:103,tj:104,uj:105,yj:106,k:107,zj:108,Aj:109,n:110,Bj:111,p:112,q:113,r:114,Cj:115,t:116,Fj:117,Gj:118,Hj:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,ne:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Cd=b.comment;this.Te=b;this.exports={};this.H=this.bindings={};a=this.id.indexOf(".");0>a?this.Fb=this.id:(this.pb=this.id.substr(0,a),this.Fb=this.id.substr(a+1));this.A={ready:!1,jb:!1,$c:!1,ca:!1,error:!1};this.zc=null;this.A.error=!1;this.fa=c||0;this.F=this.f=this.C=this.K=this.Qa=null;ua.push(this)}function va(a,b,c){xa[a]&&b&&(xa[a][b]=c)} +var sa={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},ta={Gh:0,le:1,Lh:2,Mh:3,Nh:4,Oh:5,Ph:6,Qh:7,qd:8,Rh:9,me:10,Sh:11,Th:12,ne:13,Uh:14,Vh:15,Wh:16,Xh:17,Yh:18,Zh:19,$h:20,ai:21,bi:22,ci:23,di:24,ei:25,fi:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42, +"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,nd:65,Fh:66,Ih:67,gi:68,E:69,mi:70,oi:71,Bi:72,Di:73,Ei:74,Fi:75,Gi:76,Ji:77,Li:78,Ni:79,Qi:80,Q:81,Si:82,Ui:83,bj:84,dj:85,fj:86,gj:87,kj:88,lj:89,Xe:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,mj:97,nj:98,qj:99,d:100,e:101,rj:102,sj:103,tj:104,uj:105,yj:106,k:107,zj:108,Aj:109,n:110,Bj:111,p:112,q:113,r:114,Cj:115,t:116,Fj:117,Gj:118,Hj:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,oe:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Cd=b.comment;this.Ue=b;this.exports={};this.H=this.bindings={};a=this.id.indexOf(".");0>a?this.Eb=this.id:(this.pb=this.id.substr(0,a),this.Eb=this.id.substr(a+1));this.A={ready:!1,jb:!1,$c:!1,ca:!1,error:!1};this.yc=null;this.A.error=!1;this.fa=c||0;this.F=this.f=this.C=this.K=this.Qa=null;ua.push(this)}function va(a,b,c){xa[a]&&b&&(xa[a][b]=c)} function ya(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function za(a){var b=!1;window&&(b=window.confirm(a));return b}function Aa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function Sa(a){return F(a,4,!0)} function Ta(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Xa[a]})}function Ya(a,b){return(a+" ").slice(0,b)} function Za(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Xa={"&":"&","<":"<",">":">",'"':""","'":"'"},$a={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; -function ab(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function ab(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function fb(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function gb(a,b){var c,d={aa:null,ea:null,wa:null,va:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.wa=g.load;d.va=g.exec;if(e=g.bytes)d.aa=e;else if(e=g.words)for(d.aa=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.aa=Array(4*e.length),f=c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.xa=g.load;d.wa=g.exec;if(e=g.bytes)d.aa=e;else if(e=g.words)for(d.aa=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.aa=Array(4*e.length),f=c=0;c>8&255,d.aa[f++]=e[c]>>16&255,d.aa[f++]=e[c]>>24&255;else d.aa=g;d.ea=g.symbols;d.aa.length?1==d.aa.length&&(v(d.aa[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.b["S"+a]=[0,0,!1,!1,this.pf,a];this.F=this.f=this.C=this.K=null;y(this)}p(Rb,q);h=Rb.prototype; h.reset=function(a){this.stop();a&&Zb(this,this.Ta=0)}; -h.ta=function(a,b,c,d){if(this.K&&this.K.ta(a,b,c,d)||this.f&&this.f.ta(a,b,c,d)||this.F&&this.F.ta(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.H[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.H[b]=c,this.i[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.H[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, -b){return function(){$b(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){ac(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){$b(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){ac(a,b)}}(this,b),!0):q.prototype.ta.call(this,a,b,c,d)}};h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;bc(b,this,cc);dc(b,this.reset.bind(this));ec(this);fc(this)}; +h.ua=function(a,b,c,d){if(this.K&&this.K.ua(a,b,c,d)||this.f&&this.f.ua(a,b,c,d)||this.F&&this.F.ua(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.H[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.H[b]=c,this.i[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.H[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, +b){return function(){$b(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){ac(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){$b(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){ac(a,b)}}(this,b),!0):q.prototype.ua.call(this,a,b,c,d)}};h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;bc(b,this,cc);dc(b,this.reset.bind(this));ec(this);fc(this)}; h.Ca=function(a,b){if(!b)if(this.M&&gc(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};h.Ba=function(a){return a?this.save():!0};h.save=function(){var a=new G(this);a.set(0,[this.da,this.Ta,this.Ua]);return a.data()};h.restore=function(a){if(a=a[0])hc(this,this.da=a[0]),Zb(this,this.Ta=a[1]),ic(this,a[2]);return!0};function jc(a,b,c){if(a=a.H[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ec(a,b){for(var c in a.i)jc(a,c,null!=b?b:a.i[c])} function kc(a,b,c){if(a=a.H[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function fc(a){for(var b in a.b)kc(a,b,a.b[b][1])}function lc(a,b,c,d){if(a.H[b]){var e=a.F&&a.F.Aa||8;c=c||0;c=8==e?E(c,d):F(c,d);a.H[b].textContent!=c&&(a.H[b].textContent=c)}}function $b(a,b){var c=a.b[b];kc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=mc&&(a.G=b==nc,a.I=b==oc)} function ac(a,b){var c=a.b[b];c[2]&&c[3]&&(kc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.mf=function(a){a||this.f.A.T||(a=this.f,a.C.reset(),pc(a),this.b[qc]&&this.b[qc][1]&&rc(this.f))};h.nf=function(){};h.hf=function(a){a||this.f.Z()}; @@ -78,86 +78,86 @@ h.ff=function(a){if(!a&&!this.f.A.T)if(this.b[qc]&&this.b[qc][1])rc(this.f);else h.jf=function(a){a||this.f.A.T||(this.I&&wc(this),a=this.L==Yb?zc(this.C,this.da):Ac(this.f,this.da),Zb(this,a))};h.lf=function(a){a||this.f.A.T||hc(this,this.Ua)};h.kf=function(a){a?(this.w=!0,ec(this,!0)):(this.w=!1,ec(this),ic(this,0))};h.pf=function(a,b){this.Ua=a?this.Ua|1<=a.f.ia?8:16,c=65472<=a.da&&a.da<65472+b,b=c?1:2,c=c?15:a.C.I;a.b[mc]&&a.b[mc][1]||(b=-b);hc(a,a.da&~c|a.da+b&c)} function hc(a,b){a.da=b&a.C.I;if(a.B!==a.da){a.B=a.da;b=a.B;for(var c=0;22>c;c++)Bc(a,"A"+c,b&1<c;c++)Bc(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.G=this.M/this.j|0;this.U=this.G-1;this.Ma=[];this.la=0;this.D=!1;this.N=[];this.Xe=[Sc,Tc,Uc,Vc];this.b=this.v=[];this.B=this.L=this.w=this.O=this.P=0;a=new J(this);Wc(a,this.F);this.b=Array(this.G);this.v=Array(this.G);for(b=0;b>2;this.i=this.j-1;this.G=this.M/this.j|0;this.U=this.G-1;this.Na=[];this.la=0;this.D=!1;this.N=[];this.Ye=[Sc,Tc,Uc,Vc];this.b=this.v=[];this.B=this.L=this.w=this.O=this.P=0;a=new J(this);Wc(a,this.F);this.b=Array(this.G);this.v=Array(this.G);for(b=0;b>>this.g;this.L=0;this.w=this.I;y(this)}p(Qc,q);function Zc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.v[a.P]=a.b[a.O])}}h=Qc.prototype;h.reset=function(){for(var a=0;a>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.J)return l.Ob+=l.J-f,l.J=f,!0;if(f>=l.J+l.Ob){n=l.size-(f-m);n>g&&(n=g);l.Ob=f-l.J+n;f=m+a.j;g-=n;k++;continue}}return ad(bd,f,g)}f=new J(a,f,n,a.j,d,e);Wc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+cd[d]+" at "+E(b)),!0):ad(dd,b,c)}h.od=function(a){return this.v[(a&this.w)>>>this.g].yb(a&this.i,a)}; -h.oc=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Lb||b!=this.i?this.v[c].na(b,a):this.v[c++].yb(b,a)|this.v[c&this.U].yb(0,a+1)<<8};h.pd=function(a,b){this.v[(a&this.w)>>>this.g].Ab(a&this.i,b,a)};h.Sb=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Lb||c!=this.i?this.v[d].Bb(c,b,a):(this.v[d++].Ab(c,b&255,a),this.v[d&this.U].Ab(0,b>>8&255,a+1))};function ed(a,b){return a.b[(b&a.I)>>>a.g]} +function Xc(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.J)return l.Ob+=l.J-f,l.J=f,!0;if(f>=l.J+l.Ob){n=l.size-(f-m);n>g&&(n=g);l.Ob=f-l.J+n;f=m+a.j;g-=n;k++;continue}}return ad(bd,f,g)}f=new J(a,f,n,a.j,d,e);Wc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+cd[d]+" at "+E(b)),!0):ad(dd,b,c)}h.od=function(a){return this.v[(a&this.w)>>>this.g].xb(a&this.i,a)}; +h.oc=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Lb||b!=this.i?this.v[c].na(b,a):this.v[c++].xb(b,a)|this.v[c&this.U].xb(0,a+1)<<8};h.pd=function(a,b){this.v[(a&this.w)>>>this.g].zb(a&this.i,b,a)};h.Sb=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Lb||c!=this.i?this.v[d].Ab(c,b,a):(this.v[d++].zb(c,b&255,a),this.v[d&this.U].zb(0,b>>8&255,a+1))};function ed(a,b){return a.b[(b&a.I)>>>a.g]} function zc(a,b){var c;a.D=!1;a.la++;var d=b&a.i,e=ed(a,b);Lb||d!=a.i?c=e.B(d,b):c=e.K(d,b)|ed(a,b+1).K(0,b+1)<<8;a.la--;return c}function fd(a,b,c){a.D=!1;a.la++;ed(a,b).F(b&a.i,c&255,b);a.la--}function xc(a,b,c){a.D=!1;a.la++;var d=b&a.i,e=ed(a,b);Lb||d!=a.i?e.D(d,c&65535,b):(e.F(d,c&255,b),ed(a,b+1).F(0,c>>8&255,b+1));a.la--} -function $c(a){for(var b=0,c=[],d=0;da.f.ia)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Ma[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&A(this.f,16|e[5])&&D(this.f,e[4]+".readByte("+K(this.f,b)+"): "+K(this.f,c),!0,!d.la),c;d.La(b,16,3);c=255;this.f&&A(this.f,16)&&D(this.f,"warning: unconverted read access to byte @"+K(this.f,b)+": "+K(this.f,c),!0,!d.la);return c} -function Tc(a,b,c){var d=!1,e=this.controller,f=e.Ma[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ma[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&A(this.f,16|f[5])&&D(this.f,f[4]+".writeByte("+K(this.f,c)+","+K(this.f,b)+")",!0,!e.la):(e.La(c,16,5),this.f&&A(this.f,16)&&D(this.f,"warning: unconverted write access to byte @"+K(this.f,c)+": "+K(this.f, -b),!0,!e.la))}function Uc(a,b){var c=-1,d=this.controller;a=d.Ma[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&A(this.f,16|a[5])&&D(this.f,a[4]+".readWord("+K(this.f,b)+"): "+K(this.f,c),!0,!d.la),c;d.La(b,16,2);c=65535;this.f&&A(this.f,16)&&D(this.f,"warning: unconverted read access to word @"+K(this.f,b)+": "+K(this.f,c),!0,!d.la);return c} -function Vc(a,b,c){var d=!1,e=this.controller;a=e.Ma[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&A(this.f,16|a[5])&&D(this.f,a[4]+".writeWord("+K(this.f,c)+","+K(this.f,b)+")",!0,!e.la):(e.La(c,16,4),this.f&&A(this.f,16)&&D(this.f,"warning: unconverted write access to word @"+K(this.f,c)+": "+K(this.f,b),!0,!e.la))}function M(a){q.call(this,"Device",a,256);this.b={ab:128,ld:-1}}p(M,q);h=M.prototype; -h.za=function(a,b,c,d){this.C=b;this.K=a;this.f=c;this.F=d;var e=this;this.b.ld=ld(c,function(){e.b.ab|=128;e.b.ab&64&&md(e.f,e.b.Lb);e.K&&I(e.K,1);nd(e.f,e.b.ld,1E3/60)});this.b.Lb=od(c,64,6,524288);bc(b,this,pd);dc(b,this.reset.bind(this));d&&qd(d,64,function(a){var b=e.f;rd(e,"KIPDR",b.B[0],0,a[0]);rd(e,"KDPDR",b.B[0],8,a[0]);rd(e,"KIPAR",b.M[0],0,a[0]);rd(e,"KDPAR",b.M[0],8,a[0],!0);rd(e,"SIPDR",b.B[1],0,a[0]);rd(e,"SDPDR",b.B[1],8,a[0]);rd(e,"SIPAR",b.M[1],0,a[0]);rd(e,"SDPAR",b.M[1],8,a[0], +function $c(a){for(var b=0,c=[],d=0;da.f.ia)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Na[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&A(this.f,16|e[5])&&D(this.f,e[4]+".readByte("+K(this.f,b)+"): "+K(this.f,c),!0,!d.la),c;d.La(b,16,3);c=255;this.f&&A(this.f,16)&&D(this.f,"warning: unconverted read access to byte @"+K(this.f,b)+": "+K(this.f,c),!0,!d.la);return c} +function Tc(a,b,c){var d=!1,e=this.controller,f=e.Na[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Na[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&A(this.f,16|f[5])&&D(this.f,f[4]+".writeByte("+K(this.f,c)+","+K(this.f,b)+")",!0,!e.la):(e.La(c,16,5),this.f&&A(this.f,16)&&D(this.f,"warning: unconverted write access to byte @"+K(this.f,c)+": "+K(this.f, +b),!0,!e.la))}function Uc(a,b){var c=-1,d=this.controller;a=d.Na[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&A(this.f,16|a[5])&&D(this.f,a[4]+".readWord("+K(this.f,b)+"): "+K(this.f,c),!0,!d.la),c;d.La(b,16,2);c=65535;this.f&&A(this.f,16)&&D(this.f,"warning: unconverted read access to word @"+K(this.f,b)+": "+K(this.f,c),!0,!d.la);return c} +function Vc(a,b,c){var d=!1,e=this.controller;a=e.Na[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&A(this.f,16|a[5])&&D(this.f,a[4]+".writeWord("+K(this.f,c)+","+K(this.f,b)+")",!0,!e.la):(e.La(c,16,4),this.f&&A(this.f,16)&&D(this.f,"warning: unconverted write access to word @"+K(this.f,c)+": "+K(this.f,b),!0,!e.la))}function L(a){q.call(this,"Device",a,256);this.b={bb:128,ld:-1}}p(L,q);h=L.prototype; +h.za=function(a,b,c,d){this.C=b;this.K=a;this.f=c;this.F=d;var e=this;this.b.ld=ld(c,function(){e.b.bb|=128;e.b.bb&64&&md(e.f,e.b.Lb);e.K&&I(e.K,1);nd(e.f,e.b.ld,1E3/60)});this.b.Lb=od(c,64,6,524288);bc(b,this,pd);dc(b,this.reset.bind(this));d&&qd(d,64,function(a){var b=e.f;rd(e,"KIPDR",b.B[0],0,a[0]);rd(e,"KDPDR",b.B[0],8,a[0]);rd(e,"KIPAR",b.M[0],0,a[0]);rd(e,"KDPAR",b.M[0],8,a[0],!0);rd(e,"SIPDR",b.B[1],0,a[0]);rd(e,"SDPDR",b.B[1],8,a[0]);rd(e,"SIPAR",b.M[1],0,a[0]);rd(e,"SDPAR",b.M[1],8,a[0], !0);rd(e,"UIPDR",b.B[3],0,a[0]);rd(e,"UDPDR",b.B[3],8,a[0]);rd(e,"UIPAR",b.M[3],0,a[0]);rd(e,"UDPAR",b.M[3],8,a[0],!0);b.V&32&&rd(e,"UNIMAP",b.Fa,-1,a[0])});y(this)};function rd(a,b,c,d,e,f){a=a.F;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Fa[a>>1];return a&1?b>>16:b&65535};h.wh=function(a,b){b=b>>1&63;var c=b>>1;this.f.Fa[c]=b&1?this.f.Fa[c]&65535|(a&63)<<16:this.f.Fa[c]&-65536|a&65534};h.gg=function(a){return this.f.B[1][a>>1&7]};h.ph=function(a,b){this.f.B[1][b>>1&7]=a&65295};h.eg=function(a){return this.f.B[1][(a>>1&7)+8]};h.nh=function(a,b){this.f.B[1][(b>>1&7)+8]=a&65295};h.fg=function(a){return this.f.M[1][a>>1&7]}; h.oh=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.dg=function(a){return this.f.M[1][(a>>1&7)+8]};h.mh=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.Af=function(a){return this.f.B[0][a>>1&7]};h.Kg=function(a,b){this.f.B[0][b>>1&7]=a&65295};h.yf=function(a){return this.f.B[0][(a>>1&7)+8]};h.Ig=function(a,b){this.f.B[0][(b>>1&7)+8]=a&65295};h.zf=function(a){return this.f.M[0][a>>1&7]};h.Jg=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.B[0][b]&=65295}; h.xf=function(a){return this.f.M[0][(a>>1&7)+8]};h.Hg=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.B[0][b]&=65295};h.mg=function(a){return this.f.B[3][a>>1&7]};h.vh=function(a,b){this.f.B[3][b>>1&7]=a&65295};h.kg=function(a){return this.f.B[3][(a>>1&7)+8]};h.th=function(a,b){this.f.B[3][(b>>1&7)+8]=a&65295};h.lg=function(a){return this.f.M[3][a>>1&7]};h.uh=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.jg=function(a){return this.f.M[3][(a>>1&7)+8]}; h.sh=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Mb=function(a){a&=7;return this.f.w&2048?this.f.pa[a]:this.f.g[a]};h.Qb=function(a,b){b&=7;this.f.w&2048?this.f.pa[b]=a:this.f.g[b]=a};h.Lf=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.Tg=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.Of=function(){return this.f.g[7]};h.Wg=function(a){this.f.g[7]=a};h.Nb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.pa[a]}; -h.Rb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.pa[b]=a};h.Mf=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Ug=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.Nf=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Vg=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.wf=function(a){return this.f.lc[a-65504>>1]};h.Gg=function(a,b){this.f.lc[b-65504>>1]=a};h.ce=function(a){return 65520==a?(gd(this.C)>>6)-1:0}; -h.he=function(){};h.ig=function(){return 1};h.rh=function(){};h.vf=function(){return this.f.P};h.Fg=function(){this.f.P=0};h.Cf=function(){return this.f.ic};h.Mg=function(a,b){b&1||(a&=255);this.f.ic=a};h.Hf=function(a,b){return b?0:this.f.Za};h.Pg=function(a){zd(this.f,a)};h.hg=function(a,b){return b?0:this.f.ua&65280};h.qh=function(a){this.f.ua=a|255};h.Kf=function(){return Ad(this.f)};h.Sg=function(a){Bd(this.f,a)};h.ge=function(a,b){A(this)&&D(this,"writeIgnored("+E(b)+"): "+E(a),!0,!0)}; -var N={},pd=(N[61568]=[null,null,M.prototype.ng,M.prototype.wh,"UNIMAP",64,1170],N[62592]=[null,null,M.prototype.gg,M.prototype.ph,"SIPDR",8,1145,64],N[62608]=[null,null,M.prototype.eg,M.prototype.nh,"SDPDR",8,1145,64],N[62624]=[null,null,M.prototype.fg,M.prototype.oh,"SIPAR",8,1145,64],N[62640]=[null,null,M.prototype.dg,M.prototype.mh,"SDPAR",8,1145,64],N[62656]=[null,null,M.prototype.Af,M.prototype.Kg,"KIPDR",8,1140,64],N[62672]=[null,null,M.prototype.yf,M.prototype.Ig,"KDPDR",8,1145,64],N[62688]= -[null,null,M.prototype.zf,M.prototype.Jg,"KIPAR",8,1140,64],N[62704]=[null,null,M.prototype.xf,M.prototype.Hg,"KDPAR",8,1145,64],N[62798]=[null,null,M.prototype.Gf,M.prototype.Og,"MMR3",1,1145,64],N[65382]=[null,null,M.prototype.Bf,M.prototype.Lg,"LKS"],N[65402]=[null,null,M.prototype.Df,M.prototype.Ng,"MMR0",1,1140,64],N[65404]=[null,null,M.prototype.Ef,M.prototype.ge,"MMR1",1,1145,64],N[65406]=[null,null,M.prototype.Ff,M.prototype.ge,"MMR2",1,1140,64],N[65408]=[null,null,M.prototype.mg,M.prototype.vh, -"UIPDR",8,1140,64],N[65424]=[null,null,M.prototype.kg,M.prototype.th,"UDPDR",8,1145,64],N[65440]=[null,null,M.prototype.lg,M.prototype.uh,"UIPAR",8,1140,64],N[65456]=[null,null,M.prototype.jg,M.prototype.sh,"UDPAR",8,1145,64],N[65472]=[null,null,M.prototype.Mb,M.prototype.Qb,"R0SET0"],N[65473]=[null,null,M.prototype.Mb,M.prototype.Qb,"R1SET0"],N[65474]=[null,null,M.prototype.Mb,M.prototype.Qb,"R2SET0"],N[65475]=[null,null,M.prototype.Mb,M.prototype.Qb,"R3SET0"],N[65476]=[null,null,M.prototype.Mb, -M.prototype.Qb,"R4SET0"],N[65477]=[null,null,M.prototype.Mb,M.prototype.Qb,"R5SET0"],N[65478]=[null,null,M.prototype.Lf,M.prototype.Tg,"R6KERNEL"],N[65479]=[null,null,M.prototype.Of,M.prototype.Wg,"R7KERNEL"],N[65480]=[null,null,M.prototype.Nb,M.prototype.Rb,"R0SET1",1,1145],N[65481]=[null,null,M.prototype.Nb,M.prototype.Rb,"R1SET1",1,1145],N[65482]=[null,null,M.prototype.Nb,M.prototype.Rb,"R2SET1",1,1145],N[65483]=[null,null,M.prototype.Nb,M.prototype.Rb,"R3SET1",1,1145],N[65484]=[null,null,M.prototype.Nb, -M.prototype.Rb,"R4SET1",1,1145],N[65485]=[null,null,M.prototype.Nb,M.prototype.Rb,"R5SET1",1,1145],N[65486]=[null,null,M.prototype.Mf,M.prototype.Ug,"R6SUPER",1,1145],N[65487]=[null,null,M.prototype.Nf,M.prototype.Vg,"R6USER",1,1145],N[65504]=[null,null,M.prototype.wf,M.prototype.Gg,"CTRL",8,1170],N[65520]=[null,null,M.prototype.ce,M.prototype.he,"LSIZE",1,1170],N[65522]=[null,null,M.prototype.ce,M.prototype.he,"HSIZE",1,1170],N[65524]=[null,null,M.prototype.ig,M.prototype.rh,"SYSID",1,1170],N[65526]= -[null,null,M.prototype.vf,M.prototype.Fg,"ERR",1,1170],N[65528]=[null,null,M.prototype.Cf,M.prototype.Mg,"MBR",1,1170],N[65530]=[null,null,M.prototype.Hf,M.prototype.Pg,"PIR"],N[65532]=[null,null,M.prototype.hg,M.prototype.qh,"SLR"],N[65534]=[null,null,M.prototype.Kf,M.prototype.Sg,"PSW"],N); -yb(function(){for(var a=x(document,w,"device"),b=0;b>14?this.f.g[6]:this.f.W[1]};h.Ug=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.Nf=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Vg=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.wf=function(a){return this.f.lc[a-65504>>1]};h.Gg=function(a,b){this.f.lc[b-65504>>1]=a};h.de=function(a){return 65520==a?(gd(this.C)>>6)-1:0}; +h.ie=function(){};h.ig=function(){return 1};h.rh=function(){};h.vf=function(){return this.f.P};h.Fg=function(){this.f.P=0};h.Cf=function(){return this.f.ic};h.Mg=function(a,b){b&1||(a&=255);this.f.ic=a};h.Hf=function(a,b){return b?0:this.f.$a};h.Pg=function(a){zd(this.f,a)};h.hg=function(a,b){return b?0:this.f.va&65280};h.qh=function(a){this.f.va=a|255};h.Kf=function(){return Ad(this.f)};h.Sg=function(a){Bd(this.f,a)};h.he=function(a,b){A(this)&&D(this,"writeIgnored("+E(b)+"): "+E(a),!0,!0)}; +var N={},pd=(N[61568]=[null,null,L.prototype.ng,L.prototype.wh,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.gg,L.prototype.ph,"SIPDR",8,1145,64],N[62608]=[null,null,L.prototype.eg,L.prototype.nh,"SDPDR",8,1145,64],N[62624]=[null,null,L.prototype.fg,L.prototype.oh,"SIPAR",8,1145,64],N[62640]=[null,null,L.prototype.dg,L.prototype.mh,"SDPAR",8,1145,64],N[62656]=[null,null,L.prototype.Af,L.prototype.Kg,"KIPDR",8,1140,64],N[62672]=[null,null,L.prototype.yf,L.prototype.Ig,"KDPDR",8,1145,64],N[62688]= +[null,null,L.prototype.zf,L.prototype.Jg,"KIPAR",8,1140,64],N[62704]=[null,null,L.prototype.xf,L.prototype.Hg,"KDPAR",8,1145,64],N[62798]=[null,null,L.prototype.Gf,L.prototype.Og,"MMR3",1,1145,64],N[65382]=[null,null,L.prototype.Bf,L.prototype.Lg,"LKS"],N[65402]=[null,null,L.prototype.Df,L.prototype.Ng,"MMR0",1,1140,64],N[65404]=[null,null,L.prototype.Ef,L.prototype.he,"MMR1",1,1145,64],N[65406]=[null,null,L.prototype.Ff,L.prototype.he,"MMR2",1,1140,64],N[65408]=[null,null,L.prototype.mg,L.prototype.vh, +"UIPDR",8,1140,64],N[65424]=[null,null,L.prototype.kg,L.prototype.th,"UDPDR",8,1145,64],N[65440]=[null,null,L.prototype.lg,L.prototype.uh,"UIPAR",8,1140,64],N[65456]=[null,null,L.prototype.jg,L.prototype.sh,"UDPAR",8,1145,64],N[65472]=[null,null,L.prototype.Mb,L.prototype.Qb,"R0SET0"],N[65473]=[null,null,L.prototype.Mb,L.prototype.Qb,"R1SET0"],N[65474]=[null,null,L.prototype.Mb,L.prototype.Qb,"R2SET0"],N[65475]=[null,null,L.prototype.Mb,L.prototype.Qb,"R3SET0"],N[65476]=[null,null,L.prototype.Mb, +L.prototype.Qb,"R4SET0"],N[65477]=[null,null,L.prototype.Mb,L.prototype.Qb,"R5SET0"],N[65478]=[null,null,L.prototype.Lf,L.prototype.Tg,"R6KERNEL"],N[65479]=[null,null,L.prototype.Of,L.prototype.Wg,"R7KERNEL"],N[65480]=[null,null,L.prototype.Nb,L.prototype.Rb,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.Nb,L.prototype.Rb,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.Nb,L.prototype.Rb,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.Nb,L.prototype.Rb,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.Nb, +L.prototype.Rb,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.Nb,L.prototype.Rb,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.Mf,L.prototype.Ug,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.Nf,L.prototype.Vg,"R6USER",1,1145],N[65504]=[null,null,L.prototype.wf,L.prototype.Gg,"CTRL",8,1170],N[65520]=[null,null,L.prototype.de,L.prototype.ie,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.de,L.prototype.ie,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.ig,L.prototype.rh,"SYSID",1,1170],N[65526]= +[null,null,L.prototype.vf,L.prototype.Fg,"ERR",1,1170],N[65528]=[null,null,L.prototype.Cf,L.prototype.Mg,"MBR",1,1170],N[65530]=[null,null,L.prototype.Hf,L.prototype.Pg,"PIR"],N[65532]=[null,null,L.prototype.hg,L.prototype.qh,"SLR"],N[65534]=[null,null,L.prototype.Kf,L.prototype.Sg,"PSW"],N); +yb(function(){for(var a=x(document,w,"device"),b=0;b>1),this.b=new Int32Array(this.v,0,this.size>>2),Hd(this,Id?Jd:Kd);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.tf=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.tg=function(a,b){Kb&&a&1&&this.C.La(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8}; -h.Dg=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.$a=!0};h.rf=function(a,b){this.f&&null!=this.J&&Zd(this.f,this.J+a);return this.K(a,b)};h.pg=function(a,b){this.f&&null!=this.J&&Zd(this.f,this.J+a,2);return this.B(a,b)}; +h.restore=function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Gb)for(b=0;b>8,c)};h.tf=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.tg=function(a,b){Kb&&a&1&&this.C.La(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8}; +h.Dg=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.ab=!0};h.rf=function(a,b){this.f&&null!=this.J&&Zd(this.f,this.J+a);return this.K(a,b)};h.pg=function(a,b){this.f&&null!=this.J&&Zd(this.f,this.J+a,2);return this.B(a,b)}; h.Bg=function(a,b,c){this.f&&null!=this.J&&$d(this.f,this.J+a);this.j?this.Pb(0,b,c):this.F(a,b,c)};h.yh=function(a,b,c){this.f&&null!=this.J&&$d(this.f,this.J+a,2);this.j?this.Pb(0,b,c):this.D(a,b,c)};h.qf=function(a){return this.g[a]};h.sf=function(a,b){a=this.g[a];this.f&&A(this.f,32)&&D(this.f,"Memory.readByte("+K(this.f,b)+"): "+K(this.f,a),!0);return a};h.og=function(a,b){Kb&&a&1&&this.C.La(b,64,2);return this.w.getUint16(a,!0)}; -h.sg=function(a,b){Kb&&a&1&&this.C.La(b,64,2);a=!Lb&&a&1?this.g[a]|this.g[a+1]<<8:this.G[a>>1];this.f&&A(this.f,32)&&D(this.f,"Memory.readWord("+K(this.f,b)+"): "+K(this.f,a),!0);return a};h.Ag=function(a,b){this.g[a]=b;this.$a=!0};h.Cg=function(a,b,c){this.g[a]=b;this.$a=!0;this.f&&A(this.f,32)&&D(this.f,"Memory.writeByte("+K(this.f,c)+","+K(this.f,b)+")",!0)};h.xh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);this.w.setUint16(a,b,!0);this.$a=!0}; -h.zh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);!Lb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.G[a>>1]=b;this.$a=!0;this.f&&A(this.f,32)&&D(this.f,"Memory.writeWord("+K(this.f,c)+","+K(this.f,b)+")",!0)};var Fd=0,hd=1,Gd=2,Yc=4,cd=["NONE","RAM","ROM","VID","H/W"],Ed=0,Ud=[],Ld=[J.prototype.tf,J.prototype.Dg,J.prototype.tg,J.prototype.Ah],Xd=[J.prototype.rf,J.prototype.Bg,J.prototype.pg,J.prototype.yh]; +h.sg=function(a,b){Kb&&a&1&&this.C.La(b,64,2);a=!Lb&&a&1?this.g[a]|this.g[a+1]<<8:this.G[a>>1];this.f&&A(this.f,32)&&D(this.f,"Memory.readWord("+K(this.f,b)+"): "+K(this.f,a),!0);return a};h.Ag=function(a,b){this.g[a]=b;this.ab=!0};h.Cg=function(a,b,c){this.g[a]=b;this.ab=!0;this.f&&A(this.f,32)&&D(this.f,"Memory.writeByte("+K(this.f,c)+","+K(this.f,b)+")",!0)};h.xh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);this.w.setUint16(a,b,!0);this.ab=!0}; +h.zh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);!Lb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.G[a>>1]=b;this.ab=!0;this.f&&A(this.f,32)&&D(this.f,"Memory.writeWord("+K(this.f,c)+","+K(this.f,b)+")",!0)};var Fd=0,hd=1,Gd=2,Yc=4,cd=["NONE","RAM","ROM","VID","H/W"],Ed=0,Md=[],Ld=[J.prototype.tf,J.prototype.Dg,J.prototype.tg,J.prototype.Ah],Xd=[J.prototype.rf,J.prototype.Bg,J.prototype.pg,J.prototype.yh]; if(Gb)var Kd=[J.prototype.qf,J.prototype.Ag,J.prototype.og,J.prototype.xh],Jd=[J.prototype.sf,J.prototype.Cg,J.prototype.sg,J.prototype.zh];var ae;if(Gb){var be=new ArrayBuffer(2);(new DataView(be)).setUint16(0,256,!0);ae=256===(new Uint16Array(be))[0]}else ae=!1;var Id=ae; -function ce(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Kc=0;this.Ic=b;this.hb=c;this.Sc=Math.round(this.Ic/1E4)/100;this.sb=this.Sc*this.hb;this.Tc=this.dc=this.vb=this.Jc=0;this.A.T=this.A.Dc=!1;this.A.sa=a.autoStart;"string"==typeof this.A.sa&&(this.A.sa="true"==this.A.sa);this.A.Gb=!1;this.bc=this.Ib=0;this.cc=+a.csStart;this.Hb=+a.csInterval;this.Jb=+a.csStop;this.ha=[];this.Id=this.xg.bind(this);this.ib=this.Ia=this.gb=this.b=this.ja=this.Ha=this.ac=this.fb=this.Kb= -this.Uc=this.rb=0;this.ra=null;y(this)}p(ce,q);h=ce.prototype;h.za=function(a,b,c,d){this.K=a;this.C=b;this.F=d;this.ra=a.i;for(a=0;a=a.Ib&&(a.Ib+=a.Hb,c=!0);0<=a.Jb&&a.Jb<=ke(a)&&(a.Hb=a.Jb=-1,ge(a),a.Z(),c=!0);c&&a.u(ke(a)+" cycles: checksum="+F(a.bc))}} -h.ta=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.H[b]=c,!0;case "run":return this.H[b]=c,c.onclick=function(){var a;if(a=d.K)if(a=d.K,a.A.ca)a=!0;else{var b=null,c,k=Aa(a.id);for(c=0;c=a.Ib&&(a.Ib+=a.Gb,c=!0);0<=a.Jb&&a.Jb<=ke(a)&&(a.Gb=a.Jb=-1,ge(a),a.Z(),c=!0);c&&a.u(ke(a)+" cycles: checksum="+F(a.bc))}} +h.ua=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.H[b]=c,!0;case "run":return this.H[b]=c,c.onclick=function(){var a;if(a=d.K)if(a=d.K,a.A.ca)a=!0;else{var b=null,c,k=Aa(a.id);for(c=0;ca.rb/a.sb?b=1:d=!0;a.hb=b;b=a.Sc*a.hb;if(a.sb!=b){a.sb=b;b=a.sb.toFixed(2)+"Mhz";var e=a.H.setSpeed;e&&(e.textContent=b);a.u("target speed: "+b)}c&&a.K&&oe(a.K)}uc(a,a.Ia);a.Ia=0;a.Ha=ya();a.fb=0;me(a);return d}function ld(a,b){var c=a.ha.length;a.ha.push([-1,b]);return c}function nd(a,b,c,d){0<=b&&ba.ha[b][0])&&(c=a.Ic*a.hb/1E3*c|0,a.A.T&&(c+=pe(a)),a.ha[b][0]=c)} function qe(a,b){for(var c=a.ha.length-1;0<=c;c--){var d=a.ha[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function re(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function pe(a,b){var c=a.gb-=a.b;a.b=a.ja=0;b&&(a.gb=0);return c} -h.xg=function(){if(this.A.T){this.Jc>=this.Ic&&me(this,!0);this.Kb=0;this.ac=ya();if(this.fb){var a=this.ac-this.fb;a>this.Tc&&(this.Ha+=a,this.Ha>this.ac&&(this.Ha=this.ac))}try{do{var b=qe(this,this.A.Gb?1:this.dc);try{this.pc(b)}catch(e){if("number"!=typeof e)throw e;}b=pe(this,!0);this.Kb+=b;this.Ia+=b;vc(this,b);tc(this,b);this.vb-=b;if(0>=this.vb){this.vb+=this.dc;++this.Uc>=se&&(this.K&&I(this.K,void 0),this.Uc=0);break}}while(this.A.T)}catch(e){this.Z();this.K&&this.K.stop(ya(),ke(this)); +h.xg=function(){if(this.A.T){this.Jc>=this.Ic&&me(this,!0);this.Kb=0;this.ac=ya();if(this.fb){var a=this.ac-this.fb;a>this.Tc&&(this.Ha+=a,this.Ha>this.ac&&(this.Ha=this.ac))}try{do{var b=qe(this,this.A.Fb?1:this.dc);try{this.pc(b)}catch(e){if("number"!=typeof e)throw e;}b=pe(this,!0);this.Kb+=b;this.Ia+=b;vc(this,b);tc(this,b);this.vb-=b;if(0>=this.vb){this.vb+=this.dc;++this.Uc>=se&&(this.K&&I(this.K,void 0),this.Uc=0);break}}while(this.A.T)}catch(e){this.Z();this.K&&this.K.stop(ya(),ke(this)); Ga(this,e.stack||e.message);return}if(this.A.T){a=setTimeout;b=this.Id;this.fb=ya();var c=this.Tc;this.Kb&&(c=Math.round(c*this.Kb/this.dc));var c=c-(this.fb-this.ac),d=this.fb-this.Ha;d&&(this.rb=Math.round(this.Ia/(10*d))/100,864E5<=d&&(this.ib=0,le(this)));if(0>c||this.rbc&&(this.Ha-=c),c=0;this.Jc+=this.Kb;this.fb+=c;a(b,c)}}}; function rc(a,b){if(!Ha(a))if(a.A.T)a.u(a.toString()+" busy");else{le(a);a.A.T=!0;a.A.Dc=!0;var c=a.H.run;c&&(c.textContent="Halt");a.K&&(b&&oe(a.K,!0),a.K.start(a.Ha,ke(a)));a.F||a.status("Started");setTimeout(a.Id,0)}}h.pc=function(){return 0};h.Z=function(a){var b=!1;if(this.A.T){pe(this);uc(this,this.Ia);this.Ia=0;this.A.T=!1;if(b=this.H.run)b.textContent="Run";this.K&&this.K.stop(ya(),ke(this));b=!0;this.F||this.status("Stopped")}this.A.complete=a;return b};var ne=30,se=15,de=["power","reset"]; -function te(a){var b=+a.model||1170;ce.call(this,a,6666667);this.ia=b;this.Bd=+a.addrReset||0;this.Ya=this.w=this.N=this.D=this.G=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Fa=this.lc=[];this.cb=this.O=this.zd=this.tb=this.ub=this.mb=this.eb=this.P=this.ic=this.Za=this.ua=this.U=this.jc=this.kc=this.V=this.i=0;this.Ed=[4,2,0,1];this.mc=0;this.Fd=255;1120>=this.ia?(this.yd=ue.bind(this),this.Eb=this.$e,this.mc=8,this.Fd=-1,this.Md=255,this.Ld=0):(this.yd=ve.bind(this),this.Eb=this.af, -this.Md=~(1792|(1140>=this.ia?2048:0))&65535,this.Ld=1140e.zb&&(e.zb=c,c+=4)}return ce.prototype.Ca.call(this,a,b)}; +function te(a){var b=+a.model||1170;ce.call(this,a,6666667);this.ia=b;this.Bd=+a.addrReset||0;this.Za=this.w=this.N=this.D=this.G=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Fa=this.lc=[];this.cb=this.O=this.zd=this.tb=this.ub=this.mb=this.eb=this.P=this.ic=this.$a=this.va=this.U=this.jc=this.kc=this.V=this.i=0;this.Ed=[4,2,0,1];this.mc=0;this.Fd=255;1120>=this.ia?(this.yd=ue.bind(this),this.Db=this.af,this.mc=8,this.Fd=-1,this.Md=255,this.Ld=0):(this.yd=ve.bind(this),this.Db=this.bf, +this.Md=~(1792|(1140>=this.ia?2048:0))&65535,this.Ld=1140e.yb&&(e.yb=c,c+=4)}return ce.prototype.Ca.call(this,a,b)}; h.reset=function(){this.status("Model "+this.ia);this.A.T&&this.Z();this.D=65536;this.G=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Bd,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, -65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.lc=[0,0,0,0,0,0,0,0];this.N=0;this.Ya=-1;this.v=this.j=this.Hc=this.X=this.Y=this.i=this.ic=0;pc(this);fe(this);this.A.error=!1;ce.prototype.reset.call(this)};function pc(a){a.U=0;a.jc=0;a.kc=0;a.V=0;a.P=0;a.Za=0;a.ua=255;a.tb=0;a.ub=0;a.mb=0;a.eb=262143;a.cb=a.g[7];a.O=0;a.R=null;a.C&&(we(a),a.zd=gd(a.C))} -function we(a){a.Xb=a.Lc;a.Yb=a.Mc;a.Ec=a.Nc;a.Zb=a.Qc;a.fc&&(a.Xb=a.Vd,a.Yb=a.$d);a.gc&&(a.Ec=a.ee,a.Zb=a.fe);a.tb?(a.Ga=65536,a.ob=a.V&16?4186112:253952,a.Ea=a.Zd,a.na=a.fc?a.rg:a.gd,a.Bb=a.gc?a.Ch:a.md,Zc(a.C,a.V&16?22:18)):(a.Ga=0,a.ob=57344,a.Ea=a.df,a.na=a.fc?a.qg:a.de,a.Bb=a.gc?a.Bh:a.ie,Zc(a.C,16))}function td(a){var b=a.U;b&57344||(b=b&-3199|a.ub<<5|a.mb<<1);return b} -function vd(a,b){b&=-3073;if(a.U!=b){b&57344&&!(a.U&57344)&&(a.jc=a.O>>16&65535,a.kc=a.O&65535);a.U=b;a.ub=(b&96)>>5;a.mb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.tb!=c&&(a.tb=c,we(a))}}function wd(a){a.U&57344||(a.jc=a.O>>16&65535);a=a.jc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xd(a){a.U&57344||(a.kc=a.O&65535);return a.kc}function yd(a,b){1170>a.ia&&(b&=-49);a.V!=b&&(a.V=b,a.eb=b&16?4194303:262143,we(a))} -function xe(a,b,c){a.Bd=b;ye(a,b);Bd(a,0);a.C.reset();pc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.T||rc(a)}else a.F&&a.A.ca?a.Z()||(he(a.F),I(a.K,-1)):!1===c&&a.Z();!a.A.T&&a.ra&&a.ra.stop()}h.Wd=function(){return 0}; -h.save=function(){var a=new G(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Fa,this.lc,this.P,this.ic,this.Za,this.ua,this.ub,this.mb,this.cb,this.i,this.O,this.Ya,this.nc,this.qc]);a.set(1,[Ad(this),td(this),wd(this),xd(this),this.V]);a.set(2,[this.ib,this.hb,this.A.sa]);a.set(3,ze(this));a.set(4,re(this));return a.data()}; -h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Fa=b.next().value;this.lc=b.next().value;this.P=b.next().value;this.ic=b.next().value;this.Za=b.next().value;this.ua=b.next().value;this.ub=b.next().value;this.mb=b.next().value;this.cb=b.next().value;this.i=b.next().value;this.O=b.next().value;this.Ya=b.next().value;this.nc=b.next().value;this.qc=b.next().value;b=a[1];Bd(this,b[0]);vd(this,b[1]); -this.jc=b[2];this.kc=b[3];yd(this,b[4]);b=a[2];this.ib=b[0];le(this,b[1]);this.A.sa=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function ye(a,b){a.g[7]=b&65535}function od(a,b,c,d){b={zb:b,kb:c,message:d||0,name:Pb[b],next:null};a.$b.push(b);return b}function Fe(a,b){var c=a.R;if(c==b)a.R=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.R&&(a.i|=1)} -function md(a,b){if(b){if(b!=a.R){var c=a.R;if(!c||c.kb<=b.kb)b.next=c,a.R=b;else{do{var d=c.next;if(!d||d.kb<=b.kb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&A(a,b.message|8)&&D(a,"setIRQ(vector="+E(b.zb)+",priority="+b.kb+")",!0,!0)}}function sd(a,b){b&&(Fe(a,b),b.message&&A(a,b.message|8)&&D(a,"clearIRQ(vector="+E(b.zb)+",priority="+b.kb+")",!0,!0))}function ze(a){var b=[];for(a=a.R;a;)b.push(a.zb),a=a.next;return b} -function Ge(a){return a.i&64?(a.qa(168,64,-6),!0):a.i&32?(a.qa(4,32,-5),!0):a.i&16?(a.qa(12,16,-7),!0):!1}function Ad(a){return a.w=a.w&63728|De(a)|Ce(a)|Be(a)|Ae(a)}function Bd(a,b){b&=a.Md;a.I=b<<12;a.L=~b&4;a.G=b<<14;a.D=b<<16;if((b^a.w)&a.Ld)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.N=b>>14&3;c=a.w>>14&3;a.N!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.N]);a.w=b;a.i&=-3;a.i|=a.R?2:1}function zd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.Za=b} +65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.lc=[0,0,0,0,0,0,0,0];this.N=0;this.Za=-1;this.v=this.j=this.Hc=this.X=this.Y=this.i=this.ic=0;pc(this);fe(this);this.A.error=!1;ce.prototype.reset.call(this)};function pc(a){a.U=0;a.jc=0;a.kc=0;a.V=0;a.P=0;a.$a=0;a.va=255;a.tb=0;a.ub=0;a.mb=0;a.eb=262143;a.cb=a.g[7];a.O=0;a.R=null;a.C&&(we(a),a.zd=gd(a.C))} +function we(a){a.Xb=a.Lc;a.Yb=a.Mc;a.Ec=a.Nc;a.Zb=a.Qc;a.fc&&(a.Xb=a.Wd,a.Yb=a.ae);a.gc&&(a.Ec=a.fe,a.Zb=a.ge);a.tb?(a.Ga=65536,a.ob=a.V&16?4186112:253952,a.Ea=a.$d,a.na=a.fc?a.rg:a.gd,a.Ab=a.gc?a.Ch:a.md,Zc(a.C,a.V&16?22:18)):(a.Ga=0,a.ob=57344,a.Ea=a.df,a.na=a.fc?a.qg:a.ee,a.Ab=a.gc?a.Bh:a.je,Zc(a.C,16))}function td(a){var b=a.U;b&57344||(b=b&-3199|a.ub<<5|a.mb<<1);return b} +function ud(a,b){b&=-3073;if(a.U!=b){b&57344&&!(a.U&57344)&&(a.jc=a.O>>16&65535,a.kc=a.O&65535);a.U=b;a.ub=(b&96)>>5;a.mb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.tb!=c&&(a.tb=c,we(a))}}function wd(a){a.U&57344||(a.jc=a.O>>16&65535);a=a.jc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xd(a){a.U&57344||(a.kc=a.O&65535);return a.kc}function yd(a,b){1170>a.ia&&(b&=-49);a.V!=b&&(a.V=b,a.eb=b&16?4194303:262143,we(a))} +function xe(a,b,c){a.Bd=b;ye(a,b);Bd(a,0);a.C.reset();pc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.T||rc(a)}else a.F&&a.A.ca?a.Z()||(he(a.F),I(a.K,-1)):!1===c&&a.Z();!a.A.T&&a.sa&&a.sa.stop()}h.Xd=function(){return 0}; +h.save=function(){var a=new G(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Fa,this.lc,this.P,this.ic,this.$a,this.va,this.ub,this.mb,this.cb,this.i,this.O,this.Za,this.nc,this.qc]);a.set(1,[Ad(this),td(this),wd(this),xd(this),this.V]);a.set(2,[this.ib,this.hb,this.A.ta]);a.set(3,ze(this));a.set(4,re(this));return a.data()}; +h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Fa=b.next().value;this.lc=b.next().value;this.P=b.next().value;this.ic=b.next().value;this.$a=b.next().value;this.va=b.next().value;this.ub=b.next().value;this.mb=b.next().value;this.cb=b.next().value;this.i=b.next().value;this.O=b.next().value;this.Za=b.next().value;this.nc=b.next().value;this.qc=b.next().value;b=a[1];Bd(this,b[0]);ud(this,b[1]); +this.jc=b[2];this.kc=b[3];yd(this,b[4]);b=a[2];this.ib=b[0];le(this,b[1]);this.A.ta=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function ye(a,b){a.g[7]=b&65535}function od(a,b,c,d){b={yb:b,kb:c,message:d||0,name:Pb[b],next:null};a.$b.push(b);return b}function Fe(a,b){var c=a.R;if(c==b)a.R=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.R&&(a.i|=1)} +function md(a,b){if(b){if(b!=a.R){var c=a.R;if(!c||c.kb<=b.kb)b.next=c,a.R=b;else{do{var d=c.next;if(!d||d.kb<=b.kb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&A(a,b.message|8)&&D(a,"setIRQ(vector="+E(b.yb)+",priority="+b.kb+")",!0,!0)}}function sd(a,b){b&&(Fe(a,b),b.message&&A(a,b.message|8)&&D(a,"clearIRQ(vector="+E(b.yb)+",priority="+b.kb+")",!0,!0))}function ze(a){var b=[];for(a=a.R;a;)b.push(a.yb),a=a.next;return b} +function Ge(a){return a.i&64?(a.ra(168,64,-6),!0):a.i&32?(a.ra(4,32,-5),!0):a.i&16?(a.ra(12,16,-7),!0):!1}function Ad(a){return a.w=a.w&63728|De(a)|Ce(a)|Be(a)|Ae(a)}function Bd(a,b){b&=a.Md;a.I=b<<12;a.L=~b&4;a.G=b<<14;a.D=b<<16;if((b^a.w)&a.Ld)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.N=b>>14&3;c=a.w>>14&3;a.N!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.N]);a.w=b;a.i&=-3;a.i|=a.R?2:1}function zd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.$a=b} h.Da=function(a){this.I=this.L=a;this.G=0};h.lb=function(a,b){this.I=this.L=this.D=a;this.G=b||0};function He(a,b){a.I=a.L=a.D=b;a.G=a.I^a.D>>1}function Ie(a,b,c,d){a.I=a.L=a.D=b;a.G=(c^d)&(d^b)} -h.qa=function(a,b,c){if(!this.oa){0>this.Ya?this.Ya=Ad(this):this.N||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.P|=4,this.g[6]=a=4);if(-1!=c){this.O=a|4143316992;this.N=0;var d=this.na(a|this.Ga),e=this.na(a+2&65535|this.Ga);Bd(this,e&-12289|this.Ya>>2&12288);Je(this,this.Ya);Je(this,this.g[7]);ye(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Ya=-1;this.nc=c;this.qc=a;-1==c&&this.Z();if(-4<=c)throw a;}}; +h.ra=function(a,b,c){if(!this.oa){0>this.Za?this.Za=Ad(this):this.N||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.P|=4,this.g[6]=a=4);if(-1!=c){this.O=a|4143316992;this.N=0;var d=this.na(a|this.Ga),e=this.na(a+2&65535|this.Ga);Bd(this,e&-12289|this.Za>>2&12288);Je(this,this.Za);Je(this,this.g[7]);ye(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Za=-1;this.nc=c;this.qc=a;-1==c&&this.Z();if(-4<=c)throw a;}}; function Ke(a){var b=Le(a),c=Le(a);a.w&49152&&(c=c&-225|a.w&63712);ye(a,b);Bd(a,c);a.i&=-17}function Me(a,b){var c=b>>13&31;31>c&&(b=a.V&32?a.Fa[c]+(b&8191)&4194303:b&-3932161);return b} function Ne(a,b,c){var d=[];if(c){c=Me(a,b);var e=b>>13&31;d.push(c);d.push(e);a.V&32&&(d.push(a.Fa[e]),d.push(b&8191))}else if(a.tb){var e=a.N<<1,f=b>>13;7>13;a.V&a.Ed[a.N]||(d&=7);e=a.B[a.N][d];f=(a.M[a.N][d]<<6)+(b&8191)&a.eb;3932160<=f&&(f=Me(a,f));if(a.oa)return f;f>=a.zd&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.B[a.N][d]=e;if(f!=(4194170&a.eb)||a.N)a.ub=a.N,a.mb=d;g&&(g&57344&&(0<=a.Ya&&(g|=128),a.U&57344||(g|=a.U&4096|a.ub<<5|a.mb<<1,vd(a,a.U&-61695|g&61694)),a.qa(168,64,-2)),a.U&61440||!(f<(4191360&a.eb)||f>(4194239&a.eb))||(a.U|=4096,a.U&512&&(a.i|=64)));return f}function Le(a){var b=a.na(a.g[6]|a.Ga);a.g[6]=a.g[6]+2&65535;return b}function Je(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.O=a.O&65535|(a.O&-65536)<<8|16121856;a.i&256||a.Eb(4,-2,c);a.Bb(c,b)} -function Oe(a,b,c,d){var e,f,g=d&8?0:a.Ga;switch(b){case 0:return a.qa(4,0,-3),0;case 1:return 6==c&&a.Eb(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Eb(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Eb(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,6==c&&a.Eb(d, -0,e),a.b-=6,e|g;case 7:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ga),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.O=a.O&65535|(a.O&-65536)<<8|(f<<3&248|c)<<16;return e}h.$e=function(a,b,c){!this.N&&0>=b&&c<=this.ua&&(this.i|=32)};h.af=function(a,b,c){this.N||(65534<=c&&(c|=-65536),a&4&&c<=this.ua&&(c<=this.ua-32?this.qa(4,0,-4):(this.P|=8,this.i|=32)))};h.Vd=function(a){this.F&&Zd(this.F,a,1);return this.Lc(a)};h.$d=function(a){this.F&&Zd(this.F,a,2);return this.Mc(a)}; -h.ee=function(a,b){this.F&&$d(this.F,a,1);this.Nc(a,b)};h.fe=function(a,b){this.F&&$d(this.F,a,2);this.Qc(a,b)};function Ac(a,b){a.oa++;b=a.C.oc(yc(a,b,2));a.oa--;return b}function Pe(a,b){(b?--a.gc:--a.fc)||we(a)}h.df=function(a,b,c){return Oe(this,a,b,c)};h.Zd=function(a,b,c){return yc(this,Oe(this,a,b,c),c)};h.de=function(a){return this.C.oc(this.cb=a)};h.qg=function(a){this.F&&Zd(this.F,a,2);return this.de(a)};h.gd=function(a){return this.C.oc(this.cb=yc(this,a,2))}; -h.rg=function(a){this.F&&Zd(this.F,a,2);return this.gd(a)};h.ie=function(a,b){this.C.Sb(this.cb=a,b)};h.Bh=function(a,b){this.F&&$d(this.F,a,2);this.ie(a,b)};h.md=function(a,b){this.C.Sb(this.cb=yc(this,a,4),b)};h.Ch=function(a,b){this.F&&$d(this.F,a,2);this.md(a,b)};function Qe(a,b,c){var d=a.j=b&7;(b=a.v=(b&56)>>3)?(d=Oe(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.N=a.w>>12&3,c=a.na(d|c&a.Ga),a.N=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} +function yc(a,b,c){var d,e,f;if(!(c&a.tb))return f=b&65535,57344<=f&&(f|=a.ob),f;d=b>>13;a.V&a.Ed[a.N]||(d&=7);e=a.B[a.N][d];f=(a.M[a.N][d]<<6)+(b&8191)&a.eb;3932160<=f&&(f=Me(a,f));if(a.oa)return f;f>=a.zd&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.B[a.N][d]=e;if(f!=(4194170&a.eb)||a.N)a.ub=a.N,a.mb=d;g&&(g&57344&&(0<=a.Za&&(g|=128),a.U&57344||(g|=a.U&4096|a.ub<<5|a.mb<<1,ud(a,a.U&-61695|g&61694)),a.ra(168,64,-2)),a.U&61440||!(f<(4191360&a.eb)||f>(4194239&a.eb))||(a.U|=4096,a.U&512&&(a.i|=64)));return f}function Le(a){var b=a.na(a.g[6]|a.Ga);a.g[6]=a.g[6]+2&65535;return b}function Je(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.O=a.O&65535|(a.O&-65536)<<8|16121856;a.i&256||a.Db(4,-2,c);a.Ab(c,b)} +function Oe(a,b,c,d){var e,f,g=d&8?0:a.Ga;switch(b){case 0:return a.ra(4,0,-3),0;case 1:return 6==c&&a.Db(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Db(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Db(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,6==c&&a.Db(d, +0,e),a.b-=6,e|g;case 7:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ga),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.O=a.O&65535|(a.O&-65536)<<8|(f<<3&248|c)<<16;return e}h.af=function(a,b,c){!this.N&&0>=b&&c<=this.va&&(this.i|=32)};h.bf=function(a,b,c){this.N||(65534<=c&&(c|=-65536),a&4&&c<=this.va&&(c<=this.va-32?this.ra(4,0,-4):(this.P|=8,this.i|=32)))};h.Wd=function(a){this.F&&Zd(this.F,a,1);return this.Lc(a)};h.ae=function(a){this.F&&Zd(this.F,a,2);return this.Mc(a)}; +h.fe=function(a,b){this.F&&$d(this.F,a,1);this.Nc(a,b)};h.ge=function(a,b){this.F&&$d(this.F,a,2);this.Qc(a,b)};function Ac(a,b){a.oa++;b=a.C.oc(yc(a,b,2));a.oa--;return b}function Pe(a,b){(b?--a.gc:--a.fc)||we(a)}h.df=function(a,b,c){return Oe(this,a,b,c)};h.$d=function(a,b,c){return yc(this,Oe(this,a,b,c),c)};h.ee=function(a){return this.C.oc(this.cb=a)};h.qg=function(a){this.F&&Zd(this.F,a,2);return this.ee(a)};h.gd=function(a){return this.C.oc(this.cb=yc(this,a,2))}; +h.rg=function(a){this.F&&Zd(this.F,a,2);return this.gd(a)};h.je=function(a,b){this.C.Sb(this.cb=a,b)};h.Bh=function(a,b){this.F&&$d(this.F,a,2);this.je(a,b)};h.md=function(a,b){this.C.Sb(this.cb=yc(this,a,4),b)};h.Ch=function(a,b){this.F&&$d(this.F,a,2);this.md(a,b)};function Qe(a,b,c){var d=a.j=b&7;(b=a.v=(b&56)>>3)?(d=Oe(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.N=a.w>>12&3,c=a.na(d|c&a.Ga),a.N=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} function Re(a,b,c,d){a.O=a.O&65535|1441792;var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=Oe(a,b,e,4),c&65536||(e&=65535),a.N=a.w>>12&3,e=yc(a,e|c&65536,4),a.N=a.w>>14&3,a.Zb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Se(a,b){b>>=6;var c=a.Y=b&7;return(b=a.X=(b&56)>>3)?a.Xb(a.Ea(b,c,3)):a.g[c+a.mc]&a.Fd}function Te(a,b){var c;b>>=6;var d=a.Y=b&7;(b=a.X=(b&56)>>3)?c=a.Yb(a.Ea(b,d,2)):c=a.g[d+a.mc];return c}function Ue(a,b){var c=a.j=b&7;b=a.v=(b&56)>>3;return Oe(a,b,c,8)} -function Ve(a,b){var c=a.j=b&7;return(b=a.v=(b&56)>>3)?a.Xb(a.Ea(b,c,3)):a.g[c]&255}function We(a,b){var c,d=a.j=b&7;(b=a.v=(b&56)>>3)?c=a.Yb(a.Ea(b,d,2)):c=a.g[d];return c}function sf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Hc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.Ec(e,d.call(a,c,a.Xb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} +function Ve(a,b){var c=a.j=b&7;return(b=a.v=(b&56)>>3)?a.Xb(a.Ea(b,c,3)):a.g[c]&255}function We(a,b){var c,d=a.j=b&7;(b=a.v=(b&56)>>3)?c=a.Yb(a.Ea(b,d,2)):c=a.g[d];return c}function Xe(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Hc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.Ec(e,d.call(a,c,a.Xb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} function R(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,6),a.Zb(e,d.call(a,0>c?a.g[-c-1]:c,a.Yb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function tf(a,b,c,d,e){var f=a.j=b&7;(b=a.v=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.Ec(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} function uf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Zb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} -h.pc=function(a){this.A.complete=!0;var b=this.F?vf(this.F)?1:this.A.Dc?-1:0:0,c=a?this.A.Dc?0:1:-1;this.A.Dc=!1;this.gb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(wf(this.F,this.g[7],c)){this.Z();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.Za&224)>>5,f=this.R&&this.R.kb>e?this.R:null;f&&(d=f.zb,e=f.kb);e>(this.w&224)>>5?(this.i&8&&(Ee(this,2),this.i&=-9),this.qa(d,0,-10),e=!0):e=!1;e&&(f&&Fe(this,f),a=!0);this.R||this.Za||(this.i&=-3)}else this.i& +h.pc=function(a){this.A.complete=!0;var b=this.F?vf(this.F)?1:this.A.Dc?-1:0:0,c=a?this.A.Dc?0:1:-1;this.A.Dc=!1;this.gb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(wf(this.F,this.g[7],c)){this.Z();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.$a&224)>>5,f=this.R&&this.R.kb>e?this.R:null;f&&(d=f.yb,e=f.kb);e>(this.w&224)>>5?(this.i&8&&(Ee(this,2),this.i&=-9),this.ra(d,0,-10),e=!0):e=!1;e&&(f&&Fe(this,f),a=!0);this.R||this.$a||(this.i&=-3)}else this.i& 1&&this.i++;if(a){if(this.i&4&&wf(this.F,this.g[7],c)){this.Z();break}if(0>c)break}if(this.i&112&&Ge(this)){if(this.i&4&&wf(this.F,this.g[7],c)){this.Z();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.O=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.yd(f)}while(0>1|b<<16;He(this,a);return a&65535}function Cf(a,b){a=b&128|b>>1|b<<8;He(this,a<<8);return a&255}function Df(a,b){a=b&~a;this.Da(a);return a}function Ef(a,b){a=b&~a;this.Da(a<<8);return a} function Ff(a,b){a|=b;this.Da(a);return a}function Gf(a,b){a|=b;this.Da(a<<8);return a}function Hf(a,b){a=~b|65536;this.lb(a);return a&65535}function If(a,b){a=~b|256;this.lb(a<<8);return a&255}function Jf(a,b){this.I=this.L=a=b-a;this.G=b&(b^a);return a&65535}function Kf(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.G=b&(b^c);return a&255}function Lf(a,b){this.I=this.L=a=b+a;this.G=a&(b^a);return a&65535}function Mf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.G=c&(b<<8^c);return a&255} @@ -165,22 +165,22 @@ function Nf(a,b){a=-b;this.lb(a,a&b&32768);return a&65535}function Of(a,b){a=-b; function Uf(a,b){var c=b-a;Ie(this,c<<8,a<<8,b<<8);return c&255}function Vf(a,b){this.I=this.L=b&65280;this.G=this.D=0;return(b<<8|b>>8)&65535}function Wf(a,b){a^=b;this.Da(a);return a&65535}function Xf(a){R(this,a,Te(this,a),xf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} function Yf(a){var b=We(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.D=this.G=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.G=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.v?6:7)+b} function Zf(a){var b=We(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.D=this.G=0;b&=63;if(b&32){b=64-b;32>b-1;this.D=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.v?6:7)+b}function $f(a){P(this,a,!Ae(this))}function ag(a){P(this,a,Ae(this))} -function bg(a){R(this,a,Te(this,a),Df);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function cg(a){sf(this,a,Se(this,a),Ef);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function dg(a){R(this,a,Te(this,a),Ff);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function eg(a){sf(this,a,Se(this,a),Gf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function bg(a){R(this,a,Te(this,a),Df);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function cg(a){Xe(this,a,Se(this,a),Ef);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function dg(a){R(this,a,Te(this,a),Ff);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function eg(a){Xe(this,a,Se(this,a),Gf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} function fg(a){var b=Te(this,a);a=We(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function gg(a){var b=Se(this,a);a=Ve(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function hg(a){P(this,a,Ce(this))}function ig(a){P(this,a,!De(this)==!Be(this))}function jg(a){P(this,a,!Ce(this)&&!De(this)==!Be(this))}function kg(a){P(this,a,!Ae(this)&&!Ce(this))} -function lg(a){P(this,a,Ce(this)||!De(this)!=!Be(this))}function mg(a){P(this,a,Ae(this)||Ce(this))}function ng(a){P(this,a,!De(this)!=!Be(this))}function og(a){P(this,a,De(this))}function pg(a){P(this,a,!Ce(this))}function qg(a){P(this,a,!De(this))}function rg(){this.qa(12,0,-9)}function sg(a){P(this,a,!0)}function tg(a){P(this,a,!Be(this))}function ug(a){P(this,a,Be(this))}function vg(a){a&1&&(this.D=0);a&2&&(this.G=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} +function lg(a){P(this,a,Ce(this)||!De(this)!=!Be(this))}function mg(a){P(this,a,Ae(this)||Ce(this))}function ng(a){P(this,a,!De(this)!=!Be(this))}function og(a){P(this,a,De(this))}function pg(a){P(this,a,!Ce(this))}function qg(a){P(this,a,!De(this))}function rg(){this.ra(12,0,-9)}function sg(a){P(this,a,!0)}function tg(a){P(this,a,!Be(this))}function ug(a){P(this,a,Be(this))}function vg(a){a&1&&(this.D=0);a&2&&(this.G=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} function wg(a){var b=Te(this,a);a=We(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Ie(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function xg(a){var b=Se(this,a);a=Ve(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Ie(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} -function yg(a){var b=We(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.D=this.G=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.G=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.G=32768,this.D=65536,this.b-=7}function zg(){this.qa(24,0,-9);this.b-=20} -function Ag(){this.w&49152?(this.P|=128,this.qa(4,0,-8)):(this.ra&&1120==this.ia&&this.ra.setData(this.g[0],!0),this.F?Bg(this.F):this.Z());this.b-=7}function Cg(){this.qa(16,0,-9);this.b-=20}var Dg=[0,7,7,10,7,11,9,13];function Eg(a){this.ja=this.b;ye(this,Ue(this,a));this.b=this.ja-Dg[this.v]}var Fg=[0,14,14,17,14,18,16,20];function Gg(a){this.ja=this.b;var b=Ue(this,a);a=a>>6&7;Je(this,this.g[a]);this.g[a]=this.g[7];ye(this,b);this.b=this.ja-Fg[this.v]} +function yg(a){var b=We(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.D=this.G=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.G=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.G=32768,this.D=65536,this.b-=7}function zg(){this.ra(24,0,-9);this.b-=20} +function Ag(){this.w&49152?(this.P|=128,this.ra(4,0,-8)):(this.sa&&1120==this.ia&&this.sa.setData(this.g[0],!0),this.F?Bg(this.F):this.Z());this.b-=7}function Cg(){this.ra(16,0,-9);this.b-=20}var Dg=[0,7,7,10,7,11,9,13];function Eg(a){this.ja=this.b;ye(this,Ue(this,a));this.b=this.ja-Dg[this.v]}var Fg=[0,14,14,17,14,18,16,20];function Gg(a){this.ja=this.b;var b=Ue(this,a);a=a>>6&7;Je(this,this.g[a]);this.g[a]=this.g[7];ye(this,b);this.b=this.ja-Fg[this.v]} var Hg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ig(a){var b=Te(this,a);this.ja=this.b;uf(this,a,b,this.Da);this.b=this.ja-Hg[(this.X?8:0)+this.v]+(7!=this.j||this.v?0:2)}function Jg(a){var b=Se(this,a);tf(this,a,b,65535,this.Da);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Kg=[7,13,13,17,14,18,17,21]; -function Lg(a){var b=We(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.G=0;this.D=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)ye(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Sg(a){R(this,a,Te(this,a),Tf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Tg(a){R(this,a,0,Vf);this.b-=this.v?9:3+(7==this.j?2:0)}function Ug(){this.qa(28,0,-9)} -function Vg(){this.ra&&(this.ra.kd(this.g[7],!0),this.ra.setData(this.g[0],!0));this.i|=8;Ee(this,-2);this.b-=3}function Wg(a){R(this,a,this.g[(a>>6&7)+this.mc],Wf);this.b-=this.v?9:3+(7==this.j?2:0)}function S(a){var b;if(b=this.F)b=this.F,A(b,1)?(D(b,"undefined opcode "+K(b,a),!0,!0),b=Bg(b)):b=!1;b||this.qa(8,0,-9)}function ue(a){Xg[a>>12].call(this,a)}function Yg(a){Zg[a>>6&3].call(this,a)}function $g(a){ah[a>>6&3].call(this,a)}function bh(a){ch[a>>6&3].call(this,a)} +function Lg(a){var b=We(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.G=0;this.D=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)ye(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Sg(a){R(this,a,Te(this,a),Tf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Tg(a){R(this,a,0,Vf);this.b-=this.v?9:3+(7==this.j?2:0)}function Ug(){this.ra(28,0,-9)} +function Vg(){this.sa&&(this.sa.kd(this.g[7],!0),this.sa.setData(this.g[0],!0));this.i|=8;Ee(this,-2);this.b-=3}function Wg(a){R(this,a,this.g[(a>>6&7)+this.mc],Wf);this.b-=this.v?9:3+(7==this.j?2:0)}function S(a){var b;if(b=this.F)b=this.F,A(b,1)?(D(b,"undefined opcode "+K(b,a),!0,!0),b=Bg(b)):b=!1;b||this.ra(8,0,-9)}function ue(a){Xg[a>>12].call(this,a)}function Yg(a){Zg[a>>6&3].call(this,a)}function $g(a){ah[a>>6&3].call(this,a)}function bh(a){ch[a>>6&3].call(this,a)} function dh(a){eh[a&15].call(this,a)}function fh(a){gh[a&15].call(this,a)}function hh(a){ih[a>>6&3].call(this,a)}function jh(a){kh[a>>6&3].call(this,a)}function lh(a){mh[a>>6&3].call(this,a)} var Xg=[function(a){nh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Xf,S,function(a){oh[a>>8&15].call(this,a)},Jg,xg,gg,cg,eg,Sg,S],nh=[function(a){ph[a>>4&15].call(this,a)},sg,pg,hg,ig,ng,jg,lg,Gg,Gg,Yg,$g,bh,S,S,S],Zg=[function(a){uf(this,a,0,this.lb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Hf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,1,Lf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,1,Jf);this.b-=this.v?9:3+(7==this.j?2:0)}],ah=[function(a){R(this,a,0,Nf); this.b-=this.v?11:6},function(a){R(this,a,Ae(this)?1:0,xf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,Ae(this)?1:0,Tf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=We(this,a);this.lb(a);this.b-=this.v?4:3+(7==this.j?2:0)}],ch=[function(a){R(this,a,0,Rf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Pf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Bf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,zf);this.b-=this.v?9:3+(7==this.j?2:0)}],ph= [function(a){qh[a&15].call(this,a)},S,S,S,Eg,Eg,Eg,Eg,Og,S,dh,fh,Tg,Tg,Tg,Tg],qh=[Ag,Vg,Pg,rg,Cg,Ng,S,S,S,S,S,S,S,S,S,S],eh=[Mg,function(){this.D=0;this.b-=5},function(){this.G=0;this.b-=5},vg,function(){this.L=1;this.b-=5},vg,vg,vg,function(){this.I=0;this.b-=5},vg,vg,vg,vg,vg,vg,vg],gh=[Mg,function(){this.D=65536;this.b-=5},function(){this.G=32768;this.b-=5},Qg,function(){this.L=0;this.b-=5},Qg,Qg,Qg,function(){this.I=32768;this.b-=5},Qg,Qg,Qg,Qg,Qg,Qg,Qg],oh=[qg,og,kg,mg,tg,ug,$f,ag,zg,Ug,hh,jh, -lh,S,S,S],ih=[function(a){tf(this,a,0,255,this.lb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,0,If);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,1,Mf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,1,Kf);this.b-=this.v?9:3+(7==this.j?2:0)}],kh=[function(a){sf(this,a,0,Of);this.b-=this.v?11:6},function(a){sf(this,a,Ae(this)?1:0,yf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,Ae(this)?1:0,Uf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=Ve(this, -a);this.lb(a<<8);this.b-=this.v?4:3+(7==this.j?2:0)}],mh=[function(a){sf(this,a,0,Sf);this.b-=this.v?9+(this.Hc&1):3+(7==this.j?2:0)},function(a){sf(this,a,0,Qf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,0,Cf);this.b-=this.v?9+(this.Hc&1):3+(7==this.j?2:0)},function(a){sf(this,a,0,Af);this.b-=this.v?9:3+(7==this.j?2:0)}];function ve(a){rh[a>>12].call(this,a)} +lh,S,S,S],ih=[function(a){tf(this,a,0,255,this.lb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,0,If);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,1,Mf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,1,Kf);this.b-=this.v?9:3+(7==this.j?2:0)}],kh=[function(a){Xe(this,a,0,Of);this.b-=this.v?11:6},function(a){Xe(this,a,Ae(this)?1:0,yf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,Ae(this)?1:0,Uf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=Ve(this, +a);this.lb(a<<8);this.b-=this.v?4:3+(7==this.j?2:0)}],mh=[function(a){Xe(this,a,0,Sf);this.b-=this.v?9+(this.Hc&1):3+(7==this.j?2:0)},function(a){Xe(this,a,0,Qf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,0,Cf);this.b-=this.v?9+(this.Hc&1):3+(7==this.j?2:0)},function(a){Xe(this,a,0,Af);this.b-=this.v?9:3+(7==this.j?2:0)}];function ve(a){rh[a>>12].call(this,a)} var rh=[function(a){sh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Xf,function(a){th[a>>8&15].call(this,a)},function(a){uh[a>>8&15].call(this,a)},Jg,xg,gg,cg,eg,Sg,S],sh=[function(a){vh[a>>4&15].call(this,a)},sg,pg,hg,ig,ng,jg,lg,Gg,Gg,Yg,$g,bh,function(a){wh[a>>6&3].call(this,a)},S,S],wh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.na(a|this.Ga);ye(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Qe(this,a,0);this.Da(a);Je(this,a);this.b-=11},function(a){var b=Le(this); this.ja=this.b;this.Da(b);Re(this,a,0,b);this.b=this.ja-Kg[this.v]},function(a){uf(this,a,De(this)?65535:0,this.Da);this.b-=this.v?9:3+(7==this.j?2:0)}],vh=[function(a){xh[a&15].call(this,a)},S,S,S,Eg,Eg,Eg,Eg,Og,function(a){!(a&8)||1145>this.ia?S.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},dh,fh,Tg,Tg,Tg,Tg],xh=[Ag,Vg,function(){Ke(this);this.i|=this.w&16;this.b-=13},rg,Cg,Ng,Pg,function(a){S.call(this,a)},S,S,S,S,S,S,S,S],th=[Lg,Lg,yg,yg,Yf,Yf,Zf,Zf, Wg,Wg,S,S,S,S,Rg,Rg],uh=[qg,og,kg,mg,tg,ug,$f,ag,zg,Ug,hh,jh,lh,function(a){1145>this.ia?S.call(this,a):yh[a>>6&3].call(this,a)},S,S],yh=[function(a){S.call(this,a)},function(a){a=Qe(this,a,65536);this.Da(a);Je(this,a);this.b-=11},function(a){var b=Le(this);this.ja=this.b;this.Da(b);Re(this,a,65536,b);this.b=this.ja-Kg[this.v]},function(a){S.call(this,a)}]; @@ -188,186 +188,188 @@ function zh(a){q.call(this,"ROM",a,128);this.ea=this.g=null;this.v=+a.addr;this. h=zh.prototype;h.za=function(a,b,c,d){this.C=b;this.f=c;this.F=d;Ah(this)};h.Ca=function(){this.ea&&(this.F&&Bh(this.F,this.id,this.v,this.b,this.ea),delete this.ea);return!0};h.Ba=function(){return!0}; function Ah(a){if(!Ia(a)){if(a.j){if(!a.g||!a.C)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Ga(a,"ROM size ("+F(a.g.length,8,!0)+") does not match specified size ("+F(a.b,8,!0)+")");else{var b;a:{b=a.v;if(57344<=b&&b<57344+Rc){var c={},c=(c[b]=[zh.prototype.cg,zh.prototype.lh,null,null,null,a.b>>1],c);if(bc(a.C,a,c)){a.status("Added "+a.b+"-byte ROM at "+E(b));b=a.w=!0;break a}}else if(Xc(a.C,b,a.b,Gd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0>>a.g;0=b.length){D(a,"invalid block at offset "+Sa(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,C=r-=6;0=b.length){D(a,"insufficient data for block at offset "+Sa(n),4096); break}m+=b[l++]&255;if(m&255){D(a,"invalid checksum ("+F(m,2,!0)+") for block at offset "+Sa(n),4096);break}if(C)for(D(a,"loading "+Sa(C)+" bytes at "+Sa(u)+"-"+Sa(u+C),4096);C--;)fd(a.C,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&D(a,"starting address: "+Sa(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=ta.nd&&c<=ta.We&&(b=c-(ta.nd-ta.ke));b&&(a.preventDefault&&a.preventDefault(),d.Bc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ta.me&&(b=ta.le);d.Bc(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +yb(function(){for(var a=x(document,w,"ram"),b=0;b=ta.nd&&c<=ta.Xe&&(b=c-(ta.nd-ta.le));b&&(a.preventDefault&&a.preventDefault(),d.Bc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ta.ne&&(b=ta.me);d.Bc(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Bc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;var e=this;this.P=od(this.f,this.M?-1:48,4,262144);this.R=ld(this.f,function(){var a;a=-1;e.i.length&&(a=e.i.shift()&255,D(e,"receiveByte("+F(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),nd(e.f,e.R,1E3/Math.round(e.U/10)));0<=a&&(e.D=a,e.b&128?e.D|=49152:e.b|=128,e.b&64&&md(c,e.P))});this.N=od(this.f,this.M?-1:52,4,262144);this.X=ld(this.f,function(){e.g|=128;e.g&64&&md(c,e.N)});bc(b,this,Ih,this.M?64832+8*(this.M-1)-65392:0);dc(b,this.reset.bind(this)); -y(this)};h.ae=function(a){if(!this.j){var b=ee(this.K,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Za(c[0]);if(d!=this.Fb)return;c=Za(c[1]);if(this.j=Ba(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.G=e.receiveData){this.I=a;this.O=e.receiveStatus;this.status("Connected "+this.pb+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -h.Ca=function(a,b){if(!b)if(this.ae(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.Ba=function(a){return a?this.save():!0};h.reset=function(){Jh(this)};h.save=function(){var a=new G(this);a.set(0,[this.D,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Jh(this,a[0])};function Jh(a,b){b||(b=[0,8192,128,a.i]);b=ja(b);a.D=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0} +y(this)};h.be=function(a){if(!this.j){var b=ee(this.K,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Za(c[0]);if(d!=this.Eb)return;c=Za(c[1]);if(this.j=Ba(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.G=e.receiveData){this.I=a;this.O=e.receiveStatus;this.status("Connected "+this.pb+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +h.Ca=function(a,b){if(!b)if(this.be(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.Ba=function(a){return a?this.save():!0};h.reset=function(){Jh(this)};h.save=function(){var a=new G(this);a.set(0,[this.D,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Jh(this,a[0])};function Jh(a,b){b||(b=[0,8192,128,a.i]);b=ja(b);a.D=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0} h.Bc=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Ya("",c)));this.V&&!this.B&&c&&(b=String.fromCharCode(this.V)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.B+=c}}else if(null!=this.w){if(10== a||1024<=this.w.length)this.u(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}nd(this.f,this.X,1E3/Math.round(this.Y/10));this.g&=-129};var Hh="buffer",Kh={},Ih=(Kh[65392]=[null,null,Gh.prototype.Qf,Gh.prototype.Yg,"RCSR"],Kh[65394]=[null,null,Gh.prototype.Pf,Gh.prototype.Xg,"RBUF"],Kh[65396]=[null,null,Gh.prototype.vg,Gh.prototype.Eh,"XCSR"],Kh[65398]=[null,null,Gh.prototype.ug,Gh.prototype.Dh,"XBUF"],Kh); -yb(function(){for(var a=x(document,w,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.H[b]=c,!0;case "readTape":e=Oh;case "loadTape":return e||(e=Ph),this.H[b]=c,c.onclick= +h.ua=function(a,b,c){var d=this,e=Nh;switch(b){case "listTapes":return this.H[b]=c,c.onchange=function(){var a=d.H.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){v("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b=''+b+"");a.innerHTML=b}},!0;case "descTape":return this.H[b]=c,!0;case "readTape":e=Oh;case "loadTape":return e||(e=Ph),this.H[b]=c,c.onclick= function(){var a=d.H.listTapes;a&&Qh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.N){c.parentNode.removeChild(c);break}this.H[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Qh(d,Ta(b,!0),b,Ph,a)}return!1};return!0;case Rh:return this.H[b]=c,!0}return!1}; h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;this.I=Sh(a);var e=this;if(a=Lh(this,ee(this.K,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.G=od(this.f,56,4,4096);this.P=ld(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=Ua(c),f="json"==e||"gz"==e?encodeURI(c):hb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!fb(f,null,!0,function(e,f,g){var k=0>g&&!!a.K&&!a.K.A.ca;g?a.S('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(va(a.pb,e,f),(e=gb(e,f))&&ci(a,b,c,d,e.aa,e.wa, -e.va));a.A.jb=!1;a.g&&(a.g--,a.g||y(a));$h(a)})}function Vh(a,b,c,d){if((a=a.H.listTapes)&&a.options){for(var e=0;ec.indexOf("/api/v1/dump")&&(e=Ua(c),f="json"==e||"gz"==e?encodeURI(c):hb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!fb(f,null,!0,function(e,f,g){var k=0>g&&!!a.K&&!a.K.A.ca;g?a.S('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(va(a.pb,e,f),(e=gb(e,f))&&ci(a,b,c,d,e.aa,e.xa, +e.wa));a.A.jb=!1;a.g&&(a.g--,a.g||y(a));$h(a)})}function Vh(a,b,c,d){if((a=a.H.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ba);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ua(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Va(c,"/")&&(d="dir"),f=hb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.dd?"":e)+"&format=json"));return!!fb(f, +function fi(a,b,c){q.call(this,"Disk",{id:a.pb+".disk"+F(++gi,4)},8192);this.controller=a;this.K=a.K;this.F=a.F;this.v=b;this.Va=b.name;this.Ma=this.hd="";this.dd=b.dd;this.ba=this.ma=this.ga=this.ya=this.mode=0;this.b=[];this.i=null;this.j=!1;hi(this,c,b.ba,b.ma,b.ga,b.ya);this.g=this.w=null;y(this)}p(fi,q);h=fi.prototype;h.za=function(a,b,c,d){this.F=d}; +function hi(a,b,c,d,e,f){a.mode=b;a.ba=c;a.ma=d;a.ga=e;a.ya=f;a.b=[];if("preload"!=a.mode){b=Array(a.ba);for(c=0;c>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ba);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ua(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Va(c,"/")&&(d="dir"),f=hb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.dd?"":e)+"&format=json"));return!!fb(f, null,!0,function(b,c,d){ki(a,b,c,d)})} -function ki(a,b,c,d){var e=null,f=0>d&&!!a.K&&!a.K.A.ca;a.j=!1;if(d)a.controller.S('Unable to load disk "'+a.bb+'" (error '+d+": "+b+")",f);else{va(a.controller.pb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.ba=k.length;a.ma=k[0].length;a.ga=k[0][0].length;var l=k[0][0][0];a.xa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,C=u.length;C>2,e=Array(d),f=0;fd&&!!a.K&&!a.K.A.ca;a.j=!1;if(d)a.controller.S('Unable to load disk "'+a.Va+'" (error '+d+": "+b+")",f);else{va(a.controller.pb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)v(k[0]);else{a.ba=k.length;a.ma=k[0].length;a.ga=k[0][0].length;var l=k[0][0][0];a.ya=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,C=u.length;C>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ja?f=a.Sa+a.Ja&&(a.Ja+=f-(a.Sa+a.Ja)+1):(a.Sa=f,a.Ja=1);d[f]=d[f]&~(255<g)break;e|=g<g)break;e|=g<=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.S("Unable to restore disk '"+this.bb+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=mi(this,a++);)Ii(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function Ii(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var gi=0;function Ji(a,b,c,d,e,f){q.call(this,a,b,c);this.L=Ki(this,b.autoMount);this.G=0;this.O=d;this.P=e;this.R=f;this.N=d.rd;this.i=Array(this.N);this.M=!mb("Mobi")&&window&&"FileReader"in window;this.v=[];this.Lb=null;this.exports={selectDrive:this.yg}}p(Ji,q); -function Ki(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Ji.prototype; -h.ta=function(a,b,c){var d=this;switch(b){case "listDisks":return this.H[b]=c,c.onchange=function(){var a=d.H.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v(d.type+" option error: "+k.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.H[b]=c,c.onchange=function(){var a=La(c.value,10);null!=a&& -Li(d,a)},!0;case "loadDisk":return this.H[b]=c,c.onclick=function(){var a=d.H.listDisks;a&&a.options&&Mi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.H[b]=c,c.onclick=function(){var a,b=d.H.listDrives,b=b&&La(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.S("Unable to boot the selected drive"):a.ya?(xe(d.f,0,!0),(a=d.hc(a,0,0,0,512,0,2))&&d.S("Unable to read the boot sector ("+a+")")):d.S("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c); -break}this.H[b]=c;c.onclick=function(){var a=d.H.listDrives;if(a&&a.options&&d.i)if(a=d.i[La(a.value,10)||0])if(a=a.ya){var b;b="";for(var c=0,k;k=mi(a,c++);)for(var l=0,m=k.length;lb&&-2!=b&&this.controller.S("Unable to restore disk '"+this.Va+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=mi(this,a++);)oi(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function oi(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var gi=0;function Ii(a,b,c,d,e,f){q.call(this,a,b,c);this.L=Ki(this,b.autoMount);this.G=0;this.O=d;this.P=e;this.R=f;this.N=d.rd;this.g=Array(this.N);this.M=!mb("Mobi")&&window&&"FileReader"in window;this.v=[];this.Lb=null;this.exports={selectDrive:this.yg}}p(Ii,q); +function Ki(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Ii.prototype; +h.ua=function(a,b,c){var d=this;switch(b){case "listDisks":return this.H[b]=c,c.onchange=function(){var a=d.H.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v(d.type+" option error: "+k.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.H[b]=c,c.onchange=function(){var a=La(c.value,10);null!=a&& +Li(d,a)},!0;case "loadDisk":return this.H[b]=c,c.onclick=function(){var a=d.H.listDisks;a&&a.options&&Mi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.H[b]=c,c.onclick=function(){var a,b=d.H.listDrives,b=b&&La(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.S("Unable to boot the selected drive"):a.qa?(xe(d.f,0,!0),(a=d.hc(a,0,0,0,512,0,2))&&d.S("Unable to read the boot sector ("+a+")")):d.S("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c); +break}this.H[b]=c;c.onclick=function(){var a=d.H.listDrives;if(a&&a.options&&d.g)if(a=d.g[La(a.value,10)||0])if(a=a.qa){var b;b="";for(var c=0,k;k=mi(a,c++);)for(var l=0,m=k.length;lg||9e||e>=a.i.length)a.S("Unable to load the selected drive");else if(c)if(c==Pi)a.S('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Qi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Ta(c);a.status("Attempting to load "+c+' as "'+b+'"')}Vi(a,e,b,c,!1,d)}else Si(a,e)} -function Vi(a,b,c,d,e,f){var g=-1,k=a.i[b];k.Na.toLowerCase()!=d.toLowerCase()&&(g++,Si(a,b,!0),k.cd?a.S(a.type+" busy"):(k.cd=!0,e&&(k.bd=!0,a.G++,A(a)&&D(a,"auto-loading disk: "+c)),k.yc=!!f,ji(new fi(a,k,"preload"),c,d,f,a.cf)&&g++));return g} -h.cf=function(a,b,c,d,e){a.cd=!1;b&&(b.ba>a.ba||b.ma>a.ma)&&(this.S('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.Ac)),b=null);if(b){a.ya=b;a.bb=c;a.Na=d;a:{var f;for(f=0;fg||9e||e>=a.g.length)a.S("Unable to load the selected drive");else if(c)if(c==Pi)a.S('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Qi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Ta(c);a.status("Attempting to load "+c+' as "'+b+'"')}Wi(a,e,b,c,!1,d)}else Si(a,e)} +function Wi(a,b,c,d,e,f){var g=-1,k=a.g[b];k.Ma.toLowerCase()!=d.toLowerCase()&&(g++,Si(a,b,!0),k.cd?a.S(a.type+" busy"):(k.cd=!0,e&&(k.bd=!0,a.G++,A(a)&&D(a,"auto-loading disk: "+c)),k.Hb=!!f,ji(new fi(a,k,"preload"),c,d,f,a.Vd)&&g++));return g} +h.Vd=function(a,b,c,d,e){a.cd=!1;b&&(b.ba>a.ba||b.ma>a.ma)&&(this.S('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.zc)),b=null);b?(a.qa=b,a.Va=c,a.Ma=d,Xi(this,c,d,b),this.S('Loaded disk "'+c+'" in drive '+(this.type.substr(0,2)+a.zc),a.bd||e),this.K&&oe(this.K)):a.Hb=!1;a.bd&&(a.bd=!1,--this.G||y(this));Li(this,a.zc)}; function Ni(a,b,c,d){if((a=a.H.listDisks)&&a.options){for(var e=0;e=a.ba){m=U.rc;break}n=a.seek(b,c,d+1);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=U.sc;break}if(!k&&(xc(this.C,Me(this.f,f),u|t<<8),kd(this.C))){m=U.Vb;break}r>=a.xa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Fc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ya;var n=null,r;a||(m=U.Ad,e=0);for(;e;){var u=zc(this.C,Me(this.f,f));if(kd(this.C)){m=U.Vb;break}if(!n){if(b>=a.ba){m=U.rc;break}n=a.seek(b,c,d+1,!0);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}if(k){var t,C;if(0>(t=a.read(n,r++))||0>(C=a.read(n,r++))){m=U.sc;break}if(u!=(t|C<<8)){m=U.Od;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=U.sc;break}r>=a.xa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Ce=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&~T.Db|f>>16-T.ka.Db&T.Db;this.B=65536-e&65535;this.j=this.j&~Yi.Xc|d&Yi.Xc;this.g|=a;Zi(this);return!0};function Zi(a){a.b&=~T.Ub;a.g&&(a.g|=U.pe,a.b|=T.Ub,a.g&U.Oc&&(a.b|=T.Oc),A(a)&&D(a,a.type+": ERROR: "+E(a.g)))}h.Vf=function(){return this.I};h.dh=function(){};h.Wf=function(){return this.g};h.eh=function(){};h.Sf=function(){return this.b&T.Wc}; -h.$g=function(a){this.b=this.b&~T.qb|a&T.qb;if(this.b&T.vd){a=!0;var b,c,d="",e=(this.j&Yi.nb)>>Yi.ka.nb,f=this.i[e],g,k,l,m,n,r;this.b&=~(T.Wa|T.Yc);this.g&=~U.Ne;switch(c=this.b&T.Pa){case $i.je:A(this)&&D(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=T.Wa;break;case $i.ye:d="RCHK";case $i.Ae:d||(d="READ"),b=this.hc;case $i.Zc:d||(d="WCHK");case $i.Ve:d||(d="WRITE");b||(b=this.Fc);g=(this.j&Yi.Tb)>>Yi.ka.Tb;k=(this.j&Yi.Pc)>>Yi.ka.Pc;l=this.j&Yi.Xc;m=65536-this.B&65535;n=(this.b&T.Db)<< -16-T.ka.Db|this.w;r=this.b&T.we?0:2;A(this)&&D(this,this.type+": "+d+"("+g+":"+k+":"+l+") "+E(n)+"--"+E(n+(m<<1)),!0,!0);if(g>=f.ba){this.g|=U.rc;break}if(l>=f.ga){this.g|=U.sc;break}a=b.call(this,f,g,k,l,m,n,r,c>=$i.Zc,this.Ce.bind(this));break;case $i.xc:g=(this.j&Yi.Tb)>>Yi.ka.Tb;A(this)&&D(this,this.type+": SEEK("+g+")",!0);g(n=a.read(k,m++))||0>(r=a.read(k,m++))){g=cj.Xa;break}xc(this.C,Me(this.f,f),n|r<<8);if(kd(this.C)){g=cj.Vb;break}f+=2;e--;if(m>=a.xa&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ba)))){g=cj.Xa;break}}return l?l(g,b,c,d,e,f):g}; -h.Fc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.ya;k=null;var m;a||(g=cj.Xa,e=0);for(;e;){var n=zc(this.C,Me(this.f,f));if(kd(this.C)){g=cj.Vb;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=cj.Xa;break}m=0}if(!a.write(k,m++,n&255)||!a.write(k,m++,n>>8)){g=cj.Xa;break}if(m>=a.xa&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ba)))){g=cj.Xa;break}}return l?l(g,b,c,d,e,f):g}; -h.He=function(a,b,c,d,e,f){this.D=f&65535;this.b=this.b&~V.Va|f>>16-V.ka.Va&V.Va;this.w=f>>16&dj.Vc;this.j=this.g=b<>V.ka.Va;if(!(this.b&V.Wa)){a=!0;var b,c="",d=this.i[(this.b&V.nb)>>V.ka.nb],e=d.ya,f,g,k;this.b&=~V.Cb;switch(this.b&V.Pa){case fj.Re:this.B&gj.wd&&(this.b&=V.Cb|V.Pa|V.Va);this.B=d.status|this.j&ej.wc|(e&&512==e.ba?gj.te:0);break;case fj.xc:(this.g&ej.se)==ej.Oe&&(b=this.g&ej.Wb,c=(this.g&ej.Qe)<<2,this.j=this.g&ej.Pe?this.j+b:this.j-b,this.g=this.j=this.j&ej.Wb|c);break;case fj.Be:this.B=this.j;break;case fj.ze:c="READ",b=this.hc; -case fj.Ue:c||(c="WRITE"),b||(b=this.Fc),f=this.g>>ej.ka.Wb,g=this.g&ej.wc?1:0,k=this.g&ej.Hd,!e||f>=e.ba||k>=e.ga?this.b=this.b|cj.Xa|V.Ub:(a=65536-this.B&65535,e=(this.w&dj.Vc)<<16|this.D,A(this)&&D(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+E(e)+"--"+E(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,2,!1,this.He.bind(this)))}a&&(this.b=this.b|V.Cb|V.Wa,this.b&V.Rc&&md(this.f,this.Lb))}};h.Yf=function(){return this.D};h.gh=function(a){this.D=a&hj.qb};h.ag=function(){return this.g}; -h.jh=function(a){this.g=a};h.bg=function(){return this.B};h.kh=function(a){this.B=a};h.Zf=function(){return this.w};h.hh=function(a){this.w=a&dj.Vc;this.b=this.b&~V.Va|(this.w&3)<a.v&&a.j.length&&(a.v=0);if(0>a.v||b!=a.j[a.v])a.j.splice(0,0,b),a.v=0;a.v--}else a.O?b="end":b=a.j[a.v+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(Za(b.substring(c,f))),c=f+1}}return a} -function lj(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +function Li(a,b,c){var d=!1;if(0<=b&&b=a.ba){m=U.rc;break}n=a.seek(b,c,d+1);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=U.sc;break}if(!k&&(xc(this.C,Me(this.f,f),u|t<<8),kd(this.C))){m=U.Vb;break}r>=a.ya&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Fc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.qa;var n=null,r;a||(m=U.Ad,e=0);for(;e;){var u=zc(this.C,Me(this.f,f));if(kd(this.C)){m=U.Vb;break}if(!n){if(b>=a.ba){m=U.rc;break}n=a.seek(b,c,d+1,!0);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}if(k){var t,C;if(0>(t=a.read(n,r++))||0>(C=a.read(n,r++))){m=U.sc;break}if(u!=(t|C<<8)){m=U.Od;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=U.sc;break}r>=a.ya&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.De=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&~T.Cb|f>>16-T.ka.Cb&T.Cb;this.B=65536-e&65535;this.j=this.j&~aj.Xc|d&aj.Xc;this.i|=a;bj(this);return!0};function bj(a){a.b&=~T.Ub;a.i&&(a.i|=U.qe,a.b|=T.Ub,a.i&U.Oc&&(a.b|=T.Oc),A(a)&&D(a,a.type+": ERROR: "+E(a.i)))}h.Vf=function(){return this.I};h.dh=function(){};h.Wf=function(){return this.i};h.eh=function(){};h.Sf=function(){return this.b&T.Wc}; +h.$g=function(a){this.b=this.b&~T.qb|a&T.qb;if(this.b&T.vd){a=!0;var b,c,d="",e=(this.j&aj.nb)>>aj.ka.nb,f=this.g[e],g,k,l,m,n,r;this.b&=~(T.Xa|T.Yc);this.i&=~U.Oe;switch(c=this.b&T.Pa){case cj.ke:A(this)&&D(this,this.type+": CRESET("+e+")",!0);this.i=this.j=0;this.b=T.Xa;break;case cj.ze:d="RCHK";case cj.Be:d||(d="READ"),b=this.hc;case cj.Zc:d||(d="WCHK");case cj.We:d||(d="WRITE");b||(b=this.Fc);g=(this.j&aj.Tb)>>aj.ka.Tb;k=(this.j&aj.Pc)>>aj.ka.Pc;l=this.j&aj.Xc;m=65536-this.B&65535;n=(this.b&T.Cb)<< +16-T.ka.Cb|this.w;r=this.b&T.xe?0:2;A(this)&&D(this,this.type+": "+d+"("+g+":"+k+":"+l+") "+E(n)+"--"+E(n+(m<<1)),!0,!0);if(g>=f.ba){this.i|=U.rc;break}if(l>=f.ga){this.i|=U.sc;break}a=b.call(this,f,g,k,l,m,n,r,c>=cj.Zc,this.De.bind(this));break;case cj.xc:g=(this.j&aj.Tb)>>aj.ka.Tb;A(this)&&D(this,this.type+": SEEK("+g+")",!0);g(n=a.read(k,m++))||0>(r=a.read(k,m++))){g=fj.Ya;break}xc(this.C,Me(this.f,f),n|r<<8);if(kd(this.C)){g=fj.Vb;break}f+=2;e--;if(m>=a.ya&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ba)))){g=fj.Ya;break}}return l?l(g,b,c,d,e,f):g}; +h.Fc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.qa;k=null;var m;a||(g=fj.Ya,e=0);for(;e;){var n=zc(this.C,Me(this.f,f));if(kd(this.C)){g=fj.Vb;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=fj.Ya;break}m=0}if(!a.write(k,m++,n&255)||!a.write(k,m++,n>>8)){g=fj.Ya;break}if(m>=a.ya&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ba)))){g=fj.Ya;break}}return l?l(g,b,c,d,e,f):g}; +h.Ie=function(a,b,c,d,e,f){this.D=f&65535;this.b=this.b&~V.Wa|f>>16-V.ka.Wa&V.Wa;this.w=f>>16&gj.Vc;this.j=this.i=b<>V.ka.Wa;if(!(this.b&V.Xa)){a=!0;var b,c="",d=this.g[(this.b&V.nb)>>V.ka.nb],e=d.qa,f,g,k;this.b&=~V.Bb;switch(this.b&V.Pa){case ij.Se:this.B&jj.wd&&(this.b&=V.Bb|V.Pa|V.Wa);this.B=d.status|this.j&hj.wc|(e&&512==e.ba?jj.ue:0);break;case ij.xc:(this.i&hj.te)==hj.Pe&&(b=this.i&hj.Wb,c=(this.i&hj.Re)<<2,this.j=this.i&hj.Qe?this.j+b:this.j-b,this.i=this.j=this.j&hj.Wb|c);break;case ij.Ce:this.B=this.j;break;case ij.Ae:c="READ",b=this.hc; +case ij.Ve:c||(c="WRITE"),b||(b=this.Fc),f=this.i>>hj.ka.Wb,g=this.i&hj.wc?1:0,k=this.i&hj.Hd,!e||f>=e.ba||k>=e.ga?this.b=this.b|fj.Ya|V.Ub:(a=65536-this.B&65535,e=(this.w&gj.Vc)<<16|this.D,A(this)&&D(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+E(e)+"--"+E(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,2,!1,this.Ie.bind(this)))}a&&(this.b=this.b|V.Bb|V.Xa,this.b&V.Rc&&md(this.f,this.Lb))}};h.Yf=function(){return this.D};h.gh=function(a){this.D=a&kj.qb};h.ag=function(){return this.i}; +h.jh=function(a){this.i=a};h.bg=function(){return this.B};h.kh=function(a){this.B=a};h.Zf=function(){return this.w};h.hh=function(a){this.w=a&gj.Vc;this.b=this.b&~V.Wa|(this.w&3)<a.v&&a.j.length&&(a.v=0);if(0>a.v||b!=a.j[a.v])a.j.splice(0,0,b),a.v=0;a.v--}else a.O?b="end":b=a.j[a.v+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(Za(b.substring(c,f))),c=f+1}}return a} +function oj(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function mj(a,b,c){var d;if(b){b=nj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=F(c,0,!0)+" "+c+". "+E(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.u((null!=b?b+": ":"")+d);return e} -function rj(a,b){if(b)return qj(a,b,a.U[b]);var c=0;for(b in a.U)qj(a,b,a.U[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function sj(a){jj.call(this,a);this.Ea=!1;this.ha=!0;this.G=W();this.ua=W();this.N=W();this.B=[];this.g=this.L=this.D=[];tj(this);this.P=this.Y=0;this.i=[];this.oa=void 0;uj(this);this.F=this;this.ia={};this.fa=this.Sd=0;this.R=null;this.M=[];vj(this,a.messages);this.ra=a.commands;this.Ha=wj;this.W=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.X=this.ja=0;this.b=this.V=null;var b=this;window?void 0===window[w]&&(window[w]=function(a){return je(b,a)}):void 0===global[w]&&(global[w]= -function(a){return je(b,a)})}p(sj,jj);function xj(a){a=a&&a.J;null==a&&(a=-1);return a}function W(a,b,c){return{J:void 0===a?null:a,Ka:void 0===b?!1:b,Ra:!1,Aa:c}}h=sj.prototype;h.kd=function(a,b){a.J=b;a.Ra=!1;a.Aa=void 0;return a};function yj(a){return[a.J,a.Ka,a.Aa,a.Ra,a.Cc]}function zj(a,b){var c=W(b[0],b[1],b[2]);c.Ra=b[3];b[4]&&(c.Pd=kj(a,c.Cc=b[4]));return c} -h.za=function(a,b,c,d){this.C=b;this.K=a;this.f=c;this.b=a.i;(a=ee(a,"messages"))&&vj(this,a);1140>this.f.ia&&(this.W=this.W.concat(Aj));1145>this.f.ia&&(this.W=this.W.concat(Bj));qd(this,16,function(a){a:{var b=d.C.b,c=a[0],e=a=0,l=b.length;if(c){a=xj(Cj(d,c));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.C.g;l=1}d.u("blockid physical blockaddr used size type");d.u("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.u("..."): +function pj(a,b,c){var d;if(b){b=qj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=F(c,0,!0)+" "+c+". "+E(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.u((null!=b?b+": ":"")+d);return e} +function uj(a,b){if(b)return tj(a,b,a.U[b]);var c=0;for(b in a.U)tj(a,b,a.U[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; +function vj(a){mj.call(this,a);this.Ea=!1;this.ha=!0;this.G=W();this.va=W();this.N=W();this.B=[];this.g=this.L=this.D=[];wj(this);this.P=this.Y=0;this.i=[];this.oa=void 0;xj(this);this.F=this;this.ia={};this.fa=this.Sd=0;this.R=null;this.M=[];yj(this,a.messages);this.sa=a.commands;this.Ha=zj;this.W=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.X=this.ja=0;this.b=this.V=null;var b=this;window?void 0===window[w]&&(window[w]=function(a){return je(b,a)}):void 0===global[w]&&(global[w]= +function(a){return je(b,a)})}p(vj,mj);function Aj(a){a=a&&a.J;null==a&&(a=-1);return a}function W(a,b,c){return{J:void 0===a?null:a,Ka:void 0===b?!1:b,Ra:!1,Aa:c}}h=vj.prototype;h.kd=function(a,b){a.J=b;a.Ra=!1;a.Aa=void 0;return a};function Bj(a){return[a.J,a.Ka,a.Aa,a.Ra,a.Cc]}function Cj(a,b){var c=W(b[0],b[1],b[2]);c.Ra=b[3];b[4]&&(c.Pd=nj(a,c.Cc=b[4]));return c} +h.za=function(a,b,c,d){this.C=b;this.K=a;this.f=c;this.b=a.i;(a=ee(a,"messages"))&&yj(this,a);1140>this.f.ia&&(this.W=this.W.concat(Dj));1145>this.f.ia&&(this.W=this.W.concat(Ej));qd(this,16,function(a){a:{var b=d.C.b,c=a[0],e=a=0,l=b.length;if(c){a=Aj(Fj(d,c));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.C.g;l=1}d.u("blockid physical blockaddr used size type");d.u("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.u("..."): (c=n.type,m=cd[c],n&&d.u(F(n.id,8)+" %"+F(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -h.Yd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Ij:b=Ad(this.f);break;case Jj:b=c.Za;break;case Kj:b=c.P;break;case Lj:b=c.ua&65280;break;case Mj:b=td(c);break;case Nj:b=wd(c);break;case Oj:b=xd(c);break;case Pj:b=c.V;break;case Qj:d&&(b=d.da);break;case Rj:d&&(b=d.Ta);break;case Sj:d&&Nc(d)&&(b=d.Ua)}}return b}; -h.message=function(a,b){b&&(a+=" @"+Fj(this,W(this.f.O&65535)));if(!this.R||a!=this.R)if(this.R=a,this.fa&1073741824)this.M.push(a);else{var c;if(this.fa&-2147483648&&this.f&&(c=this.f.A.T)||Ja(this,!0))this.Z(),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,pe(a),a.vb=0,a.K&&I(a.K,void 0))}}; -function uj(a){var b;if(!vf(a))a.i&&a.i.length&&a.u("instruction history buffer freed"),a.P=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Tj);for(b=0;b>8;a.u("trapped to "+K(a,c&255,1)+" ("+(0>d?Mb[-d]:K(a,d))+")")}a.G=W(a.f.g[7]);b&&1!=a.I?Xj(a):Yj(a)}}function Vj(a,b){var c;(c=!a.f||!Ia(a.f))||(c=a.f,c.A.ca?c=!0:(c.u(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.T?(b||a.u("cpu busy or unavailable, command ignored"),!1):!Ha(a.f)}h.Ca=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; -h.Ba=function(a,b){b&&this.u(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){uj(this);this.X=0;this.R=null;this.w=0;this.G=W(this.f.g[7]);this.A.T=!1;Zj(this);a||he(this)};h.save=function(){var a=new G(this);a.set(0,yj(this.G));a.set(1,yj(this.N));a.set(2,[this.j,this.O,this.fa]);a.set(3,this.B);return a.data()}; -h.restore=function(a){var b=0;void 0!==a[2]&&(this.G=zj(this,a[b++]),this.N=zj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.O=a[b][1],this.fa|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.u("running");this.A.T=!0;this.Fa=a;this.Ga=b}; -h.stop=function(a,b){if(this.A.T){this.A.T=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Ac(a.f,b)),65535!=(d&65535)&&(a.kd(a.i[a.P],b),++a.P==a.i.length&&(a.P=0)));return!1}function Bg(a){var b=a.f;if(b.A.T)throw ye(b,a.f.O&65535),a.Z(),-1;return!1}function Zd(a,b,c){ak(a,b,c||1,a.L)&&a.Z(!1)}function $d(a,b,c){ak(a,b,c||1,a.D)&&a.Z(!1)} -function tj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Pe(a.f,!1);a.L=["br"];if(a.D)for(b=1;b>>c.g],!0)):Pe(a.f,!0);a.D=["bw"];a.ja=0;a.Y=0} -h.wb=function(a,b,c){var d=!0;c||bk(this,a,b,!1,!0);if(a!=this.g){var e=xj(b);if(-1===e)this.u("invalid address: "+Fj(this,b)),d=!1;else{var f=a==this.D;65535>>g.g].wb(e&g.i,f)}else e=this.f,(f?e.gc++:e.fc++)||we(e)}}d&&(a.push(b),c?b.Ra=!0:(ck(this,a,a.length-1,"set"),uj(this)));return d}; -function bk(a,b,c,d,e){var f=!1;c=xj(c);for(var g=1;g>>d.g],b)):Pe(a.f,b));k.Ra||uj(a);break}}return f}function dk(a,b){for(var c=1;c>23)&65535,z=K(t,u);else if(B==jk)u=u.J-((f&63)<<1)&65535,z=K(t,u);else if(B==kk)z=K(t,f&7,1);else if(B==lk)z=K(t,f&63,1);else if(B==mk)z=K(t,f&255,1);else if(B=f&C,C&nk&&(B>>=6,C>>=6),C&Y){var C=null,H=B& -ok;switch(B&pk){case 0:z=Hj(H);break;case 8:z="@"+Hj(H);C=qk(t,t.f.g[H]);break;case 16:7>H?z="("+Hj(H)+")+":(B=t.Oa(u,2),z="#"+K(t,B,0,!0));break;case 24:7>H?z="@("+Hj(H)+")+":(B=t.Oa(u,2),z="@#"+K(t,B,0,!0),C=qk(t,B));break;case 32:z="-("+Hj(H)+")";break;case 40:z="@-("+Hj(H)+")";break;case 48:B=t.Oa(u,2);z=K(t,B,0,!0)+"("+Hj(H)+")";7==H&&(z=K(t,B=B+u.J&65535),C=qk(t,B));break;case 56:B=t.Oa(u,2),z="@"+K(t,B)+"("+Hj(H)+")",7==H&&(z="@"+K(t,B=B+u.J&65535),C=qk(t,Ac(t.f,B)))}C&&(z=[z,C])}t=z;if(!t|| -!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.ob&&b=c.B&&(b=c.Ma[b&jd])&&(a=b[4]);return a}function rk(a,b){switch(b){case "N":a=De(a.f);break;case "Z":a=Ce(a.f);break;case "V":a=Be(a.f);break;case "C":a=Ae(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} -function Z(a,b){var c="",d=a.f;if(8>b)c=Hj(b),c+="="+K(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+K(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+K(a,d.W[b-16]);else switch(b){case Ij:c="PS="+K(a,Ad(d));break;case Jj:c="PI="+K(a,d.Za);break;case Kj:c="ER="+K(a,d.P);break;case Lj:c="SL="+K(a,d.ua&65280);break;case Mj:c="M0="+K(a,td(d));break;case Nj:c="M1="+K(a,wd(d));break;case Oj:c="M2="+K(a,xd(d));break;case Pj:c="M3="+K(a,d.V);break;case Qj:a.b&&(c="AR="+K(a,a.b.da,3));break;case Rj:a.b&&(c="DR="+ -K(a,a.b.Ta));break;case Sj:a.b&&Nc(a.b)&&(c="SR="+K(a,a.b.Ua,3))}c&&(c+=" ");return c}function sk(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Ij)+Z(a,Jj)+Z(a,Lj);d+=rk(a,"T")+rk(a,"N")+rk(a,"Z")+rk(a,"V")+rk(a,"C");b&&(b=d,c=""+(Z(a,Mj)+Z(a,Nj)),c+=Z(a,Oj)+Z(a,Pj)+Z(a,Kj),c=c+"\n"+(Z(a,Sj)+Z(a,Qj)+Z(a,Rj)),d=b+("\n"+c));return d}h.Td=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=ab(n,l,a.Td);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({Dj:b,J:c,ef:d,ea:e,Qd:f})}function tk(a,b,c){var d=[],e=xj(b)>>>0;for(b=0;b>>0,k=f.ef;if(e>=g&&eb)){e.g[b]= -g&65535;break}a.u("unknown register: "+f);return}I(a.K);a.u("updated registers:")}}a.u(sk(a,d));c&&(a.G=W(e.g[7]),Yj(a,Fj(a,a.G)))}}function xk(a,b){b=Za(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.u(m)}k[3]&&(g=k[3],f=null);f=fk(a,b,g,f);a.u(f);a.G=b;e-=b.J-l;c++}}} -function ek(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(Wj+b):(a.O&&(a.u("ended assemble at "+Fj(a,a.N)),a.G=a.N,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.R=null;if(Ia(a)&&0n||"z"Na.length&&(a.u("note: only "+Na.length+" available"),wa=Na.length);Ca-=wa;0>Ca&&(null==Na[Na.length-1].J?(wa=Ca+wa,Ca=0):Ca+=Na.length);var $e=[];"call"==ri&&(Cc=1E5,$e=["CALL"]);for(void 0!==qi&&a.u(wa+" instructions earlier:");0=Na.length&&(Ca=0);a.oa=wa;ti++;Cc--}}ti||(a.u("no "+si+"history available"),a.oa=void 0)}else{var ia=Cj(a,Ma);if(ia)if("da"==cb){var af=ia.Ka||65535L.length?(2rb&&(rb=0);65536ef?String.fromCharCode(ef):"."),Od=Od>>8}tb&&(tb+="\n");tb=bf?tb+(ub+","):tb+(Ma+": "+ub+(Nd?"":" "+df))}tb&&a.u(tb);a.ua=ia;a.Aa=al}}}}break;case "e":if("else"== -g[0])break;var Wb,ff,gf,hf,jf=g[0],kf=g[1];"eb"==jf?(Wb=1,ff=255,gf=a.sd,hf=a.td):"e"==jf||"ew"==jf?(Wb=2,ff=65535,gf=a.Oa,hf=a.re):kf=null;if(null==kf)a.u("edit memory commands:"),a.u("\teb [a] [...] edit bytes at address a"),a.u("\tew [a] [...] edit words at address a");else{var Pd=Cj(a,kf);if(Pd)for(var Qd=2;Qdnf;){for(var vb=null,el=256;65536>Ic.J>>>0;){of.J=a.Oa(Ic,2);if(null==Ic.J||!el--)break;if(!(of.J&1)){for(var fl=a,Rd=of,yi=null,Jc=Rd.J,zi=Jc,pf=1;6>=pf&&Jc;pf++){if(2> ";yb(function(){for(var a=x(document,w,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.u("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bFk){if(Gk(d,this.G)){this.v=new G(this,"1.32.2",Pk);Gk(this.v)&&(Qk(this,d),a=Rk,Sk(this.v));this.v.set(Mk,bb());Tk(this.v);var e=this.b&&!this.B;if(a==Nk||za("Click OK to restore the previous "+Hb+" machine state, or CANCEL to reset the machine.")){if(c=Lk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Gk(d,g):("error"==f&&"no machine state"!= -g?(this.S("Error: "+g),"unable to verify user"==g&&(lb(Uk,""),this.g=null)):this.u(f+": "+g),Sk(d),Gk(d)?(c=Lk(d),e=!0):c=!1))}e&&Jk(this,c?d:null)}else a==Rk&&d.clear()}else Jk(this);delete this.G;delete this.w}e=Aa(this.id);for(f=0;fa[1];a=a[2];this.P=!0;this.A.ca=!0;var d=this.H.power;d&&(d.textContent="Shutdown");this.f&&(Vk(this,this.f,b,c,a),I(this,-2),this.f.sa());this.N&&(Qk(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0}; -function Qk(a,b){if(za("There may be a problem with your "+Hb+" machine.\n\nTo help us diagnose it, click OK to send this "+Hb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Hb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;fb("http://www.pcjs.org/api/v1/report",d,!0)}} -function zk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new G(a,"1.32.2"),g=new G(a,"1.32.2",Kk),k=bb();g.set(Mk,k);f.set(Mk,k);f.set(Wk,"1.32.2");f.set(Xk,window?window.location.href:null);f.set($k,window?window.navigator.userAgent:"");a.f&&a.f.Ba&&(c&&(b&&(a.f.A.sa=a.f.A.T),a.f.Z()),d=a.f.Ba(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.ca=!1,!1===d&&(e=null)));for(var k=Aa(a.id),l=0;ld&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} +h.Zd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Lj:b=Ad(this.f);break;case Mj:b=c.$a;break;case Nj:b=c.P;break;case Oj:b=c.va&65280;break;case Pj:b=td(c);break;case Qj:b=wd(c);break;case Rj:b=xd(c);break;case Sj:b=c.V;break;case Tj:d&&(b=d.da);break;case Uj:d&&(b=d.Ta);break;case Vj:d&&Nc(d)&&(b=d.Ua)}}return b}; +h.message=function(a,b){b&&(a+=" @"+Ij(this,W(this.f.O&65535)));if(!this.R||a!=this.R)if(this.R=a,this.fa&1073741824)this.M.push(a);else{var c;if(this.fa&-2147483648&&this.f&&(c=this.f.A.T)||Ja(this,!0))this.Z(),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,pe(a),a.vb=0,a.K&&I(a.K,void 0))}}; +function xj(a){var b;if(!vf(a))a.i&&a.i.length&&a.u("instruction history buffer freed"),a.P=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Wj);for(b=0;b>8;a.u("trapped to "+K(a,c&255,1)+" ("+(0>d?Mb[-d]:K(a,d))+")")}a.G=W(a.f.g[7]);b&&1!=a.I?ak(a):bk(a)}}function Yj(a,b){var c;(c=!a.f||!Ia(a.f))||(c=a.f,c.A.ca?c=!0:(c.u(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.T?(b||a.u("cpu busy or unavailable, command ignored"),!1):!Ha(a.f)}h.Ca=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; +h.Ba=function(a,b){b&&this.u(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){xj(this);this.X=0;this.R=null;this.w=0;this.G=W(this.f.g[7]);this.A.T=!1;ck(this);a||he(this)};h.save=function(){var a=new G(this);a.set(0,Bj(this.G));a.set(1,Bj(this.N));a.set(2,[this.j,this.O,this.fa]);a.set(3,this.B);return a.data()}; +h.restore=function(a){var b=0;void 0!==a[2]&&(this.G=Cj(this,a[b++]),this.N=Cj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.O=a[b][1],this.fa|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.u("running");this.A.T=!0;this.Fa=a;this.Ga=b}; +h.stop=function(a,b){if(this.A.T){this.A.T=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Ac(a.f,b)),65535!=(d&65535)&&(a.kd(a.i[a.P],b),++a.P==a.i.length&&(a.P=0)));return!1}function Bg(a){var b=a.f;if(b.A.T)throw ye(b,a.f.O&65535),a.Z(),-1;return!1}function Zd(a,b,c){dk(a,b,c||1,a.L)&&a.Z(!1)}function $d(a,b,c){dk(a,b,c||1,a.D)&&a.Z(!1)} +function wj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Pe(a.f,!1);a.L=["br"];if(a.D)for(b=1;b>>c.g],!0)):Pe(a.f,!0);a.D=["bw"];a.ja=0;a.Y=0} +h.wb=function(a,b,c){var d=!0;c||ek(this,a,b,!1,!0);if(a!=this.g){var e=Aj(b);if(-1===e)this.u("invalid address: "+Ij(this,b)),d=!1;else{var f=a==this.D;65535>>g.g].wb(e&g.i,f)}else e=this.f,(f?e.gc++:e.fc++)||we(e)}}d&&(a.push(b),c?b.Ra=!0:(fk(this,a,a.length-1,"set"),xj(this)));return d}; +function ek(a,b,c,d,e){var f=!1;c=Aj(c);for(var g=1;g>>d.g],b)):Pe(a.f,b));k.Ra||xj(a);break}}return f}function gk(a,b){for(var c=1;c>23)&65535,z=K(t,u);else if(B==mk)u=u.J-((f&63)<<1)&65535,z=K(t,u);else if(B==nk)z=K(t,f&7,1);else if(B==ok)z=K(t,f&63,1);else if(B==pk)z=K(t,f&255,1);else if(B=f&C,C&qk&&(B>>=6,C>>=6),C&Y){var C=null,H=B& +rk;switch(B&sk){case 0:z=Kj(H);break;case 8:z="@"+Kj(H);C=tk(t,t.f.g[H]);break;case 16:7>H?z="("+Kj(H)+")+":(B=t.Oa(u,2),z="#"+K(t,B,0,!0));break;case 24:7>H?z="@("+Kj(H)+")+":(B=t.Oa(u,2),z="@#"+K(t,B,0,!0),C=tk(t,B));break;case 32:z="-("+Kj(H)+")";break;case 40:z="@-("+Kj(H)+")";break;case 48:B=t.Oa(u,2);z=K(t,B,0,!0)+"("+Kj(H)+")";7==H&&(z=K(t,B=B+u.J&65535),C=tk(t,B));break;case 56:B=t.Oa(u,2),z="@"+K(t,B)+"("+Kj(H)+")",7==H&&(z="@"+K(t,B=B+u.J&65535),C=tk(t,Ac(t.f,B)))}C&&(z=[z,C])}t=z;if(!t|| +!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.ob&&b=c.B&&(b=c.Na[b&jd])&&(a=b[4]);return a}function uk(a,b){switch(b){case "N":a=De(a.f);break;case "Z":a=Ce(a.f);break;case "V":a=Be(a.f);break;case "C":a=Ae(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} +function Z(a,b){var c="",d=a.f;if(8>b)c=Kj(b),c+="="+K(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+K(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+K(a,d.W[b-16]);else switch(b){case Lj:c="PS="+K(a,Ad(d));break;case Mj:c="PI="+K(a,d.$a);break;case Nj:c="ER="+K(a,d.P);break;case Oj:c="SL="+K(a,d.va&65280);break;case Pj:c="M0="+K(a,td(d));break;case Qj:c="M1="+K(a,wd(d));break;case Rj:c="M2="+K(a,xd(d));break;case Sj:c="M3="+K(a,d.V);break;case Tj:a.b&&(c="AR="+K(a,a.b.da,3));break;case Uj:a.b&&(c="DR="+ +K(a,a.b.Ta));break;case Vj:a.b&&Nc(a.b)&&(c="SR="+K(a,a.b.Ua,3))}c&&(c+=" ");return c}function vk(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Lj)+Z(a,Mj)+Z(a,Oj);d+=uk(a,"T")+uk(a,"N")+uk(a,"Z")+uk(a,"V")+uk(a,"C");b&&(b=d,c=""+(Z(a,Pj)+Z(a,Qj)),c+=Z(a,Rj)+Z(a,Sj)+Z(a,Nj),c=c+"\n"+(Z(a,Vj)+Z(a,Tj)+Z(a,Uj)),d=b+("\n"+c));return d}h.Td=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=ab(n,l,a.Td);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({Dj:b,J:c,ef:d,ea:e,Qd:f})}function wk(a,b,c){var d=[],e=Aj(b)>>>0;for(b=0;b>>0,k=f.ef;if(e>=g&&eb)){e.g[b]= +g&65535;break}a.u("unknown register: "+f);return}I(a.K);a.u("updated registers:")}}a.u(vk(a,d));c&&(a.G=W(e.g[7]),bk(a,Ij(a,a.G)))}}function Ak(a,b){b=Za(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.u(m)}k[3]&&(g=k[3],f=null);f=ik(a,b,g,f);a.u(f);a.G=b;e-=b.J-l;c++}}} +function hk(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(Zj+b):(a.O&&(a.u("ended assemble at "+Ij(a,a.N)),a.G=a.N,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.R=null;if(Ia(a)&&0n||"z"Na.length&&(a.u("note: only "+Na.length+" available"),wa=Na.length);Ca-=wa;0>Ca&&(null==Na[Na.length-1].J?(wa=Ca+wa,Ca=0):Ca+=Na.length);var af=[];"call"==ti&&(Cc=1E5,af=["CALL"]);for(void 0!==si&&a.u(wa+" instructions earlier:");0=Na.length&&(Ca=0);a.oa=wa;vi++;Cc--}}vi||(a.u("no "+ui+"history available"),a.oa=void 0)}else{var ia=Fj(a,Ma);if(ia)if("da"==bb){var bf=ia.Ka||65535M.length?(2qb&&(qb=0);65536ff?String.fromCharCode(ff):"."),Qd=Qd>>8}sb&&(sb+="\n");sb=cf?sb+(tb+","):sb+(Ma+": "+tb+(Pd?"":" "+ef))}sb&&a.u(sb);a.va=ia;a.Aa=dl}}}}break;case "e":if("else"== +g[0])break;var Wb,gf,hf,jf,kf=g[0],lf=g[1];"eb"==kf?(Wb=1,gf=255,hf=a.sd,jf=a.td):"e"==kf||"ew"==kf?(Wb=2,gf=65535,hf=a.Oa,jf=a.se):lf=null;if(null==lf)a.u("edit memory commands:"),a.u("\teb [a] [...] edit bytes at address a"),a.u("\tew [a] [...] edit words at address a");else{var Rd=Fj(a,lf);if(Rd)for(var Sd=2;Sdof;){for(var ub=null,hl=256;65536>Ic.J>>>0;){pf.J=a.Oa(Ic,2);if(null==Ic.J||!hl--)break;if(!(pf.J&1)){for(var il=a,Td=pf,Ai=null,Jc=Td.J,Bi=Jc,qf=1;6>=qf&&Jc;qf++){if(2> ";yb(function(){for(var a=x(document,w,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.u("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bIk){if(Jk(d,this.G)){this.v=new G(this,"1.32.2",Sk);Jk(this.v)&&(Tk(this,d),a=Uk,Vk(this.v));this.v.set(Pk,eb());Wk(this.v);var e=this.b&&!this.B;if(a==Qk||za("Click OK to restore the previous "+Hb+" machine state, or CANCEL to reset the machine.")){if(c=Ok(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Jk(d,g):("error"==f&&"no machine state"!= +g?(this.S("Error: "+g),"unable to verify user"==g&&(lb(Xk,""),this.g=null)):this.u(f+": "+g),Vk(d),Jk(d)?(c=Ok(d),e=!0):c=!1))}e&&Mk(this,c?d:null)}else a==Uk&&d.clear()}else Mk(this);delete this.G;delete this.w}e=Aa(this.id);for(f=0;fa[1];a=a[2];this.P=!0;this.A.ca=!0;var d=this.H.power;d&&(d.textContent="Shutdown");this.f&&(Yk(this,this.f,b,c,a),I(this,-2),this.f.ta());this.N&&(Tk(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0}; +function Tk(a,b){if(za("There may be a problem with your "+Hb+" machine.\n\nTo help us diagnose it, click OK to send this "+Hb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Hb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;fb("http://www.pcjs.org/api/v1/report",d,!0)}} +function Ck(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new G(a,"1.32.2"),g=new G(a,"1.32.2",Nk),k=eb();g.set(Pk,k);f.set(Pk,k);f.set(Zk,"1.32.2");f.set($k,window?window.location.href:null);f.set(cl,window?window.navigator.userAgent:"");a.f&&a.f.Ba&&(c&&(b&&(a.f.A.ta=a.f.A.T),a.f.Z()),d=a.f.Ba(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.ca=!1,!1===d&&(e=null)));for(var k=Aa(a.id),l=0;l=d||30<=(c.Kc+=d))&&(e.textContent=c.A.T?c.rb.toFixed(2)+"Mhz":"Stopped",c.Kc=0)}if(a.i&&(a=a.i,b=b||0,a.v)){c=a.f.A.T;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;eb?a.da=a.f.g[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");fb(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);ql(a,b,c)}})}else c(a,null)} -function rl(a,b,c,d){function e(a){if(void 0===k){var b=g&&x(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Wa(a))}function f(a){e("Error: "+a);l&&(--nl||Cb(!0));l=!1}var g,k,l=!0;nl++;xa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?ol(c,null,null,!1,e,function(d,l){l?(va(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--nl||Cb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--nl||Cb(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ol(b,a,d,!0,e,m):pl(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Cb(!1);return rl(a,b,c,d)};window.findMachineComponent=function(a,b){return Da(b,a+".machine")};window.enableEvents=Cb;window.sendEvent=Eb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11-dbg.map +h.ua=function(a,b,c){var d=this;switch(b){case "power":return this.H[b]=c,c.onclick=function(){d.j||(d.A.ca?Ck(d,!1,!0):Lk(d,d.ec))},!0;case "reset":return this.H[b]=c,c.onclick=function(){if(d.A.ca&&!d.j)if(d.b&&!d.D){var a=za("Click OK to save changes to this "+Hb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Ck(d,a,!0);!a&&d.I?window&&window.location.reload():(a||(d.M=!0),d.ec(Ik),d.M=!1)}else d.reset(),d.f&&d.f.ta()},!0;case "save":if(Va(hb(),"pcjs.org"))c.parentNode.removeChild(c);else return this.H[b]= +c,c.onclick=function(){var a=Hk(d,!0);if(a){var b=!!(d.b&&!d.D||d.I),c=Ck(d,b);b?ml(d,a,c):d.S("Resume disabled, machine state not saved")}},!0}return!1};function Hk(a,b){var c=a.g;c||((c=kb(Xk),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=ol(a,c))||a.S("The user ID is invalid.")):b&&a.S("Browser local storage is not available"));return c} +function ol(a,b){a.g=null;b=fb(hb()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(lb(Xk,b.data),a.g=b.data)}catch(d){v(d.message+" ("+c+")")}return a.g}function Kk(a){var b=null;a.g&&(b=hb()+"/api/v1/user?req=load&user="+a.g+"&state="+pl(a,"1.32.2"));return b} +function ml(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=pl(a,"1.32.2");d.data=c;b=fb(hb()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");fb(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);tl(a,b,c)}})}else c(a,null)} +function ul(a,b,c,d){function e(a){if(void 0===k){var b=g&&x(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Wa(a))}function f(a){e("Error: "+a);l&&(--ql||Cb(!0));l=!1}var g,k,l=!0;ql++;xa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?rl(c,null,null,!1,e,function(d,l){l?(va(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--ql||Cb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--ql||Cb(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?rl(b,a,d,!0,e,m):sl(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Cb(!1);return ul(a,b,c,d)};window.findMachineComponent=function(a,b){return Da(b,a+".machine")};window.enableEvents=Cb;window.sendEvent=Eb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11-dbg.map diff --git a/versions/pdpjs/1.32.2/pdp11.js b/versions/pdpjs/1.32.2/pdp11.js index c5e301ca6..e8755e91e 100644 --- a/versions/pdpjs/1.32.2/pdp11.js +++ b/versions/pdpjs/1.32.2/pdp11.js @@ -36,246 +36,248 @@ var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var ea=0;function da(a){return"jscomp_symbol_"+(a||"")+ea++} function ga(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ha(this)}});ga=function(){}}function ha(a){var b=0;return ia(function(){return b":62,"?":63,"@":64,Nc:65,Ug:66,Xg:67,wh:68,E:69,Ch:70,Eh:71,Qh:72,Sh:73,Th:74,Uh:75,Vh:76,Yh:77,$h:78,bi:79,ei:80,Q:81,gi:82,ii:83,ri:84,ti:85,vi:86,wi:87,Ai:88,Bi:89,ke:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ci:97,Di:98,Gi:99,d:100,e:101,Hi:102,Ii:103,Ji:104,Ki:105,Oi:106,k:107,Pi:108,Qi:109,n:110,Ri:111,p:112,q:113,r:114,Si:115,t:116,Ui:117,Vi:118,Wi:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Cd:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Zc=b.comment;this.ge=b;this.exports={};this.m=this.bindings={};a=this.id.indexOf(".");0>a?this.ab=this.id:(this.Na=this.id.substr(0,a),this.ab=this.id.substr(a+1));this.j={ready:!1,Va:!1,Ac:!1,P:!1,error:!1};this.Vb=null;this.j.error=!1;this.Xc=c||0;this.F=this.c=this.u=this.A=this.hb=null;r.push(this)}function ta(a,b,c){ua[a]&&b&&(ua[a][b]=c)} +var ra={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},sa={Vg:0,Ad:1,$g:2,ah:3,bh:4,dh:5,eh:6,fh:7,Oc:8,gh:9,Bd:10,hh:11,ih:12,Cd:13,jh:14,kh:15,lh:16,mh:17,nh:18,oh:19,ph:20,qh:21,rh:22,sh:23,th:24,uh:25,vh:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42, +"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Nc:65,Ug:66,Xg:67,wh:68,E:69,Ch:70,Eh:71,Qh:72,Sh:73,Th:74,Uh:75,Vh:76,Yh:77,$h:78,bi:79,ei:80,Q:81,gi:82,ii:83,ri:84,ti:85,vi:86,wi:87,Ai:88,Bi:89,le:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ci:97,Di:98,Gi:99,d:100,e:101,Hi:102,Ii:103,Ji:104,Ki:105,Oi:106,k:107,Pi:108,Qi:109,n:110,Ri:111,p:112,q:113,r:114,Si:115,t:116,Ui:117,Vi:118,Wi:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,Dd:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Zc=b.comment;this.he=b;this.exports={};this.m=this.bindings={};a=this.id.indexOf(".");0>a?this.$a=this.id:(this.Na=this.id.substr(0,a),this.$a=this.id.substr(a+1));this.j={ready:!1,Va:!1,Ac:!1,P:!1,error:!1};this.Ub=null;this.j.error=!1;this.Xc=c||0;this.F=this.c=this.u=this.A=this.gb=null;r.push(this)}function ta(a,b,c){ua[a]&&b&&(ua[a][b]=c)} function va(){return Date.now()||+new Date}function u(a){window&&window.alert(a)}function wa(a){var b=!1;window&&(b=window.confirm(a));return b}function xa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=3;return""+c}function Ea(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} function Fa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Ja[a]})}function Ka(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} -var Ja={"&":"&","<":"<",">":">",'"':""","'":"'"},La={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +var Ja={"&":"&","<":"<",">":">",'"':""","'":"'"},Ma={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; function Na(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function Oa(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function Pa(a,b){var c,d={M:null,ga:null,aa:null,Z:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.aa=g.load;d.Z=g.exec;if(e=g.bytes)d.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;c>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=g;d.ga=g.symbols;d.M.length?1==d.M.length&&(u(d.M[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ba=g.load;d.aa=g.exec;if(e=g.bytes)d.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;c>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=g;d.ga=g.symbols;d.M.length?1==d.M.length&&(u(d.M[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.a["S"+a]=[0,0,!1,!1,this.De,a];this.F=this.c=this.u=this.A=null;B(this)}n(lb,q);h=lb.prototype; -h.reset=function(a){this.stop();a&&nb(this,this.g=0)}; +var gb="undefined"!==typeof ArrayBuffer,x="pdp11",hb="PDPjs",ib=!0,jb=!0,C={ad:5,jd:144,Pc:8,Pb:{ae:15,ji:16,zi:32,dd:64,Xa:128,hd:256,mi:512,Ah:1024,Ob:2048,zh:4096,Tc:57344,S:{Tc:13}},Ud:{kd:1,Zg:2,be:3,ie:28,Nb:32,Mb:64,Yc:128,si:256,Ed:512,ub:1024,fi:2048,gd:4096,xi:8192,di:16384,Fd:32768,qc:32736},Sd:{Rc:1,ra:14,Ya:48,tc:64,wa:128,pi:256,Bh:512,Dh:1024,Ld:2048,yc:8192,qc:16384,tb:32768,ie:4608,wc:61438,Ta:3967,S:{ra:1,Ya:4}},Td:{xc:15,rc:16,sb:8160,Ma:57344,S:{rc:4,sb:5,Ma:13}},ra:{zd:0,ke:2, +Pd:4,zc:6,Sb:8,Nd:10,Gd:12,yi:14}},D={ad:5,jd:112,Pc:4,Zd:{Xa:1,ra:14,va:48,tc:64,wa:128,Ma:768,Qc:15360,yh:16384,tb:32768,Yg:16254,li:128,wc:65535,Ta:1022,S:{ra:1,va:4,Ma:8}},Xd:{Ta:65534},$d:{ce:1,de:4,ee:16,ki:65408,ed:63,Rb:64,vb:65408,Hd:3,Jh:8,S:{Rb:6,vb:7}},Qb:{Kd:{Wh:0,oi:1,Wg:2,Xh:3,Sb:4,Md:5,ui:6,ni:7},Sc:8,Jd:16,Gh:32,Ih:64,Id:128,Hh:256,Mh:512,Oh:1024,Lh:2048,Kh:4096,Ph:8192,Fh:16384,Nh:32768},Yd:{vc:63},Qc:{ci:1024,xh:2048,kd:2048,Rh:3072,Ed:4096,ya:5120,ub:8192,Zh:9216},ra:{ai:0,zc:2, +fe:4,Sb:6,Qd:8,je:10,Od:12,hi:14}},kb={48:"DL11R",52:"DL11X",56:"PC11R",60:"PC11X",64:"KW11",112:"RL11",144:"RK11"};C.Ob=[203,2,12,512,C.Pb.Ob|C.Pb.hd|C.Pb.dd];D.Vd=[512,2,40,256,D.Qb.Kd.Md|D.Qb.Sc|D.Qb.Jd];x="pdp11";hb="PDPjs";jb=ib=!0; +function lb(a,b){q.call(this,"Panel",a,512);this.i=this.l=0;this.D=b;this.U=this.g=this.b=this.f=0;this.s=this.v=-1;this.w=this.B=this.o=!1;this.C=mb;this.h={};this.a={START:[1,1,!0,!1,this.Be],STEP:[1,1,!1,!1,this.Ce],ENABLE:[1,1,!1,!1,this.xe],CONT:[1,1,!0,!1,this.ve],DEP:[0,0,!0,!1,this.we],EXAM:[1,1,!0,!1,this.ye],LOAD:[1,1,!0,!1,this.Ae],TEST:[0,0,!0,!1,this.ze]};for(a=0;22>a;a++)this.a["S"+a]=[0,0,!1,!1,this.De,a];this.F=this.c=this.u=this.A=null;B(this)}n(lb,q);h=lb.prototype; +h.reset=function(a){this.stop();a&&nb(this,this.f=0)}; h.ka=function(a,b,c,d){if(this.A&&this.A.ka(a,b,c,d)||this.c&&this.c.ka(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.m[b]=c,this.l++,!0;default:return"led"==a||"rled"==a?(this.m[b]=c,this.h[b]=d?1:0,this.l++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.m[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ob(a, b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){pb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ob(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){pb(a,b)}}(this,b),!0):q.prototype.ka.call(this,a,b,c,d)}};h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;qb(b,this,rb);sb(b,this.reset.bind(this));tb(this);ub(this)};h.ja=function(a,b){if(!b)if(this.D&&vb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0}; -h.ia=function(a){return a?this.save():!0};h.save=function(){var a=new E(this);a.set(0,[this.U,this.g,this.b]);return a.data()};h.restore=function(a){if(a=a[0])wb(this,this.U=a[0]),nb(this,this.g=a[1]),xb(this,a[2]);return!0};function yb(a,b,c){if(a=a.m[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function tb(a,b){for(var c in a.h)yb(a,c,null!=b?b:a.h[c])}function zb(a,b,c){if(a=a.m[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} +h.ia=function(a){return a?this.save():!0};h.save=function(){var a=new E(this);a.set(0,[this.U,this.f,this.b]);return a.data()};h.restore=function(a){if(a=a[0])wb(this,this.U=a[0]),nb(this,this.f=a[1]),xb(this,a[2]);return!0};function yb(a,b,c){if(a=a.m[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function tb(a,b){for(var c in a.h)yb(a,c,null!=b?b:a.h[c])}function zb(a,b,c){if(a=a.m[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} function ub(a){for(var b in a.a)zb(a,b,a.a[b][1])}function Ab(a,b,c,d){if(a.m[b]){var e=a.F&&a.F.h||8;c=c||0;c=8==e?Da(c,d):Ea(c,d);a.m[b].textContent!=c&&(a.m[b].textContent=c)}}function ob(a,b){var c=a.a[b];zb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=Bb&&(a.w=b==Cb,a.B=b==Db)}function pb(a,b){var c=a.a[b];c[2]&&c[3]&&(zb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Be=function(a){a||this.c.j.L||(a=this.c,a.u.reset(),Eb(a),this.a[Fb]&&this.a[Fb][1]&&Gb(this.c))};h.Ce=function(){}; -h.xe=function(a){a||F(this.c)};h.ve=function(a){if(!a&&!this.c.j.L)if(this.a[Fb]&&this.a[Fb][1])Gb(this.c);else{a=this.F;var b;if(b=a)a.j.Va&&(a.j.Ac=!0),b=!a.j.Va;if(b)Ba(a,!0),a.g(0,null),Ba(a,!1);else try{var c=this.c.kc(1);0=a.c.pa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.u.v;a.a[Bb]&&a.a[Bb][1]||(b=-b);wb(a,a.U&~c|a.U+b&c)}function wb(a,b){a.U=b&a.u.v;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Pb(a,"A"+c,b&1<c;c++)Pb(a,"D"+c,b&1<c;c++)a.a["S"+c][1]=b&1<=a.c.pa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.u.v;a.a[Bb]&&a.a[Bb][1]||(b=-b);wb(a,a.U&~c|a.U+b&c)}function wb(a,b){a.U=b&a.u.v;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Pb(a,"A"+c,b&1<c;c++)Pb(a,"D"+c,b&1<c;c++)a.a["S"+c][1]=b&1<>2;this.g=this.f-1;this.s=this.C/this.f|0;this.K=this.s-1;this.Ka=[];this.l=0;this.o=!1;this.D=[];this.le=[Ub,Vb,Wb,Xb];this.a=this.b=[];this.B=this.w=this.i=this.H=this.I=0;a=new G(this);Yb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>2;this.f=this.g-1;this.s=this.C/this.g|0;this.K=this.s-1;this.Ka=[];this.l=0;this.o=!1;this.D=[];this.me=[Ub,Vb,Wb,Xb];this.a=this.b=[];this.B=this.w=this.i=this.H=this.I=0;a=new G(this);Yb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.v;B(this)}n(Sb,q);function ac(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Sb.prototype;h.reset=function(){for(var a=0;a>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ua)return l.Hb+=l.Ua-f,l.Ua=f,!0;if(f>=l.Ua+l.Hb){p=l.size-(f-m);p>g&&(p=g);l.Hb=f-l.Ua+p;f=m+a.f;g-=p;k++;continue}}return cc(dc,f,g)}f=new G(a,f,p,a.f,d,e);Yb(f,l);a.a[k++]=f;f=m+a.f;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+ec[d]+" at "+Da(b)),!0):cc(fc,b,c)}h.wd=function(a){return this.b[(a&this.i)>>>this.h].lb(a&this.g,a)}; -h.Kb=function(a){var b=a&this.g,c=(a&this.i)>>>this.h;return jb||b!=this.g?this.b[c].V(b,a):this.b[c++].lb(b,a)|this.b[c&this.K].lb(0,a+1)<<8};h.xd=function(a,b){this.b[(a&this.i)>>>this.h].ob(a&this.g,b,a)};h.Lb=function(a,b){var c=a&this.g,d=(a&this.i)>>>this.h;jb||c!=this.g?this.b[d].rb(c,b,a):(this.b[d++].ob(c,b&255,a),this.b[d&this.K].ob(0,b>>8&255,a+1))};function gc(a,b){return a.a[(b&a.v)>>>a.h]} -function Ob(a,b){var c;a.o=!1;a.l++;var d=b&a.g,e=gc(a,b);jb||d!=a.g?c=e.l(d,b):c=e.i(d,b)|gc(a,b+1).i(0,b+1)<<8;a.l--;return c}function hc(a,b,c){a.o=!1;a.l++;gc(a,b).m(b&a.g,c&255,b);a.l--}function Mb(a,b,c){a.o=!1;a.l++;var d=b&a.g,e=gc(a,b);jb||d!=a.g?e.F(d,c&65535,b):(e.m(d,c&255,b),gc(a,b+1).m(0,c>>8&255,b+1));a.l--} -function bc(a){for(var b=0,c=[],d=0;d>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ua)return l.Hb+=l.Ua-f,l.Ua=f,!0;if(f>=l.Ua+l.Hb){p=l.size-(f-m);p>g&&(p=g);l.Hb=f-l.Ua+p;f=m+a.g;g-=p;k++;continue}}return cc(dc,f,g)}f=new G(a,f,p,a.g,d,e);Yb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+ec[d]+" at "+Da(b)),!0):cc(fc,b,c)}h.xd=function(a){return this.b[(a&this.i)>>>this.h].lb(a&this.f,a)}; +h.Kb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return jb||b!=this.f?this.b[c].W(b,a):this.b[c++].lb(b,a)|this.b[c&this.K].lb(0,a+1)<<8};h.yd=function(a,b){this.b[(a&this.i)>>>this.h].ob(a&this.f,b,a)};h.Lb=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;jb||c!=this.f?this.b[d].rb(c,b,a):(this.b[d++].ob(c,b&255,a),this.b[d&this.K].ob(0,b>>8&255,a+1))};function gc(a,b){return a.a[(b&a.v)>>>a.h]} +function Ob(a,b){var c;a.o=!1;a.l++;var d=b&a.f,e=gc(a,b);jb||d!=a.f?c=e.l(d,b):c=e.i(d,b)|gc(a,b+1).i(0,b+1)<<8;a.l--;return c}function hc(a,b,c){a.o=!1;a.l++;gc(a,b).m(b&a.f,c&255,b);a.l--}function Mb(a,b,c){a.o=!1;a.l++;var d=b&a.f,e=gc(a,b);jb||d!=a.f?e.F(d,c&65535,b):(e.m(d,c&255,b),gc(a,b+1).m(0,c>>8&255,b+1));a.l--} +function bc(a){for(var b=0,c=[],d=0;da.c.pa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],z=g[5]||1,y=0;ya.c.pa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],z=g[5]||1,y=0;y>8:e[2](f)&255):f&1&&(e=d.Ka[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;H(d,b,16);return 255} function Vb(a,b,c){var d=!1,e=this.controller,f=e.Ka[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ka[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||H(e,c,16)}function Wb(a,b){var c=-1,d=this.controller;a=d.Ka[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;H(d,b,16);return 65535} -function Xb(a,b,c){var d=!1,e=this.controller;a=e.Ka[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||H(e,c,16)}function J(a){q.call(this,"Device",a,256);this.a={Ca:128,Jc:-1}}n(J,q);h=J.prototype;h.ha=function(a,b,c,d){this.u=b;this.A=a;this.c=c;this.F=d;var e=this;this.a.Jc=nc(c,function(){e.a.Ca|=128;e.a.Ca&64&&oc(e.c,e.a.jb);e.A&&Kb(e.A,1);qc(e.c,e.a.Jc,1E3/60)});this.a.jb=rc(c,64,6,524288);qb(b,this,sc);sb(b,this.reset.bind(this));B(this)}; -h.ja=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){this.a.Ca=128;qc(this.c,this.a.Jc,1E3/60,!0)};h.save=function(){var a=new E(this);a.set(0,[this.a.Ca]);return a.data()};h.restore=function(a){a=ja(a[0]);this.a.Ca=a.next().value;return!0};h.Pe=function(){return this.a.Ca};h.bg=function(a){this.a.Ca=a&192;this.a.Ca&64||(a=this.a.jb)&&tc(this.c,a)};h.Re=function(){return uc(this.c)}; +function Xb(a,b,c){var d=!1,e=this.controller;a=e.Ka[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||H(e,c,16)}function J(a){q.call(this,"Device",a,256);this.a={Da:128,Jc:-1}}n(J,q);h=J.prototype;h.ha=function(a,b,c,d){this.u=b;this.A=a;this.c=c;this.F=d;var e=this;this.a.Jc=nc(c,function(){e.a.Da|=128;e.a.Da&64&&oc(e.c,e.a.jb);e.A&&Kb(e.A,1);pc(e.c,e.a.Jc,1E3/60)});this.a.jb=qc(c,64,6,524288);qb(b,this,sc);sb(b,this.reset.bind(this));B(this)}; +h.ja=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){this.a.Da=128;pc(this.c,this.a.Jc,1E3/60,!0)};h.save=function(){var a=new E(this);a.set(0,[this.a.Da]);return a.data()};h.restore=function(a){a=ja(a[0]);this.a.Da=a.next().value;return!0};h.Pe=function(){return this.a.Da};h.bg=function(a){this.a.Da=a&192;this.a.Da&64||(a=this.a.jb)&&tc(this.c,a)};h.Re=function(){return uc(this.c)}; h.dg=function(a){vc(this.c,a&-129|this.c.J&128)};h.Se=function(){return wc(this.c)};h.Te=function(){return xc(this.c)};h.Ue=function(){return this.c.qa};h.eg=function(a){yc(this.c,a)};h.Df=function(a){a=a>>1&63;var b=this.c.Ja[a>>1];return a&1?b>>16:b&65535};h.Mg=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ja[c]=b&1?this.c.Ja[c]&65535|(a&63)<<16:this.c.Ja[c]&-65536|a&65534};h.wf=function(a){return this.c.s[1][a>>1&7]};h.Fg=function(a,b){this.c.s[1][b>>1&7]=a&65295}; h.uf=function(a){return this.c.s[1][(a>>1&7)+8]};h.Dg=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.vf=function(a){return this.c.H[1][a>>1&7]};h.Eg=function(a,b){b=b>>1&7;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.tf=function(a){return this.c.H[1][(a>>1&7)+8]};h.Cg=function(a,b){b=(b>>1&7)+8;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.Oe=function(a){return this.c.s[0][a>>1&7]};h.ag=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.Me=function(a){return this.c.s[0][(a>>1&7)+8]}; h.Zf=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.Ne=function(a){return this.c.H[0][a>>1&7]};h.$f=function(a,b){b=b>>1&7;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.Le=function(a){return this.c.H[0][(a>>1&7)+8]};h.Yf=function(a,b){b=(b>>1&7)+8;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.Cf=function(a){return this.c.s[3][a>>1&7]};h.Lg=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.Af=function(a){return this.c.s[3][(a>>1&7)+8]};h.Jg=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295}; h.Bf=function(a){return this.c.H[3][a>>1&7]};h.Kg=function(a,b){b=b>>1&7;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.zf=function(a){return this.c.H[3][(a>>1&7)+8]};h.Ig=function(a,b){b=(b>>1&7)+8;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.mb=function(a){a&=7;return this.c.i&2048?this.c.sa[a]:this.c.b[a]};h.pb=function(a,b){b&=7;this.c.i&2048?this.c.sa[b]=a:this.c.b[b]=a};h.Ze=function(){return this.c.i&49152?this.c.fa[0]:this.c.b[6]};h.jg=function(a){this.c.i&49152?this.c.fa[0]=a:this.c.b[6]=a}; h.bf=function(){return this.c.b[7]};h.mg=function(a){this.c.b[7]=a};h.nb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.sa[a]};h.qb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.sa[b]=a};h.$e=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.fa[1]};h.kg=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.fa[1]=a};h.af=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.fa[3]};h.lg=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.fa[3]=a}; -h.Ke=function(a){return this.c.Eb[a-65504>>1]};h.Xf=function(a,b){this.c.Eb[b-65504>>1]=a};h.rd=function(a){return 65520==a?(ic(this.u)>>6)-1:0};h.ud=function(){};h.yf=function(){return 1};h.Hg=function(){};h.Je=function(){return this.c.D};h.Wf=function(){this.c.D=0};h.Qe=function(){return this.c.Bb};h.cg=function(a,b){b&1||(a&=255);this.c.Bb=a};h.Ve=function(a,b){return b?0:this.c.Sa};h.fg=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.f|=1}b.Sa=a}; -h.xf=function(a,b){return b?0:this.c.Ia&65280};h.Gg=function(a){this.c.Ia=a|255};h.Ye=function(){return zc(this.c)};h.ig=function(a){Ac(this.c,a)};h.td=function(){}; +h.Ke=function(a){return this.c.Eb[a-65504>>1]};h.Xf=function(a,b){this.c.Eb[b-65504>>1]=a};h.sd=function(a){return 65520==a?(ic(this.u)>>6)-1:0};h.vd=function(){};h.yf=function(){return 1};h.Hg=function(){};h.Je=function(){return this.c.D};h.Wf=function(){this.c.D=0};h.Qe=function(){return this.c.Bb};h.cg=function(a,b){b&1||(a&=255);this.c.Bb=a};h.Ve=function(a,b){return b?0:this.c.Sa};h.fg=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Sa=a}; +h.xf=function(a,b){return b?0:this.c.Ia&65280};h.Gg=function(a){this.c.Ia=a|255};h.Ye=function(){return zc(this.c)};h.ig=function(a){Ac(this.c,a)};h.ud=function(){}; var K={},sc=(K[61568]=[null,null,J.prototype.Df,J.prototype.Mg,"UNIMAP",64,1170],K[62592]=[null,null,J.prototype.wf,J.prototype.Fg,"SIPDR",8,1145,64],K[62608]=[null,null,J.prototype.uf,J.prototype.Dg,"SDPDR",8,1145,64],K[62624]=[null,null,J.prototype.vf,J.prototype.Eg,"SIPAR",8,1145,64],K[62640]=[null,null,J.prototype.tf,J.prototype.Cg,"SDPAR",8,1145,64],K[62656]=[null,null,J.prototype.Oe,J.prototype.ag,"KIPDR",8,1140,64],K[62672]=[null,null,J.prototype.Me,J.prototype.Zf,"KDPDR",8,1145,64],K[62688]= -[null,null,J.prototype.Ne,J.prototype.$f,"KIPAR",8,1140,64],K[62704]=[null,null,J.prototype.Le,J.prototype.Yf,"KDPAR",8,1145,64],K[62798]=[null,null,J.prototype.Ue,J.prototype.eg,"MMR3",1,1145,64],K[65382]=[null,null,J.prototype.Pe,J.prototype.bg,"LKS"],K[65402]=[null,null,J.prototype.Re,J.prototype.dg,"MMR0",1,1140,64],K[65404]=[null,null,J.prototype.Se,J.prototype.td,"MMR1",1,1145,64],K[65406]=[null,null,J.prototype.Te,J.prototype.td,"MMR2",1,1140,64],K[65408]=[null,null,J.prototype.Cf,J.prototype.Lg, +[null,null,J.prototype.Ne,J.prototype.$f,"KIPAR",8,1140,64],K[62704]=[null,null,J.prototype.Le,J.prototype.Yf,"KDPAR",8,1145,64],K[62798]=[null,null,J.prototype.Ue,J.prototype.eg,"MMR3",1,1145,64],K[65382]=[null,null,J.prototype.Pe,J.prototype.bg,"LKS"],K[65402]=[null,null,J.prototype.Re,J.prototype.dg,"MMR0",1,1140,64],K[65404]=[null,null,J.prototype.Se,J.prototype.ud,"MMR1",1,1145,64],K[65406]=[null,null,J.prototype.Te,J.prototype.ud,"MMR2",1,1140,64],K[65408]=[null,null,J.prototype.Cf,J.prototype.Lg, "UIPDR",8,1140,64],K[65424]=[null,null,J.prototype.Af,J.prototype.Jg,"UDPDR",8,1145,64],K[65440]=[null,null,J.prototype.Bf,J.prototype.Kg,"UIPAR",8,1140,64],K[65456]=[null,null,J.prototype.zf,J.prototype.Ig,"UDPAR",8,1145,64],K[65472]=[null,null,J.prototype.mb,J.prototype.pb,"R0SET0"],K[65473]=[null,null,J.prototype.mb,J.prototype.pb,"R1SET0"],K[65474]=[null,null,J.prototype.mb,J.prototype.pb,"R2SET0"],K[65475]=[null,null,J.prototype.mb,J.prototype.pb,"R3SET0"],K[65476]=[null,null,J.prototype.mb, J.prototype.pb,"R4SET0"],K[65477]=[null,null,J.prototype.mb,J.prototype.pb,"R5SET0"],K[65478]=[null,null,J.prototype.Ze,J.prototype.jg,"R6KERNEL"],K[65479]=[null,null,J.prototype.bf,J.prototype.mg,"R7KERNEL"],K[65480]=[null,null,J.prototype.nb,J.prototype.qb,"R0SET1",1,1145],K[65481]=[null,null,J.prototype.nb,J.prototype.qb,"R1SET1",1,1145],K[65482]=[null,null,J.prototype.nb,J.prototype.qb,"R2SET1",1,1145],K[65483]=[null,null,J.prototype.nb,J.prototype.qb,"R3SET1",1,1145],K[65484]=[null,null,J.prototype.nb, -J.prototype.qb,"R4SET1",1,1145],K[65485]=[null,null,J.prototype.nb,J.prototype.qb,"R5SET1",1,1145],K[65486]=[null,null,J.prototype.$e,J.prototype.kg,"R6SUPER",1,1145],K[65487]=[null,null,J.prototype.af,J.prototype.lg,"R6USER",1,1145],K[65504]=[null,null,J.prototype.Ke,J.prototype.Xf,"CTRL",8,1170],K[65520]=[null,null,J.prototype.rd,J.prototype.ud,"LSIZE",1,1170],K[65522]=[null,null,J.prototype.rd,J.prototype.ud,"HSIZE",1,1170],K[65524]=[null,null,J.prototype.yf,J.prototype.Hg,"SYSID",1,1170],K[65526]= +J.prototype.qb,"R4SET1",1,1145],K[65485]=[null,null,J.prototype.nb,J.prototype.qb,"R5SET1",1,1145],K[65486]=[null,null,J.prototype.$e,J.prototype.kg,"R6SUPER",1,1145],K[65487]=[null,null,J.prototype.af,J.prototype.lg,"R6USER",1,1145],K[65504]=[null,null,J.prototype.Ke,J.prototype.Xf,"CTRL",8,1170],K[65520]=[null,null,J.prototype.sd,J.prototype.vd,"LSIZE",1,1170],K[65522]=[null,null,J.prototype.sd,J.prototype.vd,"HSIZE",1,1170],K[65524]=[null,null,J.prototype.yf,J.prototype.Hg,"SYSID",1,1170],K[65526]= [null,null,J.prototype.Je,J.prototype.Wf,"ERR",1,1170],K[65528]=[null,null,J.prototype.Qe,J.prototype.cg,"MBR",1,1170],K[65530]=[null,null,J.prototype.Ve,J.prototype.fg,"PIR"],K[65532]=[null,null,J.prototype.xf,J.prototype.Gg,"SLR"],K[65534]=[null,null,J.prototype.Ye,J.prototype.ig,"PSW"],K); Za(function(){for(var a=A(document,x,"device"),b=0;b>1),this.c=new Int32Array(this.g,0,this.size>>2),Fc(this,Gc?Hc:Ic);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.He=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.If=function(a,b){ib&&a&1&&H(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; -h.Uf=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.Ba=!0};h.Fe=function(a,b){return this.i(a,b)};h.Ff=function(a,b){return this.l(a,b)};h.Sf=function(a,b,c){this.A?this.Jb(0,0,c):this.m(a,b,c)};h.Og=function(a,b,c){this.A?this.Jb(0,0,c):this.F(a,b,c)};h.Ee=function(a){return this.a[a]}; -h.Ge=function(a){return this.a[a]};h.Ef=function(a,b){ib&&a&1&&H(this.b,b,64);return this.u.getUint16(a,!0)};h.Hf=function(a,b){ib&&a&1&&H(this.b,b,64);return!jb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Rf=function(a,b){this.a[a]=b;this.Ba=!0};h.Tf=function(a,b){this.a[a]=b;this.Ba=!0};h.Ng=function(a,b,c){ib&&a&1&&H(this.b,c,64);this.u.setUint16(a,b,!0);this.Ba=!0};h.Pg=function(a,b,c){ib&&a&1&&H(this.b,c,64);!jb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.Ba=!0}; -var Dc=0,jc=1,Ec=2,$b=4,ec=["NONE","RAM","ROM","VID","H/W"],Cc=0,Lc=[],Kc=[G.prototype.He,G.prototype.Uf,G.prototype.If,G.prototype.Qg],Oc=[G.prototype.Fe,G.prototype.Sf,G.prototype.Ff,G.prototype.Og];if(gb)var Ic=[G.prototype.Ee,G.prototype.Rf,G.prototype.Ef,G.prototype.Ng],Hc=[G.prototype.Ge,G.prototype.Tf,G.prototype.Hf,G.prototype.Pg];var Pc;if(gb){var Qc=new ArrayBuffer(2);(new DataView(Qc)).setUint16(0,256,!0);Pc=256===(new Uint16Array(Qc))[0]}else Pc=!1;var Gc=Pc; -function Rc(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Lc=0;this.ec=b;this.Ra=c;this.nc=Math.round(this.ec/1E4)/100;this.bb=this.nc*this.Ra;this.oc=this.Ab=this.fb=this.fc=0;this.j.L=this.j.Ic=!1;this.j.ba=a.autoStart;"string"==typeof this.j.ba&&(this.j.ba="true"==this.j.ba);this.j.Tb=!1;this.cc=this.eb=0;this.dc=+a.csStart;this.yb=+a.csInterval;this.zb=+a.csStop;this.W=[];this.bd=this.Mf.bind(this);this.Ha=this.za=this.Ga=this.a=this.Y=this.ya=this.xb=this.Fa=this.gb= -this.pc=this.Oa=0;this.ma=null;B(this)}n(Rc,q);h=Rc.prototype;h.ha=function(a,b,c,d){this.A=a;this.u=b;this.F=d;this.ma=a.g;for(a=0;a=a.eb&&(a.eb+=a.yb,c=!0);0<=a.zb&&a.zb<=Wc(a)&&(a.yb=a.zb=-1,Vc(a),F(a),c=!0);c&&a.X(Wc(a)+" cycles: checksum="+Ea(a.cc))}} -h.ka=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.m[b]=c,!0;case "run":return this.m[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.P)a=!0;else{var b=null,c,k=xa(a.id);for(c=0;ca.Oa/a.bb&&(b=1);a.Ra=b;b=a.nc*a.Ra;if(a.bb!=b){a.bb=b;b=a.bb.toFixed(2)+"Mhz";var d=a.m.setSpeed;d&&(d.textContent=b);a.X("target speed: "+b)}c&&a.A&&$c(a.A)}Ib(a,a.za);a.za=0;a.ya=va();a.Fa=0;Yc(a)}function nc(a,b){var c=a.W.length;a.W.push([-1,b]);return c}function qc(a,b,c,d){0<=b&&ba.W[b][0])&&(c=a.ec*a.Ra/1E3*c|0,a.j.L&&(c+=ad(a)),a.W[b][0]=c)}function bd(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ad(a,b){var c=a.Ga-=a.a;a.a=a.Y=0;b&&(a.Ga=0);return c} -h.Mf=function(){if(this.j.L){this.fc>=this.ec&&Yc(this,!0);this.gb=0;this.xb=va();if(this.Fa){var a=this.xb-this.Fa;a>this.oc&&(this.ya+=a,this.ya>this.xb&&(this.ya=this.xb))}try{do{for(var b,c=this.j.Tb?1:this.Ab,d=this.W.length-1;0<=d;d--){var e=this.W[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.kc(b)}catch(f){if("number"!=typeof f)throw f;}b=ad(this,!0);this.gb+=b;this.za+=b;Jb(this,b);Hb(this,b);this.fb-=b;if(0>=this.fb){this.fb+=this.Ab;++this.pc>=cd&&(this.A&&Kb(this.A,void 0),this.pc=0);break}}while(this.j.L)}catch(f){F(this); -this.A&&this.A.stop(va(),Wc(this));a=f.stack||f.message;this.j.error=!0;this.G(a);return}if(this.j.L){a=setTimeout;b=this.bd;this.Fa=va();c=this.oc;this.gb&&(c=Math.round(c*this.gb/this.Ab));c-=this.Fa-this.xb;if(d=this.Fa-this.ya)this.Oa=Math.round(this.za/(10*d))/100,864E5<=d&&(this.Ha=0,Xc(this));if(0>c||this.Oac&&(this.ya-=c),c=0;this.fc+=this.gb;this.Fa+=c;a(b,c)}}}; -function Gb(a){var b;a.j.error?(a.X(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.L)a.X(a.toString()+" busy");else{Xc(a);a.j.L=!0;a.j.Ic=!0;if(b=a.m.run)b.textContent="Halt";a.A&&a.A.start(a.ya,Wc(a));a.F||a.status("Started");setTimeout(a.bd,0)}}h.kc=function(){return 0};function F(a){var b=!1;if(a.j.L){ad(a);Ib(a,a.za);a.za=0;a.j.L=!1;if(b=a.m.run)b.textContent="Run";a.A&&a.A.stop(va(),Wc(a));b=!0;a.F||a.status("Stopped")}a.j.complete=void 0;return b}var Zc=30,cd=15,Sc=["power","reset"]; -function dd(a){var b=+a.model||1170;Rc.call(this,a,6666667);this.pa=b;this.Wc=+a.addrReset||0;this.Aa=this.i=this.B=this.v=this.l=this.o=this.w=0;this.b=this.sa=this.fa=[];this.H=this.s=this.Ja=this.Eb=[];this.Ea=this.C=this.Vc=this.cb=this.Pa=this.Qa=this.Xa=this.D=this.Bb=this.Sa=this.Ia=this.J=this.Cb=this.Db=this.qa=this.f=0;this.fe=[4,2,0,1];this.hc=0;this.$c=255;1120>=this.pa?(this.Uc=ed.bind(this),this.$a=this.oe,this.hc=8,this.$c=-1,this.fd=255,this.cd=0):(this.Uc=fd.bind(this),this.$a=this.pe, -this.fd=~(1792|(1140>=this.pa?2048:0))&65535,this.cd=1140>1),this.c=new Int32Array(this.f,0,this.size>>2),Fc(this,Gc?Hc:Ic);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.He=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.If=function(a,b){ib&&a&1&&H(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; +h.Uf=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.Ca=!0};h.Fe=function(a,b){return this.i(a,b)};h.Ff=function(a,b){return this.l(a,b)};h.Sf=function(a,b,c){this.A?this.Jb(0,0,c):this.m(a,b,c)};h.Og=function(a,b,c){this.A?this.Jb(0,0,c):this.F(a,b,c)};h.Ee=function(a){return this.a[a]}; +h.Ge=function(a){return this.a[a]};h.Ef=function(a,b){ib&&a&1&&H(this.b,b,64);return this.u.getUint16(a,!0)};h.Hf=function(a,b){ib&&a&1&&H(this.b,b,64);return!jb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Rf=function(a,b){this.a[a]=b;this.Ca=!0};h.Tf=function(a,b){this.a[a]=b;this.Ca=!0};h.Ng=function(a,b,c){ib&&a&1&&H(this.b,c,64);this.u.setUint16(a,b,!0);this.Ca=!0};h.Pg=function(a,b,c){ib&&a&1&&H(this.b,c,64);!jb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.Ca=!0}; +var Dc=0,jc=1,Ec=2,$b=4,ec=["NONE","RAM","ROM","VID","H/W"],Cc=0,Lc=[],Jc=[G.prototype.He,G.prototype.Uf,G.prototype.If,G.prototype.Qg],Oc=[G.prototype.Fe,G.prototype.Sf,G.prototype.Ff,G.prototype.Og];if(gb)var Ic=[G.prototype.Ee,G.prototype.Rf,G.prototype.Ef,G.prototype.Ng],Hc=[G.prototype.Ge,G.prototype.Tf,G.prototype.Hf,G.prototype.Pg];var Pc;if(gb){var Qc=new ArrayBuffer(2);(new DataView(Qc)).setUint16(0,256,!0);Pc=256===(new Uint16Array(Qc))[0]}else Pc=!1;var Gc=Pc; +function Rc(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Lc=0;this.ec=b;this.Ra=c;this.nc=Math.round(this.ec/1E4)/100;this.ab=this.nc*this.Ra;this.oc=this.Ab=this.eb=this.fc=0;this.j.L=this.j.Ic=!1;this.j.ca=a.autoStart;"string"==typeof this.j.ca&&(this.j.ca="true"==this.j.ca);this.j.Tb=!1;this.cc=this.cb=0;this.dc=+a.csStart;this.yb=+a.csInterval;this.zb=+a.csStop;this.X=[];this.bd=this.Mf.bind(this);this.Ha=this.Aa=this.Ga=this.a=this.Z=this.za=this.xb=this.Fa=this.fb= +this.pc=this.Oa=0;this.na=null;B(this)}n(Rc,q);h=Rc.prototype;h.ha=function(a,b,c,d){this.A=a;this.u=b;this.F=d;this.na=a.f;for(a=0;a=a.cb&&(a.cb+=a.yb,c=!0);0<=a.zb&&a.zb<=Wc(a)&&(a.yb=a.zb=-1,Vc(a),F(a),c=!0);c&&a.Y(Wc(a)+" cycles: checksum="+Ea(a.cc))}} +h.ka=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.m[b]=c,!0;case "run":return this.m[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.P)a=!0;else{var b=null,c,k=xa(a.id);for(c=0;ca.Oa/a.ab&&(b=1);a.Ra=b;b=a.nc*a.Ra;if(a.ab!=b){a.ab=b;b=a.ab.toFixed(2)+"Mhz";var d=a.m.setSpeed;d&&(d.textContent=b);a.Y("target speed: "+b)}c&&a.A&&$c(a.A)}Ib(a,a.Aa);a.Aa=0;a.za=va();a.Fa=0;Yc(a)}function nc(a,b){var c=a.X.length;a.X.push([-1,b]);return c}function pc(a,b,c,d){0<=b&&ba.X[b][0])&&(c=a.ec*a.Ra/1E3*c|0,a.j.L&&(c+=ad(a)),a.X[b][0]=c)}function bd(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ad(a,b){var c=a.Ga-=a.a;a.a=a.Z=0;b&&(a.Ga=0);return c} +h.Mf=function(){if(this.j.L){this.fc>=this.ec&&Yc(this,!0);this.fb=0;this.xb=va();if(this.Fa){var a=this.xb-this.Fa;a>this.oc&&(this.za+=a,this.za>this.xb&&(this.za=this.xb))}try{do{for(var b,c=this.j.Tb?1:this.Ab,d=this.X.length-1;0<=d;d--){var e=this.X[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.kc(b)}catch(f){if("number"!=typeof f)throw f;}b=ad(this,!0);this.fb+=b;this.Aa+=b;Jb(this,b);Hb(this,b);this.eb-=b;if(0>=this.eb){this.eb+=this.Ab;++this.pc>=cd&&(this.A&&Kb(this.A,void 0),this.pc=0);break}}while(this.j.L)}catch(f){F(this); +this.A&&this.A.stop(va(),Wc(this));a=f.stack||f.message;this.j.error=!0;this.G(a);return}if(this.j.L){a=setTimeout;b=this.bd;this.Fa=va();c=this.oc;this.fb&&(c=Math.round(c*this.fb/this.Ab));c-=this.Fa-this.xb;if(d=this.Fa-this.za)this.Oa=Math.round(this.Aa/(10*d))/100,864E5<=d&&(this.Ha=0,Xc(this));if(0>c||this.Oac&&(this.za-=c),c=0;this.fc+=this.fb;this.Fa+=c;a(b,c)}}}; +function Gb(a){var b;a.j.error?(a.Y(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.L)a.Y(a.toString()+" busy");else{Xc(a);a.j.L=!0;a.j.Ic=!0;if(b=a.m.run)b.textContent="Halt";a.A&&a.A.start(a.za,Wc(a));a.F||a.status("Started");setTimeout(a.bd,0)}}h.kc=function(){return 0};function F(a){var b=!1;if(a.j.L){ad(a);Ib(a,a.Aa);a.Aa=0;a.j.L=!1;if(b=a.m.run)b.textContent="Run";a.A&&a.A.stop(va(),Wc(a));b=!0;a.F||a.status("Stopped")}a.j.complete=void 0;return b}var Zc=30,cd=15,Sc=["power","reset"]; +function dd(a){var b=+a.model||1170;Rc.call(this,a,6666667);this.pa=b;this.Wc=+a.addrReset||0;this.Ba=this.i=this.B=this.v=this.l=this.o=this.w=0;this.b=this.sa=this.fa=[];this.H=this.s=this.Ja=this.Eb=[];this.Ea=this.C=this.Vc=this.bb=this.Pa=this.Qa=this.Wa=this.D=this.Bb=this.Sa=this.Ia=this.J=this.Cb=this.Db=this.qa=this.g=0;this.ge=[4,2,0,1];this.hc=0;this.$c=255;1120>=this.pa?(this.Uc=ed.bind(this),this.Za=this.pe,this.hc=8,this.$c=-1,this.fd=255,this.cd=0):(this.Uc=fd.bind(this),this.Za=this.qe, +this.fd=~(1792|(1140>=this.pa?2048:0))&65535,this.cd=1140e.Ib&&(e.Ib=c,c+=4)}return Rc.prototype.ja.call(this,a,b)}; h.reset=function(){this.status("Model "+this.pa);this.j.L&&F(this);this.v=65536;this.l=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.Wc,-1,-2,-3,-4,-5,-6,-7,-8];this.sa=[0,0,0,0,0,0];this.fa=[0,0,0,0];this.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, -65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ja=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Eb=[0,0,0,0,0,0,0,0];this.B=0;this.Aa=-1;this.h=this.g=this.bc=this.K=this.R=this.f=this.Bb=0;Eb(this);Uc(this);this.j.error=!1;Rc.prototype.reset.call(this)};function Eb(a){a.J=0;a.Cb=0;a.Db=0;a.qa=0;a.D=0;a.Sa=0;a.Ia=255;a.cb=0;a.Pa=0;a.Qa=0;a.Xa=262143;a.Ea=a.b[7];a.C=0;a.I=null;a.u&&(gd(a),a.Vc=ic(a.u))} -function gd(a){a.Yb=a.Mc;a.Zb=a.ic;a.jc=a.lc;a.$b=a.mc;a.cb?(a.wa=65536,a.Xb=a.qa&16?4186112:253952,a.oa=a.od,a.V=a.sd,a.rb=a.vd,ac(a.u,a.qa&16?22:18)):(a.wa=0,a.Xb=57344,a.oa=a.te,a.V=a.Gf,a.rb=a.Rg,ac(a.u,16))}function uc(a){var b=a.J;b&57344||(b=b&-3199|a.Pa<<5|a.Qa<<1);return b}function vc(a,b){b&=-3073;if(a.J!=b){b&57344&&!(a.J&57344)&&(a.Cb=a.C>>16&65535,a.Db=a.C&65535);a.J=b;a.Pa=(b&96)>>5;a.Qa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.cb!=c&&(a.cb=c,gd(a))}} -function wc(a){a.J&57344||(a.Cb=a.C>>16&65535);a=a.Cb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xc(a){a.J&57344||(a.Db=a.C&65535);return a.Db}function yc(a,b){1170>a.pa&&(b&=-49);a.qa!=b&&(a.qa=b,a.Xa=b&16?4194303:262143,gd(a))}function hd(a,b,c){a.Wc=b;id(a,b);Ac(a,0);a.u.reset();Eb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.L||Gb(a)}else a.F&&a.j.P?F(a)||(a.F.f(),Kb(a.A,-1)):!1===c&&F(a);!a.j.L&&a.ma&&a.ma.stop()}h.nd=function(){return 0}; -h.save=function(){var a=new E(this);a.set(0,[this.b,this.sa,this.fa,this.H,this.s,this.Ja,this.Eb,this.D,this.Bb,this.Sa,this.Ia,this.Pa,this.Qa,this.Ea,this.f,this.C,this.Aa,this.sc,this.uc]);a.set(1,[zc(this),uc(this),wc(this),xc(this),this.qa]);a.set(2,[this.Ha,this.Ra,this.j.ba]);a.set(3,jd(this));a.set(4,bd(this));return a.data()}; -h.restore=function(a){var b=ja(a[0]);this.b=b.next().value;this.sa=b.next().value;this.fa=b.next().value;this.H=b.next().value;this.s=b.next().value;this.Ja=b.next().value;this.Eb=b.next().value;this.D=b.next().value;this.Bb=b.next().value;this.Sa=b.next().value;this.Ia=b.next().value;this.Pa=b.next().value;this.Qa=b.next().value;this.Ea=b.next().value;this.f=b.next().value;this.C=b.next().value;this.Aa=b.next().value;this.sc=b.next().value;this.uc=b.next().value;b=a[1];Ac(this,b[0]);vc(this,b[1]); -this.Cb=b[2];this.Db=b[3];yc(this,b[4]);b=a[2];this.Ha=b[0];Xc(this,b[1]);this.j.ba=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function id(a,b){a.b[7]=b&65535}function rc(a,b,c,d){b={Ib:b,kb:c,message:d||0,name:kb[b],next:null};a.wb.push(b);return b}function tc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.f|=1)}function oc(a,b){if(b){if(b!=a.I){var c=a.I;if(!c||c.kb<=b.kb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.kb<=b.kb){b.next=d;c.next=b;break}c=d}while(c)}}a.f|=1}} -function jd(a){var b=[];for(a=a.I;a;)b.push(a.Ib),a=a.next;return b}function nd(a){return a.f&64?(I(a,168,64,-6),!0):a.f&32?(I(a,4,32,-5),!0):a.f&16?(I(a,12,16,-7),!0):!1}function zc(a){return a.i=a.i&63728|ld(a)|(a.o&65535?0:4)|(a.l&32768?2:0)|kd(a)}function Ac(a,b){b&=a.fd;a.w=b<<12;a.o=~b&4;a.l=b<<14;a.v=b<<16;if((b^a.i)&a.cd)for(var c=a.sa.length;0<=--c;){var d=a.b[c];a.b[c]=a.sa[c];a.sa[c]=d}a.B=b>>14&3;c=a.i>>14&3;a.B!=c&&(a.fa[c]=a.b[6],a.b[6]=a.fa[a.B]);a.i=b;a.f&=-3;a.f|=a.I?2:1} +65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ja=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Eb=[0,0,0,0,0,0,0,0];this.B=0;this.Ba=-1;this.h=this.f=this.bc=this.K=this.R=this.g=this.Bb=0;Eb(this);Uc(this);this.j.error=!1;Rc.prototype.reset.call(this)};function Eb(a){a.J=0;a.Cb=0;a.Db=0;a.qa=0;a.D=0;a.Sa=0;a.Ia=255;a.bb=0;a.Pa=0;a.Qa=0;a.Wa=262143;a.Ea=a.b[7];a.C=0;a.I=null;a.u&&(gd(a),a.Vc=ic(a.u))} +function gd(a){a.Yb=a.Mc;a.Zb=a.ic;a.jc=a.lc;a.$b=a.mc;a.bb?(a.xa=65536,a.Xb=a.qa&16?4186112:253952,a.oa=a.pd,a.W=a.td,a.rb=a.wd,ac(a.u,a.qa&16?22:18)):(a.xa=0,a.Xb=57344,a.oa=a.te,a.W=a.Gf,a.rb=a.Rg,ac(a.u,16))}function uc(a){var b=a.J;b&57344||(b=b&-3199|a.Pa<<5|a.Qa<<1);return b}function vc(a,b){b&=-3073;if(a.J!=b){b&57344&&!(a.J&57344)&&(a.Cb=a.C>>16&65535,a.Db=a.C&65535);a.J=b;a.Pa=(b&96)>>5;a.Qa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.bb!=c&&(a.bb=c,gd(a))}} +function wc(a){a.J&57344||(a.Cb=a.C>>16&65535);a=a.Cb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xc(a){a.J&57344||(a.Db=a.C&65535);return a.Db}function yc(a,b){1170>a.pa&&(b&=-49);a.qa!=b&&(a.qa=b,a.Wa=b&16?4194303:262143,gd(a))}function hd(a,b,c){a.Wc=b;id(a,b);Ac(a,0);a.u.reset();Eb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.L||Gb(a)}else a.F&&a.j.P?F(a)||(a.F.g(),Kb(a.A,-1)):!1===c&&F(a);!a.j.L&&a.na&&a.na.stop()}h.od=function(){return 0}; +h.save=function(){var a=new E(this);a.set(0,[this.b,this.sa,this.fa,this.H,this.s,this.Ja,this.Eb,this.D,this.Bb,this.Sa,this.Ia,this.Pa,this.Qa,this.Ea,this.g,this.C,this.Ba,this.sc,this.uc]);a.set(1,[zc(this),uc(this),wc(this),xc(this),this.qa]);a.set(2,[this.Ha,this.Ra,this.j.ca]);a.set(3,jd(this));a.set(4,bd(this));return a.data()}; +h.restore=function(a){var b=ja(a[0]);this.b=b.next().value;this.sa=b.next().value;this.fa=b.next().value;this.H=b.next().value;this.s=b.next().value;this.Ja=b.next().value;this.Eb=b.next().value;this.D=b.next().value;this.Bb=b.next().value;this.Sa=b.next().value;this.Ia=b.next().value;this.Pa=b.next().value;this.Qa=b.next().value;this.Ea=b.next().value;this.g=b.next().value;this.C=b.next().value;this.Ba=b.next().value;this.sc=b.next().value;this.uc=b.next().value;b=a[1];Ac(this,b[0]);vc(this,b[1]); +this.Cb=b[2];this.Db=b[3];yc(this,b[4]);b=a[2];this.Ha=b[0];Xc(this,b[1]);this.j.ca=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function id(a,b){a.b[7]=b&65535}function qc(a,b,c,d){b={Ib:b,kb:c,message:d||0,name:kb[b],next:null};a.wb.push(b);return b}function tc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.g|=1)}function oc(a,b){if(b){if(b!=a.I){var c=a.I;if(!c||c.kb<=b.kb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.kb<=b.kb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}} +function jd(a){var b=[];for(a=a.I;a;)b.push(a.Ib),a=a.next;return b}function nd(a){return a.g&64?(I(a,168,64,-6),!0):a.g&32?(I(a,4,32,-5),!0):a.g&16?(I(a,12,16,-7),!0):!1}function zc(a){return a.i=a.i&63728|ld(a)|(a.o&65535?0:4)|(a.l&32768?2:0)|kd(a)}function Ac(a,b){b&=a.fd;a.w=b<<12;a.o=~b&4;a.l=b<<14;a.v=b<<16;if((b^a.i)&a.cd)for(var c=a.sa.length;0<=--c;){var d=a.b[c];a.b[c]=a.sa[c];a.sa[c]=d}a.B=b>>14&3;c=a.i>>14&3;a.B!=c&&(a.fa[c]=a.b[6],a.b[6]=a.fa[a.B]);a.i=b;a.g&=-3;a.g|=a.I?2:1} h.ea=function(a){this.w=this.o=a;this.l=0};h.La=function(a,b){this.w=this.o=this.v=a;this.l=b||0};function od(a,b){a.w=a.o=a.v=b;a.l=a.w^a.v>>1}function pd(a,b,c,d){a.w=a.o=a.v=b;a.l=(c^d)&(d^b)} -function I(a,b,c,d){if(!a.ib){0>a.Aa?a.Aa=zc(a):a.B||(d=-4);-4==d&&(a.f&256&&(d=-1),a.f|=256,a.D|=4,a.b[6]=b=4);if(-1!=d){a.C=b|4143316992;a.B=0;var e=a.V(b|a.wa),f=a.V(b+2&65535|a.wa);Ac(a,f&-12289|a.Aa>>2&12288);qd(a,a.Aa);qd(a,a.b[7]);id(a,e)}a.a-=5;a.f&=~(c|19);a.f|=129;a.Aa=-1;a.sc=d;a.uc=b;-1==d&&F(a);if(-4<=d)throw b;}}function rd(a){var b=sd(a),c=sd(a);a.i&49152&&(c=c&-225|a.i&63712);id(a,b);Ac(a,c);a.f&=-17} +function I(a,b,c,d){if(!a.hb){0>a.Ba?a.Ba=zc(a):a.B||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.D|=4,a.b[6]=b=4);if(-1!=d){a.C=b|4143316992;a.B=0;var e=a.W(b|a.xa),f=a.W(b+2&65535|a.xa);Ac(a,f&-12289|a.Ba>>2&12288);qd(a,a.Ba);qd(a,a.b[7]);id(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.Ba=-1;a.sc=d;a.uc=b;-1==d&&F(a);if(-4<=d)throw b;}}function rd(a){var b=sd(a),c=sd(a);a.i&49152&&(c=c&-225|a.i&63712);id(a,b);Ac(a,c);a.g&=-17} function td(a,b){var c=b>>13&31;31>c&&(b=a.qa&32?a.Ja[c]+(b&8191)&4194303:b&-3932161);return b} -function Nb(a,b,c){var d,e,f;if(!(c&a.cb))return f=b&65535,57344<=f&&(f|=a.Xb),f;d=b>>13;a.qa&a.fe[a.B]||(d&=7);e=a.s[a.B][d];f=(a.H[a.B][d]<<6)+(b&8191)&a.Xa;3932160<=f&&(f=td(a,f));if(a.ib)return f;f>=a.Vc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.s[a.B][d]=e;if(f!=(4194170&a.Xa)||a.B)a.Pa=a.B,a.Qa=d;g&&(g&57344&&(0<=a.Aa&&(g|=128),a.J&57344||(g|=a.J&4096|a.Pa<<5|a.Qa<<1,vc(a,a.J&-61695|g&61694)),I(a,168,64,-2)),a.J&61440||!(f<(4191360&a.Xa)||f>(4194239&a.Xa))||(a.J|=4096,a.J&512&&(a.f|=64)));return f}function sd(a){var b=a.V(a.b[6]|a.wa);a.b[6]=a.b[6]+2&65535;return b}function qd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.C=a.C&65535|(a.C&-65536)<<8|16121856;a.f&256||a.$a(4,-2,c);a.rb(c,b)} -function ud(a,b,c,d){var e,f,g=d&8?0:a.wa;switch(b){case 0:return I(a,4,0,-3),0;case 1:return 6==c&&a.$a(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.$a(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.$a(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(md(a,2)),e=e+a.b[c]&65535,6==c&&a.$a(d,0, -e),a.a-=6,e|g;case 7:return e=a.V(md(a,2)),e=e+a.b[c]&65535,e=a.V(e|a.wa),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.C=a.C&65535|(a.C&-65536)<<8|(f<<3&248|c)<<16;return e}h.oe=function(a,b,c){!this.B&&0>=b&&c<=this.Ia&&(this.f|=32)};h.pe=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.Ia&&(c<=this.Ia-32?I(this,4,0,-4):(this.D|=8,this.f|=32)))};h.se=function(a){return this.Mc(a)};h.ue=function(a){return this.ic(a)};h.Of=function(a,b){this.lc(a,b)};h.Qf=function(a,b){this.mc(a,b)}; -h.te=function(a,b,c){return ud(this,a,b,c)};h.od=function(a,b,c){return Nb(this,ud(this,a,b,c),c)};h.Gf=function(a){return this.u.Kb(this.Ea=a)};h.sd=function(a){return this.u.Kb(this.Ea=Nb(this,a,2))};h.Rg=function(a,b){this.u.Lb(this.Ea=a,b)};h.vd=function(a,b){this.u.Lb(this.Ea=Nb(this,a,4),b)}; -function vd(a,b,c){var d=a.g=b&7;(b=a.h=(b&56)>>3)?(d=ud(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.B=a.i>>12&3,c=a.V(d|c&a.wa),a.B=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.fa[a.i>>12&3];return c}function wd(a,b,c,d){a.C=a.C&65535|1441792;var e=a.g=b&7;(b=a.h=(b&56)>>3)?(e=ud(a,b,e,4),c&65536||(e&=65535),a.B=a.i>>12&3,e=Nb(a,e|c&65536,4),a.B=a.i>>14&3,a.$b(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.fa[a.i>>12&3]=d} -function xd(a,b){b>>=6;var c=a.R=b&7;return(b=a.K=(b&56)>>3)?a.Yb(a.oa(b,c,3)):a.b[c+a.hc]&a.$c}function yd(a,b){var c;b>>=6;var d=a.R=b&7;(b=a.K=(b&56)>>3)?c=a.Zb(a.oa(b,d,2)):c=a.b[d+a.hc];return c}function zd(a,b){var c=a.g=b&7;b=a.h=(b&56)>>3;return ud(a,b,c,8)}function Ad(a,b){var c=a.g=b&7;return(b=a.h=(b&56)>>3)?a.Yb(a.oa(b,c,3)):a.b[c]&255}function Bd(a,b){var c,d=a.g=b&7;(b=a.h=(b&56)>>3)?c=a.Zb(a.oa(b,d,2)):c=a.b[d];return c} -function O(a,b,c,d){var e=a.g=b&7;(b=a.h=(b&56)>>3)?(e=a.bc=a.oa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.jc(e,d.call(a,c,a.Yb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function P(a,b,c,d){var e=a.g=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,6),a.$b(e,d.call(a,0>c?a.b[-c-1]:c,a.Zb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} -function Cd(a,b,c,d,e){var f=a.g=b&7;(b=a.h=(b&56)>>3)?(d=a.oa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.jc(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function Dd(a,b,c,d){var e=a.g=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.$b(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} -h.kc=function(a){this.j.complete=!0;var b=a?this.j.Ic?0:1:-1;this.j.Ic=!1;this.Ga=this.a=a;this.f=this.f&-5|0;do{if(this.f){if(a=this.f&11)if(a=!1,this.f&2){var c=160,d=(this.Sa&224)>>5,e=this.I&&this.I.kb>d?this.I:null;e&&(c=e.Ib,d=e.kb);d>(this.i&224)>>5?(this.f&8&&(md(this,2),this.f&=-9),I(this,c,0,-10),d=!0):d=!1;d&&(e&&tc(this,e),a=!0);this.I||this.Sa||(this.f&=-3)}else this.f&1&&this.f++;if(a){if(this.f&4&&this.F.b(this.b[7],b)){F(this);break}if(0>b)break}if(this.f&112&&nd(this)){if(this.f& -4&&this.F.b(this.b[7],b)){F(this);break}if(0>b)break}}this.f=this.f&15|this.i&16;a=this.C=this.b[7];e=this.V(a);this.b[7]=a+2&65535;this.Uc(e)}while(0>13;a.qa&a.ge[a.B]||(d&=7);e=a.s[a.B][d];f=(a.H[a.B][d]<<6)+(b&8191)&a.Wa;3932160<=f&&(f=td(a,f));if(a.hb)return f;f>=a.Vc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.s[a.B][d]=e;if(f!=(4194170&a.Wa)||a.B)a.Pa=a.B,a.Qa=d;g&&(g&57344&&(0<=a.Ba&&(g|=128),a.J&57344||(g|=a.J&4096|a.Pa<<5|a.Qa<<1,vc(a,a.J&-61695|g&61694)),I(a,168,64,-2)),a.J&61440||!(f<(4191360&a.Wa)||f>(4194239&a.Wa))||(a.J|=4096,a.J&512&&(a.g|=64)));return f}function sd(a){var b=a.W(a.b[6]|a.xa);a.b[6]=a.b[6]+2&65535;return b}function qd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.C=a.C&65535|(a.C&-65536)<<8|16121856;a.g&256||a.Za(4,-2,c);a.rb(c,b)} +function ud(a,b,c,d){var e,f,g=d&8?0:a.xa;switch(b){case 0:return I(a,4,0,-3),0;case 1:return 6==c&&a.Za(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Za(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Za(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.W(e)|g;a.a-=8;break;case 6:return e=a.W(md(a,2)),e=e+a.b[c]&65535,6==c&&a.Za(d,0, +e),a.a-=6,e|g;case 7:return e=a.W(md(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.xa),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.C=a.C&65535|(a.C&-65536)<<8|(f<<3&248|c)<<16;return e}h.pe=function(a,b,c){!this.B&&0>=b&&c<=this.Ia&&(this.g|=32)};h.qe=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.Ia&&(c<=this.Ia-32?I(this,4,0,-4):(this.D|=8,this.g|=32)))};h.se=function(a){return this.Mc(a)};h.ue=function(a){return this.ic(a)};h.Of=function(a,b){this.lc(a,b)};h.Qf=function(a,b){this.mc(a,b)}; +h.te=function(a,b,c){return ud(this,a,b,c)};h.pd=function(a,b,c){return Nb(this,ud(this,a,b,c),c)};h.Gf=function(a){return this.u.Kb(this.Ea=a)};h.td=function(a){return this.u.Kb(this.Ea=Nb(this,a,2))};h.Rg=function(a,b){this.u.Lb(this.Ea=a,b)};h.wd=function(a,b){this.u.Lb(this.Ea=Nb(this,a,4),b)}; +function vd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=ud(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.B=a.i>>12&3,c=a.W(d|c&a.xa),a.B=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.fa[a.i>>12&3];return c}function wd(a,b,c,d){a.C=a.C&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=ud(a,b,e,4),c&65536||(e&=65535),a.B=a.i>>12&3,e=Nb(a,e|c&65536,4),a.B=a.i>>14&3,a.$b(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.fa[a.i>>12&3]=d} +function xd(a,b){b>>=6;var c=a.R=b&7;return(b=a.K=(b&56)>>3)?a.Yb(a.oa(b,c,3)):a.b[c+a.hc]&a.$c}function yd(a,b){var c;b>>=6;var d=a.R=b&7;(b=a.K=(b&56)>>3)?c=a.Zb(a.oa(b,d,2)):c=a.b[d+a.hc];return c}function zd(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return ud(a,b,c,8)}function Ad(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Yb(a.oa(b,c,3)):a.b[c]&255}function Bd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Zb(a.oa(b,d,2)):c=a.b[d];return c} +function O(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.bc=a.oa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.jc(e,d.call(a,c,a.Yb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function P(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,6),a.$b(e,d.call(a,0>c?a.b[-c-1]:c,a.Zb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} +function Cd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.oa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.jc(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function Dd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.$b(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} +h.kc=function(a){this.j.complete=!0;var b=a?this.j.Ic?0:1:-1;this.j.Ic=!1;this.Ga=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Sa&224)>>5,e=this.I&&this.I.kb>d?this.I:null;e&&(c=e.Ib,d=e.kb);d>(this.i&224)>>5?(this.g&8&&(md(this,2),this.g&=-9),I(this,c,0,-10),d=!0):d=!1;d&&(e&&tc(this,e),a=!0);this.I||this.Sa||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.F.b(this.b[7],b)){F(this);break}if(0>b)break}if(this.g&112&&nd(this)){if(this.g& +4&&this.F.b(this.b[7],b)){F(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.C=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.Uc(e)}while(0>1|b<<16;od(this,a);return a&65535}function Jd(a,b){a=b&128|b>>1|b<<8;od(this,a<<8);return a&255}function Kd(a,b){a=b&~a;this.ea(a);return a}function Ld(a,b){a=b&~a;this.ea(a<<8);return a}function Md(a,b){a|=b;this.ea(a);return a}function Nd(a,b){a|=b;this.ea(a<<8);return a} function Od(a,b){a=~b|65536;this.La(a);return a&65535}function Pd(a,b){a=~b|256;this.La(a<<8);return a&255}function Qd(a,b){this.w=this.o=a=b-a;this.l=b&(b^a);return a&65535}function Rd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.l=b&(b^c);return a&255}function Sd(a,b){this.w=this.o=a=b+a;this.l=a&(b^a);return a&65535}function Td(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.l=c&(b<<8^c);return a&255}function Ud(a,b){a=-b;this.La(a,a&b&32768);return a&65535} function Vd(a,b){a=-b;this.La(a<<8,(a&b&128)<<8);return a&255}function Wd(a,b){a=b<<1|this.v>>16&1;od(this,a);return a&65535}function Xd(a,b){a=b<<1|this.v>>16&1;od(this,a<<8);return a&255}function Yd(a,b){a=(this.v&65536|b)>>1|b<<16;od(this,a);return a&65535}function Zd(a,b){a=((this.v&65536)>>8|b)>>1|b<<8;od(this,a<<8);return a&255}function $d(a,b){var c=b-a;pd(this,c,a,b);return c&65535}function ae(a,b){var c=b-a;pd(this,c<<8,a<<8,b<<8);return c&255} -function be(a,b){this.w=this.o=b&65280;this.l=this.v=0;return(b<<8|b>>8)&65535}function ce(a,b){a^=b;this.ea(a);return a&65535}function de(a){P(this,a,yd(this,a),Ed);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)} +function be(a,b){this.w=this.o=b&65280;this.l=this.v=0;return(b<<8|b>>8)&65535}function ce(a,b){a^=b;this.ea(a);return a&65535}function de(a){P(this,a,yd(this,a),Ed);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)} function ee(a){var b=Bd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.v=this.l=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.l=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} function fe(a){var b=Bd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.l=0;b&=63;if(b&32){b=64-b;32>b-1;this.v=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function ge(a){N(this,a,!kd(this))}function he(a){N(this,a,kd(this))} -function ie(a){P(this,a,yd(this,a),Kd);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}function je(a){O(this,a,xd(this,a),Ld);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}function ke(a){P(this,a,yd(this,a),Md);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}function le(a){O(this,a,xd(this,a),Nd);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)} -function me(a){var b=yd(this,a);a=Bd(this,a);this.ea((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.R&&6<=this.g?1:0):(this.K?4:3)+(7==this.g?2:0)}function ne(a){var b=xd(this,a);a=Ad(this,a);this.ea(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.R&&6<=this.g?1:0):(this.K?4:3)+(7==this.g?2:0)}function oe(a){N(this,a,this.o&65535?0:4)}function pe(a){N(this,a,!ld(this)==!(this.l&32768))}function qe(a){N(this,a,!!(this.o&65535)&&!ld(this)==!(this.l&32768))} +function ie(a){P(this,a,yd(this,a),Kd);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function je(a){O(this,a,xd(this,a),Ld);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function ke(a){P(this,a,yd(this,a),Md);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function le(a){O(this,a,xd(this,a),Nd);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)} +function me(a){var b=yd(this,a);a=Bd(this,a);this.ea((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function ne(a){var b=xd(this,a);a=Ad(this,a);this.ea(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function oe(a){N(this,a,this.o&65535?0:4)}function pe(a){N(this,a,!ld(this)==!(this.l&32768))}function qe(a){N(this,a,!!(this.o&65535)&&!ld(this)==!(this.l&32768))} function re(a){N(this,a,!kd(this)&&!!(this.o&65535))}function se(a){N(this,a,(this.o&65535?0:4)||!ld(this)!=!(this.l&32768))}function te(a){N(this,a,kd(this)||(this.o&65535?0:4))}function ue(a){N(this,a,!ld(this)!=!(this.l&32768))}function ve(a){N(this,a,ld(this))}function we(a){N(this,a,!!(this.o&65535))}function xe(a){N(this,a,!ld(this))}function ye(){I(this,12,0,-9)}function ze(a){N(this,a,!0)}function Ae(a){N(this,a,!(this.l&32768))}function Be(a){N(this,a,this.l&32768?2:0)} -function Q(a){a&1&&(this.v=0);a&2&&(this.l=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function Ce(a){var b=yd(this,a);a=Bd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;pd(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.g?1:0):(this.K?4:3)+(7==this.g?2:0)}function De(a){var b=xd(this,a);a=Ad(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);pd(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.g?1:0):(this.K?4:3)+(7==this.g?2:0)} +function Q(a){a&1&&(this.v=0);a&2&&(this.l=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function Ce(a){var b=yd(this,a);a=Bd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;pd(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function De(a){var b=xd(this,a);a=Ad(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);pd(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)} function Ee(a){var b=Bd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.l=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.l=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.l=32768,this.v=65536,this.a-=7}function Fe(){I(this,24,0,-9);this.a-=20} -function Ge(){this.i&49152?(this.D|=128,I(this,4,0,-8)):(this.ma&&1120==this.pa&&this.ma.setData(this.b[0],!0),this.F?this.F.i():F(this));this.a-=7}function He(){I(this,16,0,-9);this.a-=20}var Ie=[0,7,7,10,7,11,9,13];function Je(a){this.Y=this.a;id(this,zd(this,a));this.a=this.Y-Ie[this.h]}var Ke=[0,14,14,17,14,18,16,20];function Le(a){this.Y=this.a;var b=zd(this,a);a=a>>6&7;qd(this,this.b[a]);this.b[a]=this.b[7];id(this,b);this.a=this.Y-Ke[this.h]}var Me=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function Ne(a){var b=yd(this,a);this.Y=this.a;Dd(this,a,b,this.ea);this.a=this.Y-Me[(this.K?8:0)+this.h]+(7!=this.g||this.h?0:2)}function Oe(a){var b=xd(this,a);Cd(this,a,b,65535,this.ea);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}var Pe=[7,13,13,17,14,18,17,21];function Qe(a){var b=Bd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.l=0;this.v=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)id(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6} -function We(a){P(this,a,yd(this,a),$d);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}function Xe(a){P(this,a,0,be);this.a-=this.h?9:3+(7==this.g?2:0)}function Ye(){I(this,28,0,-9)}function Ze(){this.ma&&(this.ma.U=this.b[7],this.ma.setData(this.b[0],!0));this.f|=8;md(this,-2);this.a-=3}function $e(a){P(this,a,this.b[(a>>6&7)+this.hc],ce);this.a-=this.h?9:3+(7==this.g?2:0)}function S(){I(this,8,0,-9)}function ed(a){af[a>>12].call(this,a)} +function Ge(){this.i&49152?(this.D|=128,I(this,4,0,-8)):(this.na&&1120==this.pa&&this.na.setData(this.b[0],!0),this.F?this.F.i():F(this));this.a-=7}function He(){I(this,16,0,-9);this.a-=20}var Ie=[0,7,7,10,7,11,9,13];function Je(a){this.Z=this.a;id(this,zd(this,a));this.a=this.Z-Ie[this.h]}var Ke=[0,14,14,17,14,18,16,20];function Le(a){this.Z=this.a;var b=zd(this,a);a=a>>6&7;qd(this,this.b[a]);this.b[a]=this.b[7];id(this,b);this.a=this.Z-Ke[this.h]}var Me=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function Ne(a){var b=yd(this,a);this.Z=this.a;Dd(this,a,b,this.ea);this.a=this.Z-Me[(this.K?8:0)+this.h]+(7!=this.f||this.h?0:2)}function Oe(a){var b=xd(this,a);Cd(this,a,b,65535,this.ea);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}var Pe=[7,13,13,17,14,18,17,21];function Qe(a){var b=Bd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.l=0;this.v=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)id(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6} +function We(a){P(this,a,yd(this,a),$d);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Xe(a){P(this,a,0,be);this.a-=this.h?9:3+(7==this.f?2:0)}function Ye(){I(this,28,0,-9)}function Ze(){this.na&&(this.na.U=this.b[7],this.na.setData(this.b[0],!0));this.g|=8;md(this,-2);this.a-=3}function $e(a){P(this,a,this.b[(a>>6&7)+this.hc],ce);this.a-=this.h?9:3+(7==this.f?2:0)}function S(){I(this,8,0,-9)}function ed(a){af[a>>12].call(this,a)} function bf(a){cf[a>>6&3].call(this,a)}function df(a){ef[a>>6&3].call(this,a)}function ff(a){gf[a>>6&3].call(this,a)}function hf(a){jf[a&15].call(this,a)}function kf(a){lf[a&15].call(this,a)}function mf(a){nf[a>>6&3].call(this,a)}function of(a){pf[a>>6&3].call(this,a)}function qf(a){rf[a>>6&3].call(this,a)} -var af=[function(a){sf[a>>8&15].call(this,a)},Ne,Ce,me,ie,ke,de,S,function(a){tf[a>>8&15].call(this,a)},Oe,De,ne,je,le,We,S],sf=[function(a){uf[a>>4&15].call(this,a)},ze,we,oe,pe,ue,qe,se,Le,Le,bf,df,ff,S,S,S],cf=[function(a){Dd(this,a,0,this.La);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,0,Od);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,1,Sd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,1,Qd);this.a-=this.h?9:3+(7==this.g?2:0)}],ef=[function(a){P(this,a,0,Ud); -this.a-=this.h?11:6},function(a){P(this,a,kd(this)?1:0,Ed);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,kd(this)?1:0,$d);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){a=Bd(this,a);this.La(a);this.a-=this.h?4:3+(7==this.g?2:0)}],gf=[function(a){P(this,a,0,Yd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,0,Wd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,0,Id);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,0,Gd);this.a-=this.h?9:3+(7==this.g?2:0)}],uf= +var af=[function(a){sf[a>>8&15].call(this,a)},Ne,Ce,me,ie,ke,de,S,function(a){tf[a>>8&15].call(this,a)},Oe,De,ne,je,le,We,S],sf=[function(a){uf[a>>4&15].call(this,a)},ze,we,oe,pe,ue,qe,se,Le,Le,bf,df,ff,S,S,S],cf=[function(a){Dd(this,a,0,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Od);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Sd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Qd);this.a-=this.h?9:3+(7==this.f?2:0)}],ef=[function(a){P(this,a,0,Ud); +this.a-=this.h?11:6},function(a){P(this,a,kd(this)?1:0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,kd(this)?1:0,$d);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=Bd(this,a);this.La(a);this.a-=this.h?4:3+(7==this.f?2:0)}],gf=[function(a){P(this,a,0,Yd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Wd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Gd);this.a-=this.h?9:3+(7==this.f?2:0)}],uf= [function(a){vf[a&15].call(this,a)},S,S,S,Je,Je,Je,Je,Te,S,hf,kf,Xe,Xe,Xe,Xe],vf=[Ge,Ze,Ue,ye,He,Se,S,S,S,S,S,S,S,S,S,S],jf=[Re,function(){this.v=0;this.a-=5},function(){this.l=0;this.a-=5},Q,function(){this.o=1;this.a-=5},Q,Q,Q,function(){this.w=0;this.a-=5},Q,Q,Q,Q,Q,Q,Q],lf=[Re,function(){this.v=65536;this.a-=5},function(){this.l=32768;this.a-=5},R,function(){this.o=0;this.a-=5},R,R,R,function(){this.w=32768;this.a-=5},R,R,R,R,R,R,R],tf=[xe,ve,re,te,Ae,Be,ge,he,Fe,Ye,mf,of,qf,S,S,S],nf=[function(a){Cd(this, -a,0,255,this.La);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,0,Pd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,1,Td);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,1,Rd);this.a-=this.h?9:3+(7==this.g?2:0)}],pf=[function(a){O(this,a,0,Vd);this.a-=this.h?11:6},function(a){O(this,a,kd(this)?1:0,Fd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,kd(this)?1:0,ae);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){a=Ad(this,a);this.La(a<<8);this.a-=this.h?4:3+ -(7==this.g?2:0)}],rf=[function(a){O(this,a,0,Zd);this.a-=this.h?9+(this.bc&1):3+(7==this.g?2:0)},function(a){O(this,a,0,Xd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,0,Jd);this.a-=this.h?9+(this.bc&1):3+(7==this.g?2:0)},function(a){O(this,a,0,Hd);this.a-=this.h?9:3+(7==this.g?2:0)}];function fd(a){wf[a>>12].call(this,a)} -var wf=[function(a){xf[a>>8&15].call(this,a)},Ne,Ce,me,ie,ke,de,function(a){yf[a>>8&15].call(this,a)},function(a){zf[a>>8&15].call(this,a)},Oe,De,ne,je,le,We,S],xf=[function(a){Af[a>>4&15].call(this,a)},ze,we,oe,pe,ue,qe,se,Le,Le,bf,df,ff,function(a){Bf[a>>6&3].call(this,a)},S,S],Bf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.V(a|this.wa);id(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=vd(this,a,0);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this); -this.Y=this.a;this.ea(b);wd(this,a,0,b);this.a=this.Y-Pe[this.h]},function(a){Dd(this,a,ld(this)?65535:0,this.ea);this.a-=this.h?9:3+(7==this.g?2:0)}],Af=[function(a){Cf[a&15].call(this,a)},S,S,S,Je,Je,Je,Je,Te,function(a){!(a&8)||1145>this.pa?I(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.f|=1,this.f&=-3),this.a-=5)},hf,kf,Xe,Xe,Xe,Xe],Cf=[Ge,Ze,function(){rd(this);this.f|=this.i&16;this.a-=13},ye,He,Se,Ue,function(){I(this,8,0,-9)},S,S,S,S,S,S,S,S],yf=[Qe,Qe,Ee,Ee,ee,ee,fe,fe,$e, -$e,S,S,S,S,Ve,Ve],zf=[xe,ve,re,te,Ae,Be,ge,he,Fe,Ye,mf,of,qf,function(a){1145>this.pa?I(this,8,0,-9):Df[a>>6&3].call(this,a)},S,S],Df=[function(){I(this,8,0,-9)},function(a){a=vd(this,a,65536);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this);this.Y=this.a;this.ea(b);wd(this,a,65536,b);this.a=this.Y-Pe[this.h]},function(){I(this,8,0,-9)}]; -function Ef(a){q.call(this,"ROM",a,128);this.ga=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.g=a.alias;"string"==typeof this.g&&(this.g=eval(this.g));this.f=a.file;this.l=Fa(this.f);if(this.f){a=this.f;var b=Ga(this.l);"json"!=b&&"hex"!=b&&(a=Qa()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Oa(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.f=null):(ta(c.Na,a,b),(a=Pa(a,b))?(c.b=a.M,c.ga=a.ga):c.f=null);Ff(c)})}}n(Ef,q); +a,0,255,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,0,Pd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,1,Td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,1,Rd);this.a-=this.h?9:3+(7==this.f?2:0)}],pf=[function(a){O(this,a,0,Vd);this.a-=this.h?11:6},function(a){O(this,a,kd(this)?1:0,Fd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,kd(this)?1:0,ae);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=Ad(this,a);this.La(a<<8);this.a-=this.h?4:3+ +(7==this.f?2:0)}],rf=[function(a){O(this,a,0,Zd);this.a-=this.h?9+(this.bc&1):3+(7==this.f?2:0)},function(a){O(this,a,0,Xd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,0,Jd);this.a-=this.h?9+(this.bc&1):3+(7==this.f?2:0)},function(a){O(this,a,0,Hd);this.a-=this.h?9:3+(7==this.f?2:0)}];function fd(a){wf[a>>12].call(this,a)} +var wf=[function(a){xf[a>>8&15].call(this,a)},Ne,Ce,me,ie,ke,de,function(a){yf[a>>8&15].call(this,a)},function(a){zf[a>>8&15].call(this,a)},Oe,De,ne,je,le,We,S],xf=[function(a){Af[a>>4&15].call(this,a)},ze,we,oe,pe,ue,qe,se,Le,Le,bf,df,ff,function(a){Bf[a>>6&3].call(this,a)},S,S],Bf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.xa);id(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=vd(this,a,0);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this); +this.Z=this.a;this.ea(b);wd(this,a,0,b);this.a=this.Z-Pe[this.h]},function(a){Dd(this,a,ld(this)?65535:0,this.ea);this.a-=this.h?9:3+(7==this.f?2:0)}],Af=[function(a){Cf[a&15].call(this,a)},S,S,S,Je,Je,Je,Je,Te,function(a){!(a&8)||1145>this.pa?I(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},hf,kf,Xe,Xe,Xe,Xe],Cf=[Ge,Ze,function(){rd(this);this.g|=this.i&16;this.a-=13},ye,He,Se,Ue,function(){I(this,8,0,-9)},S,S,S,S,S,S,S,S],yf=[Qe,Qe,Ee,Ee,ee,ee,fe,fe,$e, +$e,S,S,S,S,Ve,Ve],zf=[xe,ve,re,te,Ae,Be,ge,he,Fe,Ye,mf,of,qf,function(a){1145>this.pa?I(this,8,0,-9):Df[a>>6&3].call(this,a)},S,S],Df=[function(){I(this,8,0,-9)},function(a){a=vd(this,a,65536);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this);this.Z=this.a;this.ea(b);wd(this,a,65536,b);this.a=this.Z-Pe[this.h]},function(){I(this,8,0,-9)}]; +function Ef(a){q.call(this,"ROM",a,128);this.ga=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.l=Fa(this.g);if(this.g){a=this.g;var b=Ga(this.l);"json"!=b&&"hex"!=b&&(a=Qa()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Oa(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ta(c.Na,a,b),(a=Pa(a,b))?(c.b=a.M,c.ga=a.ga):c.g=null);Ff(c)})}}n(Ef,q); h=Ef.prototype;h.ha=function(a,b,c,d){this.u=b;this.c=c;this.F=d;Ff(this)};h.ja=function(){this.ga&&(this.F&&this.F.a(this.id,this.h,this.a,this.ga),delete this.ga);return!0};h.ia=function(){return!0}; -function Ff(a){if(!Aa(a)){if(a.f){if(!a.b||!a.u)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+Ea(a.b.length,8,!0)+") does not match specified size ("+Ea(a.a,8,!0)+")";a.j.error=!0;a.G(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Tb){var c={},c=(c[b]=[Ef.prototype.sf,Ef.prototype.Bg,null,null,null,a.a>>1],c);if(qb(a.u,a,c)){a.status("Added "+a.a+"-byte ROM at "+Da(b));b=a.i=!0;break a}}else if(Zb(a.u,b,a.a,Ec)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0>1],c);if(qb(a.u,a,c)){a.status("Added "+a.a+"-byte ROM at "+Da(b));b=a.i=!0;break a}}else if(Zb(a.u,b,a.a,Ec)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),z=l,y=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(y)for(;y--;)hc(a.u,t++,b[z++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< b.length;e++)hc(a.u,c+e,b[e]);k=!0}if(k){if(null==d||g)F(a.c),f=!1;null!=d&&hd(a.c,d,f)}return k}Za(function(){for(var a=A(document,x,"ram"),b=0;b=sa.Nc&&c<=sa.ke&&(b=c-(sa.Nc-sa.zd));b&&(a.preventDefault&&a.preventDefault(),d.ac(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==sa.Bd&&(b=sa.Ad);d.ac(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +function T(a){q.call(this,"SerialPort",a,262144);this.B=+a.adapter;this.J=+a.baudReceive||9600;this.Z=+a.baudTransmit||9600;this.w=a.upperCase;"string"==typeof this.w&&(this.w="true"==this.w);this.h=this.i=null;this.R=+a.tabSize;this.K=+a.charBOL;this.l=0;this.v=!0;this.H=this.C=null;this.I=this.X=-1;this.o=this.a=this.b=0;this.f=[];var b=a.binding;if("console"==b)this.i="";else{var c;a=Kf;b&&(void 0===c&&(c="Panel"),(c=za(c,this.id))&&(b=c.m[b])&&this.ka(null,a,b))}this.g=this.s=this.D=null;this.exports= +{connect:this.qd,receiveData:this.ac,receiveStatus:this.Lf,setConnection:this.Pf}}n(T,q);h=T.prototype; +h.ka=function(a,b,c){var d=this;switch(b){case Kf:return this.m[b]=this.h=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?sa.Oc:sa.Dd:46==c?b=sa.Oc:a.ctrlKey&&c>=sa.Nc&&c<=sa.le&&(b=c-(sa.Nc-sa.Ad));b&&(a.preventDefault&&a.preventDefault(),d.ac(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==sa.Cd&&(b=sa.Bd);d.ac(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ac(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;var e=this;this.H=rc(this.c,this.B?-1:48,4,262144);this.I=nc(this.c,function(){var a;a=-1;e.g.length&&(a=e.g.shift()&255,e.w&&97<=a&&122>a&&(a-=32),qc(e.c,e.I,1E3/Math.round(e.J/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&oc(c,e.H))});this.C=rc(this.c,this.B?-1:52,4,262144);this.W=nc(this.c,function(){e.b|=128;e.b&64&&oc(c,e.C)});qb(b,this,Lf,this.B?64832+8*(this.B-1)-65392:0);sb(b,this.reset.bind(this));B(this)}; -h.pd=function(a){if(!this.f){var b=Tc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ka(c[0]);if(d!=this.ab)return;c=Ka(c[1]);if(this.f=ya(c)){var e=this.f.exports;if(e){var f=e.connect;f&&f.call(this.f,this.v);if(this.s=e.receiveData){this.v=a;this.D=e.receiveStatus;this.status("Connected "+this.Na+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ja=function(a,b){if(!b)if(this.pd(this.v),!a)this.reset();else if(!this.restore(a))return!1;return!0}; -h.ia=function(a){return a?this.save():!0};h.reset=function(){Mf(this)};h.save=function(){var a=new E(this);a.set(0,[this.o,this.a,this.b,this.g]);return a.data()};h.restore=function(a){return Mf(this,a[0])};function Mf(a,b){b||(b=[0,8192,128,a.g]);b=ja(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.g=b.next().value;return!0} -h.ac=function(a){if("number"==typeof a)this.g.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.R||8,c=a-this.l%a,this.R&&(b=" ".slice(0,c)));this.K&&!this.l&&c&&(b=String.fromCharCode(this.K)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.l+=c}}else if(null!= -this.i){if(10==a||1024<=this.i.length)this.X(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}qc(this.c,this.W,1E3/Math.round(this.Y/10));this.b&=-129};var Kf="buffer",Nf={},Lf=(Nf[65392]=[null,null,T.prototype.df,T.prototype.og,"RCSR"],Nf[65394]=[null,null,T.prototype.cf,T.prototype.ng,"RBUF"],Nf[65396]=[null,null,T.prototype.Kf,T.prototype.Tg,"XCSR"],Nf[65398]=[null,null,T.prototype.Jf,T.prototype.Sg,"XBUF"],Nf); -Za(function(){for(var a=A(document,x,"serial"),b=0;ba&&(a-=32),pc(e.c,e.I,1E3/Math.round(e.J/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&oc(c,e.H))});this.C=qc(this.c,this.B?-1:52,4,262144);this.X=nc(this.c,function(){e.b|=128;e.b&64&&oc(c,e.C)});qb(b,this,Lf,this.B?64832+8*(this.B-1)-65392:0);sb(b,this.reset.bind(this));B(this)}; +h.qd=function(a){if(!this.g){var b=Tc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ka(c[0]);if(d!=this.$a)return;c=Ka(c[1]);if(this.g=ya(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.v);if(this.s=e.receiveData){this.v=a;this.D=e.receiveStatus;this.status("Connected "+this.Na+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ja=function(a,b){if(!b)if(this.qd(this.v),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +h.ia=function(a){return a?this.save():!0};h.reset=function(){Mf(this)};h.save=function(){var a=new E(this);a.set(0,[this.o,this.a,this.b,this.f]);return a.data()};h.restore=function(a){return Mf(this,a[0])};function Mf(a,b){b||(b=[0,8192,128,a.f]);b=ja(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.f=b.next().value;return!0} +h.ac=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.R||8,c=a-this.l%a,this.R&&(b=" ".slice(0,c)));this.K&&!this.l&&c&&(b=String.fromCharCode(this.K)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.l+=c}}else if(null!= +this.i){if(10==a||1024<=this.i.length)this.Y(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}pc(this.c,this.X,1E3/Math.round(this.Z/10));this.b&=-129};var Kf="buffer",Nf={},Lf=(Nf[65392]=[null,null,T.prototype.df,T.prototype.og,"RCSR"],Nf[65394]=[null,null,T.prototype.cf,T.prototype.ng,"RBUF"],Nf[65396]=[null,null,T.prototype.Kf,T.prototype.Tg,"XCSR"],Nf[65398]=[null,null,T.prototype.Jf,T.prototype.Sg,"XBUF"],Nf); +Za(function(){for(var a=A(document,x,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.m[b]=c,!0;case "readTape":e=Rf;case "loadTape":return e||(e=Sf),this.m[b]=c,c.onclick= function(){var a=d.m.listTapes;a&&Tf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.C){c.parentNode.removeChild(c);break}this.m[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Tf(d,Fa(b,!0),b,Sf,a)}return!1};return!0;case Uf:return this.m[b]=c,!0}return!1}; -h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;this.v=Vf(a);var e=this;if(a=Of(this,Tc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.B[f]=a[f]);this.s=rc(this.c,56,4,4096);this.H=nc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.lc.indexOf("/api/v1/dump")&&(e=Ga(c),f="json"==e||"gz"==e?encodeURI(c):Qa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Oa(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.P;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ta(a.Na,e,f),(e=Pa(e,f))&&fg(a,b,c,d,e.M,e.aa,e.Z)); -a.j.Va=!1;a.b&&(a.b--,a.b||B(a));cg(a)})}function Yf(a,b,c,d){if((a=a.m.listTapes)&&a.options){for(var e=0;ec.indexOf("/api/v1/dump")&&(e=Ga(c),f="json"==e||"gz"==e?encodeURI(c):Qa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Oa(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.P;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ta(a.Na,e,f),(e=Pa(e,f))&&fg(a,b,c,d,e.M,e.ba,e.aa)); +a.j.Va=!1;a.b&&(a.b--,a.b||B(a));cg(a)})}function Yf(a,b,c,d){if((a=a.m.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.N);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ga(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ha(c,"/")&&(d="dir"),f=Qa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Dc?"":e)+"&format=json"));return!!Oa(f, +function ig(a,b,c){q.call(this,"Disk",{id:a.Na+".disk"+Ea(++jg,4)},8192);this.controller=a;this.A=a.A;this.F=a.F;this.h=b;this.ua=b.name;this.ma=this.Gc="";this.Dc=b.Dc;this.N=this.T=this.O=this.da=this.mode=0;this.a=[];this.f=null;this.g=!1;kg(this,c,b.N,b.T,b.O,b.da);this.b=this.i=null;B(this)}n(ig,q);h=ig.prototype;h.ha=function(a,b,c,d){this.F=d}; +function kg(a,b,c,d,e,f){a.mode=b;a.N=c;a.T=d;a.O=e;a.da=f;a.a=[];if("preload"!=a.mode){b=Array(a.N);for(c=0;c>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.N);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ga(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ha(c,"/")&&(d="dir"),f=Qa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Dc?"":e)+"&format=json"));return!!Oa(f, null,!0,function(b,c,d){ng(a,b,c,d)})} -function ng(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.P;a.f=!1;if(d)a.controller.G('Unable to load disk "'+a.Da+'" (error '+d+": "+b+")",f);else{ta(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)u(k[0]);else{a.N=k.length;a.T=k[0].length;a.O=k[0][0].length;var l=k[0][0][0];a.ca=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var z=l.bytes;if(void 0!==z&&z.length){for(var y=m<<2,fa=z.length;fa>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.f)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.la?f=a.ta+a.la&&(a.la+=f-(a.ta+a.la)+1):(a.ta=f,a.la=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.f){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.G("Unable to restore disk '"+this.Da+": "+c);return b}; +function ng(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.P;a.g=!1;if(d)a.controller.G('Unable to load disk "'+a.ua+'" (error '+d+": "+b+")",f);else{ta(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)u(k[0]);else{a.N=k.length;a.T=k[0].length;a.O=k[0][0].length;var l=k[0][0][0];a.da=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var z=l.bytes;if(void 0!==z&&z.length){for(var y=m<<2,fa=z.length;fa>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.la?f=a.ta+a.la&&(a.la+=f-(a.ta+a.la)+1):(a.ta=f,a.la=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.G("Unable to restore disk '"+this.ua+": "+c);return b}; h.toJSON=function(){var a;a=0;for(var b;b=pg(this,a++);)rg(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function rg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var jg=0;function sg(a,b,c,d,e,f){q.call(this,a,b,c);this.w=tg(this,b.autoMount);this.s=0;this.D=d;this.H=e;this.I=f;this.C=d.Pc;this.g=Array(this.C);this.B=!Va("Mobi")&&window&&"FileReader"in window;this.h=[];this.jb=null;this.exports={selectDrive:this.Nf}}n(sg,q); +function rg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var jg=0;function sg(a,b,c,d,e,f){q.call(this,a,b,c);this.w=tg(this,b.autoMount);this.s=0;this.D=d;this.H=e;this.I=f;this.C=d.Pc;this.b=Array(this.C);this.B=!Va("Mobi")&&window&&"FileReader"in window;this.h=[];this.jb=null;this.exports={selectDrive:this.Nf}}n(sg,q); function tg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){u(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=sg.prototype; h.ka=function(a,b,c){var d=this;switch(b){case "listDisks":return this.m[b]=c,c.onchange=function(){var a=d.m.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){u(d.type+" option error: "+k.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.m[b]=c,c.onchange=function(){var a=Ca(c.value);null!=a&&ug(d, -a)},!0;case "loadDisk":return this.m[b]=c,c.onclick=function(){var a=d.m.listDisks;a&&a.options&&vg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.m[b]=c,c.onclick=function(){var a,b=d.m.listDrives,b=b&&Ca(b.value);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.G("Unable to boot the selected drive"):a.da?(hd(d.c,0,!0),(a=d.Gb(a,0,0,0,512,0,2))&&d.G("Unable to read the boot sector ("+a+")")):d.G("Load a disk into the drive first")},!0;case "saveDisk":if(!this.B){c.parentNode.removeChild(c); -break}this.m[b]=c;c.onclick=function(){var a=d.m.listDrives;if(a&&a.options&&d.g)if(a=d.g[Ca(a.value)||0])if(a=a.da){var b;b="";for(var c=0,k;k=pg(a,c++);)for(var l=0,m=k.length;lb||b>=d.b.length||!(a=d.b[b])?d.G("Unable to boot the selected drive"):a.V?(hd(d.c,0,!0),(a=d.Gb(a,0,0,0,512,0,2))&&d.G("Unable to read the boot sector ("+a+")")):d.G("Load a disk into the drive first")},!0;case "saveDisk":if(!this.B){c.parentNode.removeChild(c); +break}this.m[b]=c;c.onclick=function(){var a=d.m.listDrives;if(a&&a.options&&d.b)if(a=d.b[Ca(a.value)||0])if(a=a.V){var b;b="";for(var c=0,k;k=pg(a,c++);)for(var l=0,m=k.length;lg||9e||e>=a.g.length)a.G("Unable to load the selected drive");else if(c)if(c==yg)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==zg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Fa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Eg(a,e,b,c,!1,d)}else Bg(a,e)} -function Eg(a,b,c,d,e,f){var g=-1,k=a.g[b];k.na.toLowerCase()!=d.toLowerCase()&&(g++,Bg(a,b,!0),k.Cc?a.G(a.type+" busy"):(k.Cc=!0,e&&(k.Bc=!0,a.s++),k.Ub=!!f,mg(new ig(a,k,"preload"),c,d,f,a.re)&&g++));return g} -h.re=function(a,b,c,d,e){a.Cc=!1;b&&(b.N>a.N||b.T>a.T)&&(this.G('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.Wb)),b=null);if(b){a.da=b;a.Da=c;a.na=d;a:{var f;for(f=0;fg||9e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if(c==yg)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==zg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Fa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Fg(a,e,b,c,!1,d)}else Bg(a,e)} +function Fg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.ma.toLowerCase()!=d.toLowerCase()&&(g++,Bg(a,b,!0),k.Cc?a.G(a.type+" busy"):(k.Cc=!0,e&&(k.Bc=!0,a.s++),k.ib=!!f,mg(new ig(a,k,"preload"),c,d,f,a.nd)&&g++));return g} +h.nd=function(a,b,c,d,e){a.Cc=!1;b&&(b.N>a.N||b.T>a.T)&&(this.G('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.Vb)),b=null);b?(a.V=b,a.ua=c,a.ma=d,Gg(this,c,d,b),this.G('Loaded disk "'+c+'" in drive '+(this.type.substr(0,2)+a.Vb),a.Bc||e),this.A&&$c(this.A)):a.ib=!1;a.Bc&&(a.Bc=!1,--this.s||B(this));ug(this,a.Vb)}; function wg(a,b,c,d){if((a=a.m.listDisks)&&a.options){for(var e=0;e=a.N){m=V.Mb;break}p=a.seek(b,c,d+1);if(!p){m=V.gd;break}t=0;++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b))}var z,y;if(0>(z=a.read(p,t++))||0>(y=a.read(p,t++))){m=V.Nb;break}if(!k&&(Mb(this.u,td(this.c,f),z|y<<8),mc(this.u))){m=V.ub;break}t>=a.ca&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.gc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var p=null,t;a||(m=V.Yc,e=0);for(;e;){var z=Ob(this.u,td(this.c,f));if(mc(this.u)){m=V.ub;break}if(!p){if(b>=a.N){m=V.Mb;break}p=a.seek(b,c,d+1,!0);if(!p){m=V.gd;break}t=0;++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b))}if(k){var y,fa;if(0>(y=a.read(p,t++))||0>(fa=a.read(p,t++))){m=V.Nb;break}if(z!=(y|fa<<8)){m=V.kd;break}}else if(!a.write(p,t++,z&255)||!a.write(p,t++,z>>8)){m=V.Nb;break}t>=a.ca&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Qd=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&~U.Za|f>>16-U.S.Za&U.Za;this.l=65536-e&65535;this.f=this.f&~W.xc|d&W.xc;this.b|=a;Hg(this);return!0};function Hg(a){a.a&=~U.tb;a.b&&(a.b|=V.Ed,a.a|=U.tb,a.b&V.qc&&(a.a|=U.qc))}h.jf=function(){return this.v};h.tg=function(){};h.kf=function(){return this.b};h.ug=function(){};h.ff=function(){return this.a&U.wc}; -h.qg=function(a){this.a=this.a&~U.Ta|a&U.Ta;if(this.a&U.Rc){a=!0;var b,c,d=(this.f&W.Ma)>>W.S.Ma,e=this.g[d],f,g,k,l,m,p;this.a&=~(U.va|U.yc);this.b&=~V.ae;switch(c=this.a&U.ra){case Ig.yd:this.b=this.f=0;this.a=U.va;break;case Ig.Md:case Ig.Od:b=this.Gb;case Ig.zc:case Ig.je:b||(b=this.gc);f=(this.f&W.sb)>>W.S.sb;g=(this.f&W.rc)>>W.S.rc;k=this.f&W.xc;l=65536-this.l&65535;m=(this.a&U.Za)<<16-U.S.Za|this.i;p=this.a&U.Kd?0:2;if(f>=e.N){this.b|=V.Mb;break}if(k>=e.O){this.b|=V.Nb;break}a=b.call(this, -e,f,g,k,l,m,p,c>=Ig.zc,this.Qd.bind(this));break;case Ig.Sb:f=(this.f&W.sb)>>W.S.sb;f(p=a.read(k,m++))||0>(t=a.read(k,m++))){g=Y.xa;break}Mb(this.u,td(this.c,f),p|t<<8);if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(m>=a.ca&&(k=null,++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.xa;break}}return l?l(g,b,c,d,e,f):g}; -h.gc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.da;k=null;var m;a||(g=Y.xa,e=0);for(;e;){var p=Ob(this.u,td(this.c,f));if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=Y.xa;break}m=0}if(!a.write(k,m++,p&255)||!a.write(k,m++,p>>8)){g=Y.xa;break}if(m>=a.ca&&(k=null,++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.xa;break}}return l?l(g,b,c,d,e,f):g}; -h.Vd=function(a,b,c,d,e,f){this.o=f&65535;this.a=this.a&~X.ua|f>>16-X.S.ua&X.ua;this.i=f>>16&Lg.vc;this.f=this.b=b<>X.S.ua;if(!(this.a&X.va)){a=!0;var b,c=this.g[(this.a&X.Ma)>>X.S.Ma],d=c.da,e,f,g;this.a&=~X.Ya;switch(this.a&X.ra){case Mg.ee:this.l&Ng.Sc&&(this.a&=X.Ya|X.ra|X.ua);this.l=c.status|this.f&Z.Rb|(d&&512==d.N?Ng.Hd:0);break;case Mg.Sb:(this.b&Z.Gd)==Z.be&&(b=this.b&Z.vb,c=(this.b&Z.de)<<2,this.f=this.b&Z.ce?this.f+b:this.f-b,this.b=this.f=this.f&Z.vb|c);break;case Mg.Pd:this.l=this.f;break;case Mg.Nd:b=this.Gb;case Mg.ie:b||(b=this.gc), -e=this.b>>Z.S.vb,f=this.b&Z.Rb?1:0,g=this.b&Z.ed,!d||e>=d.N||g>=d.O?this.a=this.a|Y.xa|X.tb:(a=65536-this.l&65535,d=(this.i&Lg.vc)<<16|this.o,a=b.call(this,c,e,f,g,a,d,2,!1,this.Vd.bind(this)))}a&&(this.a=this.a|X.Ya|X.va,this.a&X.tc&&oc(this.c,this.jb))}};h.mf=function(){return this.o};h.wg=function(a){this.o=a&Og.Ta};h.qf=function(){return this.b};h.zg=function(a){this.b=a};h.rf=function(){return this.l};h.Ag=function(a){this.l=a};h.nf=function(){return this.i}; -h.xg=function(a){this.i=a&Lg.vc;this.a=this.a&~X.ua|(this.i&3)<\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bTg){if(Ug(d,this.s)){this.h=new E(this,"1.32.2",ch);Ug(this.h)&&(dh(this,d),a=gh,hh(this.h));this.h.set($g,Na());ih(this.h);var e=this.a&&!this.l;if(a==ah||wa("Click OK to restore the previous "+hb+" machine state, or CANCEL to reset the machine.")){if(c=Zg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ug(d,g):("error"==f&&"no machine state"!= -g?(this.G("Error: "+g),"unable to verify user"==g&&(Ua(jh,""),this.b=null)):this.X(f+": "+g),hh(d),Ug(d)?(c=Zg(d),e=!0):c=!1))}e&&Xg(this,c?d:null)}else a==gh&&d.clear()}else Xg(this);delete this.s;delete this.i}e=xa(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.P=!0;var d=this.m.power;d&&(d.textContent="Shutdown");this.c&&(kh(this,this.c,b,c,a),Kb(this,-2),this.c.ba());this.C&&(dh(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.f=0}; -function dh(a,b){if(wa("There may be a problem with your "+hb+" machine.\n\nTo help us diagnose it, click OK to send this "+hb+" machine state to http://www.pcjs.org.")){var c=a.K;a=a.b||"";b=b.toString();var d={};d.app=hb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;Oa("http://www.pcjs.org/api/v1/report",d,!0)}} -function lh(a,b,c){var d,e="none";if(a.f)return null;a.f--;var f=new E(a,"1.32.2"),g=new E(a,"1.32.2",Yg),k=Na();g.set($g,k);f.set($g,k);f.set(mh,"1.32.2");f.set(nh,window?window.location.href:null);f.set(oh,window?window.navigator.userAgent:"");a.c&&a.c.ia&&(c&&(b&&(a.c.j.ba=a.c.j.L),F(a.c)),d=a.c.ia(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.P=!1,!1===d&&(e=null)));for(var k=xa(a.id),l=0;l=a.N){m=V.Mb;break}p=a.seek(b,c,d+1);if(!p){m=V.gd;break}t=0;++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b))}var z,y;if(0>(z=a.read(p,t++))||0>(y=a.read(p,t++))){m=V.Nb;break}if(!k&&(Mb(this.u,td(this.c,f),z|y<<8),mc(this.u))){m=V.ub;break}t>=a.da&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.gc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.V;var p=null,t;a||(m=V.Yc,e=0);for(;e;){var z=Ob(this.u,td(this.c,f));if(mc(this.u)){m=V.ub;break}if(!p){if(b>=a.N){m=V.Mb;break}p=a.seek(b,c,d+1,!0);if(!p){m=V.gd;break}t=0;++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b))}if(k){var y,fa;if(0>(y=a.read(p,t++))||0>(fa=a.read(p,t++))){m=V.Nb;break}if(z!=(y|fa<<8)){m=V.kd;break}}else if(!a.write(p,t++,z&255)||!a.write(p,t++,z>>8)){m=V.Nb;break}t>=a.da&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Rd=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&~U.Ya|f>>16-U.S.Ya&U.Ya;this.l=65536-e&65535;this.g=this.g&~W.xc|d&W.xc;this.f|=a;Kg(this);return!0};function Kg(a){a.a&=~U.tb;a.f&&(a.f|=V.Fd,a.a|=U.tb,a.f&V.qc&&(a.a|=U.qc))}h.jf=function(){return this.v};h.tg=function(){};h.kf=function(){return this.f};h.ug=function(){};h.ff=function(){return this.a&U.wc}; +h.qg=function(a){this.a=this.a&~U.Ta|a&U.Ta;if(this.a&U.Rc){a=!0;var b,c,d=(this.g&W.Ma)>>W.S.Ma,e=this.b[d],f,g,k,l,m,p;this.a&=~(U.wa|U.yc);this.f&=~V.be;switch(c=this.a&U.ra){case Lg.zd:this.f=this.g=0;this.a=U.wa;break;case Lg.Nd:case Lg.Pd:b=this.Gb;case Lg.zc:case Lg.ke:b||(b=this.gc);f=(this.g&W.sb)>>W.S.sb;g=(this.g&W.rc)>>W.S.rc;k=this.g&W.xc;l=65536-this.l&65535;m=(this.a&U.Ya)<<16-U.S.Ya|this.i;p=this.a&U.Ld?0:2;if(f>=e.N){this.f|=V.Mb;break}if(k>=e.O){this.f|=V.Nb;break}a=b.call(this, +e,f,g,k,l,m,p,c>=Lg.zc,this.Rd.bind(this));break;case Lg.Sb:f=(this.g&W.sb)>>W.S.sb;f(p=a.read(k,m++))||0>(t=a.read(k,m++))){g=Y.ya;break}Mb(this.u,td(this.c,f),p|t<<8);if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(m>=a.da&&(k=null,++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.ya;break}}return l?l(g,b,c,d,e,f):g}; +h.gc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.V;k=null;var m;a||(g=Y.ya,e=0);for(;e;){var p=Ob(this.u,td(this.c,f));if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=Y.ya;break}m=0}if(!a.write(k,m++,p&255)||!a.write(k,m++,p>>8)){g=Y.ya;break}if(m>=a.da&&(k=null,++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.ya;break}}return l?l(g,b,c,d,e,f):g}; +h.Wd=function(a,b,c,d,e,f){this.o=f&65535;this.a=this.a&~X.va|f>>16-X.S.va&X.va;this.i=f>>16&Og.vc;this.g=this.f=b<>X.S.va;if(!(this.a&X.wa)){a=!0;var b,c=this.b[(this.a&X.Ma)>>X.S.Ma],d=c.V,e,f,g;this.a&=~X.Xa;switch(this.a&X.ra){case Pg.fe:this.l&Qg.Sc&&(this.a&=X.Xa|X.ra|X.va);this.l=c.status|this.g&Z.Rb|(d&&512==d.N?Qg.Id:0);break;case Pg.Sb:(this.f&Z.Hd)==Z.ce&&(b=this.f&Z.vb,c=(this.f&Z.ee)<<2,this.g=this.f&Z.de?this.g+b:this.g-b,this.f=this.g=this.g&Z.vb|c);break;case Pg.Qd:this.l=this.g;break;case Pg.Od:b=this.Gb;case Pg.je:b||(b=this.gc), +e=this.f>>Z.S.vb,f=this.f&Z.Rb?1:0,g=this.f&Z.ed,!d||e>=d.N||g>=d.O?this.a=this.a|Y.ya|X.tb:(a=65536-this.l&65535,d=(this.i&Og.vc)<<16|this.o,a=b.call(this,c,e,f,g,a,d,2,!1,this.Wd.bind(this)))}a&&(this.a=this.a|X.Xa|X.wa,this.a&X.tc&&oc(this.c,this.jb))}};h.mf=function(){return this.o};h.wg=function(a){this.o=a&Rg.Ta};h.qf=function(){return this.f};h.zg=function(a){this.f=a};h.rf=function(){return this.l};h.Ag=function(a){this.l=a};h.nf=function(){return this.i}; +h.xg=function(a){this.i=a&Og.vc;this.a=this.a&~X.va|(this.i&3)<\nLicense: GPL version 3 or later ");this.Y("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bWg){if(Xg(d,this.s)){this.h=new E(this,"1.32.2",fh);Xg(this.h)&&(ih(this,d),a=jh,kh(this.h));this.h.set(ch,Na());lh(this.h);var e=this.a&&!this.l;if(a==dh||wa("Click OK to restore the previous "+hb+" machine state, or CANCEL to reset the machine.")){if(c=bh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Xg(d,g):("error"==f&&"no machine state"!= +g?(this.G("Error: "+g),"unable to verify user"==g&&(Ua(mh,""),this.b=null)):this.Y(f+": "+g),kh(d),Xg(d)?(c=bh(d),e=!0):c=!1))}e&&$g(this,c?d:null)}else a==jh&&d.clear()}else $g(this);delete this.s;delete this.i}e=xa(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.P=!0;var d=this.m.power;d&&(d.textContent="Shutdown");this.c&&(nh(this,this.c,b,c,a),Kb(this,-2),this.c.ca());this.C&&(ih(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; +function ih(a,b){if(wa("There may be a problem with your "+hb+" machine.\n\nTo help us diagnose it, click OK to send this "+hb+" machine state to http://www.pcjs.org.")){var c=a.K;a=a.b||"";b=b.toString();var d={};d.app=hb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;Oa("http://www.pcjs.org/api/v1/report",d,!0)}} +function oh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new E(a,"1.32.2"),g=new E(a,"1.32.2",ah),k=Na();g.set(ch,k);f.set(ch,k);f.set(ph,"1.32.2");f.set(qh,window?window.location.href:null);f.set(rh,window?window.navigator.userAgent:"");a.c&&a.c.ia&&(c&&(b&&(a.c.j.ca=a.c.j.L),F(a.c)),d=a.c.ia(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.P=!1,!1===d&&(e=null)));for(var k=xa(a.id),l=0;l=d||30<=(c.Lc+=d))&&(e.textContent=c.j.L?c.Oa.toFixed(2)+"Mhz":"Stopped",c.Lc=0)}if(a.g&&(a=a.g,b=b||0,a.l)){c=a.c.j.L;d=!!(a.c.f&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]:0=d||30<=(c.Lc+=d))&&(e.textContent=c.j.L?c.Oa.toFixed(2)+"Mhz":"Stopped",c.Lc=0)}if(a.f&&(a=a.f,b=b||0,a.l)){c=a.c.j.L;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Oa(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);wh(a,b,c)}})}else c(a,null)} -function xh(a,b,c,d){function e(a){if(void 0===k){var b=g&&A(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ia(a))}function f(a){e("Error: "+a);l&&(--th||cb(!0));l=!1}var g,k,l=!0;th++;ua[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?uh(c,null,null,!1,e,function(d,l){l?(ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--th||cb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--th||cb(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?uh(b,a,d,!0,e,m):vh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(z){f(z.message)}return l}window.embedPDP11=function(a,b,c,d){cb(!1);return xh(a,b,c,d)};window.findMachineComponent=function(a,b){return za(b,a+".machine")};window.enableEvents=cb;window.sendEvent=eb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map +h.ka=function(a,b,c){var d=this;switch(b){case "power":return this.m[b]=c,c.onclick=function(){d.g||(d.j.P?oh(d,!1,!0):Zg(d,d.Fb))},!0;case "reset":return this.m[b]=c,c.onclick=function(){if(d.j.P&&!d.g)if(d.a&&!d.o){var a=wa("Click OK to save changes to this "+hb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");oh(d,a,!0);!a&&d.v?window&&window.location.reload():(a||(d.B=!0),d.Fb(Wg),d.B=!1)}else d.reset(),d.c&&d.c.ca()},!0;case "save":if(Ha(Qa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.m[b]= +c,c.onclick=function(){var a=Vg(d,!0);if(a){var b=!!(d.a&&!d.o||d.v),c=oh(d,b);b?sh(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1};function Vg(a,b){var c=a.b;c||((c=Ta(mh),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=uh(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c} +function uh(a,b){a.b=null;b=Oa(Qa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ua(mh,b.data),a.b=b.data)}catch(d){u(d.message+" ("+c+")")}return a.b}function Yg(a){var b=null;a.b&&(b=Qa()+"/api/v1/user?req=load&user="+a.b+"&state="+vh(a,"1.32.2"));return b} +function sh(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=vh(a,"1.32.2");d.data=c;b=Oa(Qa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Oa(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);zh(a,b,c)}})}else c(a,null)} +function Ah(a,b,c,d){function e(a){if(void 0===k){var b=g&&A(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ia(a))}function f(a){e("Error: "+a);l&&(--wh||cb(!0));l=!1}var g,k,l=!0;wh++;ua[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?xh(c,null,null,!1,e,function(d,l){l?(ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--wh||cb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--wh||cb(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?xh(b,a,d,!0,e,m):yh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(z){f(z.message)}return l}window.embedPDP11=function(a,b,c,d){cb(!1);return Ah(a,b,c,d)};window.findMachineComponent=function(a,b){return za(b,a+".machine")};window.enableEvents=cb;window.sendEvent=eb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map From 6854c4c8ba490e7be437453a1a79e6609b301da0 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Sat, 28 Jan 2017 17:50:22 -0800 Subject: [PATCH 13/15] Avoid spurious calls to start/stop the CPU (eg, when the RAM component calls setReset()) if the CPU isn't actually powered yet --- modules/pdp11/lib/cpustate.js | 13 ++- versions/pdpjs/1.32.2/pdp11-dbg.js | 146 ++++++++++++++--------------- versions/pdpjs/1.32.2/pdp11.js | 111 +++++++++++----------- 3 files changed, 138 insertions(+), 132 deletions(-) diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index a2622daf1..2eb6e4599 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -590,7 +590,12 @@ class CPUStatePDP11 extends CPUPDP11 { for (var i = 2; i <= 5; i++) { this.regsGen[i] = 0; } - if (!this.isRunning()) this.startCPU(); + if (!this.flags.powered) { + this.flags.autoStart = true; + } + else if (!this.flags.running) { + this.startCPU(); + } } else { if (this.dbg && this.flags.powered) { @@ -599,9 +604,9 @@ class CPUStatePDP11 extends CPUPDP11 { * when stopCPU() stops a running CPU, the Debugger gets notified, so no need to notify it again. * * TODO: There are more serious problems to deal with if another component is slamming a new PC down - * the CPU's throat (presumably while also dropping some new code into RAM) while the CPU was still running; - * we should probably force a complete reset if the CPU is running, but for now, it's up to the user - * to hit the reset button themselves. + * the CPU's throat (presumably while also dropping some new code into RAM) while the CPU is running; + * we should probably force a complete reset, but for now, it's up to the user to hit the reset button + * themselves. */ if (!this.stopCPU()) { this.dbg.updateStatus(); diff --git a/versions/pdpjs/1.32.2/pdp11-dbg.js b/versions/pdpjs/1.32.2/pdp11-dbg.js index 770375ba3..12860f91b 100644 --- a/versions/pdpjs/1.32.2/pdp11-dbg.js +++ b/versions/pdpjs/1.32.2/pdp11-dbg.js @@ -38,14 +38,14 @@ function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol(" function p(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}for(var ka=ba,la=["Math","log2"],ma=0;ma":62,"?":63,"@":64,nd:65,Fh:66,Ih:67,gi:68,E:69,mi:70,oi:71,Bi:72,Di:73,Ei:74,Fi:75,Gi:76,Ji:77,Li:78,Ni:79,Qi:80,Q:81,Si:82,Ui:83,bj:84,dj:85,fj:86,gj:87,kj:88,lj:89,Xe:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,mj:97,nj:98,qj:99,d:100,e:101,rj:102,sj:103,tj:104,uj:105,yj:106,k:107,zj:108,Aj:109,n:110,Bj:111,p:112,q:113,r:114,Cj:115,t:116,Fj:117,Gj:118,Hj:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,oe:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Cd=b.comment;this.Ue=b;this.exports={};this.H=this.bindings={};a=this.id.indexOf(".");0>a?this.Eb=this.id:(this.pb=this.id.substr(0,a),this.Eb=this.id.substr(a+1));this.A={ready:!1,jb:!1,$c:!1,ca:!1,error:!1};this.yc=null;this.A.error=!1;this.fa=c||0;this.F=this.f=this.C=this.K=this.Qa=null;ua.push(this)}function va(a,b,c){xa[a]&&b&&(xa[a][b]=c)} +"|":124,"}":125,"~":126,oe:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Cd=b.comment;this.Ue=b;this.exports={};this.H=this.bindings={};a=this.id.indexOf(".");0>a?this.Eb=this.id:(this.pb=this.id.substr(0,a),this.Eb=this.id.substr(a+1));this.A={ready:!1,jb:!1,$c:!1,Z:!1,error:!1};this.yc=null;this.A.error=!1;this.fa=c||0;this.F=this.f=this.C=this.K=this.Qa=null;ua.push(this)}function va(a,b,c){xa[a]&&b&&(xa[a][b]=c)} function ya(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function za(a){var b=!1;window&&(b=window.confirm(a));return b}function Aa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;bb?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function fb(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function gb(a,b){var c,d={aa:null,ea:null,xa:null,wa:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.xa=g.load;d.wa=g.exec;if(e=g.bytes)d.aa=e;else if(e=g.words)for(d.aa=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.aa=Array(4*e.length),f=c=0;c>8&255,d.aa[f++]=e[c]>>16&255,d.aa[f++]=e[c]>>24&255;else d.aa=g;d.ea=g.symbols;d.aa.length?1==d.aa.length&&(v(d.aa[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.xa=g.load;d.wa=g.exec;if(e=g.bytes)d.ba=e;else if(e=g.words)for(d.ba=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ba=Array(4*e.length),f=c=0;c>8&255,d.ba[f++]=e[c]>>16&255,d.ba[f++]=e[c]>>24&255;else d.ba=g;d.ea=g.symbols;d.ba.length?1==d.ba.length&&(v(d.ba[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c=a.f.ia?8:16,c=65472<=a.da&&a.da<65472+b,b=c?1:2,c=c?15:a.C.I;a.b[mc]&&a.b[mc][1]||(b=-b);hc(a,a.da&~c|a.da+b&c)} function hc(a,b){a.da=b&a.C.I;if(a.B!==a.da){a.B=a.da;b=a.B;for(var c=0;22>c;c++)Bc(a,"A"+c,b&1<c;c++)Bc(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<a.f.ia)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Na[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&A(this.f,16|e[5])&&D(this.f,e[4]+".readByte("+K(this.f,b)+"): "+K(this.f,c),!0,!d.la),c;d.La(b,16,3);c=255;this.f&&A(this.f,16)&&D(this.f,"warning: unconverted read access to byte @"+K(this.f,b)+": "+K(this.f,c),!0,!d.la);return c} function Tc(a,b,c){var d=!1,e=this.controller,f=e.Na[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Na[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&A(this.f,16|f[5])&&D(this.f,f[4]+".writeByte("+K(this.f,c)+","+K(this.f,b)+")",!0,!e.la):(e.La(c,16,5),this.f&&A(this.f,16)&&D(this.f,"warning: unconverted write access to byte @"+K(this.f,c)+": "+K(this.f, b),!0,!e.la))}function Uc(a,b){var c=-1,d=this.controller;a=d.Na[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&A(this.f,16|a[5])&&D(this.f,a[4]+".readWord("+K(this.f,b)+"): "+K(this.f,c),!0,!d.la),c;d.La(b,16,2);c=65535;this.f&&A(this.f,16)&&D(this.f,"warning: unconverted read access to word @"+K(this.f,b)+": "+K(this.f,c),!0,!d.la);return c} @@ -118,47 +118,47 @@ h.Bg=function(a,b,c){this.f&&null!=this.J&&$d(this.f,this.J+a);this.j?this.Pb(0, h.sg=function(a,b){Kb&&a&1&&this.C.La(b,64,2);a=!Lb&&a&1?this.g[a]|this.g[a+1]<<8:this.G[a>>1];this.f&&A(this.f,32)&&D(this.f,"Memory.readWord("+K(this.f,b)+"): "+K(this.f,a),!0);return a};h.Ag=function(a,b){this.g[a]=b;this.ab=!0};h.Cg=function(a,b,c){this.g[a]=b;this.ab=!0;this.f&&A(this.f,32)&&D(this.f,"Memory.writeByte("+K(this.f,c)+","+K(this.f,b)+")",!0)};h.xh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);this.w.setUint16(a,b,!0);this.ab=!0}; h.zh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);!Lb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.G[a>>1]=b;this.ab=!0;this.f&&A(this.f,32)&&D(this.f,"Memory.writeWord("+K(this.f,c)+","+K(this.f,b)+")",!0)};var Fd=0,hd=1,Gd=2,Yc=4,cd=["NONE","RAM","ROM","VID","H/W"],Ed=0,Md=[],Ld=[J.prototype.tf,J.prototype.Dg,J.prototype.tg,J.prototype.Ah],Xd=[J.prototype.rf,J.prototype.Bg,J.prototype.pg,J.prototype.yh]; if(Gb)var Kd=[J.prototype.qf,J.prototype.Ag,J.prototype.og,J.prototype.xh],Jd=[J.prototype.sf,J.prototype.Cg,J.prototype.sg,J.prototype.zh];var ae;if(Gb){var be=new ArrayBuffer(2);(new DataView(be)).setUint16(0,256,!0);ae=256===(new Uint16Array(be))[0]}else ae=!1;var Id=ae; -function ce(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Kc=0;this.Ic=b;this.hb=c;this.Sc=Math.round(this.Ic/1E4)/100;this.sb=this.Sc*this.hb;this.Tc=this.dc=this.vb=this.Jc=0;this.A.T=this.A.Dc=!1;this.A.ta=a.autoStart;"string"==typeof this.A.ta&&(this.A.ta="true"==this.A.ta);this.A.Fb=!1;this.bc=this.Ib=0;this.cc=+a.csStart;this.Gb=+a.csInterval;this.Jb=+a.csStop;this.ha=[];this.Id=this.xg.bind(this);this.ib=this.Ia=this.gb=this.b=this.ja=this.Ha=this.ac=this.fb=this.Kb= -this.Uc=this.rb=0;this.sa=null;y(this)}p(ce,q);h=ce.prototype;h.za=function(a,b,c,d){this.K=a;this.C=b;this.F=d;this.sa=a.i;for(a=0;a=a.Ib&&(a.Ib+=a.Gb,c=!0);0<=a.Jb&&a.Jb<=ke(a)&&(a.Gb=a.Jb=-1,ge(a),a.Z(),c=!0);c&&a.u(ke(a)+" cycles: checksum="+F(a.bc))}} -h.ua=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.H[b]=c,!0;case "run":return this.H[b]=c,c.onclick=function(){var a;if(a=d.K)if(a=d.K,a.A.ca)a=!0;else{var b=null,c,k=Aa(a.id);for(c=0;c=a.Ib&&(a.Ib+=a.Gb,c=!0);0<=a.Jb&&a.Jb<=ke(a)&&(a.Gb=a.Jb=-1,ge(a),a.aa(),c=!0);c&&a.u(ke(a)+" cycles: checksum="+F(a.bc))}} +h.ua=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.H[b]=c,!0;case "run":return this.H[b]=c,c.onclick=function(){var a;if(a=d.K)if(a=d.K,a.A.Z)a=!0;else{var b=null,c,k=Aa(a.id);for(c=0;ca.rb/a.sb?b=1:d=!0;a.hb=b;b=a.Sc*a.hb;if(a.sb!=b){a.sb=b;b=a.sb.toFixed(2)+"Mhz";var e=a.H.setSpeed;e&&(e.textContent=b);a.u("target speed: "+b)}c&&a.K&&oe(a.K)}uc(a,a.Ia);a.Ia=0;a.Ha=ya();a.fb=0;me(a);return d}function ld(a,b){var c=a.ha.length;a.ha.push([-1,b]);return c}function nd(a,b,c,d){0<=b&&ba.ha[b][0])&&(c=a.Ic*a.hb/1E3*c|0,a.A.T&&(c+=pe(a)),a.ha[b][0]=c)} function qe(a,b){for(var c=a.ha.length-1;0<=c;c--){var d=a.ha[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function re(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function pe(a,b){var c=a.gb-=a.b;a.b=a.ja=0;b&&(a.gb=0);return c} -h.xg=function(){if(this.A.T){this.Jc>=this.Ic&&me(this,!0);this.Kb=0;this.ac=ya();if(this.fb){var a=this.ac-this.fb;a>this.Tc&&(this.Ha+=a,this.Ha>this.ac&&(this.Ha=this.ac))}try{do{var b=qe(this,this.A.Fb?1:this.dc);try{this.pc(b)}catch(e){if("number"!=typeof e)throw e;}b=pe(this,!0);this.Kb+=b;this.Ia+=b;vc(this,b);tc(this,b);this.vb-=b;if(0>=this.vb){this.vb+=this.dc;++this.Uc>=se&&(this.K&&I(this.K,void 0),this.Uc=0);break}}while(this.A.T)}catch(e){this.Z();this.K&&this.K.stop(ya(),ke(this)); +h.xg=function(){if(this.A.T){this.Jc>=this.Ic&&me(this,!0);this.Kb=0;this.ac=ya();if(this.fb){var a=this.ac-this.fb;a>this.Tc&&(this.Ha+=a,this.Ha>this.ac&&(this.Ha=this.ac))}try{do{var b=qe(this,this.A.Fb?1:this.dc);try{this.pc(b)}catch(e){if("number"!=typeof e)throw e;}b=pe(this,!0);this.Kb+=b;this.Ia+=b;vc(this,b);tc(this,b);this.vb-=b;if(0>=this.vb){this.vb+=this.dc;++this.Uc>=se&&(this.K&&I(this.K,void 0),this.Uc=0);break}}while(this.A.T)}catch(e){this.aa();this.K&&this.K.stop(ya(),ke(this)); Ga(this,e.stack||e.message);return}if(this.A.T){a=setTimeout;b=this.Id;this.fb=ya();var c=this.Tc;this.Kb&&(c=Math.round(c*this.Kb/this.dc));var c=c-(this.fb-this.ac),d=this.fb-this.Ha;d&&(this.rb=Math.round(this.Ia/(10*d))/100,864E5<=d&&(this.ib=0,le(this)));if(0>c||this.rbc&&(this.Ha-=c),c=0;this.Jc+=this.Kb;this.fb+=c;a(b,c)}}}; -function rc(a,b){if(!Ha(a))if(a.A.T)a.u(a.toString()+" busy");else{le(a);a.A.T=!0;a.A.Dc=!0;var c=a.H.run;c&&(c.textContent="Halt");a.K&&(b&&oe(a.K,!0),a.K.start(a.Ha,ke(a)));a.F||a.status("Started");setTimeout(a.Id,0)}}h.pc=function(){return 0};h.Z=function(a){var b=!1;if(this.A.T){pe(this);uc(this,this.Ia);this.Ia=0;this.A.T=!1;if(b=this.H.run)b.textContent="Run";this.K&&this.K.stop(ya(),ke(this));b=!0;this.F||this.status("Stopped")}this.A.complete=a;return b};var ne=30,se=15,de=["power","reset"]; +function rc(a,b){if(!Ha(a))if(a.A.T)a.u(a.toString()+" busy");else{le(a);a.A.T=!0;a.A.Dc=!0;var c=a.H.run;c&&(c.textContent="Halt");a.K&&(b&&oe(a.K,!0),a.K.start(a.Ha,ke(a)));a.F||a.status("Started");setTimeout(a.Id,0)}}h.pc=function(){return 0};h.aa=function(a){var b=!1;if(this.A.T){pe(this);uc(this,this.Ia);this.Ia=0;this.A.T=!1;if(b=this.H.run)b.textContent="Run";this.K&&this.K.stop(ya(),ke(this));b=!0;this.F||this.status("Stopped")}this.A.complete=a;return b};var ne=30,se=15,de=["power","reset"]; function te(a){var b=+a.model||1170;ce.call(this,a,6666667);this.ia=b;this.Bd=+a.addrReset||0;this.Za=this.w=this.N=this.D=this.G=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Fa=this.lc=[];this.cb=this.O=this.zd=this.tb=this.ub=this.mb=this.eb=this.P=this.ic=this.$a=this.va=this.U=this.jc=this.kc=this.V=this.i=0;this.Ed=[4,2,0,1];this.mc=0;this.Fd=255;1120>=this.ia?(this.yd=ue.bind(this),this.Db=this.af,this.mc=8,this.Fd=-1,this.Md=255,this.Ld=0):(this.yd=ve.bind(this),this.Db=this.bf, this.Md=~(1792|(1140>=this.ia?2048:0))&65535,this.Ld=1140e.yb&&(e.yb=c,c+=4)}return ce.prototype.Ca.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.ia);this.A.T&&this.Z();this.D=65536;this.G=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Bd,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, -65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.lc=[0,0,0,0,0,0,0,0];this.N=0;this.Za=-1;this.v=this.j=this.Hc=this.X=this.Y=this.i=this.ic=0;pc(this);fe(this);this.A.error=!1;ce.prototype.reset.call(this)};function pc(a){a.U=0;a.jc=0;a.kc=0;a.V=0;a.P=0;a.$a=0;a.va=255;a.tb=0;a.ub=0;a.mb=0;a.eb=262143;a.cb=a.g[7];a.O=0;a.R=null;a.C&&(we(a),a.zd=gd(a.C))} +h.reset=function(){this.status("Model "+this.ia);this.A.T&&this.aa();this.D=65536;this.G=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Bd,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535, +65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.lc=[0,0,0,0,0,0,0,0];this.N=0;this.Za=-1;this.v=this.j=this.Hc=this.X=this.Y=this.i=this.ic=0;pc(this);fe(this);this.A.error=!1;ce.prototype.reset.call(this)};function pc(a){a.U=0;a.jc=0;a.kc=0;a.V=0;a.P=0;a.$a=0;a.va=255;a.tb=0;a.ub=0;a.mb=0;a.eb=262143;a.cb=a.g[7];a.O=0;a.R=null;a.C&&(we(a),a.zd=gd(a.C))} function we(a){a.Xb=a.Lc;a.Yb=a.Mc;a.Ec=a.Nc;a.Zb=a.Qc;a.fc&&(a.Xb=a.Wd,a.Yb=a.ae);a.gc&&(a.Ec=a.fe,a.Zb=a.ge);a.tb?(a.Ga=65536,a.ob=a.V&16?4186112:253952,a.Ea=a.$d,a.na=a.fc?a.rg:a.gd,a.Ab=a.gc?a.Ch:a.md,Zc(a.C,a.V&16?22:18)):(a.Ga=0,a.ob=57344,a.Ea=a.df,a.na=a.fc?a.qg:a.ee,a.Ab=a.gc?a.Bh:a.je,Zc(a.C,16))}function td(a){var b=a.U;b&57344||(b=b&-3199|a.ub<<5|a.mb<<1);return b} function ud(a,b){b&=-3073;if(a.U!=b){b&57344&&!(a.U&57344)&&(a.jc=a.O>>16&65535,a.kc=a.O&65535);a.U=b;a.ub=(b&96)>>5;a.mb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.tb!=c&&(a.tb=c,we(a))}}function wd(a){a.U&57344||(a.jc=a.O>>16&65535);a=a.jc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xd(a){a.U&57344||(a.kc=a.O&65535);return a.kc}function yd(a,b){1170>a.ia&&(b&=-49);a.V!=b&&(a.V=b,a.eb=b&16?4194303:262143,we(a))} -function xe(a,b,c){a.Bd=b;ye(a,b);Bd(a,0);a.C.reset();pc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.T||rc(a)}else a.F&&a.A.ca?a.Z()||(he(a.F),I(a.K,-1)):!1===c&&a.Z();!a.A.T&&a.sa&&a.sa.stop()}h.Xd=function(){return 0}; -h.save=function(){var a=new G(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Fa,this.lc,this.P,this.ic,this.$a,this.va,this.ub,this.mb,this.cb,this.i,this.O,this.Za,this.nc,this.qc]);a.set(1,[Ad(this),td(this),wd(this),xd(this),this.V]);a.set(2,[this.ib,this.hb,this.A.ta]);a.set(3,ze(this));a.set(4,re(this));return a.data()}; +function xe(a,b,c){a.Bd=b;ye(a,b);Bd(a,0);a.C.reset();pc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.Z?a.A.T||rc(a):a.A.qa=!0}else a.F&&a.A.Z?a.aa()||(he(a.F),I(a.K,-1)):!1===c&&a.aa();!a.A.T&&a.ta&&a.ta.stop()}h.Xd=function(){return 0}; +h.save=function(){var a=new G(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Fa,this.lc,this.P,this.ic,this.$a,this.va,this.ub,this.mb,this.cb,this.i,this.O,this.Za,this.nc,this.qc]);a.set(1,[Ad(this),td(this),wd(this),xd(this),this.V]);a.set(2,[this.ib,this.hb,this.A.qa]);a.set(3,ze(this));a.set(4,re(this));return a.data()}; h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Fa=b.next().value;this.lc=b.next().value;this.P=b.next().value;this.ic=b.next().value;this.$a=b.next().value;this.va=b.next().value;this.ub=b.next().value;this.mb=b.next().value;this.cb=b.next().value;this.i=b.next().value;this.O=b.next().value;this.Za=b.next().value;this.nc=b.next().value;this.qc=b.next().value;b=a[1];Bd(this,b[0]);ud(this,b[1]); -this.jc=b[2];this.kc=b[3];yd(this,b[4]);b=a[2];this.ib=b[0];le(this,b[1]);this.A.ta=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function ye(a,b){a.g[7]=b&65535}function od(a,b,c,d){b={yb:b,kb:c,message:d||0,name:Pb[b],next:null};a.$b.push(b);return b}function Fe(a,b){var c=a.R;if(c==b)a.R=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.R&&(a.i|=1)} function md(a,b){if(b){if(b!=a.R){var c=a.R;if(!c||c.kb<=b.kb)b.next=c,a.R=b;else{do{var d=c.next;if(!d||d.kb<=b.kb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&A(a,b.message|8)&&D(a,"setIRQ(vector="+E(b.yb)+",priority="+b.kb+")",!0,!0)}}function sd(a,b){b&&(Fe(a,b),b.message&&A(a,b.message|8)&&D(a,"clearIRQ(vector="+E(b.yb)+",priority="+b.kb+")",!0,!0))}function ze(a){var b=[];for(a=a.R;a;)b.push(a.yb),a=a.next;return b} -function Ge(a){return a.i&64?(a.ra(168,64,-6),!0):a.i&32?(a.ra(4,32,-5),!0):a.i&16?(a.ra(12,16,-7),!0):!1}function Ad(a){return a.w=a.w&63728|De(a)|Ce(a)|Be(a)|Ae(a)}function Bd(a,b){b&=a.Md;a.I=b<<12;a.L=~b&4;a.G=b<<14;a.D=b<<16;if((b^a.w)&a.Ld)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.N=b>>14&3;c=a.w>>14&3;a.N!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.N]);a.w=b;a.i&=-3;a.i|=a.R?2:1}function zd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.$a=b} +function Ge(a){return a.i&64?(a.sa(168,64,-6),!0):a.i&32?(a.sa(4,32,-5),!0):a.i&16?(a.sa(12,16,-7),!0):!1}function Ad(a){return a.w=a.w&63728|De(a)|Ce(a)|Be(a)|Ae(a)}function Bd(a,b){b&=a.Md;a.I=b<<12;a.L=~b&4;a.G=b<<14;a.D=b<<16;if((b^a.w)&a.Ld)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.N=b>>14&3;c=a.w>>14&3;a.N!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.N]);a.w=b;a.i&=-3;a.i|=a.R?2:1}function zd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.$a=b} h.Da=function(a){this.I=this.L=a;this.G=0};h.lb=function(a,b){this.I=this.L=this.D=a;this.G=b||0};function He(a,b){a.I=a.L=a.D=b;a.G=a.I^a.D>>1}function Ie(a,b,c,d){a.I=a.L=a.D=b;a.G=(c^d)&(d^b)} -h.ra=function(a,b,c){if(!this.oa){0>this.Za?this.Za=Ad(this):this.N||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.P|=4,this.g[6]=a=4);if(-1!=c){this.O=a|4143316992;this.N=0;var d=this.na(a|this.Ga),e=this.na(a+2&65535|this.Ga);Bd(this,e&-12289|this.Za>>2&12288);Je(this,this.Za);Je(this,this.g[7]);ye(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Za=-1;this.nc=c;this.qc=a;-1==c&&this.Z();if(-4<=c)throw a;}}; +h.sa=function(a,b,c){if(!this.oa){0>this.Za?this.Za=Ad(this):this.N||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.P|=4,this.g[6]=a=4);if(-1!=c){this.O=a|4143316992;this.N=0;var d=this.na(a|this.Ga),e=this.na(a+2&65535|this.Ga);Bd(this,e&-12289|this.Za>>2&12288);Je(this,this.Za);Je(this,this.g[7]);ye(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Za=-1;this.nc=c;this.qc=a;-1==c&&this.aa();if(-4<=c)throw a;}}; function Ke(a){var b=Le(a),c=Le(a);a.w&49152&&(c=c&-225|a.w&63712);ye(a,b);Bd(a,c);a.i&=-17}function Me(a,b){var c=b>>13&31;31>c&&(b=a.V&32?a.Fa[c]+(b&8191)&4194303:b&-3932161);return b} function Ne(a,b,c){var d=[];if(c){c=Me(a,b);var e=b>>13&31;d.push(c);d.push(e);a.V&32&&(d.push(a.Fa[e]),d.push(b&8191))}else if(a.tb){var e=a.N<<1,f=b>>13;7>13;a.V&a.Ed[a.N]||(d&=7);e=a.B[a.N][d];f=(a.M[a.N][d]<<6)+(b&8191)&a.eb;3932160<=f&&(f=Me(a,f));if(a.oa)return f;f>=a.zd&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.B[a.N][d]=e;if(f!=(4194170&a.eb)||a.N)a.ub=a.N,a.mb=d;g&&(g&57344&&(0<=a.Za&&(g|=128),a.U&57344||(g|=a.U&4096|a.ub<<5|a.mb<<1,ud(a,a.U&-61695|g&61694)),a.ra(168,64,-2)),a.U&61440||!(f<(4191360&a.eb)||f>(4194239&a.eb))||(a.U|=4096,a.U&512&&(a.i|=64)));return f}function Le(a){var b=a.na(a.g[6]|a.Ga);a.g[6]=a.g[6]+2&65535;return b}function Je(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.O=a.O&65535|(a.O&-65536)<<8|16121856;a.i&256||a.Db(4,-2,c);a.Ab(c,b)} -function Oe(a,b,c,d){var e,f,g=d&8?0:a.Ga;switch(b){case 0:return a.ra(4,0,-3),0;case 1:return 6==c&&a.Db(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Db(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Db(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,6==c&&a.Db(d, -0,e),a.b-=6,e|g;case 7:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ga),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.O=a.O&65535|(a.O&-65536)<<8|(f<<3&248|c)<<16;return e}h.af=function(a,b,c){!this.N&&0>=b&&c<=this.va&&(this.i|=32)};h.bf=function(a,b,c){this.N||(65534<=c&&(c|=-65536),a&4&&c<=this.va&&(c<=this.va-32?this.ra(4,0,-4):(this.P|=8,this.i|=32)))};h.Wd=function(a){this.F&&Zd(this.F,a,1);return this.Lc(a)};h.ae=function(a){this.F&&Zd(this.F,a,2);return this.Mc(a)}; +function yc(a,b,c){var d,e,f;if(!(c&a.tb))return f=b&65535,57344<=f&&(f|=a.ob),f;d=b>>13;a.V&a.Ed[a.N]||(d&=7);e=a.B[a.N][d];f=(a.M[a.N][d]<<6)+(b&8191)&a.eb;3932160<=f&&(f=Me(a,f));if(a.oa)return f;f>=a.zd&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.B[a.N][d]=e;if(f!=(4194170&a.eb)||a.N)a.ub=a.N,a.mb=d;g&&(g&57344&&(0<=a.Za&&(g|=128),a.U&57344||(g|=a.U&4096|a.ub<<5|a.mb<<1,ud(a,a.U&-61695|g&61694)),a.sa(168,64,-2)),a.U&61440||!(f<(4191360&a.eb)||f>(4194239&a.eb))||(a.U|=4096,a.U&512&&(a.i|=64)));return f}function Le(a){var b=a.na(a.g[6]|a.Ga);a.g[6]=a.g[6]+2&65535;return b}function Je(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.O=a.O&65535|(a.O&-65536)<<8|16121856;a.i&256||a.Db(4,-2,c);a.Ab(c,b)} +function Oe(a,b,c,d){var e,f,g=d&8?0:a.Ga;switch(b){case 0:return a.sa(4,0,-3),0;case 1:return 6==c&&a.Db(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Db(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Db(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,6==c&&a.Db(d, +0,e),a.b-=6,e|g;case 7:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ga),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.O=a.O&65535|(a.O&-65536)<<8|(f<<3&248|c)<<16;return e}h.af=function(a,b,c){!this.N&&0>=b&&c<=this.va&&(this.i|=32)};h.bf=function(a,b,c){this.N||(65534<=c&&(c|=-65536),a&4&&c<=this.va&&(c<=this.va-32?this.sa(4,0,-4):(this.P|=8,this.i|=32)))};h.Wd=function(a){this.F&&Zd(this.F,a,1);return this.Lc(a)};h.ae=function(a){this.F&&Zd(this.F,a,2);return this.Mc(a)}; h.fe=function(a,b){this.F&&$d(this.F,a,1);this.Nc(a,b)};h.ge=function(a,b){this.F&&$d(this.F,a,2);this.Qc(a,b)};function Ac(a,b){a.oa++;b=a.C.oc(yc(a,b,2));a.oa--;return b}function Pe(a,b){(b?--a.gc:--a.fc)||we(a)}h.df=function(a,b,c){return Oe(this,a,b,c)};h.$d=function(a,b,c){return yc(this,Oe(this,a,b,c),c)};h.ee=function(a){return this.C.oc(this.cb=a)};h.qg=function(a){this.F&&Zd(this.F,a,2);return this.ee(a)};h.gd=function(a){return this.C.oc(this.cb=yc(this,a,2))}; h.rg=function(a){this.F&&Zd(this.F,a,2);return this.gd(a)};h.je=function(a,b){this.C.Sb(this.cb=a,b)};h.Bh=function(a,b){this.F&&$d(this.F,a,2);this.je(a,b)};h.md=function(a,b){this.C.Sb(this.cb=yc(this,a,4),b)};h.Ch=function(a,b){this.F&&$d(this.F,a,2);this.md(a,b)};function Qe(a,b,c){var d=a.j=b&7;(b=a.v=(b&56)>>3)?(d=Oe(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.N=a.w>>12&3,c=a.na(d|c&a.Ga),a.N=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} function Re(a,b,c,d){a.O=a.O&65535|1441792;var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=Oe(a,b,e,4),c&65536||(e&=65535),a.N=a.w>>12&3,e=yc(a,e|c&65536,4),a.N=a.w>>14&3,a.Zb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Se(a,b){b>>=6;var c=a.Y=b&7;return(b=a.X=(b&56)>>3)?a.Xb(a.Ea(b,c,3)):a.g[c+a.mc]&a.Fd}function Te(a,b){var c;b>>=6;var d=a.Y=b&7;(b=a.X=(b&56)>>3)?c=a.Yb(a.Ea(b,d,2)):c=a.g[d+a.mc];return c}function Ue(a,b){var c=a.j=b&7;b=a.v=(b&56)>>3;return Oe(a,b,c,8)} function Ve(a,b){var c=a.j=b&7;return(b=a.v=(b&56)>>3)?a.Xb(a.Ea(b,c,3)):a.g[c]&255}function We(a,b){var c,d=a.j=b&7;(b=a.v=(b&56)>>3)?c=a.Yb(a.Ea(b,d,2)):c=a.g[d];return c}function Xe(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Hc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.Ec(e,d.call(a,c,a.Xb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} function R(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,6),a.Zb(e,d.call(a,0>c?a.g[-c-1]:c,a.Yb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function tf(a,b,c,d,e){var f=a.j=b&7;(b=a.v=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.Ec(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} function uf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Zb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} -h.pc=function(a){this.A.complete=!0;var b=this.F?vf(this.F)?1:this.A.Dc?-1:0:0,c=a?this.A.Dc?0:1:-1;this.A.Dc=!1;this.gb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(wf(this.F,this.g[7],c)){this.Z();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.$a&224)>>5,f=this.R&&this.R.kb>e?this.R:null;f&&(d=f.yb,e=f.kb);e>(this.w&224)>>5?(this.i&8&&(Ee(this,2),this.i&=-9),this.ra(d,0,-10),e=!0):e=!1;e&&(f&&Fe(this,f),a=!0);this.R||this.$a||(this.i&=-3)}else this.i& -1&&this.i++;if(a){if(this.i&4&&wf(this.F,this.g[7],c)){this.Z();break}if(0>c)break}if(this.i&112&&Ge(this)){if(this.i&4&&wf(this.F,this.g[7],c)){this.Z();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.O=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.yd(f)}while(0>5,f=this.R&&this.R.kb>e?this.R:null;f&&(d=f.yb,e=f.kb);e>(this.w&224)>>5?(this.i&8&&(Ee(this,2),this.i&=-9),this.sa(d,0,-10),e=!0):e=!1;e&&(f&&Fe(this,f),a=!0);this.R||this.$a||(this.i&=-3)}else this.i& +1&&this.i++;if(a){if(this.i&4&&wf(this.F,this.g[7],c)){this.aa();break}if(0>c)break}if(this.i&112&&Ge(this)){if(this.i&4&&wf(this.F,this.g[7],c)){this.aa();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.O=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.yd(f)}while(0>1|b<<16;He(this,a);return a&65535}function Cf(a,b){a=b&128|b>>1|b<<8;He(this,a<<8);return a&255}function Df(a,b){a=b&~a;this.Da(a);return a}function Ef(a,b){a=b&~a;this.Da(a<<8);return a} function Ff(a,b){a|=b;this.Da(a);return a}function Gf(a,b){a|=b;this.Da(a<<8);return a}function Hf(a,b){a=~b|65536;this.lb(a);return a&65535}function If(a,b){a=~b|256;this.lb(a<<8);return a&255}function Jf(a,b){this.I=this.L=a=b-a;this.G=b&(b^a);return a&65535}function Kf(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.G=b&(b^c);return a&255}function Lf(a,b){this.I=this.L=a=b+a;this.G=a&(b^a);return a&65535}function Mf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.G=c&(b<<8^c);return a&255} function Nf(a,b){a=-b;this.lb(a,a&b&32768);return a&65535}function Of(a,b){a=-b;this.lb(a<<8,(a&b&128)<<8);return a&255}function Pf(a,b){a=b<<1|this.D>>16&1;He(this,a);return a&65535}function Qf(a,b){a=b<<1|this.D>>16&1;He(this,a<<8);return a&255}function Rf(a,b){a=(this.D&65536|b)>>1|b<<16;He(this,a);return a&65535}function Sf(a,b){a=((this.D&65536)>>8|b)>>1|b<<8;He(this,a<<8);return a&255}function Tf(a,b){var c=b-a;Ie(this,c,a,b);return c&65535} @@ -167,14 +167,14 @@ function Yf(a){var b=We(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760 function Zf(a){var b=We(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.D=this.G=0;b&=63;if(b&32){b=64-b;32>b-1;this.D=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.v?6:7)+b}function $f(a){P(this,a,!Ae(this))}function ag(a){P(this,a,Ae(this))} function bg(a){R(this,a,Te(this,a),Df);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function cg(a){Xe(this,a,Se(this,a),Ef);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function dg(a){R(this,a,Te(this,a),Ff);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function eg(a){Xe(this,a,Se(this,a),Gf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} function fg(a){var b=Te(this,a);a=We(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function gg(a){var b=Se(this,a);a=Ve(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function hg(a){P(this,a,Ce(this))}function ig(a){P(this,a,!De(this)==!Be(this))}function jg(a){P(this,a,!Ce(this)&&!De(this)==!Be(this))}function kg(a){P(this,a,!Ae(this)&&!Ce(this))} -function lg(a){P(this,a,Ce(this)||!De(this)!=!Be(this))}function mg(a){P(this,a,Ae(this)||Ce(this))}function ng(a){P(this,a,!De(this)!=!Be(this))}function og(a){P(this,a,De(this))}function pg(a){P(this,a,!Ce(this))}function qg(a){P(this,a,!De(this))}function rg(){this.ra(12,0,-9)}function sg(a){P(this,a,!0)}function tg(a){P(this,a,!Be(this))}function ug(a){P(this,a,Be(this))}function vg(a){a&1&&(this.D=0);a&2&&(this.G=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} +function lg(a){P(this,a,Ce(this)||!De(this)!=!Be(this))}function mg(a){P(this,a,Ae(this)||Ce(this))}function ng(a){P(this,a,!De(this)!=!Be(this))}function og(a){P(this,a,De(this))}function pg(a){P(this,a,!Ce(this))}function qg(a){P(this,a,!De(this))}function rg(){this.sa(12,0,-9)}function sg(a){P(this,a,!0)}function tg(a){P(this,a,!Be(this))}function ug(a){P(this,a,Be(this))}function vg(a){a&1&&(this.D=0);a&2&&(this.G=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} function wg(a){var b=Te(this,a);a=We(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Ie(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function xg(a){var b=Se(this,a);a=Ve(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Ie(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} -function yg(a){var b=We(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.D=this.G=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.G=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.G=32768,this.D=65536,this.b-=7}function zg(){this.ra(24,0,-9);this.b-=20} -function Ag(){this.w&49152?(this.P|=128,this.ra(4,0,-8)):(this.sa&&1120==this.ia&&this.sa.setData(this.g[0],!0),this.F?Bg(this.F):this.Z());this.b-=7}function Cg(){this.ra(16,0,-9);this.b-=20}var Dg=[0,7,7,10,7,11,9,13];function Eg(a){this.ja=this.b;ye(this,Ue(this,a));this.b=this.ja-Dg[this.v]}var Fg=[0,14,14,17,14,18,16,20];function Gg(a){this.ja=this.b;var b=Ue(this,a);a=a>>6&7;Je(this,this.g[a]);this.g[a]=this.g[7];ye(this,b);this.b=this.ja-Fg[this.v]} +function yg(a){var b=We(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.D=this.G=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.G=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.G=32768,this.D=65536,this.b-=7}function zg(){this.sa(24,0,-9);this.b-=20} +function Ag(){this.w&49152?(this.P|=128,this.sa(4,0,-8)):(this.ta&&1120==this.ia&&this.ta.setData(this.g[0],!0),this.F?Bg(this.F):this.aa());this.b-=7}function Cg(){this.sa(16,0,-9);this.b-=20}var Dg=[0,7,7,10,7,11,9,13];function Eg(a){this.ja=this.b;ye(this,Ue(this,a));this.b=this.ja-Dg[this.v]}var Fg=[0,14,14,17,14,18,16,20];function Gg(a){this.ja=this.b;var b=Ue(this,a);a=a>>6&7;Je(this,this.g[a]);this.g[a]=this.g[7];ye(this,b);this.b=this.ja-Fg[this.v]} var Hg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ig(a){var b=Te(this,a);this.ja=this.b;uf(this,a,b,this.Da);this.b=this.ja-Hg[(this.X?8:0)+this.v]+(7!=this.j||this.v?0:2)}function Jg(a){var b=Se(this,a);tf(this,a,b,65535,this.Da);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Kg=[7,13,13,17,14,18,17,21]; -function Lg(a){var b=We(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.G=0;this.D=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)ye(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Sg(a){R(this,a,Te(this,a),Tf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Tg(a){R(this,a,0,Vf);this.b-=this.v?9:3+(7==this.j?2:0)}function Ug(){this.ra(28,0,-9)} -function Vg(){this.sa&&(this.sa.kd(this.g[7],!0),this.sa.setData(this.g[0],!0));this.i|=8;Ee(this,-2);this.b-=3}function Wg(a){R(this,a,this.g[(a>>6&7)+this.mc],Wf);this.b-=this.v?9:3+(7==this.j?2:0)}function S(a){var b;if(b=this.F)b=this.F,A(b,1)?(D(b,"undefined opcode "+K(b,a),!0,!0),b=Bg(b)):b=!1;b||this.ra(8,0,-9)}function ue(a){Xg[a>>12].call(this,a)}function Yg(a){Zg[a>>6&3].call(this,a)}function $g(a){ah[a>>6&3].call(this,a)}function bh(a){ch[a>>6&3].call(this,a)} +function Lg(a){var b=We(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.G=0;this.D=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)ye(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Sg(a){R(this,a,Te(this,a),Tf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Tg(a){R(this,a,0,Vf);this.b-=this.v?9:3+(7==this.j?2:0)}function Ug(){this.sa(28,0,-9)} +function Vg(){this.ta&&(this.ta.kd(this.g[7],!0),this.ta.setData(this.g[0],!0));this.i|=8;Ee(this,-2);this.b-=3}function Wg(a){R(this,a,this.g[(a>>6&7)+this.mc],Wf);this.b-=this.v?9:3+(7==this.j?2:0)}function S(a){var b;if(b=this.F)b=this.F,A(b,1)?(D(b,"undefined opcode "+K(b,a),!0,!0),b=Bg(b)):b=!1;b||this.sa(8,0,-9)}function ue(a){Xg[a>>12].call(this,a)}function Yg(a){Zg[a>>6&3].call(this,a)}function $g(a){ah[a>>6&3].call(this,a)}function bh(a){ch[a>>6&3].call(this,a)} function dh(a){eh[a&15].call(this,a)}function fh(a){gh[a&15].call(this,a)}function hh(a){ih[a>>6&3].call(this,a)}function jh(a){kh[a>>6&3].call(this,a)}function lh(a){mh[a>>6&3].call(this,a)} var Xg=[function(a){nh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Xf,S,function(a){oh[a>>8&15].call(this,a)},Jg,xg,gg,cg,eg,Sg,S],nh=[function(a){ph[a>>4&15].call(this,a)},sg,pg,hg,ig,ng,jg,lg,Gg,Gg,Yg,$g,bh,S,S,S],Zg=[function(a){uf(this,a,0,this.lb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Hf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,1,Lf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,1,Jf);this.b-=this.v?9:3+(7==this.j?2:0)}],ah=[function(a){R(this,a,0,Nf); this.b-=this.v?11:6},function(a){R(this,a,Ae(this)?1:0,xf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,Ae(this)?1:0,Tf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=We(this,a);this.lb(a);this.b-=this.v?4:3+(7==this.j?2:0)}],ch=[function(a){R(this,a,0,Rf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Pf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Bf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,zf);this.b-=this.v?9:3+(7==this.j?2:0)}],ph= @@ -184,16 +184,16 @@ a);this.lb(a<<8);this.b-=this.v?4:3+(7==this.j?2:0)}],mh=[function(a){Xe(this,a, var rh=[function(a){sh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Xf,function(a){th[a>>8&15].call(this,a)},function(a){uh[a>>8&15].call(this,a)},Jg,xg,gg,cg,eg,Sg,S],sh=[function(a){vh[a>>4&15].call(this,a)},sg,pg,hg,ig,ng,jg,lg,Gg,Gg,Yg,$g,bh,function(a){wh[a>>6&3].call(this,a)},S,S],wh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.na(a|this.Ga);ye(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Qe(this,a,0);this.Da(a);Je(this,a);this.b-=11},function(a){var b=Le(this); this.ja=this.b;this.Da(b);Re(this,a,0,b);this.b=this.ja-Kg[this.v]},function(a){uf(this,a,De(this)?65535:0,this.Da);this.b-=this.v?9:3+(7==this.j?2:0)}],vh=[function(a){xh[a&15].call(this,a)},S,S,S,Eg,Eg,Eg,Eg,Og,function(a){!(a&8)||1145>this.ia?S.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},dh,fh,Tg,Tg,Tg,Tg],xh=[Ag,Vg,function(){Ke(this);this.i|=this.w&16;this.b-=13},rg,Cg,Ng,Pg,function(a){S.call(this,a)},S,S,S,S,S,S,S,S],th=[Lg,Lg,yg,yg,Yf,Yf,Zf,Zf, Wg,Wg,S,S,S,S,Rg,Rg],uh=[qg,og,kg,mg,tg,ug,$f,ag,zg,Ug,hh,jh,lh,function(a){1145>this.ia?S.call(this,a):yh[a>>6&3].call(this,a)},S,S],yh=[function(a){S.call(this,a)},function(a){a=Qe(this,a,65536);this.Da(a);Je(this,a);this.b-=11},function(a){var b=Le(this);this.ja=this.b;this.Da(b);Re(this,a,65536,b);this.b=this.ja-Kg[this.v]},function(a){S.call(this,a)}]; -function zh(a){q.call(this,"ROM",a,128);this.ea=this.g=null;this.v=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Ta(this.j);if(this.j){a=this.j;var b=Ua(this.B);"json"!=b&&"hex"!=b&&(a=hb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;fb(a,null,!0,function(a,b,f){f?(c.S("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(va(c.pb,a,b),(a=gb(a,b))?(c.g=a.aa,c.ea=a.ea):c.j=null);Ah(c)})}}p(zh,q); +function zh(a){q.call(this,"ROM",a,128);this.ea=this.g=null;this.v=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Ta(this.j);if(this.j){a=this.j;var b=Ua(this.B);"json"!=b&&"hex"!=b&&(a=hb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;fb(a,null,!0,function(a,b,f){f?(c.S("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(va(c.pb,a,b),(a=gb(a,b))?(c.g=a.ba,c.ea=a.ea):c.j=null);Ah(c)})}}p(zh,q); h=zh.prototype;h.za=function(a,b,c,d){this.C=b;this.f=c;this.F=d;Ah(this)};h.Ca=function(){this.ea&&(this.F&&Bh(this.F,this.id,this.v,this.b,this.ea),delete this.ea);return!0};h.Ba=function(){return!0}; function Ah(a){if(!Ia(a)){if(a.j){if(!a.g||!a.C)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Ga(a,"ROM size ("+F(a.g.length,8,!0)+") does not match specified size ("+F(a.b,8,!0)+")");else{var b;a:{b=a.v;if(57344<=b&&b<57344+Rc){var c={},c=(c[b]=[zh.prototype.cg,zh.prototype.lh,null,null,null,a.b>>1],c);if(bc(a.C,a,c)){a.status("Added "+a.b+"-byte ROM at "+E(b));b=a.w=!0;break a}}else if(Xc(a.C,b,a.b,Gd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){D(a,"invalid block at offset "+Sa(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,C=r-=6;0=b.length){D(a,"insufficient data for block at offset "+Sa(n),4096); -break}m+=b[l++]&255;if(m&255){D(a,"invalid checksum ("+F(m,2,!0)+") for block at offset "+Sa(n),4096);break}if(C)for(D(a,"loading "+Sa(C)+" bytes at "+Sa(u)+"-"+Sa(u+C),4096);C--;)fd(a.C,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&D(a,"starting address: "+Sa(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Ya("",c)));this.V&&!this.B&&c&&(b=String.fromCharCode(this.V)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.B+=c}}else if(null!=this.w){if(10== a||1024<=this.w.length)this.u(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}nd(this.f,this.X,1E3/Math.round(this.Y/10));this.g&=-129};var Hh="buffer",Kh={},Ih=(Kh[65392]=[null,null,Gh.prototype.Qf,Gh.prototype.Yg,"RCSR"],Kh[65394]=[null,null,Gh.prototype.Pf,Gh.prototype.Xg,"RBUF"],Kh[65396]=[null,null,Gh.prototype.vg,Gh.prototype.Eh,"XCSR"],Kh[65398]=[null,null,Gh.prototype.ug,Gh.prototype.Dh,"XBUF"],Kh); -yb(function(){for(var a=x(document,w,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.H[b]=c,!0;case "readTape":e=Oh;case "loadTape":return e||(e=Ph),this.H[b]=c,c.onclick= function(){var a=d.H.listTapes;a&&Qh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.N){c.parentNode.removeChild(c);break}this.H[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Qh(d,Ta(b,!0),b,Ph,a)}return!1};return!0;case Rh:return this.H[b]=c,!0}return!1}; h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;this.I=Sh(a);var e=this;if(a=Lh(this,ee(this.K,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.G=od(this.f,56,4,4096);this.P=ld(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=Ua(c),f="json"==e||"gz"==e?encodeURI(c):hb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!fb(f,null,!0,function(e,f,g){var k=0>g&&!!a.K&&!a.K.A.ca;g?a.S('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(va(a.pb,e,f),(e=gb(e,f))&&ci(a,b,c,d,e.aa,e.xa, +function Zh(a,b,c,d,e,f){var g=-1;if(a.j.toLowerCase()!=c.toLowerCase()||a.i!=d)g++,ai(a,!0),a.A.jb?a.S("PC11 busy"):(e&&(a.g++,A(a)&&D(a,"auto-loading tape: "+b)),bi(a,b,c,d,f)?g++:a.A.jb=!0);g&&ci(a,a.L,a.j,a.i,a.ba,a.xa,a.wa)} +function bi(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),ci(a,b,c,d,e),a.v=Wh);$h(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=Ua(c),f="json"==e||"gz"==e?encodeURI(c):hb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!fb(f,null,!0,function(e,f,g){var k=0>g&&!!a.K&&!a.K.A.Z;g?a.S('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(va(a.pb,e,f),(e=gb(e,f))&&ci(a,b,c,d,e.ba,e.xa, e.wa));a.A.jb=!1;a.g&&(a.g--,a.g||y(a));$h(a)})}function Vh(a,b,c,d){if((a=a.H.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ba);for(d=0;d>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ca);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ua(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Va(c,"/")&&(d="dir"),f=hb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.dd?"":e)+"&format=json"));return!!fb(f, null,!0,function(b,c,d){ki(a,b,c,d)})} -function ki(a,b,c,d){var e=null,f=0>d&&!!a.K&&!a.K.A.ca;a.j=!1;if(d)a.controller.S('Unable to load disk "'+a.Va+'" (error '+d+": "+b+")",f);else{va(a.controller.pb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.ba=k.length;a.ma=k[0].length;a.ga=k[0][0].length;var l=k[0][0][0];a.ya=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,C=u.length;Cd&&!!a.K&&!a.K.A.Z;a.j=!1;if(d)a.controller.S('Unable to load disk "'+a.Va+'" (error '+d+": "+b+")",f);else{va(a.controller.pb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)v(k[0]);else{a.ca=k.length;a.ma=k[0].length;a.ga=k[0][0].length;var l=k[0][0][0];a.ya=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,C=u.length;C>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ja?f=a.Sa+a.Ja&&(a.Ja+=f-(a.Sa+a.Ja)+1):(a.Sa=f,a.Ja=1);d[f]=d[f]&~(255<g)break;e|=g<g)break;e|=g<=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.S("Unable to restore disk '"+this.Va+": "+c);return b}; h.toJSON=function(){var a;a=0;for(var b;b=mi(this,a++);)oi(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; function oi(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var gi=0;function Ii(a,b,c,d,e,f){q.call(this,a,b,c);this.L=Ki(this,b.autoMount);this.G=0;this.O=d;this.P=e;this.R=f;this.N=d.rd;this.g=Array(this.N);this.M=!mb("Mobi")&&window&&"FileReader"in window;this.v=[];this.Lb=null;this.exports={selectDrive:this.yg}}p(Ii,q); function Ki(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Ii.prototype; h.ua=function(a,b,c){var d=this;switch(b){case "listDisks":return this.H[b]=c,c.onchange=function(){var a=d.H.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v(d.type+" option error: "+k.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.H[b]=c,c.onchange=function(){var a=La(c.value,10);null!=a&& -Li(d,a)},!0;case "loadDisk":return this.H[b]=c,c.onclick=function(){var a=d.H.listDisks;a&&a.options&&Mi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.H[b]=c,c.onclick=function(){var a,b=d.H.listDrives,b=b&&La(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.S("Unable to boot the selected drive"):a.qa?(xe(d.f,0,!0),(a=d.hc(a,0,0,0,512,0,2))&&d.S("Unable to read the boot sector ("+a+")")):d.S("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c); -break}this.H[b]=c;c.onclick=function(){var a=d.H.listDrives;if(a&&a.options&&d.g)if(a=d.g[La(a.value,10)||0])if(a=a.qa){var b;b="";for(var c=0,k;k=mi(a,c++);)for(var l=0,m=k.length;lb||b>=d.g.length||!(a=d.g[b])?d.S("Unable to boot the selected drive"):a.ra?(xe(d.f,0,!0),(a=d.hc(a,0,0,0,512,0,2))&&d.S("Unable to read the boot sector ("+a+")")):d.S("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c); +break}this.H[b]=c;c.onclick=function(){var a=d.H.listDrives;if(a&&a.options&&d.g)if(a=d.g[La(a.value,10)||0])if(a=a.ra){var b;b="";for(var c=0,k;k=mi(a,c++);)for(var l=0,m=k.length;lg||9e||e>=a.g.length)a.S("Unable to load the selected drive");else if(c)if(c==Pi)a.S('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Qi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Ta(c);a.status("Attempting to load "+c+' as "'+b+'"')}Wi(a,e,b,c,!1,d)}else Si(a,e)} function Wi(a,b,c,d,e,f){var g=-1,k=a.g[b];k.Ma.toLowerCase()!=d.toLowerCase()&&(g++,Si(a,b,!0),k.cd?a.S(a.type+" busy"):(k.cd=!0,e&&(k.bd=!0,a.G++,A(a)&&D(a,"auto-loading disk: "+c)),k.Hb=!!f,ji(new fi(a,k,"preload"),c,d,f,a.Vd)&&g++));return g} -h.Vd=function(a,b,c,d,e){a.cd=!1;b&&(b.ba>a.ba||b.ma>a.ma)&&(this.S('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.zc)),b=null);b?(a.qa=b,a.Va=c,a.Ma=d,Xi(this,c,d,b),this.S('Loaded disk "'+c+'" in drive '+(this.type.substr(0,2)+a.zc),a.bd||e),this.K&&oe(this.K)):a.Hb=!1;a.bd&&(a.bd=!1,--this.G||y(this));Li(this,a.zc)}; +h.Vd=function(a,b,c,d,e){a.cd=!1;b&&(b.ca>a.ca||b.ma>a.ma)&&(this.S('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.zc)),b=null);b?(a.ra=b,a.Va=c,a.Ma=d,Xi(this,c,d,b),this.S('Loaded disk "'+c+'" in drive '+(this.type.substr(0,2)+a.zc),a.bd||e),this.K&&oe(this.K)):a.Hb=!1;a.bd&&(a.bd=!1,--this.G||y(this));Li(this,a.zc)}; function Ni(a,b,c,d){if((a=a.H.listDisks)&&a.options){for(var e=0;e=a.ba){m=U.rc;break}n=a.seek(b,c,d+1);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=U.sc;break}if(!k&&(xc(this.C,Me(this.f,f),u|t<<8),kd(this.C))){m=U.Vb;break}r>=a.ya&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Fc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.qa;var n=null,r;a||(m=U.Ad,e=0);for(;e;){var u=zc(this.C,Me(this.f,f));if(kd(this.C)){m=U.Vb;break}if(!n){if(b>=a.ba){m=U.rc;break}n=a.seek(b,c,d+1,!0);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}if(k){var t,C;if(0>(t=a.read(n,r++))||0>(C=a.read(n,r++))){m=U.sc;break}if(u!=(t|C<<8)){m=U.Od;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=U.sc;break}r>=a.ya&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.hc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ra;var n=null,r;a||(m=U.Ad,e=0);for(;e;){if(!n){if(b>=a.ca){m=U.rc;break}n=a.seek(b,c,d+1);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=U.sc;break}if(!k&&(xc(this.C,Me(this.f,f),u|t<<8),kd(this.C))){m=U.Vb;break}r>=a.ya&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Fc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ra;var n=null,r;a||(m=U.Ad,e=0);for(;e;){var u=zc(this.C,Me(this.f,f));if(kd(this.C)){m=U.Vb;break}if(!n){if(b>=a.ca){m=U.rc;break}n=a.seek(b,c,d+1,!0);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}if(k){var t,C;if(0>(t=a.read(n,r++))||0>(C=a.read(n,r++))){m=U.sc;break}if(u!=(t|C<<8)){m=U.Od;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=U.sc;break}r>=a.ya&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; h.De=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&~T.Cb|f>>16-T.ka.Cb&T.Cb;this.B=65536-e&65535;this.j=this.j&~aj.Xc|d&aj.Xc;this.i|=a;bj(this);return!0};function bj(a){a.b&=~T.Ub;a.i&&(a.i|=U.qe,a.b|=T.Ub,a.i&U.Oc&&(a.b|=T.Oc),A(a)&&D(a,a.type+": ERROR: "+E(a.i)))}h.Vf=function(){return this.I};h.dh=function(){};h.Wf=function(){return this.i};h.eh=function(){};h.Sf=function(){return this.b&T.Wc}; h.$g=function(a){this.b=this.b&~T.qb|a&T.qb;if(this.b&T.vd){a=!0;var b,c,d="",e=(this.j&aj.nb)>>aj.ka.nb,f=this.g[e],g,k,l,m,n,r;this.b&=~(T.Xa|T.Yc);this.i&=~U.Oe;switch(c=this.b&T.Pa){case cj.ke:A(this)&&D(this,this.type+": CRESET("+e+")",!0);this.i=this.j=0;this.b=T.Xa;break;case cj.ze:d="RCHK";case cj.Be:d||(d="READ"),b=this.hc;case cj.Zc:d||(d="WCHK");case cj.We:d||(d="WRITE");b||(b=this.Fc);g=(this.j&aj.Tb)>>aj.ka.Tb;k=(this.j&aj.Pc)>>aj.ka.Pc;l=this.j&aj.Xc;m=65536-this.B&65535;n=(this.b&T.Cb)<< -16-T.ka.Cb|this.w;r=this.b&T.xe?0:2;A(this)&&D(this,this.type+": "+d+"("+g+":"+k+":"+l+") "+E(n)+"--"+E(n+(m<<1)),!0,!0);if(g>=f.ba){this.i|=U.rc;break}if(l>=f.ga){this.i|=U.sc;break}a=b.call(this,f,g,k,l,m,n,r,c>=cj.Zc,this.De.bind(this));break;case cj.xc:g=(this.j&aj.Tb)>>aj.ka.Tb;A(this)&&D(this,this.type+": SEEK("+g+")",!0);g=f.ca){this.i|=U.rc;break}if(l>=f.ga){this.i|=U.sc;break}a=b.call(this,f,g,k,l,m,n,r,c>=cj.Zc,this.De.bind(this));break;case cj.xc:g=(this.j&aj.Tb)>>aj.ka.Tb;A(this)&&D(this,this.type+": SEEK("+g+")",!0);g(n=a.read(k,m++))||0>(r=a.read(k,m++))){g=fj.Ya;break}xc(this.C,Me(this.f,f),n|r<<8);if(kd(this.C)){g=fj.Vb;break}f+=2;e--;if(m>=a.ya&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ba)))){g=fj.Ya;break}}return l?l(g,b,c,d,e,f):g}; -h.Fc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.qa;k=null;var m;a||(g=fj.Ya,e=0);for(;e;){var n=zc(this.C,Me(this.f,f));if(kd(this.C)){g=fj.Vb;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=fj.Ya;break}m=0}if(!a.write(k,m++,n&255)||!a.write(k,m++,n>>8)){g=fj.Ya;break}if(m>=a.ya&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ba)))){g=fj.Ya;break}}return l?l(g,b,c,d,e,f):g}; +h.hc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.ra;k=null;var m;a||(g=fj.Ya,e=0);for(;e;){if(!k){k=a.seek(b,c,d+1);if(!k){g=fj.Ya;break}m=0}var n,r;if(0>(n=a.read(k,m++))||0>(r=a.read(k,m++))){g=fj.Ya;break}xc(this.C,Me(this.f,f),n|r<<8);if(kd(this.C)){g=fj.Vb;break}f+=2;e--;if(m>=a.ya&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ca)))){g=fj.Ya;break}}return l?l(g,b,c,d,e,f):g}; +h.Fc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.ra;k=null;var m;a||(g=fj.Ya,e=0);for(;e;){var n=zc(this.C,Me(this.f,f));if(kd(this.C)){g=fj.Vb;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=fj.Ya;break}m=0}if(!a.write(k,m++,n&255)||!a.write(k,m++,n>>8)){g=fj.Ya;break}if(m>=a.ya&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ca)))){g=fj.Ya;break}}return l?l(g,b,c,d,e,f):g}; h.Ie=function(a,b,c,d,e,f){this.D=f&65535;this.b=this.b&~V.Wa|f>>16-V.ka.Wa&V.Wa;this.w=f>>16&gj.Vc;this.j=this.i=b<>V.ka.Wa;if(!(this.b&V.Xa)){a=!0;var b,c="",d=this.g[(this.b&V.nb)>>V.ka.nb],e=d.qa,f,g,k;this.b&=~V.Bb;switch(this.b&V.Pa){case ij.Se:this.B&jj.wd&&(this.b&=V.Bb|V.Pa|V.Wa);this.B=d.status|this.j&hj.wc|(e&&512==e.ba?jj.ue:0);break;case ij.xc:(this.i&hj.te)==hj.Pe&&(b=this.i&hj.Wb,c=(this.i&hj.Re)<<2,this.j=this.i&hj.Qe?this.j+b:this.j-b,this.i=this.j=this.j&hj.Wb|c);break;case ij.Ce:this.B=this.j;break;case ij.Ae:c="READ",b=this.hc; -case ij.Ve:c||(c="WRITE"),b||(b=this.Fc),f=this.i>>hj.ka.Wb,g=this.i&hj.wc?1:0,k=this.i&hj.Hd,!e||f>=e.ba||k>=e.ga?this.b=this.b|fj.Ya|V.Ub:(a=65536-this.B&65535,e=(this.w&gj.Vc)<<16|this.D,A(this)&&D(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+E(e)+"--"+E(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,2,!1,this.Ie.bind(this)))}a&&(this.b=this.b|V.Bb|V.Xa,this.b&V.Rc&&md(this.f,this.Lb))}};h.Yf=function(){return this.D};h.gh=function(a){this.D=a&kj.qb};h.ag=function(){return this.i}; +h.ih=function(a){this.b=this.b&~V.qb|a&V.qb;this.w=this.w&60|(a&V.Wa)>>V.ka.Wa;if(!(this.b&V.Xa)){a=!0;var b,c="",d=this.g[(this.b&V.nb)>>V.ka.nb],e=d.ra,f,g,k;this.b&=~V.Bb;switch(this.b&V.Pa){case ij.Se:this.B&jj.wd&&(this.b&=V.Bb|V.Pa|V.Wa);this.B=d.status|this.j&hj.wc|(e&&512==e.ca?jj.ue:0);break;case ij.xc:(this.i&hj.te)==hj.Pe&&(b=this.i&hj.Wb,c=(this.i&hj.Re)<<2,this.j=this.i&hj.Qe?this.j+b:this.j-b,this.i=this.j=this.j&hj.Wb|c);break;case ij.Ce:this.B=this.j;break;case ij.Ae:c="READ",b=this.hc; +case ij.Ve:c||(c="WRITE"),b||(b=this.Fc),f=this.i>>hj.ka.Wb,g=this.i&hj.wc?1:0,k=this.i&hj.Hd,!e||f>=e.ca||k>=e.ga?this.b=this.b|fj.Ya|V.Ub:(a=65536-this.B&65535,e=(this.w&gj.Vc)<<16|this.D,A(this)&&D(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+E(e)+"--"+E(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,2,!1,this.Ie.bind(this)))}a&&(this.b=this.b|V.Bb|V.Xa,this.b&V.Rc&&md(this.f,this.Lb))}};h.Yf=function(){return this.D};h.gh=function(a){this.D=a&kj.qb};h.ag=function(){return this.i}; h.jh=function(a){this.i=a};h.bg=function(){return this.B};h.kh=function(a){this.B=a};h.Zf=function(){return this.w};h.hh=function(a){this.w=a&gj.Vc;this.b=this.b&~V.Wa|(this.w&3)<>=8;d=F(c,0,!0)+" "+c+". "+E(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.u((null!=b?b+": ":"")+d);return e} function uj(a,b){if(b)return tj(a,b,a.U[b]);var c=0;for(b in a.U)tj(a,b,a.U[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function vj(a){mj.call(this,a);this.Ea=!1;this.ha=!0;this.G=W();this.va=W();this.N=W();this.B=[];this.g=this.L=this.D=[];wj(this);this.P=this.Y=0;this.i=[];this.oa=void 0;xj(this);this.F=this;this.ia={};this.fa=this.Sd=0;this.R=null;this.M=[];yj(this,a.messages);this.sa=a.commands;this.Ha=zj;this.W=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.X=this.ja=0;this.b=this.V=null;var b=this;window?void 0===window[w]&&(window[w]=function(a){return je(b,a)}):void 0===global[w]&&(global[w]= +function vj(a){mj.call(this,a);this.Ea=!1;this.ha=!0;this.G=W();this.va=W();this.N=W();this.B=[];this.g=this.L=this.D=[];wj(this);this.P=this.Y=0;this.i=[];this.oa=void 0;xj(this);this.F=this;this.ia={};this.fa=this.Sd=0;this.R=null;this.M=[];yj(this,a.messages);this.ta=a.commands;this.Ha=zj;this.W=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.X=this.ja=0;this.b=this.V=null;var b=this;window?void 0===window[w]&&(window[w]=function(a){return je(b,a)}):void 0===global[w]&&(global[w]= function(a){return je(b,a)})}p(vj,mj);function Aj(a){a=a&&a.J;null==a&&(a=-1);return a}function W(a,b,c){return{J:void 0===a?null:a,Ka:void 0===b?!1:b,Ra:!1,Aa:c}}h=vj.prototype;h.kd=function(a,b){a.J=b;a.Ra=!1;a.Aa=void 0;return a};function Bj(a){return[a.J,a.Ka,a.Aa,a.Ra,a.Cc]}function Cj(a,b){var c=W(b[0],b[1],b[2]);c.Ra=b[3];b[4]&&(c.Pd=nj(a,c.Cc=b[4]));return c} h.za=function(a,b,c,d){this.C=b;this.K=a;this.f=c;this.b=a.i;(a=ee(a,"messages"))&&yj(this,a);1140>this.f.ia&&(this.W=this.W.concat(Dj));1145>this.f.ia&&(this.W=this.W.concat(Ej));qd(this,16,function(a){a:{var b=d.C.b,c=a[0],e=a=0,l=b.length;if(c){a=Aj(Fj(d,c));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.C.g;l=1}d.u("blockid physical blockaddr used size type");d.u("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.u("..."): (c=n.type,m=cd[c],n&&d.u(F(n.id,8)+" %"+F(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} h.Zd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Lj:b=Ad(this.f);break;case Mj:b=c.$a;break;case Nj:b=c.P;break;case Oj:b=c.va&65280;break;case Pj:b=td(c);break;case Qj:b=wd(c);break;case Rj:b=xd(c);break;case Sj:b=c.V;break;case Tj:d&&(b=d.da);break;case Uj:d&&(b=d.Ta);break;case Vj:d&&Nc(d)&&(b=d.Ua)}}return b}; -h.message=function(a,b){b&&(a+=" @"+Ij(this,W(this.f.O&65535)));if(!this.R||a!=this.R)if(this.R=a,this.fa&1073741824)this.M.push(a);else{var c;if(this.fa&-2147483648&&this.f&&(c=this.f.A.T)||Ja(this,!0))this.Z(),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,pe(a),a.vb=0,a.K&&I(a.K,void 0))}}; +h.message=function(a,b){b&&(a+=" @"+Ij(this,W(this.f.O&65535)));if(!this.R||a!=this.R)if(this.R=a,this.fa&1073741824)this.M.push(a);else{var c;if(this.fa&-2147483648&&this.f&&(c=this.f.A.T)||Ja(this,!0))this.aa(),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,pe(a),a.vb=0,a.K&&I(a.K,void 0))}}; function xj(a){var b;if(!vf(a))a.i&&a.i.length&&a.u("instruction history buffer freed"),a.P=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Wj);for(b=0;b>8;a.u("trapped to "+K(a,c&255,1)+" ("+(0>d?Mb[-d]:K(a,d))+")")}a.G=W(a.f.g[7]);b&&1!=a.I?ak(a):bk(a)}}function Yj(a,b){var c;(c=!a.f||!Ia(a.f))||(c=a.f,c.A.ca?c=!0:(c.u(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.T?(b||a.u("cpu busy or unavailable, command ignored"),!1):!Ha(a.f)}h.Ca=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; +function sc(a,b,c,d){if(!Yj(a))return!1;var e="";null===c&&(e=(c=!a.pa||"tr"==a.pa)?"tr":"t");a.w=0;b||vf(a)&&wf(a,a.f.g[7],0);try{b=qe(a.f,b);var f=a.f.pc(b);0>8;a.u("trapped to "+K(a,c&255,1)+" ("+(0>d?Mb[-d]:K(a,d))+")")}a.G=W(a.f.g[7]);b&&1!=a.I?ak(a):bk(a)}}function Yj(a,b){var c;(c=!a.f||!Ia(a.f))||(c=a.f,c.A.Z?c=!0:(c.u(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.T?(b||a.u("cpu busy or unavailable, command ignored"),!1):!Ha(a.f)}h.Ca=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; h.Ba=function(a,b){b&&this.u(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){xj(this);this.X=0;this.R=null;this.w=0;this.G=W(this.f.g[7]);this.A.T=!1;ck(this);a||he(this)};h.save=function(){var a=new G(this);a.set(0,Bj(this.G));a.set(1,Bj(this.N));a.set(2,[this.j,this.O,this.fa]);a.set(3,this.B);return a.data()}; h.restore=function(a){var b=0;void 0!==a[2]&&(this.G=Cj(this,a[b++]),this.N=Cj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.O=a[b][1],this.fa|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.u("running");this.A.T=!0;this.Fa=a;this.Ga=b}; h.stop=function(a,b){if(this.A.T){this.A.T=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Ac(a.f,b)),65535!=(d&65535)&&(a.kd(a.i[a.P],b),++a.P==a.i.length&&(a.P=0)));return!1}function Bg(a){var b=a.f;if(b.A.T)throw ye(b,a.f.O&65535),a.Z(),-1;return!1}function Zd(a,b,c){dk(a,b,c||1,a.L)&&a.Z(!1)}function $d(a,b,c){dk(a,b,c||1,a.D)&&a.Z(!1)} +function wf(a,b,c){var d=-1;c||(d=Ac(a.f,b))||(a.f.O&65535)!=b||(b=Ee(a.f,2));if(0d&&(d=Ac(a.f,b)),65535!=(d&65535)&&(a.kd(a.i[a.P],b),++a.P==a.i.length&&(a.P=0)));return!1}function Bg(a){var b=a.f;if(b.A.T)throw ye(b,a.f.O&65535),a.aa(),-1;return!1}function Zd(a,b,c){dk(a,b,c||1,a.L)&&a.aa(!1)}function $d(a,b,c){dk(a,b,c||1,a.D)&&a.aa(!1)} function wj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Pe(a.f,!1);a.L=["br"];if(a.D)for(b=1;b>>c.g],!0)):Pe(a.f,!0);a.D=["bw"];a.ja=0;a.Y=0} h.wb=function(a,b,c){var d=!0;c||ek(this,a,b,!1,!0);if(a!=this.g){var e=Aj(b);if(-1===e)this.u("invalid address: "+Ij(this,b)),d=!1;else{var f=a==this.D;65535>>g.g].wb(e&g.i,f)}else e=this.f,(f?e.gc++:e.fc++)||we(e)}}d&&(a.push(b),c?b.Ra=!0:(fk(this,a,a.length-1,"set"),xj(this)));return d}; function ek(a,b,c,d,e){var f=!1;c=Aj(c);for(var g=1;g>>d.g],b)):Pe(a.f,b));k.Ra||xj(a);break}}return f}function gk(a,b){for(var c=1;cqb&&(qb=0);65536ff?String.fromCharCode(ff):"."),Qd=Qd>>8}sb&&(sb+="\n");sb=cf?sb+(tb+","):sb+(Ma+": "+tb+(Pd?"":" "+ef))}sb&&a.u(sb);a.va=ia;a.Aa=dl}}}}break;case "e":if("else"== g[0])break;var Wb,gf,hf,jf,kf=g[0],lf=g[1];"eb"==kf?(Wb=1,gf=255,hf=a.sd,jf=a.td):"e"==kf||"ew"==kf?(Wb=2,gf=65535,hf=a.Oa,jf=a.se):lf=null;if(null==lf)a.u("edit memory commands:"),a.u("\teb [a] [...] edit bytes at address a"),a.u("\tew [a] [...] edit words at address a");else{var Rd=Fj(a,lf);if(Rd)for(var Sd=2;Sdof;){for(var ub=null,hl=256;65536>Ic.J>>>0;){pf.J=a.Oa(Ic,2);if(null==Ic.J||!hl--)break;if(!(pf.J&1)){for(var il=a,Td=pf,Ai=null,Jc=Td.J,Bi=Jc,qf=1;6>=qf&&Jc;qf++){if(2> ";yb(function(){for(var a=x(document,w,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.u("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bIk){if(Jk(d,this.G)){this.v=new G(this,"1.32.2",Sk);Jk(this.v)&&(Tk(this,d),a=Uk,Vk(this.v));this.v.set(Pk,eb());Wk(this.v);var e=this.b&&!this.B;if(a==Qk||za("Click OK to restore the previous "+Hb+" machine state, or CANCEL to reset the machine.")){if(c=Ok(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Jk(d,g):("error"==f&&"no machine state"!= g?(this.S("Error: "+g),"unable to verify user"==g&&(lb(Xk,""),this.g=null)):this.u(f+": "+g),Vk(d),Jk(d)?(c=Ok(d),e=!0):c=!1))}e&&Mk(this,c?d:null)}else a==Uk&&d.clear()}else Mk(this);delete this.G;delete this.w}e=Aa(this.id);for(f=0;fa[1];a=a[2];this.P=!0;this.A.ca=!0;var d=this.H.power;d&&(d.textContent="Shutdown");this.f&&(Yk(this,this.f,b,c,a),I(this,-2),this.f.ta());this.N&&(Tk(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0}; +function Yk(a,b,c,d,e){if(!b.A.Z){b.A.Z=!0;var f=null;try{if(e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,".")))),"string"===typeof f&&(f=null),!b.Ca(f,d)&&f&&(v("Unable to restore state for "+b.type),a.I&&!a.R?(c.clear(),a.b=Ik,window&&window.location.reload()):a.N=!0,b.Ca(null),e=!1),!d&&b.Cd){var g=b.Cd.split("|");for(a=0;aa[1];a=a[2];this.P=!0;this.A.Z=!0;var d=this.H.power;d&&(d.textContent="Shutdown");this.f&&(Yk(this,this.f,b,c,a),I(this,-2),this.f.qa());this.N&&(Tk(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0}; function Tk(a,b){if(za("There may be a problem with your "+Hb+" machine.\n\nTo help us diagnose it, click OK to send this "+Hb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Hb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;fb("http://www.pcjs.org/api/v1/report",d,!0)}} -function Ck(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new G(a,"1.32.2"),g=new G(a,"1.32.2",Nk),k=eb();g.set(Pk,k);f.set(Pk,k);f.set(Zk,"1.32.2");f.set($k,window?window.location.href:null);f.set(cl,window?window.navigator.userAgent:"");a.f&&a.f.Ba&&(c&&(b&&(a.f.A.ta=a.f.A.T),a.f.Z()),d=a.f.Ba(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.ca=!1,!1===d&&(e=null)));for(var k=Aa(a.id),l=0;l=d||30<=(c.Kc+=d))&&(e.textContent=c.A.T?c.rb.toFixed(2)+"Mhz":"Stopped",c.Kc=0)}if(a.i&&(a=a.i,b=b||0,a.v)){c=a.f.A.T;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;eb?a.da=a.f.g[7]:0":62,"?":63,"@":64,Nc:65,Ug:66,Xg:67,wh:68,E:69,Ch:70,Eh:71,Qh:72,Sh:73,Th:74,Uh:75,Vh:76,Yh:77,$h:78,bi:79,ei:80,Q:81,gi:82,ii:83,ri:84,ti:85,vi:86,wi:87,Ai:88,Bi:89,le:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ci:97,Di:98,Gi:99,d:100,e:101,Hi:102,Ii:103,Ji:104,Ki:105,Oi:106,k:107,Pi:108,Qi:109,n:110,Ri:111,p:112,q:113,r:114,Si:115,t:116,Ui:117,Vi:118,Wi:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Dd:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Zc=b.comment;this.he=b;this.exports={};this.m=this.bindings={};a=this.id.indexOf(".");0>a?this.$a=this.id:(this.Na=this.id.substr(0,a),this.$a=this.id.substr(a+1));this.j={ready:!1,Va:!1,Ac:!1,P:!1,error:!1};this.Ub=null;this.j.error=!1;this.Xc=c||0;this.F=this.c=this.u=this.A=this.gb=null;r.push(this)}function ta(a,b,c){ua[a]&&b&&(ua[a][b]=c)} +"|":124,"}":125,"~":126,Dd:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Zc=b.comment;this.he=b;this.exports={};this.m=this.bindings={};a=this.id.indexOf(".");0>a?this.$a=this.id:(this.Na=this.id.substr(0,a),this.$a=this.id.substr(a+1));this.j={ready:!1,Va:!1,Ac:!1,O:!1,error:!1};this.Ub=null;this.j.error=!1;this.Xc=c||0;this.F=this.c=this.u=this.A=this.gb=null;r.push(this)}function ta(a,b,c){ua[a]&&b&&(ua[a][b]=c)} function va(){return Date.now()||+new Date}function u(a){window&&window.alert(a)}function wa(a){var b=!1;window&&(b=window.confirm(a));return b}function xa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b":">",'"':""","'":"'"},Ma={0:"NUL" function Na(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function Oa(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function Pa(a,b){var c,d={M:null,ga:null,ba:null,aa:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ba=g.load;d.aa=g.exec;if(e=g.bytes)d.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ca=g.load;d.ba=g.exec;if(e=g.bytes)d.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;c>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=g;d.ga=g.symbols;d.M.length?1==d.M.length&&(u(d.M[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.Ca=!0};h.Fe=function(a,b){return this.i(a,b)};h.Ff=function(a,b){return this.l(a,b)};h.Sf=function(a,b,c){this.A?this.Jb(0,0,c):this.m(a,b,c)};h.Og=function(a,b,c){this.A?this.Jb(0,0,c):this.F(a,b,c)};h.Ee=function(a){return this.a[a]}; h.Ge=function(a){return this.a[a]};h.Ef=function(a,b){ib&&a&1&&H(this.b,b,64);return this.u.getUint16(a,!0)};h.Hf=function(a,b){ib&&a&1&&H(this.b,b,64);return!jb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Rf=function(a,b){this.a[a]=b;this.Ca=!0};h.Tf=function(a,b){this.a[a]=b;this.Ca=!0};h.Ng=function(a,b,c){ib&&a&1&&H(this.b,c,64);this.u.setUint16(a,b,!0);this.Ca=!0};h.Pg=function(a,b,c){ib&&a&1&&H(this.b,c,64);!jb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.Ca=!0}; var Dc=0,jc=1,Ec=2,$b=4,ec=["NONE","RAM","ROM","VID","H/W"],Cc=0,Lc=[],Jc=[G.prototype.He,G.prototype.Uf,G.prototype.If,G.prototype.Qg],Oc=[G.prototype.Fe,G.prototype.Sf,G.prototype.Ff,G.prototype.Og];if(gb)var Ic=[G.prototype.Ee,G.prototype.Rf,G.prototype.Ef,G.prototype.Ng],Hc=[G.prototype.Ge,G.prototype.Tf,G.prototype.Hf,G.prototype.Pg];var Pc;if(gb){var Qc=new ArrayBuffer(2);(new DataView(Qc)).setUint16(0,256,!0);Pc=256===(new Uint16Array(Qc))[0]}else Pc=!1;var Gc=Pc; -function Rc(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Lc=0;this.ec=b;this.Ra=c;this.nc=Math.round(this.ec/1E4)/100;this.ab=this.nc*this.Ra;this.oc=this.Ab=this.eb=this.fc=0;this.j.L=this.j.Ic=!1;this.j.ca=a.autoStart;"string"==typeof this.j.ca&&(this.j.ca="true"==this.j.ca);this.j.Tb=!1;this.cc=this.cb=0;this.dc=+a.csStart;this.yb=+a.csInterval;this.zb=+a.csStop;this.X=[];this.bd=this.Mf.bind(this);this.Ha=this.Aa=this.Ga=this.a=this.Z=this.za=this.xb=this.Fa=this.fb= -this.pc=this.Oa=0;this.na=null;B(this)}n(Rc,q);h=Rc.prototype;h.ha=function(a,b,c,d){this.A=a;this.u=b;this.F=d;this.na=a.f;for(a=0;a=a.cb&&(a.cb+=a.yb,c=!0);0<=a.zb&&a.zb<=Wc(a)&&(a.yb=a.zb=-1,Vc(a),F(a),c=!0);c&&a.Y(Wc(a)+" cycles: checksum="+Ea(a.cc))}} -h.ka=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.m[b]=c,!0;case "run":return this.m[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.P)a=!0;else{var b=null,c,k=xa(a.id);for(c=0;ca.Oa/a.ab&&(b=1);a.Ra=b;b=a.nc*a.Ra;if(a.ab!=b){a.ab=b;b=a.ab.toFixed(2)+"Mhz";var d=a.m.setSpeed;d&&(d.textContent=b);a.Y("target speed: "+b)}c&&a.A&&$c(a.A)}Ib(a,a.Aa);a.Aa=0;a.za=va();a.Fa=0;Yc(a)}function nc(a,b){var c=a.X.length;a.X.push([-1,b]);return c}function pc(a,b,c,d){0<=b&&ba.X[b][0])&&(c=a.ec*a.Ra/1E3*c|0,a.j.L&&(c+=ad(a)),a.X[b][0]=c)}function bd(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ad(a,b){var c=a.Ga-=a.a;a.a=a.Z=0;b&&(a.Ga=0);return c} +function Rc(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Lc=0;this.ec=b;this.Ra=c;this.nc=Math.round(this.ec/1E4)/100;this.ab=this.nc*this.Ra;this.oc=this.Ab=this.eb=this.fc=0;this.j.L=this.j.Ic=!1;this.j.Y=a.autoStart;"string"==typeof this.j.Y&&(this.j.Y="true"==this.j.Y);this.j.Tb=!1;this.cc=this.cb=0;this.dc=+a.csStart;this.yb=+a.csInterval;this.zb=+a.csStop;this.X=[];this.bd=this.Mf.bind(this);this.Ha=this.Aa=this.Ga=this.a=this.aa=this.za=this.xb=this.Fa=this.fb=this.pc= +this.Oa=0;this.na=null;B(this)}n(Rc,q);h=Rc.prototype;h.ha=function(a,b,c,d){this.A=a;this.u=b;this.F=d;this.na=a.f;for(a=0;a=a.cb&&(a.cb+=a.yb,c=!0);0<=a.zb&&a.zb<=Wc(a)&&(a.yb=a.zb=-1,Vc(a),F(a),c=!0);c&&a.Z(Wc(a)+" cycles: checksum="+Ea(a.cc))}} +h.ka=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.m[b]=c,!0;case "run":return this.m[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.O)a=!0;else{var b=null,c,k=xa(a.id);for(c=0;ca.Oa/a.ab&&(b=1);a.Ra=b;b=a.nc*a.Ra;if(a.ab!=b){a.ab=b;b=a.ab.toFixed(2)+"Mhz";var d=a.m.setSpeed;d&&(d.textContent=b);a.Z("target speed: "+b)}c&&a.A&&$c(a.A)}Ib(a,a.Aa);a.Aa=0;a.za=va();a.Fa=0;Yc(a)}function nc(a,b){var c=a.X.length;a.X.push([-1,b]);return c}function pc(a,b,c,d){0<=b&&ba.X[b][0])&&(c=a.ec*a.Ra/1E3*c|0,a.j.L&&(c+=ad(a)),a.X[b][0]=c)}function bd(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ad(a,b){var c=a.Ga-=a.a;a.a=a.aa=0;b&&(a.Ga=0);return c} h.Mf=function(){if(this.j.L){this.fc>=this.ec&&Yc(this,!0);this.fb=0;this.xb=va();if(this.Fa){var a=this.xb-this.Fa;a>this.oc&&(this.za+=a,this.za>this.xb&&(this.za=this.xb))}try{do{for(var b,c=this.j.Tb?1:this.Ab,d=this.X.length-1;0<=d;d--){var e=this.X[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.kc(b)}catch(f){if("number"!=typeof f)throw f;}b=ad(this,!0);this.fb+=b;this.Aa+=b;Jb(this,b);Hb(this,b);this.eb-=b;if(0>=this.eb){this.eb+=this.Ab;++this.pc>=cd&&(this.A&&Kb(this.A,void 0),this.pc=0);break}}while(this.j.L)}catch(f){F(this); this.A&&this.A.stop(va(),Wc(this));a=f.stack||f.message;this.j.error=!0;this.G(a);return}if(this.j.L){a=setTimeout;b=this.bd;this.Fa=va();c=this.oc;this.fb&&(c=Math.round(c*this.fb/this.Ab));c-=this.Fa-this.xb;if(d=this.Fa-this.za)this.Oa=Math.round(this.Aa/(10*d))/100,864E5<=d&&(this.Ha=0,Xc(this));if(0>c||this.Oac&&(this.za-=c),c=0;this.fc+=this.fb;this.Fa+=c;a(b,c)}}}; -function Gb(a){var b;a.j.error?(a.Y(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.L)a.Y(a.toString()+" busy");else{Xc(a);a.j.L=!0;a.j.Ic=!0;if(b=a.m.run)b.textContent="Halt";a.A&&a.A.start(a.za,Wc(a));a.F||a.status("Started");setTimeout(a.bd,0)}}h.kc=function(){return 0};function F(a){var b=!1;if(a.j.L){ad(a);Ib(a,a.Aa);a.Aa=0;a.j.L=!1;if(b=a.m.run)b.textContent="Run";a.A&&a.A.stop(va(),Wc(a));b=!0;a.F||a.status("Stopped")}a.j.complete=void 0;return b}var Zc=30,cd=15,Sc=["power","reset"]; +function Gb(a){var b;a.j.error?(a.Z(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.L)a.Z(a.toString()+" busy");else{Xc(a);a.j.L=!0;a.j.Ic=!0;if(b=a.m.run)b.textContent="Halt";a.A&&a.A.start(a.za,Wc(a));a.F||a.status("Started");setTimeout(a.bd,0)}}h.kc=function(){return 0};function F(a){var b=!1;if(a.j.L){ad(a);Ib(a,a.Aa);a.Aa=0;a.j.L=!1;if(b=a.m.run)b.textContent="Run";a.A&&a.A.stop(va(),Wc(a));b=!0;a.F||a.status("Stopped")}a.j.complete=void 0;return b}var Zc=30,cd=15,Sc=["power","reset"]; function dd(a){var b=+a.model||1170;Rc.call(this,a,6666667);this.pa=b;this.Wc=+a.addrReset||0;this.Ba=this.i=this.B=this.v=this.l=this.o=this.w=0;this.b=this.sa=this.fa=[];this.H=this.s=this.Ja=this.Eb=[];this.Ea=this.C=this.Vc=this.bb=this.Pa=this.Qa=this.Wa=this.D=this.Bb=this.Sa=this.Ia=this.J=this.Cb=this.Db=this.qa=this.g=0;this.ge=[4,2,0,1];this.hc=0;this.$c=255;1120>=this.pa?(this.Uc=ed.bind(this),this.Za=this.pe,this.hc=8,this.$c=-1,this.fd=255,this.cd=0):(this.Uc=fd.bind(this),this.Za=this.qe, this.fd=~(1792|(1140>=this.pa?2048:0))&65535,this.cd=1140e.Ib&&(e.Ib=c,c+=4)}return Rc.prototype.ja.call(this,a,b)}; h.reset=function(){this.status("Model "+this.pa);this.j.L&&F(this);this.v=65536;this.l=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.Wc,-1,-2,-3,-4,-5,-6,-7,-8];this.sa=[0,0,0,0,0,0];this.fa=[0,0,0,0];this.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535, 65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ja=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Eb=[0,0,0,0,0,0,0,0];this.B=0;this.Ba=-1;this.h=this.f=this.bc=this.K=this.R=this.g=this.Bb=0;Eb(this);Uc(this);this.j.error=!1;Rc.prototype.reset.call(this)};function Eb(a){a.J=0;a.Cb=0;a.Db=0;a.qa=0;a.D=0;a.Sa=0;a.Ia=255;a.bb=0;a.Pa=0;a.Qa=0;a.Wa=262143;a.Ea=a.b[7];a.C=0;a.I=null;a.u&&(gd(a),a.Vc=ic(a.u))} function gd(a){a.Yb=a.Mc;a.Zb=a.ic;a.jc=a.lc;a.$b=a.mc;a.bb?(a.xa=65536,a.Xb=a.qa&16?4186112:253952,a.oa=a.pd,a.W=a.td,a.rb=a.wd,ac(a.u,a.qa&16?22:18)):(a.xa=0,a.Xb=57344,a.oa=a.te,a.W=a.Gf,a.rb=a.Rg,ac(a.u,16))}function uc(a){var b=a.J;b&57344||(b=b&-3199|a.Pa<<5|a.Qa<<1);return b}function vc(a,b){b&=-3073;if(a.J!=b){b&57344&&!(a.J&57344)&&(a.Cb=a.C>>16&65535,a.Db=a.C&65535);a.J=b;a.Pa=(b&96)>>5;a.Qa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.bb!=c&&(a.bb=c,gd(a))}} -function wc(a){a.J&57344||(a.Cb=a.C>>16&65535);a=a.Cb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xc(a){a.J&57344||(a.Db=a.C&65535);return a.Db}function yc(a,b){1170>a.pa&&(b&=-49);a.qa!=b&&(a.qa=b,a.Wa=b&16?4194303:262143,gd(a))}function hd(a,b,c){a.Wc=b;id(a,b);Ac(a,0);a.u.reset();Eb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.L||Gb(a)}else a.F&&a.j.P?F(a)||(a.F.g(),Kb(a.A,-1)):!1===c&&F(a);!a.j.L&&a.na&&a.na.stop()}h.od=function(){return 0}; -h.save=function(){var a=new E(this);a.set(0,[this.b,this.sa,this.fa,this.H,this.s,this.Ja,this.Eb,this.D,this.Bb,this.Sa,this.Ia,this.Pa,this.Qa,this.Ea,this.g,this.C,this.Ba,this.sc,this.uc]);a.set(1,[zc(this),uc(this),wc(this),xc(this),this.qa]);a.set(2,[this.Ha,this.Ra,this.j.ca]);a.set(3,jd(this));a.set(4,bd(this));return a.data()}; +function wc(a){a.J&57344||(a.Cb=a.C>>16&65535);a=a.Cb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xc(a){a.J&57344||(a.Db=a.C&65535);return a.Db}function yc(a,b){1170>a.pa&&(b&=-49);a.qa!=b&&(a.qa=b,a.Wa=b&16?4194303:262143,gd(a))}function hd(a,b,c){a.Wc=b;id(a,b);Ac(a,0);a.u.reset();Eb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.O?a.j.L||Gb(a):a.j.Y=!0}else a.F&&a.j.O?F(a)||(a.F.g(),Kb(a.A,-1)):!1===c&&F(a);!a.j.L&&a.na&&a.na.stop()}h.od=function(){return 0}; +h.save=function(){var a=new E(this);a.set(0,[this.b,this.sa,this.fa,this.H,this.s,this.Ja,this.Eb,this.D,this.Bb,this.Sa,this.Ia,this.Pa,this.Qa,this.Ea,this.g,this.C,this.Ba,this.sc,this.uc]);a.set(1,[zc(this),uc(this),wc(this),xc(this),this.qa]);a.set(2,[this.Ha,this.Ra,this.j.Y]);a.set(3,jd(this));a.set(4,bd(this));return a.data()}; h.restore=function(a){var b=ja(a[0]);this.b=b.next().value;this.sa=b.next().value;this.fa=b.next().value;this.H=b.next().value;this.s=b.next().value;this.Ja=b.next().value;this.Eb=b.next().value;this.D=b.next().value;this.Bb=b.next().value;this.Sa=b.next().value;this.Ia=b.next().value;this.Pa=b.next().value;this.Qa=b.next().value;this.Ea=b.next().value;this.g=b.next().value;this.C=b.next().value;this.Ba=b.next().value;this.sc=b.next().value;this.uc=b.next().value;b=a[1];Ac(this,b[0]);vc(this,b[1]); -this.Cb=b[2];this.Db=b[3];yc(this,b[4]);b=a[2];this.Ha=b[0];Xc(this,b[1]);this.j.ca=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function id(a,b){a.b[7]=b&65535}function qc(a,b,c,d){b={Ib:b,kb:c,message:d||0,name:kb[b],next:null};a.wb.push(b);return b}function tc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.g|=1)}function oc(a,b){if(b){if(b!=a.I){var c=a.I;if(!c||c.kb<=b.kb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.kb<=b.kb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}} function jd(a){var b=[];for(a=a.I;a;)b.push(a.Ib),a=a.next;return b}function nd(a){return a.g&64?(I(a,168,64,-6),!0):a.g&32?(I(a,4,32,-5),!0):a.g&16?(I(a,12,16,-7),!0):!1}function zc(a){return a.i=a.i&63728|ld(a)|(a.o&65535?0:4)|(a.l&32768?2:0)|kd(a)}function Ac(a,b){b&=a.fd;a.w=b<<12;a.o=~b&4;a.l=b<<14;a.v=b<<16;if((b^a.i)&a.cd)for(var c=a.sa.length;0<=--c;){var d=a.b[c];a.b[c]=a.sa[c];a.sa[c]=d}a.B=b>>14&3;c=a.i>>14&3;a.B!=c&&(a.fa[c]=a.b[6],a.b[6]=a.fa[a.B]);a.i=b;a.g&=-3;a.g|=a.I?2:1} h.ea=function(a){this.w=this.o=a;this.l=0};h.La=function(a,b){this.w=this.o=this.v=a;this.l=b||0};function od(a,b){a.w=a.o=a.v=b;a.l=a.w^a.v>>1}function pd(a,b,c,d){a.w=a.o=a.v=b;a.l=(c^d)&(d^b)} @@ -156,30 +156,31 @@ function me(a){var b=yd(this,a);a=Bd(this,a);this.ea((0>b?this.b[-b-1]:b)&a);thi function re(a){N(this,a,!kd(this)&&!!(this.o&65535))}function se(a){N(this,a,(this.o&65535?0:4)||!ld(this)!=!(this.l&32768))}function te(a){N(this,a,kd(this)||(this.o&65535?0:4))}function ue(a){N(this,a,!ld(this)!=!(this.l&32768))}function ve(a){N(this,a,ld(this))}function we(a){N(this,a,!!(this.o&65535))}function xe(a){N(this,a,!ld(this))}function ye(){I(this,12,0,-9)}function ze(a){N(this,a,!0)}function Ae(a){N(this,a,!(this.l&32768))}function Be(a){N(this,a,this.l&32768?2:0)} function Q(a){a&1&&(this.v=0);a&2&&(this.l=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function Ce(a){var b=yd(this,a);a=Bd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;pd(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function De(a){var b=xd(this,a);a=Ad(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);pd(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)} function Ee(a){var b=Bd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.l=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.l=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.l=32768,this.v=65536,this.a-=7}function Fe(){I(this,24,0,-9);this.a-=20} -function Ge(){this.i&49152?(this.D|=128,I(this,4,0,-8)):(this.na&&1120==this.pa&&this.na.setData(this.b[0],!0),this.F?this.F.i():F(this));this.a-=7}function He(){I(this,16,0,-9);this.a-=20}var Ie=[0,7,7,10,7,11,9,13];function Je(a){this.Z=this.a;id(this,zd(this,a));this.a=this.Z-Ie[this.h]}var Ke=[0,14,14,17,14,18,16,20];function Le(a){this.Z=this.a;var b=zd(this,a);a=a>>6&7;qd(this,this.b[a]);this.b[a]=this.b[7];id(this,b);this.a=this.Z-Ke[this.h]}var Me=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function Ne(a){var b=yd(this,a);this.Z=this.a;Dd(this,a,b,this.ea);this.a=this.Z-Me[(this.K?8:0)+this.h]+(7!=this.f||this.h?0:2)}function Oe(a){var b=xd(this,a);Cd(this,a,b,65535,this.ea);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}var Pe=[7,13,13,17,14,18,17,21];function Qe(a){var b=Bd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.l=0;this.v=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)id(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6} -function We(a){P(this,a,yd(this,a),$d);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Xe(a){P(this,a,0,be);this.a-=this.h?9:3+(7==this.f?2:0)}function Ye(){I(this,28,0,-9)}function Ze(){this.na&&(this.na.U=this.b[7],this.na.setData(this.b[0],!0));this.g|=8;md(this,-2);this.a-=3}function $e(a){P(this,a,this.b[(a>>6&7)+this.hc],ce);this.a-=this.h?9:3+(7==this.f?2:0)}function S(){I(this,8,0,-9)}function ed(a){af[a>>12].call(this,a)} -function bf(a){cf[a>>6&3].call(this,a)}function df(a){ef[a>>6&3].call(this,a)}function ff(a){gf[a>>6&3].call(this,a)}function hf(a){jf[a&15].call(this,a)}function kf(a){lf[a&15].call(this,a)}function mf(a){nf[a>>6&3].call(this,a)}function of(a){pf[a>>6&3].call(this,a)}function qf(a){rf[a>>6&3].call(this,a)} +function Ge(){this.i&49152?(this.D|=128,I(this,4,0,-8)):(this.na&&1120==this.pa&&this.na.setData(this.b[0],!0),this.F?this.F.i():F(this));this.a-=7}function He(){I(this,16,0,-9);this.a-=20}var Ie=[0,7,7,10,7,11,9,13];function Je(a){this.aa=this.a;id(this,zd(this,a));this.a=this.aa-Ie[this.h]}var Ke=[0,14,14,17,14,18,16,20];function Le(a){this.aa=this.a;var b=zd(this,a);a=a>>6&7;qd(this,this.b[a]);this.b[a]=this.b[7];id(this,b);this.a=this.aa-Ke[this.h]} +var Me=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ne(a){var b=yd(this,a);this.aa=this.a;Dd(this,a,b,this.ea);this.a=this.aa-Me[(this.K?8:0)+this.h]+(7!=this.f||this.h?0:2)}function Oe(a){var b=xd(this,a);Cd(this,a,b,65535,this.ea);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}var Pe=[7,13,13,17,14,18,17,21]; +function Qe(a){var b=Bd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.l=0;this.v=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)id(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function We(a){P(this,a,yd(this,a),$d);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Xe(a){P(this,a,0,be);this.a-=this.h?9:3+(7==this.f?2:0)}function Ye(){I(this,28,0,-9)} +function Ze(){this.na&&(this.na.U=this.b[7],this.na.setData(this.b[0],!0));this.g|=8;md(this,-2);this.a-=3}function $e(a){P(this,a,this.b[(a>>6&7)+this.hc],ce);this.a-=this.h?9:3+(7==this.f?2:0)}function S(){I(this,8,0,-9)}function ed(a){af[a>>12].call(this,a)}function bf(a){cf[a>>6&3].call(this,a)}function df(a){ef[a>>6&3].call(this,a)}function ff(a){gf[a>>6&3].call(this,a)}function hf(a){jf[a&15].call(this,a)}function kf(a){lf[a&15].call(this,a)}function mf(a){nf[a>>6&3].call(this,a)} +function of(a){pf[a>>6&3].call(this,a)}function qf(a){rf[a>>6&3].call(this,a)} var af=[function(a){sf[a>>8&15].call(this,a)},Ne,Ce,me,ie,ke,de,S,function(a){tf[a>>8&15].call(this,a)},Oe,De,ne,je,le,We,S],sf=[function(a){uf[a>>4&15].call(this,a)},ze,we,oe,pe,ue,qe,se,Le,Le,bf,df,ff,S,S,S],cf=[function(a){Dd(this,a,0,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Od);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Sd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Qd);this.a-=this.h?9:3+(7==this.f?2:0)}],ef=[function(a){P(this,a,0,Ud); this.a-=this.h?11:6},function(a){P(this,a,kd(this)?1:0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,kd(this)?1:0,$d);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=Bd(this,a);this.La(a);this.a-=this.h?4:3+(7==this.f?2:0)}],gf=[function(a){P(this,a,0,Yd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Wd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Gd);this.a-=this.h?9:3+(7==this.f?2:0)}],uf= [function(a){vf[a&15].call(this,a)},S,S,S,Je,Je,Je,Je,Te,S,hf,kf,Xe,Xe,Xe,Xe],vf=[Ge,Ze,Ue,ye,He,Se,S,S,S,S,S,S,S,S,S,S],jf=[Re,function(){this.v=0;this.a-=5},function(){this.l=0;this.a-=5},Q,function(){this.o=1;this.a-=5},Q,Q,Q,function(){this.w=0;this.a-=5},Q,Q,Q,Q,Q,Q,Q],lf=[Re,function(){this.v=65536;this.a-=5},function(){this.l=32768;this.a-=5},R,function(){this.o=0;this.a-=5},R,R,R,function(){this.w=32768;this.a-=5},R,R,R,R,R,R,R],tf=[xe,ve,re,te,Ae,Be,ge,he,Fe,Ye,mf,of,qf,S,S,S],nf=[function(a){Cd(this, a,0,255,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,0,Pd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,1,Td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,1,Rd);this.a-=this.h?9:3+(7==this.f?2:0)}],pf=[function(a){O(this,a,0,Vd);this.a-=this.h?11:6},function(a){O(this,a,kd(this)?1:0,Fd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,kd(this)?1:0,ae);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=Ad(this,a);this.La(a<<8);this.a-=this.h?4:3+ (7==this.f?2:0)}],rf=[function(a){O(this,a,0,Zd);this.a-=this.h?9+(this.bc&1):3+(7==this.f?2:0)},function(a){O(this,a,0,Xd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,0,Jd);this.a-=this.h?9+(this.bc&1):3+(7==this.f?2:0)},function(a){O(this,a,0,Hd);this.a-=this.h?9:3+(7==this.f?2:0)}];function fd(a){wf[a>>12].call(this,a)} var wf=[function(a){xf[a>>8&15].call(this,a)},Ne,Ce,me,ie,ke,de,function(a){yf[a>>8&15].call(this,a)},function(a){zf[a>>8&15].call(this,a)},Oe,De,ne,je,le,We,S],xf=[function(a){Af[a>>4&15].call(this,a)},ze,we,oe,pe,ue,qe,se,Le,Le,bf,df,ff,function(a){Bf[a>>6&3].call(this,a)},S,S],Bf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.xa);id(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=vd(this,a,0);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this); -this.Z=this.a;this.ea(b);wd(this,a,0,b);this.a=this.Z-Pe[this.h]},function(a){Dd(this,a,ld(this)?65535:0,this.ea);this.a-=this.h?9:3+(7==this.f?2:0)}],Af=[function(a){Cf[a&15].call(this,a)},S,S,S,Je,Je,Je,Je,Te,function(a){!(a&8)||1145>this.pa?I(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},hf,kf,Xe,Xe,Xe,Xe],Cf=[Ge,Ze,function(){rd(this);this.g|=this.i&16;this.a-=13},ye,He,Se,Ue,function(){I(this,8,0,-9)},S,S,S,S,S,S,S,S],yf=[Qe,Qe,Ee,Ee,ee,ee,fe,fe,$e, -$e,S,S,S,S,Ve,Ve],zf=[xe,ve,re,te,Ae,Be,ge,he,Fe,Ye,mf,of,qf,function(a){1145>this.pa?I(this,8,0,-9):Df[a>>6&3].call(this,a)},S,S],Df=[function(){I(this,8,0,-9)},function(a){a=vd(this,a,65536);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this);this.Z=this.a;this.ea(b);wd(this,a,65536,b);this.a=this.Z-Pe[this.h]},function(){I(this,8,0,-9)}]; +this.aa=this.a;this.ea(b);wd(this,a,0,b);this.a=this.aa-Pe[this.h]},function(a){Dd(this,a,ld(this)?65535:0,this.ea);this.a-=this.h?9:3+(7==this.f?2:0)}],Af=[function(a){Cf[a&15].call(this,a)},S,S,S,Je,Je,Je,Je,Te,function(a){!(a&8)||1145>this.pa?I(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},hf,kf,Xe,Xe,Xe,Xe],Cf=[Ge,Ze,function(){rd(this);this.g|=this.i&16;this.a-=13},ye,He,Se,Ue,function(){I(this,8,0,-9)},S,S,S,S,S,S,S,S],yf=[Qe,Qe,Ee,Ee,ee,ee,fe,fe, +$e,$e,S,S,S,S,Ve,Ve],zf=[xe,ve,re,te,Ae,Be,ge,he,Fe,Ye,mf,of,qf,function(a){1145>this.pa?I(this,8,0,-9):Df[a>>6&3].call(this,a)},S,S],Df=[function(){I(this,8,0,-9)},function(a){a=vd(this,a,65536);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this);this.aa=this.a;this.ea(b);wd(this,a,65536,b);this.a=this.aa-Pe[this.h]},function(){I(this,8,0,-9)}]; function Ef(a){q.call(this,"ROM",a,128);this.ga=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.l=Fa(this.g);if(this.g){a=this.g;var b=Ga(this.l);"json"!=b&&"hex"!=b&&(a=Qa()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Oa(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ta(c.Na,a,b),(a=Pa(a,b))?(c.b=a.M,c.ga=a.ga):c.g=null);Ff(c)})}}n(Ef,q); h=Ef.prototype;h.ha=function(a,b,c,d){this.u=b;this.c=c;this.F=d;Ff(this)};h.ja=function(){this.ga&&(this.F&&this.F.a(this.id,this.h,this.a,this.ga),delete this.ga);return!0};h.ia=function(){return!0}; function Ff(a){if(!Aa(a)){if(a.g){if(!a.b||!a.u)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+Ea(a.b.length,8,!0)+") does not match specified size ("+Ea(a.a,8,!0)+")";a.j.error=!0;a.G(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Tb){var c={},c=(c[b]=[Ef.prototype.sf,Ef.prototype.Bg,null,null,null,a.a>>1],c);if(qb(a.u,a,c)){a.status("Added "+a.a+"-byte ROM at "+Da(b));b=a.i=!0;break a}}else if(Zb(a.u,b,a.a,Ec)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),z=l,y=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(y)for(;y--;)hc(a.u,t++,b[z++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< b.length;e++)hc(a.u,c+e,b[e]);k=!0}if(k){if(null==d||g)F(a.c),f=!1;null!=d&&hd(a.c,d,f)}return k}Za(function(){for(var a=A(document,x,"ram"),b=0;b=sa.Nc&&c<=sa.le&&(b=c-(sa.Nc-sa.Ad));b&&(a.preventDefault&&a.preventDefault(),d.ac(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==sa.Cd&&(b=sa.Bd);d.ac(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ac(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; @@ -189,30 +190,30 @@ h.ia=function(a){return a?this.save():!0};h.reset=function(){Mf(this)};h.save=fu h.ac=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.R||8,c=a-this.l%a,this.R&&(b=" ".slice(0,c)));this.K&&!this.l&&c&&(b=String.fromCharCode(this.K)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.l+=c}}else if(null!= -this.i){if(10==a||1024<=this.i.length)this.Y(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}pc(this.c,this.X,1E3/Math.round(this.Z/10));this.b&=-129};var Kf="buffer",Nf={},Lf=(Nf[65392]=[null,null,T.prototype.df,T.prototype.og,"RCSR"],Nf[65394]=[null,null,T.prototype.cf,T.prototype.ng,"RBUF"],Nf[65396]=[null,null,T.prototype.Kf,T.prototype.Tg,"XCSR"],Nf[65398]=[null,null,T.prototype.Jf,T.prototype.Sg,"XBUF"],Nf); -Za(function(){for(var a=A(document,x,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.m[b]=c,!0;case "readTape":e=Rf;case "loadTape":return e||(e=Sf),this.m[b]=c,c.onclick= function(){var a=d.m.listTapes;a&&Tf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.C){c.parentNode.removeChild(c);break}this.m[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Tf(d,Fa(b,!0),b,Sf,a)}return!1};return!0;case Uf:return this.m[b]=c,!0}return!1}; h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;this.v=Vf(a);var e=this;if(a=Of(this,Tc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.B[f]=a[f]);this.s=qc(this.c,56,4,4096);this.H=nc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.lc.indexOf("/api/v1/dump")&&(e=Ga(c),f="json"==e||"gz"==e?encodeURI(c):Qa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Oa(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.P;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ta(a.Na,e,f),(e=Pa(e,f))&&fg(a,b,c,d,e.M,e.ba,e.aa)); +function Tf(a,b,c,d,e){if(c)if(c==Zf)a.G('Use "Choose File" and "Mount" to select and load a local tape.');else{if(c==$f){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=Fa(c);a.status("Attempting to load "+c+' as "'+b+'"');a.h=$f}else a.h=c;bg(a,b,c,d,!1,e)}else dg(a,!1)}function bg(a,b,c,d,e,f){var g=-1;if(a.g.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,dg(a,!0),a.j.Va?a.G("PC11 busy"):(e&&a.b++,eg(a,b,c,d,f)?g++:a.j.Va=!0);g&&fg(a,a.w,a.g,a.f,a.M,a.ca,a.ba)} +function eg(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),fg(a,b,c,d,e),a.h=Zf);cg(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=Ga(c),f="json"==e||"gz"==e?encodeURI(c):Qa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Oa(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.O;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ta(a.Na,e,f),(e=Pa(e,f))&&fg(a,b,c,d,e.M,e.ca,e.ba)); a.j.Va=!1;a.b&&(a.b--,a.b||B(a));cg(a)})}function Yf(a,b,c,d){if((a=a.m.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.N);for(d=0;d>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.N);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ga(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ha(c,"/")&&(d="dir"),f=Qa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Dc?"":e)+"&format=json"));return!!Oa(f, null,!0,function(b,c,d){ng(a,b,c,d)})} -function ng(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.P;a.g=!1;if(d)a.controller.G('Unable to load disk "'+a.ua+'" (error '+d+": "+b+")",f);else{ta(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)u(k[0]);else{a.N=k.length;a.T=k[0].length;a.O=k[0][0].length;var l=k[0][0][0];a.da=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var z=l.bytes;if(void 0!==z&&z.length){for(var y=m<<2,fa=z.length;fad&&!!a.A&&!a.A.j.O;a.g=!1;if(d)a.controller.G('Unable to load disk "'+a.ua+'" (error '+d+": "+b+")",f);else{ta(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)u(k[0]);else{a.N=k.length;a.T=k[0].length;a.P=k[0][0].length;var l=k[0][0][0];a.da=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var z=l.bytes;if(void 0!==z&&z.length){for(var y=m<<2,fa=z.length;fa>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.la?f=a.ta+a.la&&(a.la+=f-(a.ta+a.la)+1):(a.ta=f,a.la=1);d[f]=d[f]&~(255<g)break;e|=g<g)break;e|=g<=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.G("Unable to restore disk '"+this.ua+": "+c);return b}; h.toJSON=function(){var a;a=0;for(var b;b=pg(this,a++);)rg(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; @@ -225,7 +226,7 @@ a+"."):(window.open(b),a="Check your browser for a new window/tab containing the h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;if(a=tg(this,Tc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);this.reset();this.jb=qc(this.c,this.D.jd,this.D.ad,this.Xc);qb(b,this,this.I);sb(b,this.reset.bind(this));wg(this,"None",xg,!0);this.B&&wg(this,"Local Disk",yg);wg(this,"Remote Disk",zg);Ag(this)||B(this)}; h.ja=function(a,b){if(!b){if(!a){if(this.reset(),this.A.B){this.h=[];for(a=0;ag||9e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if(c==yg)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==zg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Fa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Fg(a,e,b,c,!1,d)}else Bg(a,e)} @@ -236,40 +237,40 @@ function ug(a,b,c){var d=!1;if(0<=b&&b=a.N){m=V.Mb;break}p=a.seek(b,c,d+1);if(!p){m=V.gd;break}t=0;++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b))}var z,y;if(0>(z=a.read(p,t++))||0>(y=a.read(p,t++))){m=V.Nb;break}if(!k&&(Mb(this.u,td(this.c,f),z|y<<8),mc(this.u))){m=V.ub;break}t>=a.da&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.gc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.V;var p=null,t;a||(m=V.Yc,e=0);for(;e;){var z=Ob(this.u,td(this.c,f));if(mc(this.u)){m=V.ub;break}if(!p){if(b>=a.N){m=V.Mb;break}p=a.seek(b,c,d+1,!0);if(!p){m=V.gd;break}t=0;++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b))}if(k){var y,fa;if(0>(y=a.read(p,t++))||0>(fa=a.read(p,t++))){m=V.Nb;break}if(z!=(y|fa<<8)){m=V.kd;break}}else if(!a.write(p,t++,z&255)||!a.write(p,t++,z>>8)){m=V.Nb;break}t>=a.da&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Gb=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.V;var p=null,t;a||(m=V.Yc,e=0);for(;e;){if(!p){if(b>=a.N){m=V.Mb;break}p=a.seek(b,c,d+1);if(!p){m=V.gd;break}t=0;++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b))}var z,y;if(0>(z=a.read(p,t++))||0>(y=a.read(p,t++))){m=V.Nb;break}if(!k&&(Mb(this.u,td(this.c,f),z|y<<8),mc(this.u))){m=V.ub;break}t>=a.da&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.gc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.V;var p=null,t;a||(m=V.Yc,e=0);for(;e;){var z=Ob(this.u,td(this.c,f));if(mc(this.u)){m=V.ub;break}if(!p){if(b>=a.N){m=V.Mb;break}p=a.seek(b,c,d+1,!0);if(!p){m=V.gd;break}t=0;++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b))}if(k){var y,fa;if(0>(y=a.read(p,t++))||0>(fa=a.read(p,t++))){m=V.Nb;break}if(z!=(y|fa<<8)){m=V.kd;break}}else if(!a.write(p,t++,z&255)||!a.write(p,t++,z>>8)){m=V.Nb;break}t>=a.da&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; h.Rd=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&~U.Ya|f>>16-U.S.Ya&U.Ya;this.l=65536-e&65535;this.g=this.g&~W.xc|d&W.xc;this.f|=a;Kg(this);return!0};function Kg(a){a.a&=~U.tb;a.f&&(a.f|=V.Fd,a.a|=U.tb,a.f&V.qc&&(a.a|=U.qc))}h.jf=function(){return this.v};h.tg=function(){};h.kf=function(){return this.f};h.ug=function(){};h.ff=function(){return this.a&U.wc}; -h.qg=function(a){this.a=this.a&~U.Ta|a&U.Ta;if(this.a&U.Rc){a=!0;var b,c,d=(this.g&W.Ma)>>W.S.Ma,e=this.b[d],f,g,k,l,m,p;this.a&=~(U.wa|U.yc);this.f&=~V.be;switch(c=this.a&U.ra){case Lg.zd:this.f=this.g=0;this.a=U.wa;break;case Lg.Nd:case Lg.Pd:b=this.Gb;case Lg.zc:case Lg.ke:b||(b=this.gc);f=(this.g&W.sb)>>W.S.sb;g=(this.g&W.rc)>>W.S.rc;k=this.g&W.xc;l=65536-this.l&65535;m=(this.a&U.Ya)<<16-U.S.Ya|this.i;p=this.a&U.Ld?0:2;if(f>=e.N){this.f|=V.Mb;break}if(k>=e.O){this.f|=V.Nb;break}a=b.call(this, +h.qg=function(a){this.a=this.a&~U.Ta|a&U.Ta;if(this.a&U.Rc){a=!0;var b,c,d=(this.g&W.Ma)>>W.S.Ma,e=this.b[d],f,g,k,l,m,p;this.a&=~(U.wa|U.yc);this.f&=~V.be;switch(c=this.a&U.ra){case Lg.zd:this.f=this.g=0;this.a=U.wa;break;case Lg.Nd:case Lg.Pd:b=this.Gb;case Lg.zc:case Lg.ke:b||(b=this.gc);f=(this.g&W.sb)>>W.S.sb;g=(this.g&W.rc)>>W.S.rc;k=this.g&W.xc;l=65536-this.l&65535;m=(this.a&U.Ya)<<16-U.S.Ya|this.i;p=this.a&U.Ld?0:2;if(f>=e.N){this.f|=V.Mb;break}if(k>=e.P){this.f|=V.Nb;break}a=b.call(this, e,f,g,k,l,m,p,c>=Lg.zc,this.Rd.bind(this));break;case Lg.Sb:f=(this.g&W.sb)>>W.S.sb;f(p=a.read(k,m++))||0>(t=a.read(k,m++))){g=Y.ya;break}Mb(this.u,td(this.c,f),p|t<<8);if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(m>=a.da&&(k=null,++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.ya;break}}return l?l(g,b,c,d,e,f):g}; -h.gc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.V;k=null;var m;a||(g=Y.ya,e=0);for(;e;){var p=Ob(this.u,td(this.c,f));if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=Y.ya;break}m=0}if(!a.write(k,m++,p&255)||!a.write(k,m++,p>>8)){g=Y.ya;break}if(m>=a.da&&(k=null,++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.ya;break}}return l?l(g,b,c,d,e,f):g}; +h.Gb=function(a,b,c,d,e,f,g,k,l){g=0;a=a.V;k=null;var m;a||(g=Y.ya,e=0);for(;e;){if(!k){k=a.seek(b,c,d+1);if(!k){g=Y.ya;break}m=0}var p,t;if(0>(p=a.read(k,m++))||0>(t=a.read(k,m++))){g=Y.ya;break}Mb(this.u,td(this.c,f),p|t<<8);if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(m>=a.da&&(k=null,++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.ya;break}}return l?l(g,b,c,d,e,f):g}; +h.gc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.V;k=null;var m;a||(g=Y.ya,e=0);for(;e;){var p=Ob(this.u,td(this.c,f));if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=Y.ya;break}m=0}if(!a.write(k,m++,p&255)||!a.write(k,m++,p>>8)){g=Y.ya;break}if(m>=a.da&&(k=null,++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.ya;break}}return l?l(g,b,c,d,e,f):g}; h.Wd=function(a,b,c,d,e,f){this.o=f&65535;this.a=this.a&~X.va|f>>16-X.S.va&X.va;this.i=f>>16&Og.vc;this.g=this.f=b<>X.S.va;if(!(this.a&X.wa)){a=!0;var b,c=this.b[(this.a&X.Ma)>>X.S.Ma],d=c.V,e,f,g;this.a&=~X.Xa;switch(this.a&X.ra){case Pg.fe:this.l&Qg.Sc&&(this.a&=X.Xa|X.ra|X.va);this.l=c.status|this.g&Z.Rb|(d&&512==d.N?Qg.Id:0);break;case Pg.Sb:(this.f&Z.Hd)==Z.ce&&(b=this.f&Z.vb,c=(this.f&Z.ee)<<2,this.g=this.f&Z.de?this.g+b:this.g-b,this.f=this.g=this.g&Z.vb|c);break;case Pg.Qd:this.l=this.g;break;case Pg.Od:b=this.Gb;case Pg.je:b||(b=this.gc), -e=this.f>>Z.S.vb,f=this.f&Z.Rb?1:0,g=this.f&Z.ed,!d||e>=d.N||g>=d.O?this.a=this.a|Y.ya|X.tb:(a=65536-this.l&65535,d=(this.i&Og.vc)<<16|this.o,a=b.call(this,c,e,f,g,a,d,2,!1,this.Wd.bind(this)))}a&&(this.a=this.a|X.Xa|X.wa,this.a&X.tc&&oc(this.c,this.jb))}};h.mf=function(){return this.o};h.wg=function(a){this.o=a&Rg.Ta};h.qf=function(){return this.f};h.zg=function(a){this.f=a};h.rf=function(){return this.l};h.Ag=function(a){this.l=a};h.nf=function(){return this.i}; +e=this.f>>Z.S.vb,f=this.f&Z.Rb?1:0,g=this.f&Z.ed,!d||e>=d.N||g>=d.P?this.a=this.a|Y.ya|X.tb:(a=65536-this.l&65535,d=(this.i&Og.vc)<<16|this.o,a=b.call(this,c,e,f,g,a,d,2,!1,this.Wd.bind(this)))}a&&(this.a=this.a|X.Xa|X.wa,this.a&X.tc&&oc(this.c,this.jb))}};h.mf=function(){return this.o};h.wg=function(a){this.o=a&Rg.Ta};h.qf=function(){return this.f};h.zg=function(a){this.f=a};h.rf=function(){return this.l};h.Ag=function(a){this.l=a};h.nf=function(){return this.i}; h.xg=function(a){this.i=a&Og.vc;this.a=this.a&~X.va|(this.i&3)<\nLicense: GPL version 3 or later ");this.Y("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;b\nLicense: GPL version 3 or later ");this.Z("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bWg){if(Xg(d,this.s)){this.h=new E(this,"1.32.2",fh);Xg(this.h)&&(ih(this,d),a=jh,kh(this.h));this.h.set(ch,Na());lh(this.h);var e=this.a&&!this.l;if(a==dh||wa("Click OK to restore the previous "+hb+" machine state, or CANCEL to reset the machine.")){if(c=bh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Xg(d,g):("error"==f&&"no machine state"!= -g?(this.G("Error: "+g),"unable to verify user"==g&&(Ua(mh,""),this.b=null)):this.Y(f+": "+g),kh(d),Xg(d)?(c=bh(d),e=!0):c=!1))}e&&$g(this,c?d:null)}else a==jh&&d.clear()}else $g(this);delete this.s;delete this.i}e=xa(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.P=!0;var d=this.m.power;d&&(d.textContent="Shutdown");this.c&&(nh(this,this.c,b,c,a),Kb(this,-2),this.c.ca());this.C&&(ih(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; +g?(this.G("Error: "+g),"unable to verify user"==g&&(Ua(mh,""),this.b=null)):this.Z(f+": "+g),kh(d),Xg(d)?(c=bh(d),e=!0):c=!1))}e&&$g(this,c?d:null)}else a==jh&&d.clear()}else $g(this);delete this.s;delete this.i}e=xa(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.O=!0;var d=this.m.power;d&&(d.textContent="Shutdown");this.c&&(nh(this,this.c,b,c,a),Kb(this,-2),this.c.Y());this.C&&(ih(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; function ih(a,b){if(wa("There may be a problem with your "+hb+" machine.\n\nTo help us diagnose it, click OK to send this "+hb+" machine state to http://www.pcjs.org.")){var c=a.K;a=a.b||"";b=b.toString();var d={};d.app=hb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;Oa("http://www.pcjs.org/api/v1/report",d,!0)}} -function oh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new E(a,"1.32.2"),g=new E(a,"1.32.2",ah),k=Na();g.set(ch,k);f.set(ch,k);f.set(ph,"1.32.2");f.set(qh,window?window.location.href:null);f.set(rh,window?window.navigator.userAgent:"");a.c&&a.c.ia&&(c&&(b&&(a.c.j.ca=a.c.j.L),F(a.c)),d=a.c.ia(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.P=!1,!1===d&&(e=null)));for(var k=xa(a.id),l=0;l=d||30<=(c.Lc+=d))&&(e.textContent=c.j.L?c.Oa.toFixed(2)+"Mhz":"Stopped",c.Lc=0)}if(a.f&&(a=a.f,b=b||0,a.l)){c=a.c.j.L;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]:0 Date: Sat, 28 Jan 2017 22:50:52 -0800 Subject: [PATCH 14/15] Add resume property to more machines --- .../machine/vt100/debugger/machine-right.xml | 2 +- .../pc8080/machine/vt100/debugger/machine.xml | 2 +- .../pc8080/machine/vt100/machine-right.xml | 10 +- devices/pc8080/machine/vt100/machine.xml | 10 +- devices/pdp11/machine/1170/vt100/README.md | 6 +- .../machine/1170/vt100/debugger/README.md | 6 +- .../1170/vt100/debugger/machine-left.xml | 2 +- .../pdp11/machine/1170/vt100/machine-left.xml | 2 +- modules/pc8080/lib/video.js | 113 +++++++++++++----- 9 files changed, 103 insertions(+), 50 deletions(-) diff --git a/devices/pc8080/machine/vt100/debugger/machine-right.xml b/devices/pc8080/machine/vt100/debugger/machine-right.xml index da0516814..d531d7fd1 100644 --- a/devices/pc8080/machine/vt100/debugger/machine-right.xml +++ b/devices/pc8080/machine/vt100/debugger/machine-right.xml @@ -2,7 +2,7 @@ VT100 Terminal - + diff --git a/devices/pc8080/machine/vt100/debugger/machine.xml b/devices/pc8080/machine/vt100/debugger/machine.xml index 4afc0c4cf..f9c7c2590 100644 --- a/devices/pc8080/machine/vt100/debugger/machine.xml +++ b/devices/pc8080/machine/vt100/debugger/machine.xml @@ -2,7 +2,7 @@ VT100 Terminal - + diff --git a/devices/pc8080/machine/vt100/machine-right.xml b/devices/pc8080/machine/vt100/machine-right.xml index 400ea5dac..de6b4b084 100644 --- a/devices/pc8080/machine/vt100/machine-right.xml +++ b/devices/pc8080/machine/vt100/machine-right.xml @@ -2,8 +2,7 @@ VT100 Terminal - - + diff --git a/devices/pc8080/machine/vt100/machine.xml b/devices/pc8080/machine/vt100/machine.xml index d146d8406..2e0329328 100644 --- a/devices/pc8080/machine/vt100/machine.xml +++ b/devices/pc8080/machine/vt100/machine.xml @@ -2,8 +2,7 @@ VT100 Terminal - - + diff --git a/devices/pdp11/machine/1170/vt100/README.md b/devices/pdp11/machine/1170/vt100/README.md index 515aea2ed..4836a9797 100644 --- a/devices/pdp11/machine/1170/vt100/README.md +++ b/devices/pdp11/machine/1170/vt100/README.md @@ -13,8 +13,10 @@ machines: connection: serialPort->test1170.dl11 --- -{% include machine.html id="test1170" %} +This VT100 Terminal is connected to the PDP-11/70 below. + +Machine configurations with the [PCjs Debugger](debugger/) are also available. {% include machine.html id="vt100" %} -This PDP-11/70 is also available with our built-in [Debugger](debugger/). +{% include machine.html id="test1170" %} diff --git a/devices/pdp11/machine/1170/vt100/debugger/README.md b/devices/pdp11/machine/1170/vt100/debugger/README.md index 42a98712e..397443bf6 100644 --- a/devices/pdp11/machine/1170/vt100/debugger/README.md +++ b/devices/pdp11/machine/1170/vt100/debugger/README.md @@ -15,6 +15,10 @@ machines: connection: serialPort->test1170.dl11 --- -{% include machine.html id="test1170" %} +This VT100 Terminal is connected to the PDP-11/70 below. + +Both machines include a Debugger. Machine configurations [without Debuggers](../) are also available. {% include machine.html id="vt100" %} + +{% include machine.html id="test1170" %} diff --git a/devices/pdp11/machine/1170/vt100/debugger/machine-left.xml b/devices/pdp11/machine/1170/vt100/debugger/machine-left.xml index 7bb9395d8..022a412b8 100644 --- a/devices/pdp11/machine/1170/vt100/debugger/machine-left.xml +++ b/devices/pdp11/machine/1170/vt100/debugger/machine-left.xml @@ -2,7 +2,7 @@ PDP-11/70 with 256Kb, Front Panel, and Debugger - + diff --git a/devices/pdp11/machine/1170/vt100/machine-left.xml b/devices/pdp11/machine/1170/vt100/machine-left.xml index 193a6af6c..a166a58f1 100644 --- a/devices/pdp11/machine/1170/vt100/machine-left.xml +++ b/devices/pdp11/machine/1170/vt100/machine-left.xml @@ -2,7 +2,7 @@ PDP-11/70 with 256Kb and Front Panel - + diff --git a/modules/pc8080/lib/video.js b/modules/pc8080/lib/video.js index 744182c32..ab40d268c 100644 --- a/modules/pc8080/lib/video.js +++ b/modules/pc8080/lib/video.js @@ -355,6 +355,48 @@ class Video8080 extends Component { return true; } + /** + * setBinding(sHTMLType, sBinding, control, sValue) + * + * @this {Video8080} + * @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) + * @param {string} [sValue] optional data value + * @return {boolean} true if binding was successful, false if unrecognized binding request + */ + setBinding(sHTMLType, sBinding, control, sValue) + { + var video = this; + + /* + * TODO: A more general-purpose binding mechanism would be nice someday.... + */ + if (sHTMLType == "led" || sHTMLType == "rled") { + this.ledBindings[sBinding] = control; + return true; + } + + switch (sBinding) { + case "fullScreen": + this.bindings[sBinding] = control; + if (this.container && this.container.doFullScreen) { + control.onclick = function onClickFullScreen() { + if (DEBUG) video.printMessage("fullScreen()"); + video.doFullScreen(); + }; + } else { + if (DEBUG) this.log("FullScreen API not available"); + control.parentNode.removeChild(/** @type {Node} */ (control)); + } + return true; + + default: + break; + } + return false; + } + /** * initBus(cmp, bus, cpu, dbg) * @@ -581,6 +623,11 @@ class Video8080 extends Component { */ powerUp(data, fRepower) { + if (!fRepower) { + if (data) { + if (!this.restore(data)) return false; + } + } /* * Because the VT100 frame buffer can be located anywhere in RAM (above 0x2000), we must defer this * test code until the powerUp() notification handler is called, when all RAM has (hopefully) been allocated. @@ -653,45 +700,45 @@ class Video8080 extends Component { } /** - * setBinding(sHTMLType, sBinding, control, sValue) + * powerDown(fSave, fShutdown) * * @this {Video8080} - * @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) - * @param {string} [sValue] optional data value - * @return {boolean} true if binding was successful, false if unrecognized binding request + * @param {boolean} [fSave] + * @param {boolean} [fShutdown] + * @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure */ - setBinding(sHTMLType, sBinding, control, sValue) + powerDown(fSave, fShutdown) { - var video = this; + return !fSave || this.save(); + } - /* - * TODO: A more general-purpose binding mechanism would be nice someday.... - */ - if (sHTMLType == "led" || sHTMLType == "rled") { - this.ledBindings[sBinding] = control; - return true; - } + /** + * save() + * + * This implements save support for the Video8080 component. + * + * @this {Video8080} + * @return {Object|null} + */ + save() + { + var state = new State(this); + state.set(0, []); + return state.data(); + } - switch (sBinding) { - case "fullScreen": - this.bindings[sBinding] = control; - if (this.container && this.container.doFullScreen) { - control.onclick = function onClickFullScreen() { - if (DEBUG) video.printMessage("fullScreen()"); - video.doFullScreen(); - }; - } else { - if (DEBUG) this.log("FullScreen API not available"); - control.parentNode.removeChild(/** @type {Node} */ (control)); - } - return true; - - default: - break; - } - return false; + /** + * restore(data) + * + * This implements restore support for the Video8080 component. + * + * @this {Video8080} + * @param {Object} data + * @return {boolean} true if restore successful, false if not + */ + restore(data) + { + return true; } /** From 38dc1d1f42b5a233f2f99d0874b5ab0c1a43b388 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Sat, 28 Jan 2017 23:03:22 -0800 Subject: [PATCH 15/15] Merge branch 'master' into next-release # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit. --- docs/about/README.md | 1 - docs/c1pjs/README.md | 4 +- versions/pc8080/1.32.2/pc8080-dbg.js | 89 ++++++++++++++-------------- versions/pc8080/1.32.2/pc8080.js | 69 ++++++++++----------- 4 files changed, 82 insertions(+), 81 deletions(-) diff --git a/docs/about/README.md b/docs/about/README.md index 0fb1fb8ba..e3f9da38e 100644 --- a/docs/about/README.md +++ b/docs/about/README.md @@ -25,7 +25,6 @@ capabilities can be found in the [Documentation](/docs/). The first PCjs simulation was [C1Pjs](/docs/c1pjs/), which emulates the Challenger 1P, a 6502-based microcomputer introduced by Ohio Scientific in 1978. - C1Pjs v1.0 was released in July 2012. More information about the first release of C1Pjs was [posted](http://osiweb.org/osiforum/viewtopic.php?f=3&t=103) on the [OSI Discussion Forum](http://osiweb.org/osiforum/index.php) at [osiweb.org](http://osiweb.org/). diff --git a/docs/c1pjs/README.md b/docs/c1pjs/README.md index eaedd4fc4..5eb21c2bc 100644 --- a/docs/c1pjs/README.md +++ b/docs/c1pjs/README.md @@ -15,8 +15,8 @@ C1Pjs Documentation --- C1Pjs is a JavaScript simulation of the Challenger 1P, an 8-bit 6502-based microcomputer -manufactured by Ohio Scientific in 1978. The base configuration included 4Kb of RAM and an -8Kb BASIC-in-ROM from Microsoft. Below is a simulation of the 8Kb model. +manufactured by Ohio Scientific in 1978. The base configuration included an 8Kb BASIC-in-ROM from Microsoft +and 4Kb of RAM (user-expandable to 8Kb). Below is a simulation of the 8Kb RAM configuration. After you've read the Documentation, check out our other [C1P Machine Configurations](/devices/c1p/machine/), learn how [Customize and Embed](embed/) your own machines, read the [Source Code](/modules/c1pjs/), and diff --git a/versions/pc8080/1.32.2/pc8080-dbg.js b/versions/pc8080/1.32.2/pc8080-dbg.js index ae5043974..e84fabf75 100644 --- a/versions/pc8080/1.32.2/pc8080-dbg.js +++ b/versions/pc8080/1.32.2/pc8080-dbg.js @@ -39,7 +39,7 @@ function oa(a,b){b=pa(b.parentNode,"pc8080-control");for(var c=0;c>1)+2;10>this.g&&(this.g=10);15>2;this.j=this.w-1;this.L=this.N/this.w|0;this.I=this.L-1;this.A=[];this.B=[];this.D=this.F=!1;this.R=[];this.T=[];a=new z;yb(a,this.K);this.b=Array(this.L);for(b=0;b>>a.g;0f&&(p=f);if(h&&h.size){if(h.type==d){if(e+f<=h.J)return h.mb+=h.J-e,h.J=e,!0;if(e>=h.J+h.mb){p=h.size-(e-l);p>f&&(p=f);h.mb=e-h.J+p;e=l+a.w;f-=p;g++;continue}}return Ab(Bb,e,f)}e=new z(e,p,a.w,d);yb(e,a.K,h);a.b[g++]=e;e=l+a.w;f-=p}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+Cb[d]+" at "+y(b)),!0):Ab(Db,b,c)} +xb.prototype.va=function(a,b){b||this.reset();return!0};function zb(a,b,c,d){for(var e=b,f=c,g=e>>>a.g;0f&&(p=f);if(h&&h.size){if(h.type==d){if(e+f<=h.J)return h.mb+=h.J-e,h.J=e,!0;if(e>=h.J+h.mb){p=h.size-(e-l);p>f&&(p=f);h.mb=e-h.J+p;e=l+a.w;f-=p;g++;continue}}return Ab(Bb,e,f)}e=new z(e,p,a.w,d);yb(e,a.K,h);a.b[g++]=e;e=l+a.w;f-=p}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+Cb[d]+" at "+y(b)),!0):Ab(Db,b,c)} function Eb(a,b){return a.b[(b&a.C)>>>a.g].lb(b&a.j,b)}function Fb(a,b){var c=b&a.j,d=(b&a.C)>>>a.g;return c!=a.j?a.b[d].kc(c,b):a.b[d++].Xa(c,b)|a.b[d&a.I].Xa(0,b+1)<<8}function Gb(a,b){var c=b&a.j,d=(b&a.C)>>>a.g;return c!=a.j?a.b[d].Jb(c,b):a.b[d++].lb(c,b)|a.b[d&a.I].lb(0,b+1)<<8}function Hb(a,b,c){a.b[(b&a.C)>>>a.g].nb(b&a.j,c&255,b)}function Ib(a,b,c){var d=b&a.j,e=(b&a.C)>>>a.g;d!=a.j?a.b[e].nc(d,c&65535,b):(a.b[e++].Ya(d,c&255,b),a.b[e&a.I].Ya(0,c>>8&255,b+1))} -function Jb(a){for(var b=0,c=[],d=0;d>>=f)&l;if(void 0!==g){if(g[0])g[0](b,l,d);a.K&&a.F!=g[1]&&Tb(a.K,b,l)}else a.K&&(za(a.K,a,b,l,d),a.F&&Tb(a.K,b,l));f+=h<<3;b+=h;e-=h}}function Ab(a,b,c){q("Memory block error ("+a+": "+x(b)+","+x(c)+")");return!1}var Bb=1,Db=2,Ub;if(qb){var Vb=new ArrayBuffer(2);(new DataView(Vb)).setUint16(0,256,!0);Ub=256===(new Uint16Array(Vb))[0]}else Ub=!1;var Wb=Ub; -function z(a,b,c,d){this.id=Xb+=2;this.b=null;this.J=a;this.mb=b;this.size=c||0;this.type=d||Yb;this.u=d==Zb;yb(this);this.Ca=this.gc=!1;if(c)if(qb)this.j=new ArrayBuffer(c),this.w=new DataView(this.j,0,c),this.g=new Uint8Array(this.j,0,c),this.A=new Uint16Array(this.j,0,c>>1),this.b=new Int32Array(this.j,0,c>>2),$b(this,Wb?ac:bc);else{this.b=Array(c>>2);for(a=0;a>1),this.b=new Int32Array(this.j,0,c>>2),$b(this,Wb?ac:bc);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)};k.Xd=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};k.ae=function(a){var b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8};k.fe=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Ca=!0};k.Vd=function(a,b){if(this.K&&null!=this.J){var c=this.K;sc(c,this.J+a,1,c.I)&&c.da(!0)}return this.lb(a,b)};k.Zd=function(a,b){if(this.K&&null!=this.J){var c=this.K;sc(c,this.J+a,2,c.I)&&c.da(!0)}return this.Jb(a,b)}; k.de=function(a,b,c){if(this.K&&null!=this.J){var d=this.K;sc(d,this.J+a,1,d.w)&&d.da(!0)}this.u?this.ob(0,b):this.nb(a,b,c)};k.he=function(a,b,c){if(this.K&&null!=this.J){var d=this.K;sc(d,this.J+a,2,d.w)&&d.da(!0)}this.u?this.ob(0,b):this.Ob(a,b,c)};k.Ud=function(a){return this.g[a]};k.Wd=function(a){return this.g[a]};k.Yd=function(a){return this.w.getUint16(a,!0)};k.$d=function(a){return a&1?this.g[a]|this.g[a+1]<<8:this.A[a>>1]};k.ce=function(a,b){this.g[a]=b;this.Ca=!0}; -k.ee=function(a,b){this.g[a]=b;this.Ca=!0};k.ge=function(a,b){this.w.setUint16(a,b,!0);this.Ca=!0};k.ie=function(a,b){a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.A[a>>1]=b;this.Ca=!0};var Yb=0,Zb=2,Cb=["NONE","RAM","ROM","VID","H/W"],Xb=0,ec=[],cc=[z.prototype.Xd,z.prototype.fe,z.prototype.ae,z.prototype.je],hc=[z.prototype.Vd,z.prototype.de,z.prototype.Zd,z.prototype.he];if(qb)var bc=[z.prototype.Ud,z.prototype.ce,z.prototype.Yd,z.prototype.ge],ac=[z.prototype.Wd,z.prototype.ee,z.prototype.$d,z.prototype.ie]; +k.ee=function(a,b){this.g[a]=b;this.Ca=!0};k.ge=function(a,b){this.w.setUint16(a,b,!0);this.Ca=!0};k.ie=function(a,b){a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.A[a>>1]=b;this.Ca=!0};var Yb=0,Zb=2,Cb=["NONE","RAM","ROM","VID","H/W"],Xb=0,ec=[],dc=[z.prototype.Xd,z.prototype.fe,z.prototype.ae,z.prototype.je],qc=[z.prototype.Vd,z.prototype.de,z.prototype.Zd,z.prototype.he];if(qb)var bc=[z.prototype.Ud,z.prototype.ce,z.prototype.Yd,z.prototype.ge],ac=[z.prototype.Wd,z.prototype.ee,z.prototype.$d,z.prototype.ie]; function tc(a,b){n.call(this,"CPU",a,1);var c=a.multiplier||1;this.Fa=a.cycles||b;this.U=c;this.Sa=Math.round(this.Fa/1E4)/100;this.Z=this.Sa*this.U;this.G.ka=!1;this.G.Mb=!1;this.G.ib=a.autoStart;this.G.ec=!1;this.G.Va=!1;this.ya=this.oa=0;this.za=a.csStart;this.na=a.csInterval;this.sa=a.csStop;this.T=[];this.zb=this.qb.bind(this);sa(this)}ba(tc,n);k=tc.prototype; k.Ea=function(a,b,c,d){this.S=a;this.H=b;this.K=d;for(b=0;b=a.oa&&(a.oa+=a.na,c=!0);0<=a.sa&&a.sa<=Cc(a)&&(a.na=a.sa=-1,xc(a),a.da(),c=!0);c&&a.i(Cc(a)+" cycles: checksum="+x(a.ya))}} k.ca=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.P[b]=c;a=!0;break;case "run":this.P[b]=c;c.onclick=function(){var a;if(a=d.S)if(a=d.S,a.G.ja)a=!0;else{var b=null,c,h=ja(a.id);for(c=0;ca.Y/a.Z?b=1:d=!0;a.U=b;b=a.Sa*a.U;if(a.Z!=b){a.Z=b;b=a.Z.toFixed(2)+"Mhz";var e=a.P.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.S&&Hc(a.S)}Ec(a,a.X);a.X=0;a.V=fa();a.ea=0;Fc(a);return d}function Ic(a,b){var c=a.T.length;a.T.push([-1,b]);return c}function Jc(a,b,c){0<=b&&ba.T[b][0]&&(c*=a.Fa*a.U/1E3,a.T[b][0]=c+Kc(a))}function Kc(a,b){var c=a.ga-=a.b;a.b=0;b&&(a.ga=0);return c} k.qb=function(a){if(va(this,!0)){if(!this.G.ka){Dc(this);this.S&&this.S.start(this.V,Cc(this));this.G.ka=!0;this.G.Mb=!0;this.W&&this.W.start();var b=this.P.run;b&&(b.textContent="Halt");this.S&&(Lc(this.S,!0),a&&Hc(this.S,!0))}this.Ua>=this.Fa&&Fc(this,!0);this.Ha=0;this.Ma=fa();this.ea&&(a=this.Ma-this.ea,a>this.gb&&(this.V+=a,this.V>this.Ma&&(this.V=this.Ma)));try{do{for(var c,d=this.G.Va?1:this.Na,e=this.T.length-1;0<=e;e--){var f=this.T[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.Ab(c);c=Kc(this,!0); -this.Ha+=c;this.X+=c;Bc(this,c);a=c;for(var g=this.T.length-1;0<=g;g--){var h=this.T[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.va-=c;if(0>=this.va){this.va+=this.Na;++this.hb>=Mc&&(this.S&&Lc(this.S),this.hb=0);break}}while(this.G.ka)}catch(l){this.da();Ac(this);this.S&&this.S.stop(fa(),Cc(this));va(this,!1);qa(this,l.stack||l.message);return}c=setTimeout;d=this.zb;this.ea=fa();e=this.gb;this.Ha&&(e=Math.round(e*this.Ha/this.Na));e-=this.ea-this.Ma;if(f=this.ea-this.V)this.Y=Math.round(this.X/ +this.Ha+=c;this.X+=c;Bc(this,c);a=c;for(var g=this.T.length-1;0<=g;g--){var h=this.T[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.wa-=c;if(0>=this.wa){this.wa+=this.Na;++this.hb>=Mc&&(this.S&&Lc(this.S),this.hb=0);break}}while(this.G.ka)}catch(l){this.da();Ac(this);this.S&&this.S.stop(fa(),Cc(this));va(this,!1);qa(this,l.stack||l.message);return}c=setTimeout;d=this.zb;this.ea=fa();e=this.gb;this.Ha&&(e=Math.round(e*this.Ha/this.Na));e-=this.ea-this.Ma;if(f=this.ea-this.V)this.Y=Math.round(this.X/ (10*f))/100,864E5<=f&&(this.la=0,Dc(this));if(0>e||this.Ye&&(this.V-=e),e=0;this.Ua+=this.Ha;this.ea+=e;c(d,e)}else Ac(this),this.S&&this.S.stop(fa(),Cc(this))};k.Ab=function(){return 0};k.da=function(a){ua(this,!0);Kc(this);Ec(this,this.X);this.X=0;if(this.G.ka){this.G.ka=!1;this.W&&this.W.stop();var b=this.P.run;b&&(b.textContent="Run")}this.G.complete=a};function Ac(a,b){if(a.S){for(var c=a.S,d=0;d>8&255;a.A=b&255}function jd(a){return a.B<<8|a.C}function kd(a,b){a.B=b>>8&255;a.C=b&255}function D(a){return a.D<<8|a.F} +k.ca=function(a,b,c){switch(b){case "A":case "B":case "C":case "BC":case "D":case "E":case "DE":case "H":case "L":case "HL":case "SP":case "PC":case "PS":case "IF":case "SF":case "ZF":case "AF":case "PF":case "CF":this.P[b]=c;this.fb++;a=!0;break;default:a=tc.prototype.ca.call(this,a,b,c)}return a};function hd(a){return a.w<<8|a.A}function id(a,b){a.w=b>>8&255;a.A=b&255}function jd(a){return a.B<<8|a.C}function kd(a,b){a.B=b>>8&255;a.C=b&255}function D(a){return a.D<<8|a.F} function ld(a,b){a.D=b>>8&255;a.F=b&255}function C(a,b){a.j=b&65535}function md(a){return a.I&256?1:0}function nd(a,b){a.I=a.I&255|b}function od(a){return sb[a.L&255]?4:0}function pd(a){return(a.L^a.O)&16?16:0}function qd(a){return a.I&255?0:64}function rd(a){return a.L&128?128:0}function Uc(a){return a.N&-214|rd(a)|qd(a)|pd(a)|od(a)|md(a)}function Sc(a,b){a.I=a.L=a.O=0;b&1&&(a.I|=256);b&4||(a.L|=1);b&16&&(a.O|=16);b&64||(a.I|=255);b&128&&(a.L^=192);a.N=a.N&-726|b&512|2} function sd(a,b){a.O=a.g^b;return a.L=(a.I=a.g+b)&255}function td(a,b){a.O=a.g^b;return a.L=(a.I=a.g+b+(a.I&256?1:0))&255}function ud(a,b){a.I=a.L=a.O=a.g&b;(a.g|b)&8&&(a.O^=16);return a.I}function vd(a,b){a.O=b^255;b=a.L=b+255&255;a.I=a.I&-256|b;return b}function wd(a,b){a.O=b;b=a.L=b+1&255;a.I=a.I&-256|b;return b}function xd(a,b){return a.L=a.I=a.O=a.g|b}function E(a,b){b^=255;a.O=a.g^b;return a.L=(a.I=a.g+b+1^256)&255} function yd(a,b){b^=255;a.O=a.g^b;return a.L=(a.I=a.g+b+(a.I&256?0:1)^256)&255}function zd(a,b){return a.L=a.I=a.O=a.g^b}function F(a,b){a=a.H;return a.b[(b&a.C)>>>a.g].Xa(b&a.j,b)}function Ad(a,b,c){a=a.H;a.b[(b&a.C)>>>a.g].Ya(b&a.j,c&255,b)}function G(a){var b=F(a,a.j);C(a,a.j+1);return b}function H(a){var b=Fb(a.H,a.j);C(a,a.j+2);return b}function Bd(a){var b=Fb(a.H,a.M);a.M=a.M+2&65535;return b}function I(a,b){a.M=a.M-2&65535;Ib(a.H,a.M,b)} function Cd(a){if(a.b&&a.R&255&&a.N&512){for(var b=0;8>b&&!(a.R&1<b?255:1<>8;nd(this,a&256);this.b-=4},Gd,function(){var a;ld(this,a=D(this)+Wc(this));nd(this,a>>8&256);this.b-=10},function(){this.g=F(this,Wc(this));this.b-=7},function(){id(this,Wc(this)-1);this.b-= +var Pc=[Gd,function(){id(this,H(this));this.b-=10},function(){Ad(this,hd(this),this.g);this.b-=7},function(){id(this,hd(this)+1);this.b-=5},function(){this.w=wd(this,this.w);this.b-=5},function(){this.w=vd(this,this.w);this.b-=5},function(){this.w=G(this);this.b-=7},function(){var a=this.g<<1;this.g=a&255|a>>8;nd(this,a&256);this.b-=4},Gd,function(){var a;ld(this,a=D(this)+hd(this));nd(this,a>>8&256);this.b-=10},function(){this.g=F(this,hd(this));this.b-=7},function(){id(this,hd(this)-1);this.b-= 5},function(){this.A=wd(this,this.A);this.b-=5},function(){this.A=vd(this,this.A);this.b-=5},function(){this.A=G(this);this.b-=7},function(){var a=this.g<<8&256;this.g=(a|this.g)>>1;nd(this,a);this.b-=4},Gd,function(){kd(this,H(this));this.b-=10},function(){Ad(this,jd(this),this.g);this.b-=7},function(){kd(this,jd(this)+1);this.b-=5},function(){this.B=wd(this,this.B);this.b-=5},function(){this.B=vd(this,this.B);this.b-=5},function(){this.B=G(this);this.b-=7},function(){var a=this.g<<1;this.g=a&255| md(this);nd(this,a&256);this.b-=4},Gd,function(){var a;ld(this,a=D(this)+jd(this));nd(this,a>>8&256);this.b-=10},function(){this.g=F(this,jd(this));this.b-=7},function(){kd(this,jd(this)-1);this.b-=5},function(){this.C=wd(this,this.C);this.b-=5},function(){this.C=vd(this,this.C);this.b-=5},function(){this.C=G(this);this.b-=7},function(){var a=this.g<<8;this.g=(md(this)<<8|this.g)>>1;nd(this,a&256);this.b-=4},Gd,function(){ld(this,H(this));this.b-=10},function(){var a=H(this);Ib(this.H,a,D(this)); this.b-=16},function(){ld(this,D(this)+1);this.b-=5},function(){this.D=wd(this,this.D);this.b-=5},function(){this.D=vd(this,this.D);this.b-=5},function(){this.D=G(this);this.b-=7},function(){var a=0,b=md(this);if(pd(this)||9<(this.g&15))a|=6;if(b||154<=this.g)a|=96,b=1;this.g=sd(this,a);nd(this,b?256:0);this.b-=4},Gd,function(){var a;ld(this,a=D(this)+D(this));nd(this,a>>8&256);this.b-=10},function(){var a;a=H(this);a=Fb(this.H,a);ld(this,a);this.b-=16},function(){ld(this,D(this)-1);this.b-=5},function(){this.F= @@ -111,7 +111,7 @@ F(this,D(this)));this.b-=7},function(){this.g=td(this,this.g);this.b-=4},functio this.A);this.b-=4},function(){this.g=yd(this,this.B);this.b-=4},function(){this.g=yd(this,this.C);this.b-=4},function(){this.g=yd(this,this.D);this.b-=4},function(){this.g=yd(this,this.F);this.b-=4},function(){this.g=yd(this,F(this,D(this)));this.b-=7},function(){this.g=yd(this,this.g);this.b-=4},function(){this.g=ud(this,this.w);this.b-=4},function(){this.g=ud(this,this.A);this.b-=4},function(){this.g=ud(this,this.B);this.b-=4},function(){this.g=ud(this,this.C);this.b-=4},function(){this.g=ud(this, this.D);this.b-=4},function(){this.g=ud(this,this.F);this.b-=4},function(){this.g=ud(this,F(this,D(this)));this.b-=7},function(){this.g=ud(this,this.g);this.b-=4},function(){this.g=zd(this,this.w);this.b-=4},function(){this.g=zd(this,this.A);this.b-=4},function(){this.g=zd(this,this.B);this.b-=4},function(){this.g=zd(this,this.C);this.b-=4},function(){this.g=zd(this,this.D);this.b-=4},function(){this.g=zd(this,this.F);this.b-=4},function(){this.g=zd(this,F(this,D(this)));this.b-=7},function(){this.g= zd(this,this.g);this.b-=4},function(){this.g=xd(this,this.w);this.b-=4},function(){this.g=xd(this,this.A);this.b-=4},function(){this.g=xd(this,this.B);this.b-=4},function(){this.g=xd(this,this.C);this.b-=4},function(){this.g=xd(this,this.D);this.b-=4},function(){this.g=xd(this,this.F);this.b-=4},function(){this.g=xd(this,F(this,D(this)));this.b-=7},function(){this.g=xd(this,this.g);this.b-=4},function(){E(this,this.w);this.b-=4},function(){E(this,this.A);this.b-=4},function(){E(this,this.B);this.b-= -4},function(){E(this,this.C);this.b-=4},function(){E(this,this.D);this.b-=4},function(){E(this,this.F);this.b-=4},function(){E(this,F(this,D(this)));this.b-=7},function(){E(this,this.g);this.b-=4},function(){qd(this)||(C(this,Bd(this)),this.b-=6);this.b-=5},function(){id(this,Bd(this));this.b-=10},function(){var a=H(this);qd(this)||C(this,a);this.b-=10},Hd,function(){var a=H(this);qd(this)||(I(this,this.j),C(this,a),this.b-=6);this.b-=11},function(){I(this,Wc(this));this.b-=11},function(){this.g= +4},function(){E(this,this.C);this.b-=4},function(){E(this,this.D);this.b-=4},function(){E(this,this.F);this.b-=4},function(){E(this,F(this,D(this)));this.b-=7},function(){E(this,this.g);this.b-=4},function(){qd(this)||(C(this,Bd(this)),this.b-=6);this.b-=5},function(){id(this,Bd(this));this.b-=10},function(){var a=H(this);qd(this)||C(this,a);this.b-=10},Hd,function(){var a=H(this);qd(this)||(I(this,this.j),C(this,a),this.b-=6);this.b-=11},function(){I(this,hd(this));this.b-=11},function(){this.g= sd(this,G(this));this.b-=7},function(){I(this,this.j);C(this,0);this.b-=11},function(){qd(this)&&(C(this,Bd(this)),this.b-=6);this.b-=5},Id,function(){var a=H(this);qd(this)&&C(this,a);this.b-=10},Hd,function(){var a=H(this);qd(this)&&(I(this,this.j),C(this,a),this.b-=6);this.b-=11},Jd,function(){this.g=td(this,G(this));this.b-=7},function(){I(this,this.j);C(this,8);this.b-=11},function(){md(this)||(C(this,Bd(this)),this.b-=6);this.b-=5},function(){kd(this,Bd(this));this.b-=10},function(){var a=H(this); md(this)||C(this,a);this.b-=10},function(){var a=G(this);Sb(this.H,a,this.g,this.j+-2&65535);this.b-=10},function(){var a=H(this);md(this)||(I(this,this.j),C(this,a),this.b-=6);this.b-=11},function(){I(this,jd(this));this.b-=11},function(){this.g=E(this,G(this));this.b-=7},function(){I(this,this.j);C(this,16);this.b-=11},function(){md(this)&&(C(this,Bd(this)),this.b-=6);this.b-=5},Id,function(){var a=H(this);md(this)&&C(this,a);this.b-=10},function(){var a=G(this);this.g=Ob(this.H,a,this.j+-2&65535)& 255;this.b-=10},function(){var a=H(this);md(this)&&(I(this,this.j),C(this,a),this.b-=6);this.b-=11},Jd,function(){this.g=yd(this,G(this));this.b-=7},function(){I(this,this.j);C(this,24);this.b-=11},function(){od(this)||(C(this,Bd(this)),this.b-=6);this.b-=5},function(){ld(this,Bd(this));this.b-=10},function(){var a=H(this);od(this)||C(this,a);this.b-=10},function(){var a=Bd(this);I(this,D(this));ld(this,a);this.b-=18},function(){var a=H(this);od(this)||(I(this,this.j),C(this,a),this.b-=6);this.b-= @@ -119,7 +119,7 @@ md(this)||C(this,a);this.b-=10},function(){var a=G(this);Sb(this.H,a,this.g,this this.j);C(this,40);this.b-=11},function(){rd(this)||(C(this,Bd(this)),this.b-=6);this.b-=5},function(){var a=Bd(this);Sc(this,a&255|this.N&-256);this.g=a>>8;this.b-=10},function(){var a=H(this);rd(this)||C(this,a);this.b-=10},function(){this.N&=-513;this.b-=4},function(){var a=H(this);rd(this)||(I(this,this.j),C(this,a),this.b-=6);this.b-=11},function(){I(this,Uc(this)&255|this.g<<8);this.b-=11},function(){this.g=xd(this,G(this));this.b-=7},function(){I(this,this.j);C(this,48);this.b-=11},function(){rd(this)&& (C(this,Bd(this)),this.b-=6);this.b-=5},function(){this.M=D(this)&65535;this.b-=5},function(){var a=H(this);rd(this)&&C(this,a);this.b-=10},function(){this.N|=512;this.b-=4;Cd(this)},function(){var a=H(this);rd(this)&&(I(this,this.j),C(this,a),this.b-=6);this.b-=11},Jd,function(){E(this,G(this));this.b-=7},function(){I(this,this.j);C(this,56);this.b-=11}]; function Kd(a){n.call(this,"ChipSet",a,32768);var b=a.model;b&&!Ld[b]&&ga("Unrecognized ChipSet model: "+b);this.g=Ld[b]||{};a.sound&&(this.U=null,window&&(this.U=window.AudioContext||window.webkitAudioContext),this.U&&new this.U);sa(this)}ba(Kd,n);k=Kd.prototype;k.ca=function(){return!1}; -k.Ea=function(a,b,c,d){this.H=b;this.u=c;this.K=d;this.S=a;this.B=vb(a,"Keyboard");this.C=vb(a,"SerialPort");this.video=vb(a,"Video");Nb(b,this,this.g.xb);Rb(b,this,this.g.yb);if(d){var e=this;Md(d,16384,function(){for(var a="",b=0;b>8-this.T&255;v(this,a,null,b,"SHIFT.RESULT",c,!0);return c};k.Kd=function(a,b,c){v(this,a,b,c,"SHIFT.COUNT",null,!0);this.T=b};k.Md=function(a,b,c){v(this,a,b,c,"SOUND1",null,!0);this.Y=b};k.Ld=function(a,b,c){v(this,a,b,c,"SHIFT.DATA",null,!0);this.N=b<<8|this.N>>8}; @@ -134,19 +134,19 @@ L.INIT=[[L.sc.INIT,L.xa.Xb|L.xa.Rc],[L.Ka.Dc,L.Ka.Ec],[L.rb.Gc,L.rb.Cc,L.rb.Fc,L [11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11808,11984,11856,11776,11808,11776,12E3,12E3,11881,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]];Nd.xb={0:Kd.prototype.Bd,1:Kd.prototype.Cd,2:Kd.prototype.Dd,3:Kd.prototype.Ad}; Nd.yb={2:Kd.prototype.Kd,3:Kd.prototype.Md,4:Kd.prototype.Ld,5:Kd.prototype.Nd,6:Kd.prototype.Od};L.xb={66:Kd.prototype.Ed};L.yb={66:Kd.prototype.Pd,98:Kd.prototype.Sd,162:Kd.prototype.Rd,194:Kd.prototype.Qd};hb(function(){for(var a=pa(document,"pc8080","chipset"),b=0;b>>0,g],t=Pa(r,l,a.dc);0>t&&r.splice(-(t+1),0,l)}p&&(h.a=p.replace(/''/g,'"'))}a.A.push({Hf:b,J:c,Gd:d,ra:e,cc:f})}delete this.ra}return!0};Sd.prototype.wa=function(){return!0}; +Sd.prototype.va=function(){if(this.ra){if(this.K){var a=this.K,b=this.id,c=this.A,d=this.g,e=this.ra,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,p=h.a;if(void 0!==l){var r=f,l=[l>>>0,g],t=Pa(r,l,a.dc);0>t&&r.splice(-(t+1),0,l)}p&&(h.a=p.replace(/''/g,'"'))}a.A.push({Hf:b,J:c,Gd:d,ra:e,cc:f})}delete this.ra}return!0};Sd.prototype.ua=function(){return!0}; function Td(a,b,c,d){if(d)a.aa("Unable to load system ROM (error "+d+": "+b+")");else{da(a.ab,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,g=e.data;if(f)a.b=f;else if(g)for(a.b=Array(4*g.length),d=c=0;c>8&255,a.b[d++]=g[c]>>16&255,a.b[d++]=g[c]>>24&255;else a.b=e;a.ra=e.symbols;if(!a.b.length){q("Empty ROM: "+b);return}if(1==a.b.length){q(a.b[0]);return}}catch(h){a.aa("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm, " ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e>>f.g;0>>= f.g;0=m.pb&&a<=m.Db?d.j&(fe|ge)||(d.j|=ge,he(d,20,!0),De(d)):a>=m.pd&&a<=m.z&&d.j&ge&&(d.j&=~ge,he(d,20,!1),De(d));return!0},c.onpaste=function(a){a:{if(d.C&&d.C.Ra&&(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(), a=a.clipboardData||window.clipboardData)){Ee(d.C,a.getData("Text"));a=!1;break a}a=!0}return a},!0;default:if(this.b.Ta&&void 0!==this.b.Ta[b])return this.P[e]=c,c.onclick=function(a,b){return function(c){c.preventDefault&&c.preventDefault();he(a,b,!0,!0)}}(this,this.b.Ta[b]),!0}}return!1};k.Ea=function(a,b,c,d){this.S=a;this.u=c;this.K=d;var e=this;this.L=Ic(this.u,function(){Fe(e)});this.W=vb(a,"ChipSet");this.C=vb(a,"SerialPort");Nb(b,this,this.b.xb);Rb(b,this,this.b.yb)}; -k.ua=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.wa=function(a){return a?this.save():!0};k.reset=function(){this.g=[];this.j=0;this.b.INIT&&!this.restore(this.b.INIT)&&this.aa("reset error")};k.save=function(){var a=new Vc(this);switch(this.b.pa){case M.pa:a.set(0,[this.D,this.B,this.A,this.F,-1])}return a.data()}; +k.va=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.ua=function(a){return a?this.save():!0};k.reset=function(){this.g=[];this.j=0;this.b.INIT&&!this.restore(this.b.INIT)&&this.aa("reset error")};k.save=function(){var a=new Vc(this);switch(this.b.pa){case M.pa:a.set(0,[this.D,this.B,this.A,this.F,-1])}return a.data()}; k.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.b.pa){case Ge.pa:return!0;case M.pa:return this.D=b[0],De(this,this.D&M.Ba.Vb),this.B=b[1],this.A=b[2],this.F=b[3],this.w=b[4],!0}return!1};function De(a,b){var c;null!=b?a.I=b:b=a.I;for(var d in a.b.bb)if(c="led-"+d,c=a.P[c]){var e=a.b.bb[d],f=!!(b&e);e&e-1&&(f=!(b&~e));c.style.backgroundColor=f?"#"+x(16711680,6):"#000000"}if(c=a.P["led-caps-lock"])c.style.backgroundColor=a.j&ge?"#"+x(65280,6):"#000000"} function ee(a,b,c){var d=!0,e=b.keyCode,f=2==b.location,g=0;switch(e){case 16:g=f?He:Ie;break;case 17:g=f?Je:Ke;break;case 18:g=f?Le:Me;break;case 91:g=f?Ne:Oe;break;case 20:g=ge}g&&(a.j=c?a.j|g:a.j&~g);var h;a:if(e=a.b.Pb[e]||e,a.b.Cb[e])h=e;else{for(h in a.b.Ta)if(a.b.Ta[h]===e)break a;h=null}h&&!b.metaKey&&(d=!1,a.j&(Pe|Qe)&&(13==h?(h=118,d=!0):8==h&&(h=46,d=!0),d&&(a.j=c?a.j|Qe:a.j&~Qe)),d=he(a,h,c),(!(h>=m.pb&&h<=m.Db)||a.j|Re)&&b.preventDefault&&b.preventDefault());return d} function he(a,b,c,d){var e;a:{for(e=0;ee?a.g.push({Lb:b,Ib:Date.now(),ub:d||!1}):(a.g[e].Ib=Date.now(),a.g[e].ub=d||!1),d&&Fe(a);else if(0<=e){if(!a.g[e].ub&&(d=a.g[e].Ib)&&Date.now()-d>3)*a.N,!zb(a.H,a.la,a.L,3)))return!1;a.L?(a.Ua=a.j.createImageData(b,c),a.eb=16/a.na|0,Ze(a,a.L>>1)):Ze(a,(a.O+1)*a.Z);a.D=document.createElement("canvas");a.D.width=b;a.D.height=c;a.va=a.D.getContext("2d");a.T={};a.X=1<>3)*a.N,!zb(a.H,a.la,a.L,3)))return!1;a.L?(a.Ua=a.j.createImageData(b,c),a.eb=16/a.na|0,Ze(a,a.L>>1)):Ze(a,(a.O+1)*a.Z);a.D=document.createElement("canvas");a.D.width=b;a.D.height=c;a.wa=a.D.getContext("2d");a.T={};a.X=1<=a.Ha?8:16,f=8>(7>4)*c)}return l}Ue.prototype.ua=function(){return!0};Ue.prototype.ca=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.Fa[b]=c,!0;switch(b){case "fullScreen":return this.P[b]=c,this.b&&this.b.Wa?c.onclick=function(){d.Wa()}:c.parentNode.removeChild(c),!0}return!1}; -Ue.prototype.Wa=function(){var a=!1;if(this.b){if(this.b.Wa){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.M/this.I;b>c&&(a=Math.round(c/b*100)+"%")}this.Sa?(this.F.style.width=a,this.F.style.width=a,this.F.style.display="block",this.F.style.margin="auto"):(this.b.style.width=a,this.b.style.height="auto");this.b.style.backgroundColor="black";this.b.Wa();a=!0}this.V&&this.V.focus()}return a}; +(r&15)*b,(r>>4)*c)}return l}k.va=function(a,b){return b||!a||this.restore(a)?!0:!1};k.ua=function(a){return!a||this.save()};k.save=function(){var a=new Vc(this);a.set(0,[]);return a.data()};k.restore=function(){return!0}; +k.Wa=function(){var a=!1;if(this.b){if(this.b.Wa){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.M/this.I;b>c&&(a=Math.round(c/b*100)+"%")}this.Sa?(this.F.style.width=a,this.F.style.width=a,this.F.style.display="block",this.F.style.margin="auto"):(this.b.style.width=a,this.b.style.height="auto");this.b.style.backgroundColor="black";this.b.Wa();a=!0}this.V&&this.V.focus()}return a}; function Xe(a,b){!b&&a.b&&(a.Sa?a.F.style.width=a.F.style.height="":a.b.style.width=a.b.style.height="");xa(a,"notifyFullScreen("+b+")")}function Ze(a,b){a.cb=b;a.W=!1;if(void 0===a.A||a.A.length!=a.cb)a.A=Array(a.cb)}function kf(a,b,c,d,e){d=a.g?(b.height-c-1)*b.width+d:c+d*b.width;e&&a.Y==af&&(208<=c&&236>c?e=a.X+bf:28<=c&&72>c&&(e=a.X+cf));a=a.U[e];d*=a.length;b.data[d]=a[0];b.data[d+1]=a[1];b.data[d+2]=a[2];b.data[d+3]=a[3]} function Nc(a,b){var c=!0;if(!b){a.oa&&(120==a.oa?a.fb&1?(Dd(a.u,2),c=!1):Dd(a.u,1):Dd(a.u,4));if(c&&a.W&&a.L){for(var d=a.H,e=a.L,f=!0,g=a.la>>>d.g;0>=1);;){var w=Eb(a.H,r++);if((w&lf)==lf){var u=Eb(a.H,r++),d=u&mf,c=(u&nf)<<8|Eb(a.H,r),c=c+(u&of? -pf:qf);break}if(p>4)*w.ba,K,ia,ta,ma,La=w.fa,dc=w.ba;B?(K=A*u.fa,ia=e*u.ba,ta=u.fa,ma=u.ba):(K=A*u.La,ia=e*u.Ma,ta=u.La,ma=u.Ma);w.fa>u.fa&&(K*=2,ta*=2);w.ba>u.ba&&(t==jf&&(S+=u.ba),dc=u.ba);B?B.drawImage(w.canvas,ya,S,La,dc,K,ia,ta,ma):(K+=0,ia+=0,u.j.drawImage(w.canvas, -ya,S,La,dc,K,ia,ta,ma))}h++}g++}e++}}a.W=!0;!b&&a.ya&&1==h&&(a.A[l]=-1,h=0);a.ya=!1;(h||b)&&a.va&&a.j.drawImage(a.D,0,a.sa,a.C,a.N-a.ba,0,0,a.zb,a.rd)}else{e=a.la;f=e+a.L;l=h=g=0;b=a.C;p=0;c=a.N;t=d=0;r=a.na;A=(1<>8|(u&255)<<8);h>B&A,kf(a,a.Ua,h++,l,ya),B+=r;h>p&&(p=h);l=d&&(d=l+1)}e+=2;g++;if(h>=a.C&&(h=0,l++,l>a.N))break}a.W=!0;b>4)*w.ba,K,ia,ta,ma,La=w.fa,cc=w.ba;B?(K=A*u.fa,ia=e*u.ba,ta=u.fa,ma=u.ba):(K=A*u.La,ia=e*u.Ma,ta=u.La,ma=u.Ma);w.fa>u.fa&&(K*=2,ta*=2);w.ba>u.ba&&(t==jf&&(S+=u.ba),cc=u.ba);B?B.drawImage(w.canvas,ya,S,La,cc,K,ia,ta,ma):(K+=0,ia+=0,u.j.drawImage(w.canvas, +ya,S,La,cc,K,ia,ta,ma))}h++}g++}e++}}a.W=!0;!b&&a.ya&&1==h&&(a.A[l]=-1,h=0);a.ya=!1;(h||b)&&a.wa&&a.j.drawImage(a.D,0,a.sa,a.C,a.N-a.ba,0,0,a.zb,a.rd)}else{e=a.la;f=e+a.L;l=h=g=0;b=a.C;p=0;c=a.N;t=d=0;r=a.na;A=(1<>8|(u&255)<<8);h>B&A,kf(a,a.Ua,h++,l,ya),B+=r;h>p&&(p=h);l=d&&(d=l+1)}e+=2;g++;if(h>=a.C&&(h=0,l++,l>a.N))break}a.W=!0;bMissing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=Ua().indexOf("MSIE")&&(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.onresize());var f=+(d.aspect||cb("aspect"));f&&.3<=f&&3.33>=f&&(gb("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");bb("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new Ue(d,e,g,f,c);oa(d,c)}}); function rf(a){n.call(this,"SerialPort",a,8388608);this.T=+a.adapter;switch(this.T){case 0:this.U=0;this.X=2;break;default:q("Unrecognized serial adapter #"+this.T);return}this.g=this.j=null;this.V=a.tabSize;this.R=a.charBOL;this.w=0;this.N=!1;this.D=!0;var b=a.binding;if("console"==b)this.j="";else{var c;a=sf;b&&(void 0===c&&(c="Panel"),(c=la(c,this.id))&&(b=c.P[b])&&this.ca(null,a,b))}this.A="";this.b=this.Ra=this.I=null;this.exports={connect:this.ic,receiveData:this.Kb,receiveStatus:this.be}} @@ -178,7 +179,7 @@ ba(rf,n);k=rf.prototype; k.ca=function(a,b,c,d){var e=this;switch(b){case sf:return this.P[b]=this.g=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64");if(2==c.length){var d=Na(c[0]);if(d!=this.$a)return;c=Na(c[1]);if(this.b=ka(c)){var e=this.b.exports;if(e){var f=e.connect;f&&f.call(this.b,this.D);if(this.Ra=e.receiveData){this.D=a;this.I=e.receiveStatus;this.status("Connected "+this.ab+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -k.ua=function(a,b){if(!b)if(this.ic(this.D),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.wa=function(a){return a?this.save():!0};k.reset=function(){wf(this)};k.save=function(){var a=new Vc(this),b=0,c=[];c[b++]=this.F;c[b++]=this.M;c[b++]=this.O;c[b++]=this.ia;c[b++]=this.B;c[b++]=this.C;c[b]=this.L;a.set(0,c);return a.data()};k.restore=function(a){return wf(this,a[0])}; +k.va=function(a,b){if(!b)if(this.ic(this.D),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.ua=function(a){return a?this.save():!0};k.reset=function(){wf(this)};k.save=function(){var a=new Vc(this),b=0,c=[];c[b++]=this.F;c[b++]=this.M;c[b++]=this.O;c[b++]=this.ia;c[b++]=this.B;c[b++]=this.C;c[b]=this.L;a.set(0,c);return a.data()};k.restore=function(a){return wf(this,a[0])}; function wf(a,b){var c=0;b||(b=xf);a.F=b[c++];a.M=b[c++];a.O=b[c++];a.ia=b[c++];a.B=b[c++];a.C=b[c++];a.L=b[c];return!0}function yf(a,b){var c=a.L&b;b&15||(c>>=4);b=zf[c];c=((a.B&Af)>>2)+6;a.B&Bf&&c++;c+=((a.B&Cf)>>6)+1>>1;return 1E3/Math.round(b/c)}function tf(a,b){xa(a,"receiveByte("+Da(b)+"), status="+Da(a.ia));return a.N||a.ia&Df?!1:(a.M=b,a.ia|=Df,Dd(a.u,a.X),!0)} k.Kb=function(a){null!=a&&(this.A="number"!=typeof a?a:this.A+String.fromCharCode(a));this.A&&(tf(this,this.A.charCodeAt(0))&&(this.A=this.A.substr(1)),this.A&&this.u&&Jc(this.u,this.Y,yf(this,Ef)));return!0};k.be=function(a){this.ia&=~Ff;a&64&&(this.ia|=Ff)};function Ee(a,b){a.ia=a.ia|Pd|Gf;b&&a.Ra&&a.Ra.call(a.b,b)}k.zd=function(a,b){var c=this.M;v(this,a,null,b,"DATA",c);this.ia&=~Df;return c};k.yd=function(a,b){var c=this.ia;v(this,a,null,b,"STATUS",c);return c}; k.Jd=function(a,b,c){v(this,a,b,c,"DATA");this.O=b;this.ia&=~(Pd|Gf);xa(this,"transmitByte("+Da(b)+")");if(19==b)this.N=!0;else if(17==b)this.N=!1;else if(this.Ra&&this.Ra.call(this.b,b),this.g)if(8==b)this.g.value=this.g.value.slice(0,-1),0":String.fromCharCode(b);c=a.length;9==b?(b=this.V||8,c=b-this.w%b,this.V&&(a=Ka("",c))):13==b&&(this.w=c=0,a="\n");this.R&&!this.w&&c&&(a=String.fromCharCode(this.R)+a);this.g.value+=a;this.g.scrollTop= @@ -202,15 +203,15 @@ k.vc=function(a,b,c){var d=ag(a);if(-1!==d){var e=this.H,f=d&e.j,g=(d&e.C)>>>e.g function bg(a,b,c){var d;c=(c?a.F:a.la).J;if(void 0!==b){d=b=Of(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=Ra(Gg,a.substr(b,1))));return c};function Ig(a,b){var c=0;a=a.Hb(b);if(void 0!==a)switch(b){case Jg:case Kg:case Lg:case Mg:case Ng:case Og:case Pg:case Qg:c=2;break;case Rg:case Sg:case Tg:case Ug:case Vg:case Wg:case Xg:c=4}return c?x(a,c):"??"} -k.Hb=function(a){var b;if(0<=a){var c=this.u;switch(a){case Jg:b=c.g;break;case Kg:b=c.w;break;case Lg:b=c.A;break;case Rg:b=Wc(c);break;case Mg:b=c.B;break;case Ng:b=c.C;break;case Sg:b=jd(c);break;case Og:b=c.D;break;case Pg:b=c.F;break;case Tg:b=D(c);break;case Qg:b=F(c,D(c));break;case Ug:b=c.M;break;case Vg:b=c.j;break;case Wg:b=Uc(c);break;case Xg:b=Uc(c)&255|c.g<<8}}return b}; +k.Hb=function(a){var b;if(0<=a){var c=this.u;switch(a){case Jg:b=c.g;break;case Kg:b=c.w;break;case Lg:b=c.A;break;case Rg:b=hd(c);break;case Mg:b=c.B;break;case Ng:b=c.C;break;case Sg:b=jd(c);break;case Og:b=c.D;break;case Pg:b=c.F;break;case Tg:b=D(c);break;case Qg:b=F(c,D(c));break;case Ug:b=c.M;break;case Vg:b=c.j;break;case Wg:b=Uc(c);break;case Xg:b=Uc(c)&255|c.g<<8}}return b}; function Yg(a,b){b=Of(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=a.Gb(b,c+1),0<=e&&(b=b.substr(0,c)+Ig(a,e)+b.substr(c+1+Gg[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=Ba(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=bg(a,e))?(d=e+' "'+ig(a,d)+'"',b=b.replace("$"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("^",c));)e=b.substr(c+1,9),(d=bg(a,e))?(dg(d),d=e+ -' "'+ig(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}k.message=function(a,b){b&&(a+=" at "+hg(Wf(this.u.j).J));this.ha&1073741824?this.X.push(a):this.V&&a==this.V||(this.V=a,this.ha&-2147483648&&(this.da(),a+=" (cpu halted)"),this.i(a),this.u&&(a=this.u,Kc(a),a.va=0,Ac(a)))}; +' "'+ig(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}k.message=function(a,b){b&&(a+=" at "+hg(Wf(this.u.j).J));this.ha&1073741824?this.X.push(a):this.V&&a==this.V||(this.V=a,this.ha&-2147483648&&(this.da(),a+=" (cpu halted)"),this.i(a),this.u&&(a=this.u,Kc(a),a.wa=0,Ac(a)))}; function za(a,b,c,d,e,f,g,h){h|=256;null!=f&&(a.ha&h)!=h||a.message(b.$a+"."+(null!=d?"outPort":"inPort")+"("+y(c)+","+(f?f:"unknown")+(null!=d?","+Da(d):"")+")"+(null!=g?": "+Da(g):"")+(null!=e?" at "+hg(e):""))} function Yf(a){var b;if(Ed(a)){if(!a.D||!a.D.length){a.D=Array(Zg);for(b=0;b>>d.g],!1)}a.I=["br"];if(a.w)for(b=1;b>>d.g],!0);a.w=["bw"];a.oa=0}k.Pa=function(a,b,c){var d=!0;c||eh(this,a,b,!1,!0);if(a!=this.j){var e=ag(b);if(-1===e)this.i("invalid address: "+hg(b.J)),d=!1;else{var f=this.H;f.b[e>>>f.g].Pa(e&f.j,a==this.w)}}d&&(a.push(b),c?b.Da=!0:(fh(this,a,a.length-1,"set"),Yf(this)));return d}; function eh(a,b,c,d,e){var f=!1;c=ag(c);for(var g=1;g>>d.g],b==a.w));h.Da||Yf(a);break}}return f}function gh(a,b){for(var c=1;cthis.b&&this.g.length&&(this.b=0);if(0>this.b| function hh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.L&&(a.i("ended assemble at "+hg(a.O.J)),a.F=a.O,a.L=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.V=null;if(ra(a)&&0p||"z"Xa.length&&(a.i("note: only "+Xa.length+" available"),Aa=Xa.length);Ma-=Aa;0>Ma&&(null==Xa[Xa.length-1].J?(Aa=Ma+Aa,Ma=0):Ma+=Xa.length);var le=[];"call"==ng&&(ic=1E5,le=["CALL"]);for(void 0!==mg&&a.i(Aa+" instructions earlier:");0< -ic&&Ma!=a.T;){var qg=Xa[Ma++];if(null==qg.J)break;var jc=Wf(qg.J),ni=Aa--,rg=ih(a,jc,"history",ni);(!le.length||0<=rg.indexOf(le[0]))&&a.i(rg);jc.Fb&&(Ma+=jc.Fb,ic-=jc.Fb,Aa-=jc.Fb);Ma>=Xa.length&&(Ma=0);a.sa=Aa;pg++;ic--}}pg||(a.i("no "+og+"history available"),a.sa=void 0)}else{var Xc=bg(a,ma);if(Xc){var Yc=0;La&&("l"==La.charAt(0)&&(La=La.substr(1)||dc),Yc=Pf(a,La)>>>0,65536>4||1;oi--&&0<$c;){var ad=0,me=0,lc,ne="", -sg="",ma=hg(Xc.J);for(lc=16;0bd?String.fromCharCode(bd):".";$c--}kc&&(kc+="\n");kc+=ma+" "+ne+(lc?"":" "+sg)}kc&&a.i(kc);a.la=Xc}}}}break;case "e":if("else"==f[0])break;var cd=1,tg=255,ug=a.Ga,vg=a.Sb;"ew"==f[0]&&(cd=2,tg=65535,ug=a.Bb,vg=a.vc);var wg=cd<<1,xg=f[1];if(null==xg)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a"); -else{var dd=bg(a,xg);if(dd)for(var ed=2;edue;){for(var rb=null,ui=256;65536>oc.J>>>0;){zg.J=a.Bb(oc,2);if(null==oc.J||!ui--)break;for(var vi=a,gd=zg, -Ag=null,pc=gd.J,Bg=pc,ve=1;6>=ve&&pc;ve++){if(2Xa.length&&(a.i("note: only "+Xa.length+" available"),Aa=Xa.length);Ma-=Aa;0>Ma&&(null==Xa[Xa.length-1].J?(Aa=Ma+Aa,Ma=0):Ma+=Xa.length);var le=[];"call"==ng&&(hc=1E5,le=["CALL"]);for(void 0!==mg&&a.i(Aa+" instructions earlier:");0< +hc&&Ma!=a.T;){var qg=Xa[Ma++];if(null==qg.J)break;var ic=Wf(qg.J),ni=Aa--,rg=ih(a,ic,"history",ni);(!le.length||0<=rg.indexOf(le[0]))&&a.i(rg);ic.Fb&&(Ma+=ic.Fb,hc-=ic.Fb,Aa-=ic.Fb);Ma>=Xa.length&&(Ma=0);a.sa=Aa;pg++;hc--}}pg||(a.i("no "+og+"history available"),a.sa=void 0)}else{var Wc=bg(a,ma);if(Wc){var Xc=0;La&&("l"==La.charAt(0)&&(La=La.substr(1)||cc),Xc=Pf(a,La)>>>0,65536>4||1;oi--&&0ad?String.fromCharCode(ad):".";Zc--}jc&&(jc+="\n");jc+=ma+" "+ne+(kc?"":" "+sg)}jc&&a.i(jc);a.la=Wc}}}}break;case "e":if("else"==f[0])break;var bd=1,tg=255,ug=a.Ga,vg=a.Sb;"ew"==f[0]&&(bd=2,tg=65535,ug=a.Bb,vg=a.vc);var wg=bd<<1,xg=f[1];if(null==xg)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a"); +else{var cd=bg(a,xg);if(cd)for(var dd=2;ddue;){for(var rb=null,ui=256;65536>nc.J>>>0;){zg.J=a.Bb(nc,2);if(null==nc.J||!ui--)break;for(var vi=a,fd=zg, +Ag=null,oc=fd.J,Bg=oc,ve=1;6>=ve&&oc;ve++){if(2Th){if(Vh(d,this.F)){this.w=new Vc(this,"1.32.2",di);Vh(this.w)&&(ei(this,d),a=fi,gi(this.w));this.w.set(ai,Qa());hi(this.w);var e=this.b&&!this.C;if(a==bi||ha("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=$h(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Vh(d,g):("error"==f&&"no machine state"!= g?(this.aa("Error: "+g),"unable to verify user"==g&&(ab(ii,""),this.g=null)):this.i(f+": "+g),gi(d),Vh(d)?(c=$h(d),e=!0):c=!1))}e&&Yh(this,c?d:null)}else a==fi&&d.clear()}else Yh(this);delete this.F;delete this.I}e=ja(this.id);for(f=0;fa[1];a=a[2];this.W=!0;this.G.ja=!0;var d=this.P.power;d&&(d.textContent="Shutdown");this.u&&(ji(this,this.u,b,c,a),this.u.ib());this.N&&(ei(this,b),b.clear());!c&&this.w&&(this.w.clear(),delete this.w);this.j=0}; function ei(a,b){if(ha("There may be a problem with your PC8080 machine.\n\nTo help us diagnose it, click OK to send this PC8080 machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PC8080",ver:"1.32.2"};d.url=a.U;d.user=c;d.type="bug";d.data=b;Sa("http://www.pcjs.org/api/v1/report",d,!0)}} -function Kh(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new Vc(a,"1.32.2"),g=new Vc(a,"1.32.2",Zh),h=Qa();g.set(ai,h);f.set(ai,h);f.set(ki,"1.32.2");f.set(li,window?window.location.href:null);f.set(mi,Ua());a.u&&a.u.wa&&(c&&a.u.da(),d=a.u.wa(b,c),"object"===typeof d&&f.set(a.u.id,d),c&&(a.u.G.ja=!1,!1===d&&(e=null)));for(var h=ja(a.id),l=0;l>1)+2;10>this.b&&(this.b=10);15>2;this.f=this.c-1;this.h=this.v/this.c|0;this.o=this.h-1;this.j=[];this.l=[];this.B=[];this.C=[];a=new D;Va(a,this.J);this.a=Array(this.h);for(b=0;b>1)+2;10>this.b&&(this.b=10);15>2;this.f=this.c-1;this.h=this.v/this.c|0;this.o=this.h-1;this.j=[];this.l=[];this.B=[];this.C=[];a=new D;Va(a,this.J);this.a=Array(this.h);for(b=0;b>>a.b;0f&&(n=f);if(h&&h.size){if(h.type==d){if(e+f<=h.Pa)return h.fb+=h.Pa-e,h.Pa=e,!0;if(e>=h.Pa+h.fb){n=h.size-(e-l);n>f&&(n=f);h.fb=e-h.Pa+n;e=l+a.c;f-=n;g++;continue}}return Xa(Ya,e,f)}e=new D(e,n,a.c,d);Va(e,a.J,h);a.a[g++]=e;e=l+a.c;f-=n}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+Za[d]+" at "+B(b,4,!0)),!0):Xa($a,b,c)}function ab(a,b){return a.a[(b&a.g)>>>a.b].eb(b&a.f,b)} function bb(a,b){var c=b&a.f,d=(b&a.g)>>>a.b;return c!=a.f?a.a[d].td(c,b):a.a[d++].Sa(c,b)|a.a[d&a.o].Sa(0,b+1)<<8}function cb(a,b,c){a.a[(b&a.g)>>>a.b].Lb(b&a.f,c&255,b)}function db(a,b,c){var d=b&a.f,e=(b&a.g)>>>a.b;d!=a.f?a.a[e].Dd(d,c&65535,b):(a.a[e++].Ta(d,c&255,b),a.a[e&a.o].Ta(0,c>>8&255,b+1))} function eb(a){for(var b=0,c=[],d=0;d>1),this.a=new Int32Array(this.m,0,c>>2),ob(this,jb?pb:qb);else{this.a=Array(c>>2);for(a=0;a>1),this.a=new Int32Array(this.m,0,c>>2),ob(this,jb?pb:qb);else{this.a=Array(c>>2);for(a=0;a>2),b=0;b>8,c)};k.sd=function(a){return this.a[a>>2]>>>((a&3)<<3)&255}; k.xd=function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8};k.Cd=function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ja=!0};k.qd=function(a,b){return this.eb(a,b)};k.vd=function(a,b){return this.Jb(a,b)};k.Ad=function(a,b,c){this.w||this.Lb(a,b,c)}; k.Fd=function(a,b,c){this.w||this.h(a,b,c)};k.pd=function(a){return this.b[a]};k.rd=function(a){return this.b[a]};k.ud=function(a){return this.u.getUint16(a,!0)};k.wd=function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.g[a>>1]};k.zd=function(a,b){this.b[a]=b;this.ja=!0};k.Bd=function(a,b){this.b[a]=b;this.ja=!0};k.Ed=function(a,b){this.u.setUint16(a,b,!0);this.ja=!0};k.Gd=function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.g[a>>1]=b;this.ja=!0}; -var lb=0,nb=2,Za=["NONE","RAM","ROM","VID","H/W"],kb=0,sb=[],rb=[D.prototype.sd,D.prototype.Cd,D.prototype.xd,D.prototype.Hd],vb=[D.prototype.qd,D.prototype.Ad,D.prototype.vd,D.prototype.Fd];if(Pa)var qb=[D.prototype.pd,D.prototype.zd,D.prototype.ud,D.prototype.Ed],pb=[D.prototype.rd,D.prototype.Bd,D.prototype.wd,D.prototype.Gd]; -function wb(a,b){q.call(this,"CPU",a);var c=a.multiplier||1;this.na=a.cycles||b;this.O=c;this.Da=Math.round(this.na/1E4)/100;this.X=this.Da*this.O;this.i.ka=!1;this.i.Kb=!1;this.i.Qa=a.autoStart;this.i.Bb=!1;this.i.Za=!1;this.wa=this.da=0;this.xa=a.csStart;this.ha=a.csInterval;this.la=a.csStop;this.H=[];this.jb=this.gb.bind(this);z(this)}m(wb,q);k=wb.prototype; -k.qa=function(a,b,c,d){this.F=a;this.u=b;this.J=d;for(b=0;ba.R/a.X&&(b=1);a.O=b;b=a.Da*a.O;if(a.X!=b){a.X=b;b=a.X.toFixed(2)+"Mhz";var d=a.w.setSpeed;d&&(d.textContent=b);a.aa("target speed: "+b)}c&&a.F&&Hb(a.F)}a.I+=a.P;a.P=0;a.L=da();a.V=0;Eb(a)}function Ib(a,b){var c=a.H.length;a.H.push([-1,b]);return c}function Jb(a,b,c){0<=b&&ba.H[b][0]&&(c*=a.na*a.O/1E3,a.H[b][0]=c+Kb(a))}function Kb(a,b){var c=a.ca-=a.a;a.a=0;b&&(a.ca=0);return c} +break;case "speed":this.w[b]=c;a=!0;break;case "setSpeed":this.w[b]=c,c.onclick=function(){Db(d,d.O<<1,!0)},c.textContent=this.X.toFixed(2)+"Mhz",a=!0}return a};function Eb(a,b){var c=1;b&&1a.R/a.X&&(b=1);a.O=b;b=a.Da*a.O;if(a.X!=b){a.X=b;b=a.X.toFixed(2)+"Mhz";var d=a.w.setSpeed;d&&(d.textContent=b);a.aa("target speed: "+b)}c&&a.F&&Hb(a.F)}a.I+=a.P;a.P=0;a.L=da();a.V=0;Eb(a)}function Ib(a,b){var c=a.H.length;a.H.push([-1,b]);return c}function Jb(a,b,c){0<=b&&ba.H[b][0]&&(c*=a.na*a.O/1E3,a.H[b][0]=c+Kb(a))}function Kb(a,b){var c=a.da-=a.a;a.a=0;b&&(a.da=0);return c} k.gb=function(a){if(la(this,!0)){if(!this.i.ka){Db(this);this.F&&this.F.start(this.L,Gb(this));this.i.ka=!0;this.i.Kb=!0;this.N&&this.N.start();var b=this.w.run;b&&(b.textContent="Halt");this.F&&(Lb(this.F,!0),a&&Hb(this.F,!0))}this.Fa>=this.na&&Eb(this,!0);this.oa=0;this.va=da();this.V&&(a=this.va-this.V,a>this.Na&&(this.L+=a,this.L>this.va&&(this.L=this.va)));try{do{for(var c,d=this.i.Za?1:this.ya,e=this.H.length-1;0<=e;e--){var f=this.H[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.qb(c);c=Kb(this,!0); -this.oa+=c;this.P+=c;a=c;this.i.Za&&(b=!1,this.wa=this.wa+this.Eb()|0,this.da-=a,0>=this.da&&(this.da+=this.ha,b=!0),0<=this.la&&this.la<=Gb(this)&&(this.ha=this.la=-1,Ab(this),Cb(this),b=!0),b&&this.aa(Gb(this)+" cycles: checksum="+B(this.wa)));a=c;for(var g=this.H.length-1;0<=g;g--){var h=this.H[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.ma-=c;if(0>=this.ma){this.ma+=this.ya;++this.Oa>=Mb&&(this.F&&Lb(this.F),this.Oa=0);break}}while(this.i.ka)}catch(l){Cb(this);Bb(this);this.F&&this.F.stop(da(), +this.oa+=c;this.P+=c;a=c;this.i.Za&&(b=!1,this.wa=this.wa+this.Eb()|0,this.ea-=a,0>=this.ea&&(this.ea+=this.ha,b=!0),0<=this.la&&this.la<=Gb(this)&&(this.ha=this.la=-1,Ab(this),Cb(this),b=!0),b&&this.aa(Gb(this)+" cycles: checksum="+B(this.wa)));a=c;for(var g=this.H.length-1;0<=g;g--){var h=this.H[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.ma-=c;if(0>=this.ma){this.ma+=this.ya;++this.Oa>=Mb&&(this.F&&Lb(this.F),this.Oa=0);break}}while(this.i.ka)}catch(l){Cb(this);Bb(this);this.F&&this.F.stop(da(), Gb(this));la(this,!1);c=l.stack||l.message;this.i.error=!0;this.G(c);return}c=setTimeout;d=this.jb;this.V=da();e=this.Na;this.oa&&(e=Math.round(e*this.oa/this.ya));e-=this.V-this.va;if(f=this.V-this.L)this.R=Math.round(this.P/(10*f))/100,864E5<=f&&(this.I=0,Db(this));if(0>e||this.Re&&(this.L-=e),e=0;this.Fa+=this.oa;this.V+=e;c(d,e)}else Bb(this),this.F&&this.F.stop(da(),Gb(this))};k.qb=function(){return 0}; function Cb(a){a.i.Ya&&(a.i.kb=!0);Kb(a);a.I+=a.P;a.P=0;if(a.i.ka){a.i.ka=!1;a.N&&a.N.stop();var b=a.w.run;b&&(b.textContent="Run")}a.i.complete=void 0}function Bb(a){if(a.F){for(var b=a.F,c=0;c>8&255;a.l=b&255}function F(a,b){a.s=b&65535}function J(a){return a.o&256?1:0}function $b(a,b){a.o=a.o&255|b}function ac(a){return Qa[a.v&255]?4:0}function Ub(a){return a.D&-214|(a.v&128?128:0)|(a.o&255?0:64)|((a.v^a.B)&16?16:0)|ac(a)|J(a)}function Sb(a,b){a.o=a.v=a.B=0;b&1&&(a.o|=256);b&4||(a.v|=1);b&16&&(a.B|=16);b&64||(a.o|=255);b&128&&(a.v^=192);a.D=a.D&-726|b&512|2}function bc(a,b){a.B=a.b^b;return a.v=(a.o=a.b+b)&255} function cc(a,b){a.B=a.b^b;return a.v=(a.o=a.b+b+(a.o&256?1:0))&255}function dc(a,b){a.o=a.v=a.B=a.b&b;(a.b|b)&8&&(a.B^=16);return a.o}function ec(a,b){a.B=b^255;b=a.v=b+255&255;a.o=a.o&-256|b;return b}function fc(a,b){a.B=b;b=a.v=b+1&255;a.o=a.o&-256|b;return b}function gc(a,b){return a.v=a.o=a.B=a.b|b}function L(a,b){b^=255;a.B=a.b^b;return a.v=(a.o=a.b+b+1^256)&255}function hc(a,b){b^=255;a.B=a.b^b;return a.v=(a.o=a.b+b+(a.o&256?0:1)^256)&255}function ic(a,b){return a.v=a.o=a.B=a.b^b} function M(a,b){a=a.u;return a.a[(b&a.g)>>>a.b].Sa(b&a.f,b)}function N(a,b,c){a=a.u;a.a[(b&a.g)>>>a.b].Ta(b&a.f,c&255,b)}function O(a){var b=M(a,a.s);F(a,a.s+1);return b}function P(a){var b=bb(a.u,a.s);F(a,a.s+2);return b}function Q(a){var b=bb(a.u,a.A);a.A=a.A+2&65535;return b}function R(a,b){a.A=a.A-2&65535;db(a.u,a.A,b)}function jc(a){if(a.a&&a.C&255&&a.D&512){for(var b=0;8>b&&!(a.C&1<b?255:1<>8;$b(this,a&256);this.a-=4},lc,function(){var a;I(this,a=H(this)+Vb(this));$b(this,a>>8&256);this.a-=10},function(){this.b=M(this,Vb(this));this.a-=7},function(){Xb(this,Vb(this)-1);this.a-=5}, function(){this.c=fc(this,this.c);this.a-=5},function(){this.c=ec(this,this.c);this.a-=5},function(){this.c=O(this);this.a-=7},function(){var a=this.b<<8&256;this.b=(a|this.b)>>1;$b(this,a);this.a-=4},lc,function(){Zb(this,P(this));this.a-=10},function(){N(this,Yb(this),this.b);this.a-=7},function(){Zb(this,Yb(this)+1);this.a-=5},function(){this.h=fc(this,this.h);this.a-=5},function(){this.h=ec(this,this.h);this.a-=5},function(){this.h=O(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|J(this); @@ -112,7 +112,7 @@ P(this);ac(this)||F(this,a);this.a-=10},function(){var a=Q(this);R(this,H(this)) I(this,Yb(this));Zb(this,a);this.a-=5},function(){var a=P(this);ac(this)&&(R(this,this.s),F(this,a),this.a-=6);this.a-=11},oc,function(){this.b=ic(this,O(this));this.a-=7},function(){R(this,this.s);F(this,40);this.a-=11},function(){this.v&128||(F(this,Q(this)),this.a-=6);this.a-=5},function(){var a=Q(this);Sb(this,a&255|this.D&-256);this.b=a>>8;this.a-=10},function(){var a=P(this);this.v&128||F(this,a);this.a-=10},function(){this.D&=-513;this.a-=4},function(){var a=P(this);this.v&128||(R(this,this.s), F(this,a),this.a-=6);this.a-=11},function(){R(this,Ub(this)&255|this.b<<8);this.a-=11},function(){this.b=gc(this,O(this));this.a-=7},function(){R(this,this.s);F(this,48);this.a-=11},function(){this.v&128&&(F(this,Q(this)),this.a-=6);this.a-=5},function(){this.A=H(this)&65535;this.a-=5},function(){var a=P(this);this.v&128&&F(this,a);this.a-=10},function(){this.D|=512;this.a-=4;jc(this)},function(){var a=P(this);this.v&128&&(R(this,this.s),F(this,a),this.a-=6);this.a-=11},oc,function(){L(this,O(this)); this.a-=7},function(){R(this,this.s);F(this,56);this.a-=11}];function U(a){q.call(this,"ChipSet",a);var b=a.model;b&&!pc[b]&&ea("Unrecognized ChipSet model: "+b);this.b=pc[b]||{};a.sound&&(this.I=null,window&&(this.I=window.AudioContext||window.webkitAudioContext),this.I&&new this.I);z(this)}m(U,q);k=U.prototype;k.S=function(){return!1}; -k.qa=function(a,b,c,d){this.u=b;this.m=c;this.J=d;this.F=a;this.h=C(a,"Keyboard");this.g=C(a,"SerialPort");this.video=C(a,"Video");fb(b,this,this.b.bb);gb(b,this,this.b.cb)};k.ba=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.fa=function(a){return a?this.save():!0};k.reset=function(){this.b.INIT&&!this.restore(this.b.INIT)&&this.G("reset error")}; +k.qa=function(a,b,c,d){this.u=b;this.m=c;this.J=d;this.F=a;this.h=C(a,"Keyboard");this.g=C(a,"SerialPort");this.video=C(a,"Video");fb(b,this,this.b.bb);gb(b,this,this.b.cb)};k.ca=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.ba=function(a){return a?this.save():!0};k.reset=function(){this.b.INIT&&!this.restore(this.b.INIT)&&this.G("reset error")}; k.save=function(){var a=new G(this);switch(this.b.Y){case V.Y:a.set(0,[this.V,this.f,this.X,this.B,this.H,this.P,this.R]);break;case W.Y:a.set(0,[this.N,this.s]),a.set(1,[this.l,this.o]),a.set(2,[this.c,this.C,this.O,this.L]),a.set(3,[this.A,this.a,this.v,this.D,this.j])}return a.data()}; k.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.b.Y){case V.Y:return this.V=b[0],this.f=b[1],this.X=b[2],this.B=b[3],this.H=b[4],this.P=b[5],this.R=b[6],!0;case W.Y:return this.N=b[0],this.s=b[1],b=a[1],this.l=b[0],this.o=b[1],b=a[2],this.c=b[0],this.C=b[1],this.O=b[2],this.L=b[3],b=a[3],this.A=b[0],this.a=b[1],this.v=b[2],this.D=b[3],this.j=b[4],!0}return!1};k.start=function(){};k.stop=function(){};k.Xc=function(){return this.V};k.Yc=function(){return this.f};k.Zc=function(){return this.X}; k.Wc=function(){return this.B>>8-this.H&255};k.ed=function(a,b){this.H=b};k.gd=function(a,b){this.P=b};k.fd=function(a,b){this.B=b<<8|this.B>>8};k.hd=function(a,b){this.R=b};k.jd=function(){};function qc(a){var b=0,c=0,d=~a.A;for(a=0;10>a;a++)d&1&&(b=9-a),d>>=1;for(a=0;10>a;a++)d&1&&(c=9-a),d>>=1;return 10*b+c} @@ -124,43 +124,44 @@ var V={Y:1978.1,Fc:{Z:0,ne:1,re:16,ye:32,He:64,Ge:128,Ha:14},za:{Z:1,Vb:1,yc:2,u W.INIT=[[W.Tb.INIT,W.ga.qc|W.ga.rc],[W.ua.cc,W.ua.dc],[W.Va.fc,W.Va.bc,W.Va.ec,W.Va.ac],[0,0,0,0,[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11776,11984,11888,11776,11808,11776,12E3,12E3,11901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11808,11984,11856,11776,11808,11776,12E3,12E3,11881,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]];V.bb={0:U.prototype.Xc,1:U.prototype.Yc,2:U.prototype.Zc,3:U.prototype.Wc}; V.cb={2:U.prototype.ed,3:U.prototype.gd,4:U.prototype.fd,5:U.prototype.hd,6:U.prototype.jd};W.bb={66:U.prototype.$c};W.cb={66:U.prototype.kd,98:U.prototype.nd,162:U.prototype.md,194:U.prototype.ld};Ha(function(){for(var a=y(document,"pc8080","chipset"),b=0;b>8&255,a.a[d++]=g[c]>>16&255,a.a[d++]=g[c]>>24&255;else a.a=e;a.sa=e.symbols;if(!a.a.length){u("Empty ROM: "+b);return}if(1==a.a.length){u(a.a[0]);return}}catch(h){a.G("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm, " ").replace(/ +$/,"").split(" "),a.a=Array(b.length),e=0;e>>f.b;0>>=f.b;0=p.Ua&&a<=p.ib?d.c&(Ic|Jc)||(d.c|=Jc,Kc(d,20,!0),Lc(d)):a>=p.Oc&&a<=p.z&&d.c&Jc&&(d.c&=~Jc,Kc(d,20,!1),Lc(d));return!0},c.onpaste=function(a){a:{if(d.g&&d.g.Ba&&(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(), a=a.clipboardData||window.clipboardData)){Mc(d.g,a.getData("Text"));a=!1;break a}a=!0}return a},!0;default:if(this.a.Ea&&void 0!==this.a.Ea[b])return this.w[e]=c,c.onclick=function(a,b){return function(c){c.preventDefault&&c.preventDefault();Kc(a,b,!0,!0)}}(this,this.a.Ea[b]),!0}}return!1};k.qa=function(a,b,c,d){this.F=a;this.m=c;this.J=d;var e=this;this.v=Ib(this.m,function(){Nc(e)});this.N=C(a,"ChipSet");this.g=C(a,"SerialPort");fb(b,this,this.a.bb);gb(b,this,this.a.cb)}; -k.ba=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.fa=function(a){return a?this.save():!0};k.reset=function(){this.b=[];this.c=0;this.a.INIT&&!this.restore(this.a.INIT)&&this.G("reset error")};k.save=function(){var a=new G(this);switch(this.a.Y){case X.Y:a.set(0,[this.l,this.j,this.h,this.o,-1])}return a.data()}; -k.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.a.Y){case Oc.Y:return!0;case X.Y:return this.l=b[0],Lc(this,this.l&X.ea.ub),this.j=b[1],this.h=b[2],this.o=b[3],this.f=b[4],!0}return!1};function Lc(a,b){var c;null!=b?a.s=b:b=a.s;for(var d in a.a.Ja)if(c="led-"+d,c=a.w[c]){var e=a.a.Ja[d],f=!!(b&e);e&e-1&&(f=!(b&~e));c.style.backgroundColor=f?"#"+B(16711680,6):"#000000"}if(c=a.w["led-caps-lock"])c.style.backgroundColor=a.c&Jc?"#"+B(65280,6):"#000000"} +k.ca=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.ba=function(a){return a?this.save():!0};k.reset=function(){this.b=[];this.c=0;this.a.INIT&&!this.restore(this.a.INIT)&&this.G("reset error")};k.save=function(){var a=new G(this);switch(this.a.Y){case X.Y:a.set(0,[this.l,this.j,this.h,this.o,-1])}return a.data()}; +k.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.a.Y){case Oc.Y:return!0;case X.Y:return this.l=b[0],Lc(this,this.l&X.fa.ub),this.j=b[1],this.h=b[2],this.o=b[3],this.f=b[4],!0}return!1};function Lc(a,b){var c;null!=b?a.s=b:b=a.s;for(var d in a.a.Ja)if(c="led-"+d,c=a.w[c]){var e=a.a.Ja[d],f=!!(b&e);e&e-1&&(f=!(b&~e));c.style.backgroundColor=f?"#"+B(16711680,6):"#000000"}if(c=a.w["led-caps-lock"])c.style.backgroundColor=a.c&Jc?"#"+B(65280,6):"#000000"} function Hc(a,b,c){var d=!0,e=b.keyCode,f=2==b.location,g=0;switch(e){case 16:g=f?Pc:Qc;break;case 17:g=f?Rc:Sc;break;case 18:g=f?Tc:Uc;break;case 91:g=f?Wc:Xc;break;case 20:g=Jc}g&&(a.c=c?a.c|g:a.c&~g);var h;a:if(e=a.a.ob[e]||e,a.a.hb[e])h=e;else{for(h in a.a.Ea)if(a.a.Ea[h]===e)break a;h=null}h&&!b.metaKey&&(d=!1,a.c&(Yc|Zc)&&(13==h?(h=118,d=!0):8==h&&(h=46,d=!0),d&&(a.c=c?a.c|Zc:a.c&~Zc)),d=Kc(a,h,c),(!(h>=p.Ua&&h<=p.ib)||a.c|$c)&&b.preventDefault&&b.preventDefault());return d} function Kc(a,b,c,d){var e;a:{for(e=0;ee?a.b.push({nb:b,lb:Date.now(),$a:d||!1}):(a.b[e].lb=Date.now(),a.b[e].$a=d||!1),d&&Nc(a);else if(0<=e){if(!a.b[e].$a&&(d=a.b[e].lb)&&Date.now()-dc||c>e)c=e}else{Kc(a,d,!1);b=0;continue}}b++}0<=c&&Jb(a.m,a.v,c)}k.ad=function(){var a=this.j;0<=this.f&&(this.fc||c>e)c=e}else{Kc(a,d,!1);b=0;continue}}b++}0<=c&&Jb(a.m,a.v,c)}k.ad=function(){var a=this.j;0<=this.f&&(this.f>3)*a.B,!Wa(a.u,a.ca,a.v,3)))return!1;a.v?(a.Fa=a.c.createImageData(b,c),a.La=16/a.da|0,hd(a,a.v>>1)):hd(a,(a.C+1)*a.R);a.l=document.createElement("canvas");a.l.width=b;a.l.height=c;a.ma=a.l.getContext("2d");a.H={};a.O=1<>3)*a.B,!Wa(a.u,a.da,a.v,3)))return!1;a.v?(a.Fa=a.c.createImageData(b,c),a.La=16/a.ea|0,hd(a,a.v>>1)):hd(a,(a.C+1)*a.R);a.l=document.createElement("canvas");a.l.width=b;a.l.height=c;a.ma=a.l.getContext("2d");a.H={};a.O=1<=a.va?8:16,f=8>(7>4)*c)}return l}cd.prototype.ba=function(){return!0};cd.prototype.S=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.ra[b]=c,!0;switch(b){case "fullScreen":return this.w[b]=c,this.a&&this.a.Ga?c.onclick=function(){d.Ga()}:c.parentNode.removeChild(c),!0}return!1}; -cd.prototype.Ga=function(){var a=!1;if(this.a){if(this.a.Ga){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.A/this.s;b>c&&(a=Math.round(c/b*100)+"%")}this.Da?(this.o.style.width=a,this.o.style.width=a,this.o.style.display="block",this.o.style.margin="auto"):(this.a.style.width=a,this.a.style.height="auto");this.a.style.backgroundColor="black";this.a.Ga();a=!0}this.L&&this.L.focus()}return a}; +function od(a,b,c,d){var e=8>=a.va?8:16,f=8>(7>4)*c)}return l}k.ca=function(a,b){return b||!a||this.restore(a)?!0:!1};k.ba=function(a){return!a||this.save()};k.save=function(){var a=new G(this);a.set(0,[]);return a.data()};k.restore=function(){return!0}; +k.Ga=function(){var a=!1;if(this.a){if(this.a.Ga){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.A/this.s;b>c&&(a=Math.round(c/b*100)+"%")}this.Da?(this.o.style.width=a,this.o.style.width=a,this.o.style.display="block",this.o.style.margin="auto"):(this.a.style.width=a,this.a.style.height="auto");this.a.style.backgroundColor="black";this.a.Ga();a=!0}this.L&&this.L.focus()}return a}; function fd(a,b){!b&&a.a&&(a.Da?a.o.style.width=a.o.style.height="":a.a.style.width=a.a.style.height="")}function hd(a,b){a.Ka=b;a.N=!1;if(void 0===a.g||a.g.length!=a.Ka)a.g=Array(a.Ka)}function sd(a,b,c,d,e){d=a.b?(b.height-c-1)*b.width+d:c+d*b.width;e&&a.P==jd&&(208<=c&&236>c?e=a.O+kd:28<=c&&72>c&&(e=a.O+ld));a=a.I[e];d*=a.length;b.data[d]=a[0];b.data[d+1]=a[1];b.data[d+2]=a[2];b.data[d+3]=a[3]} -function Nb(a,b){var c=!0;if(!b){a.ha&&(120==a.ha?a.Ma&1?(kc(a.m,2),c=!1):kc(a.m,1):kc(a.m,4));if(c&&a.N&&a.v){for(var d=a.u,e=a.v,f=!0,g=a.ca>>>d.b;0>=1);;){var x=ab(a.u,v++);if((x&td)==td){var t=ab(a.u,v++),d=t&ud,c=(t&vd)<<8|ab(a.u,v),c=c+(t&wd?xd: -yd);break}if(n>4)*x.K,ca,ta,Ua,mb,Vc=x.M,Wb=x.K;E?(ca=K*t.M,ta=e*t.K,Ua=t.M,mb=t.K):(ca=K*t.wa,ta=e*t.xa,Ua=t.wa,mb=t.xa);x.M>t.M&&(ca*=2,Ua*=2);x.K>t.K&&(A==rd&&(S+=t.K),Wb=t.K);E?E.drawImage(x.canvas,Y,S,Vc,Wb,ca,ta,Ua,mb):(ca+=0,ta+=0,t.c.drawImage(x.canvas,Y,S,Vc,Wb, -ca,ta,Ua,mb))}h++}g++}e++}}a.N=!0;!b&&a.na&&1==h&&(a.g[l]=-1,h=0);a.na=!1;(h||b)&&a.ma&&a.c.drawImage(a.l,0,a.la,a.j,a.B-a.K,0,0,a.jb,a.Ob)}else{e=a.ca;f=e+a.v;l=h=g=0;b=a.j;n=0;c=a.B;A=d=0;v=a.da;K=(1<>>t.b;t=x!=t.f?t.a[Y].Jb(x,E):t.a[Y++].eb(x,E)|t.a[Y&t.o].eb(0,E+1)<<8;if(a.N&&t===a.g[g])h+=a.La;else{a.g[g]=t;(E=A)&&(t=t>>8|(t&255)<<8);h>E&K,sd(a,a.Fa,h++,l,Y),E+=v;h>n&&(n=h);l=d&&(d=l+1)}e+= +function Nb(a,b){var c=!0;if(!b){a.ha&&(120==a.ha?a.Ma&1?(kc(a.m,2),c=!1):kc(a.m,1):kc(a.m,4));if(c&&a.N&&a.v){for(var d=a.u,e=a.v,f=!0,g=a.da>>>d.b;0>=1);;){var x=ab(a.u,v++);if((x&td)==td){var t=ab(a.u,v++),d=t&ud,c=(t&vd)<<8|ab(a.u,v),c=c+(t&wd?xd: +yd);break}if(n>4)*x.K,ca,ta,Ta,lb,Vc=x.M,Wb=x.K;E?(ca=K*t.M,ta=e*t.K,Ta=t.M,lb=t.K):(ca=K*t.wa,ta=e*t.xa,Ta=t.wa,lb=t.xa);x.M>t.M&&(ca*=2,Ta*=2);x.K>t.K&&(A==rd&&(T+=t.K),Wb=t.K);E?E.drawImage(x.canvas,Y,T,Vc,Wb,ca,ta,Ta,lb):(ca+=0,ta+=0,t.c.drawImage(x.canvas,Y,T,Vc,Wb, +ca,ta,Ta,lb))}h++}g++}e++}}a.N=!0;!b&&a.na&&1==h&&(a.g[l]=-1,h=0);a.na=!1;(h||b)&&a.ma&&a.c.drawImage(a.l,0,a.la,a.j,a.B-a.K,0,0,a.jb,a.Ob)}else{e=a.da;f=e+a.v;l=h=g=0;b=a.j;n=0;c=a.B;A=d=0;v=a.ea;K=(1<>>t.b;t=x!=t.f?t.a[Y].Jb(x,E):t.a[Y++].eb(x,E)|t.a[Y&t.o].eb(0,E+1)<<8;if(a.N&&t===a.g[g])h+=a.La;else{a.g[g]=t;(E=A)&&(t=t>>8|(t&255)<<8);h>E&K,sd(a,a.Fa,h++,l,Y),E+=v;h>n&&(n=h);l=d&&(d=l+1)}e+= 2;g++;if(h>=a.j&&(h=0,l++,l>a.B))break}a.N=!0;bMissing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(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.onresize());var f=+(d.aspect||Ea("aspect"));f&&.3<=f&&3.33>=f&&(Ga("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");Da("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new cd(d,e,g,f,c);ja(d,c)}}); @@ -169,23 +170,23 @@ k=zd.prototype; k.S=function(a,b,c,d){var e=this;switch(b){case Ad:return this.w[b]=this.b=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64");if(2==c.length){var d=ua(c[0]);if(d!=this.Wa)return;c=ua(c[1]);if(this.a=ha(c)){var e=this.a.exports;if(e){var f=e.connect;f&&f.call(this.a,this.l);if(this.Ba=e.receiveData){this.l=a;this.s=e.receiveStatus;this.status("Connected "+this.Ia+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -k.ba=function(a,b){if(!b)if(this.Fb(this.l),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.fa=function(a){return a?this.save():!0};k.reset=function(){Ed(this)};k.save=function(){var a=new G(this),b=0,c=[];c[b++]=this.o;c[b++]=this.A;c[b++]=this.C;c[b++]=this.T;c[b++]=this.h;c[b++]=this.j;c[b]=this.v;a.set(0,c);return a.data()};k.restore=function(a){return Ed(this,a[0])}; +k.ca=function(a,b){if(!b)if(this.Fb(this.l),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.ba=function(a){return a?this.save():!0};k.reset=function(){Ed(this)};k.save=function(){var a=new G(this),b=0,c=[];c[b++]=this.o;c[b++]=this.A;c[b++]=this.C;c[b++]=this.T;c[b++]=this.h;c[b++]=this.j;c[b]=this.v;a.set(0,c);return a.data()};k.restore=function(a){return Ed(this,a[0])}; function Ed(a,b){var c=0;b||(b=Fd);a.o=b[c++];a.A=b[c++];a.C=b[c++];a.T=b[c++];a.h=b[c++];a.j=b[c++];a.v=b[c];return!0}function Gd(a,b){var c=a.v&b;b&15||(c>>=4);b=Hd[c];c=((a.h&Id)>>2)+6;a.h&Jd&&c++;c+=((a.h&Kd)>>6)+1>>1;return 1E3/Math.round(b/c)}function Bd(a,b){return a.B||a.T&Ld?!1:(a.A=b,a.T|=Ld,kc(a.m,a.O),!0)} k.mb=function(a){null!=a&&(this.g="number"!=typeof a?a:this.g+String.fromCharCode(a));this.g&&(Bd(this,this.g.charCodeAt(0))&&(this.g=this.g.substr(1)),this.g&&this.m&&Jb(this.m,this.P,Gd(this,Md)));return!0};k.yd=function(a){this.T&=~Nd;a&64&&(this.T|=Nd)};function Mc(a,b){a.T=a.T|rc|Od;b&&a.Ba&&a.Ba.call(a.a,b)}k.Vc=function(){var a=this.A;this.T&=~Ld;return a};k.Uc=function(){return this.T}; k.dd=function(a,b){this.C=b;this.T&=~(rc|Od);if(19==b)this.B=!0;else if(17==b)this.B=!1;else if(this.Ba&&this.Ba.call(this.a,b),this.b)if(8==b)this.b.value=this.b.value.slice(0,-1),0":String.fromCharCode(b);c=a.length;9==b?(b=this.L||8,c=b-this.f%b,this.L&&(a=" ".slice(0,c))):13==b&&(this.f=c=0,a="\n");this.D&&!this.f&&c&&(a=String.fromCharCode(this.D)+a);this.b.value+=a;this.b.scrollTop=this.b.scrollHeight; this.f+=c}else if(null!=this.c){if(10==b||1024<=this.c.length)this.aa(this.c),this.c="";10!=b&&(this.c+=String.fromCharCode(b))}this.m&&Jb(this.m,this.R,Gd(this,Pd))};k.cd=function(a,b){this.o?(this.s&&(b^this.j)&(Qd|Rd)&&(a=0,this.l?(a|=b&Qd?32:0,a|=b&Rd?320:0):(a|=b&Qd?16:0,a|=b&Rd?1048576:0),this.s.call(this.a,a)),this.j=b,this.j&Sd&&(this.o=!1)):(this.h=b,this.o=!0)};k.bd=function(a,b){this.v=b}; var Id=12,Jd=16,Kd=192,Rd=2,Qd=32,Sd=64,rc=1,Ld=2,Od=4,Nd=128,Md=15,Pd=240,Hd=[50,75,110,134.5,150,200,300,600,1200,1800,2E3,2400,3600,4800,9600,19200],Fd=[!1,0,0,133,142,39,238],Ad="buffer",Cd={0:zd.prototype.Vc,1:zd.prototype.Uc},Dd={0:zd.prototype.dd,1:zd.prototype.cd,2:zd.prototype.bd};Ha(function(){for(var a=y(document,"pc8080","serial"),b=0;b\nLicense: GPL version 3 or later ");for(b=0;bVd){if(Xd(d,this.o)){this.f=new G(this,"1.32.2",fe);Xd(this.f)&&(ge(this,d),a=he,ie(this.f));this.f.set(ce,wa());je(this.f);var e=this.a&&!this.j;if(a==de||fa("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=be(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Xd(d,g):("error"==f&&"no machine state"!= g?(this.G("Error: "+g),"unable to verify user"==g&&(Ca(ke,""),this.b=null)):this.aa(f+": "+g),ie(d),Xd(d)?(c=be(d),e=!0):c=!1))}e&&$d(this,c?d:null)}else a==he&&d.clear()}else $d(this);delete this.o;delete this.s}e=ga(this.id);for(f=0;fa[1];a=a[2];this.N=!0;this.i.U=!0;var d=this.w.power;d&&(d.textContent="Shutdown");this.m&&(le(this,this.m,b,c,a),this.m.Qa());this.B&&(ge(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.c=0}; function ge(a,b){if(fa("There may be a problem with your PC8080 machine.\n\nTo help us diagnose it, click OK to send this PC8080 machine state to http://www.pcjs.org.")){var c=a.b||"";b=b.toString();var d={app:"PC8080",ver:"1.32.2"};d.url=a.I;d.user=c;d.type="bug";d.data=b;xa("http://www.pcjs.org/api/v1/report",d,!0)}} -function me(a,b,c){var d,e="none";if(a.c)return null;a.c--;var f=new G(a,"1.32.2"),g=new G(a,"1.32.2",ae),h=wa();g.set(ce,h);f.set(ce,h);f.set(ne,"1.32.2");f.set(oe,window?window.location.href:null);f.set(pe,window?window.navigator.userAgent:"");a.m&&a.m.fa&&(c&&Cb(a.m),d=a.m.fa(b,c),"object"===typeof d&&f.set(a.m.id,d),c&&(a.m.i.U=!1,!1===d&&(e=null)));for(var h=ga(a.id),l=0;l