From 3ec9a31c927a887c9488918c9231818501cec77d Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Mon, 8 Aug 2016 11:24:55 -0700 Subject: [PATCH] README formatting --- .../pc8080/machine/vt100/debugger/README.md | 84 ++-- versions/pc8080/1.23.3/pc8080-dbg.js | 404 +++++++++--------- versions/pc8080/1.23.3/pc8080.js | 249 +++++------ 3 files changed, 369 insertions(+), 368 deletions(-) diff --git a/devices/pc8080/machine/vt100/debugger/README.md b/devices/pc8080/machine/vt100/debugger/README.md index d017e3f12..0121c57f7 100644 --- a/devices/pc8080/machine/vt100/debugger/README.md +++ b/devices/pc8080/machine/vt100/debugger/README.md @@ -163,50 +163,50 @@ VT100 Initialization Process From "Power-Up and Self-Test", section 4.2.8, p. 4-19, of the VT100 Technical Manual (July 1982): - When power is first applied to the terminal controller board, the reset circuit in the 8224 holds the microprocessor - in a halt state. Within a second, after the voltages stabilize in the power supply, the RC network at the reset input - allows tlhe input voltage to rise to the switching threshold of a Schmitt trigger. Then the reset is released with the - 8080 program counter set to 0. The low 64 bytes of program are reserved for the eight interrupt service routines which - can be addressed by the restart instruction (see previous section). The low 8 start the power-up routine by disabling - the interrupts, setting up the stack pointer, and then going immediately into the self-test routines. +> When power is first applied to the terminal controller board, the reset circuit in the 8224 holds the microprocessor +in a halt state. Within a second, after the voltages stabilize in the power supply, the RC network at the reset input +allows tlhe input voltage to rise to the switching threshold of a Schmitt trigger. Then the reset is released with the +8080 program counter set to 0. The low 64 bytes of program are reserved for the eight interrupt service routines which +can be addressed by the restart instruction (see previous section). The low 8 start the power-up routine by disabling +the interrupts, setting up the stack pointer, and then going immediately into the self-test routines. - Assuming there are no hard logic failures present on the board, the microprocessor attempts to perform a confidence - check of the controller. Some failures are considered fatal and will stop the machine; other failures limit its operation - but win not prevent its use. Fatal failures are indicated by the LEDs on the keyboard, while nonfatal errors are indicated - as a single character on the screen. +> Assuming there are no hard logic failures present on the board, the microprocessor attempts to perform a confidence +check of the controller. Some failures are considered fatal and will stop the machine; other failures limit its operation +but win not prevent its use. Fatal failures are indicated by the LEDs on the keyboard, while nonfatal errors are indicated +as a single character on the screen. - The microprocessor first sends the number of the first ROM to the LEDs on the keyboard. Then it calculates a checksum - of the contents of the first 2K of program. (Since firmware is treated as four 2K blocks of code, later VT100s with one - 8K X 8 ROM chip operate the same way but any block failure requires replacement of the one chip). At the time of ROM - preparation, a special byte was included within each block to make the checksum equal zero if there are no errors. If - there is an error, the microprocessor halts and the LEDs indicate the current ROM at the time of failure. Otherwise, the - LEDs are incremented to show the next ROM number and the process continues. - - The next part of the test is writing and reading the RAM. Every bit in the RAM is written with a 0 and a 1 and read each - time. If the advanced video option is present (as indicated by the Option Present flag), its RAM is tested immediately - after the main RAM. In the main RAM a failure halts the machine. Failure of a bit in the advanced video option RAM is - indicated on the screen and the process continues. In another termnnal, the VT52, one bad bit in the screen RAM means there - is one location that may not contain right character. This can be annoying to the user but does not affect the rest of the - screen. If one bit is bad in a VT100 line address, the entire screen below the affected line can become garbled and unsuable. - A bad bit in the scratch area could disable communication with the host. So this confidence check ensures that any RAM - failure is detected immediately. - - The next test checks the nonvola1tile RAM by reading it. A checksum is calculated and compared with the value stored the - last time the NVR was written during a save. A bad NVR does not stop the VT100 because the SET-UP values can always be - reestablished from the keyboard at power-up. The NVR test is also the normal time when the terminal gets its auto SET-UP - readings from the NVR. Time is saved because reading the NVR is the most time-consuming part of both the self-test and the - auto SET-UP. If the NVR fails, the bell sounds several times to inform the operator, and then default settings stored in - the ROM allow the terminal to work. The operator must then manually reset any parameters that differ from the default values. - - To test the keyboard, the microprocessor commands the keyboard to scan once, lights all the LEDs, for about a half second, - and sounds the bell. It waits for the scan to finish and then looks for the last key address 7FH at the keyboard UART. - If the test fails, the terminal remains on-line, making it a receive-only (RO) terminal. - - This is the end of testing. - - Once the NVR data is in the scratch area in RAM, the microprocessor uses that data to program the hardware. All operating - parameters that were last saved (see NVR) are recalled and the terminal is set to match them. Finally the cursor appears - at column 1, line 1, and the microprocessor enters its background routine, ready for operation. +> The microprocessor first sends the number of the first ROM to the LEDs on the keyboard. Then it calculates a checksum +of the contents of the first 2K of program. (Since firmware is treated as four 2K blocks of code, later VT100s with one +8K X 8 ROM chip operate the same way but any block failure requires replacement of the one chip). At the time of ROM +preparation, a special byte was included within each block to make the checksum equal zero if there are no errors. If +there is an error, the microprocessor halts and the LEDs indicate the current ROM at the time of failure. Otherwise, the +LEDs are incremented to show the next ROM number and the process continues. + +> The next part of the test is writing and reading the RAM. Every bit in the RAM is written with a 0 and a 1 and read each +time. If the advanced video option is present (as indicated by the Option Present flag), its RAM is tested immediately +after the main RAM. In the main RAM a failure halts the machine. Failure of a bit in the advanced video option RAM is +indicated on the screen and the process continues. In another termnnal, the VT52, one bad bit in the screen RAM means there +is one location that may not contain right character. This can be annoying to the user but does not affect the rest of the +screen. If one bit is bad in a VT100 line address, the entire screen below the affected line can become garbled and unsuable. +A bad bit in the scratch area could disable communication with the host. So this confidence check ensures that any RAM +failure is detected immediately. + +> The next test checks the nonvola1tile RAM by reading it. A checksum is calculated and compared with the value stored the +last time the NVR was written during a save. A bad NVR does not stop the VT100 because the SET-UP values can always be +reestablished from the keyboard at power-up. The NVR test is also the normal time when the terminal gets its auto SET-UP +readings from the NVR. Time is saved because reading the NVR is the most time-consuming part of both the self-test and the +auto SET-UP. If the NVR fails, the bell sounds several times to inform the operator, and then default settings stored in +the ROM allow the terminal to work. The operator must then manually reset any parameters that differ from the default values. + +> To test the keyboard, the microprocessor commands the keyboard to scan once, lights all the LEDs, for about a half second, +and sounds the bell. It waits for the scan to finish and then looks for the last key address 7FH at the keyboard UART. +If the test fails, the terminal remains on-line, making it a receive-only (RO) terminal. + +> This is the end of testing. + +> Once the NVR data is in the scratch area in RAM, the microprocessor uses that data to program the hardware. All operating +parameters that were last saved (see NVR) are recalled and the terminal is set to match them. Finally the cursor appears +at column 1, line 1, and the microprocessor enters its background routine, ready for operation. Some additional observations: diff --git a/versions/pc8080/1.23.3/pc8080-dbg.js b/versions/pc8080/1.23.3/pc8080-dbg.js index 4eaf152f6..2d3da499b 100644 --- a/versions/pc8080/1.23.3/pc8080-dbg.js +++ b/versions/pc8080/1.23.3/pc8080-dbg.js @@ -1,134 +1,134 @@ (function(){var m;function aa(a,b){var c;if(a){b||(b=16);if("$"==a.charAt(0))b=16,a=a.substr(1);else if("0x"==a.substr(0,2))b=16,a=a.substr(2);else{var d=a.charAt(a.length-1).toLowerCase();"h"==d?(b=16,d=null):"."==d&&(b=10,d=null);null==d&&(a=a.substr(0,a.length-1))}var e,d=a,f=b;(f&&10!=f?16==f?null!==d.match(/^[0-9a-f]+$/i):2==f&&null!==d.match(/^[01]+$/i):null!==d.match(/^[0-9]+$/))&&!isNaN(e=parseInt(a,b))&&(c=e|0)}return c} function n(a,b){var c="";void 0===b?b=8:8=d?48:55),c=String.fromCharCode(d)+c;a>>=4}return c}function r(a){return"0x"+n(a,4)}function ba(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function ga(a){return a.replace(/[&<>"']/g,function(a){return fa[a]})}function ha(a,b){return(a+" ").slice(0,b)}function ja(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} -function ka(a,b,c){var d=0,e=a.length,f=0;for(void 0===c&&(c=function(a,b){return a>b?1:a>1,g;g=c(b,a[h]);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 na(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;c":">",'"':""","'":"'"};function ga(a){return a.replace(/[&<>"']/g,function(a){return ea[a]})}function ha(a,b){return(a+" ").slice(0,b)}function ia(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} +function ja(a,b,c){var d=0,e=a.length,f=0;for(void 0===c&&(c=function(a,b){return a>b?1:a>1,g;g=c(b,a[h]);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 ma(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;c=this.J?10:20>=this.J?12:24>=this.J?14:15;this.Ba=1<>2;this.A=this.Ba-1;this.L=this.O/this.Ba|0;this.K=this.L-1;this.w=[];this.u=[];this.D=this.I=!1;this.Z=[];this.ba=[];a=new F;ub(a,this.H);this.V=Array(this.L);for(b=0;b>>a.la;0f&&(l=f);if(g&&g.size){if(g.type==d){if(e+f<=g.F)return g.Fb+=g.F-e,g.F=e,!0;if(e>=g.F+g.Fb){l=g.size-(e-k);l>f&&(l=f);g.Fb=e-g.F+l;e=k+a.Ba;f-=l;h++;continue}}return wb(1,e,f)}e=new F(e,l,a.Ba,d);ub(e,a.H,g);a.V[h++]=e;e=k+a.Ba;f-=l}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+xb[d]+" at "+r(b)),!0):wb(2,b,c)}m.Y=function(a){return this.V[(a&this.G)>>>this.la].qb(a&this.A,a)}; -function yb(a,b){return a.V[(b&a.G)>>>a.la].Db(b&a.A,b)}m.Pa=function(a){var b=a&this.A,c=(a&this.G)>>>this.la;return b!=this.A?this.V[c].vc(b,a):this.V[c++].qb(b,a)|this.V[c&this.K].qb(0,a+1)<<8};function zb(a,b){var c=b&a.A,d=(b&a.G)>>>a.la;return c!=a.A?a.V[d].Zb(c,b):a.V[d++].Db(c,b)|a.V[d&a.K].Db(0,b+1)<<8}m.qa=function(a,b){this.V[(a&this.G)>>>this.la].sb(a&this.A,b&255,a)};function Ab(a,b,c){a.V[(b&a.G)>>>a.la].Gb(b&a.A,c&255,b)} -m.Qb=function(a,b){var c=a&this.A,d=(a&this.G)>>>this.la;c!=this.A?this.V[d].xc(c,b&65535,a):(this.V[d++].sb(c,b&255,a),this.V[d&this.K].sb(0,b>>8&255,a+1))};function Bb(a,b){if(void 0===b)return a.D=!a.D,a.D;void 0===a.w[b]&&(a.w[b]=[null,!1]);a.w[b][1]=!a.w[b][1];return a.w[b][1]}function Cb(a,b,c){var d;void 0===d&&(d=0);if(c)for(var e in c){var f=a,h=+e+d,g=c[e].bind(b);if(void 0!==g)for(var k=+e+d;k<=h;k++)void 0!==f.w[k]?t("Input port "+r(k)+" already registered"):f.w[k]=[g,!1]}} -function Db(a,b,c){for(var d=1,e=0,f=0;0>>=f)&k;if(void 0!==h){if(h[0])h[0](b,k,d);a.H&&a.I!=h[1]&&Ib(a.H,b,k)}else a.H&&(fb(a.H,a,b,k,d),a.I&&Ib(a.H,b,k));f+=g<<3;b+=g;e-=g}} -function wb(a,b,c){t("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1}var Jb;if(ob){var Sb=new ArrayBuffer(2);(new DataView(Sb)).setUint16(0,256,!0);Jb=256===(new Uint16Array(Sb))[0]}else Jb=!1;var Tb=Jb; -function F(a,b,c,d){this.id=Ub+=2;this.b=null;this.F=a;this.Fb=b;this.size=c||0;this.type=d||Vb;this.M=d==Wb;ub(this);this.Ka=this.oc=!1;if(c)if(ob)this.D=new ArrayBuffer(c),this.I=new DataView(this.D,0,c),this.A=new Uint8Array(this.D,0,c),this.K=new Uint16Array(this.D,0,c>>1),this.b=new Int32Array(this.D,0,c>>2),Xb(this,Tb?Yb:Zb);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},da:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ma: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},Ea:function(a,b){var c=a>>2,d=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2,d=(a&3)<<3;24>d?this.b[c]=this.b[c]&~(65535<>8);this.Ka=!0},Z:function(a,b){if(this.H&&null!=this.F){var c=this.H;dc(c,this.F+a,1,c.Z)&&c.ja(!0)}return this.Db(a,b)},fa:function(a,b){if(this.H&&null!=this.F){var c=this.H;dc(c,this.F+a,2,c.Z)&&c.ja(!0)}return this.Zb(a,b)},wa:function(a,b,c){if(this.H&&null!=this.F){var d=this.H;dc(d,this.F+a,1,d.I)&&d.ja(!0)}this.M?this.G(a,b,c):this.Gb(a,b,c)},Ga:function(a, -b,c){if(this.H&&null!=this.F){var d=this.H;dc(d,this.F+a,2,d.I)&&d.ja(!0)}this.M?this.G(a,b,c):this.$b(a,b,c)},W:function(a){return this.A[a]},ba:function(a){return this.A[a]},ea:function(a){return this.I.getUint16(a,!0)},ka:function(a){return a&1?this.A[a]|this.A[a+1]<<8:this.K[a>>1]},ra:function(a,b){this.A[a]=b;this.Ka=!0},za:function(a,b){this.A[a]=b;this.Ka=!0},Fa:function(a,b){this.I.setUint16(a,b,!0);this.Ka=!0},Ha:function(a,b){a&1?(this.A[a]=b,this.A[a+1]=b>>8):this.K[a>>1]=b;this.Ka=!0}}; -function ub(a,b,c){a.H=b;a.w=a.u=0;c&&((a.w=c.w)&&cc(a,bc,!1),(a.u=c.u)&&ac(a,bc,!1))}function ec(a,b){b?0===--a.u&&(a.sb=a.M?a.G:a.Gb,a.xc=a.M?a.J:a.$b):0===--a.w&&(a.qb=a.Db,a.vc=a.Zb)}function ac(a,b,c){c&&a.u||(a.sb=!a.M&&b[2]||a.G,a.xc=!a.M&&b[3]||a.J);if(c||void 0===c)a.Gb=b[2]||a.G,a.$b=b[3]||a.J}function cc(a,b,c){c&&a.w||(a.qb=b[0]||a.L,a.vc=b[1]||a.O);if(c||void 0===c)a.Db=b[0]||a.L,a.Zb=b[1]||a.O}function Xb(a,b){b||(b=fc);cc(a,b,void 0);ac(a,b,void 0)} -var fc=[],$b=[F.prototype.da,F.prototype.ma,F.prototype.Ea,F.prototype.ab],bc=[F.prototype.Z,F.prototype.fa,F.prototype.wa,F.prototype.Ga];if(ob)var Zb=[F.prototype.W,F.prototype.ea,F.prototype.ra,F.prototype.Fa],Yb=[F.prototype.ba,F.prototype.ka,F.prototype.za,F.prototype.Ha]; -function gc(a,b){w.call(this,"CPU",a,gc,1);var c=a.cycles||b,d=a.multiplier||1;this.i={};this.i.pb=c;this.i.Nb=0;this.i.Za=d;this.i.Vb=Math.round(this.i.pb/1E4)/100;this.i.Xa=this.i.Vb*this.i.Za;this.C.va=!1;this.C.Ub=!1;this.C.nc=a.autoStart;this.C.pc=!1;this.C.hb=!1;this.i.xb=this.i.mb=0;this.i.yb=a.csStart;this.i.lb=a.csInterval;this.i.nb=a.csStop;this.ba=this.$a.bind(this);E(this)}$a(gc);var hc=["power","reset"];m=gc.prototype; -m.Na=function(a,b,c,d){this.w=a;this.A=b;this.H=d;for(b=0;b=a.i.mb&&(a.i.mb+=a.i.lb,c=!0);0<=a.i.nb&&a.i.nb<=Bc(a)&&(a.i.lb=a.i.nb=-1,kc(a),a.ja(),c=!0);c&&a.g(Bc(a)+" cycles: checksum="+n(a.i.xb))}} -m.pa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.M[b]=c;a=!0;break;case "run":this.M[b]=c;c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.C.sa)a=!0;else{var b=null,c,g=cb(a.id);for(c=0;cc&&(c=2);var d=1;b&&1a.i.Wa/a.i.Xa?b=1:d=!0;a.i.Za=b;b=a.i.Vb*a.i.Za;if(a.i.Xa!=b){a.i.Xa=b;b=a.i.Xa.toFixed(2)+"Mhz";var e=a.M.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.w&&a.w.Eb()}Dc(a,a.I);a.I=0;a.i.kb=la();a.i.Ya=0;Ec(a);return d} -m.$a=function(a){if(ib(this,!0)){if(!this.C.va){Cc(this);this.w&&this.w.start(this.i.kb,Bc(this));this.C.va=!0;this.C.Ub=!0;this.G&&this.G.start();var b=this.M.run;b&&(b.textContent="Halt");this.w&&(this.w.Da(!0),a&&this.w.Eb(!0))}this.i.Yb>=this.i.pb&&Ec(this,!0);this.i.Bb=0;this.i.Mb=la();this.i.Ya&&(a=this.i.Mb-this.i.Ya,a>this.i.rc&&(this.i.kb+=a,this.i.kb>this.i.Mb&&(this.i.kb=this.i.Mb)));try{do{this.rb(this.C.hb?1:this.i.nd);var c=this.D-this.b;this.I+=c;this.i.Bb+=c;Dc(this,0,!0);Ac(this, -c);this.i.Ab-=c;0>=this.i.Ab&&(this.i.Ab+=this.i.tc,this.w&&Fc(this.w,this.i.Nb++),this.i.Nb>this.L&&(this.i.Nb=0));this.i.zb-=c;0>=this.i.zb&&(this.i.zb+=this.i.sc,this.w&&this.w.Da());this.i.ob-=c;if(0>=this.i.ob){this.i.ob+=this.i.Xb;break}}while(this.C.va)}catch(e){this.ja();mc(this);this.w&&this.w.stop(la(),Bc(this));ib(this,!1);nb(this,e.stack||e.message);return}c=setTimeout;a=this.ba;this.i.Ya=la();b=this.i.rc;this.i.Bb&&(b=Math.round(b*this.i.Bb/this.i.Xb));var b=b-(this.i.Ya-this.i.Mb),d= -this.i.Ya-this.i.kb;d&&(this.i.Wa=Math.round(this.I/(10*d))/100,864E5<=d&&(this.J=0,Cc(this)));if(0>b||this.i.Wa>8&255;a.R=b&255}function Pc(a){return a.S<<8|a.T}function Qc(a,b){a.S=b>>8&255;a.T=b&255}function K(a){return a.U<<8|a.X} -function Rc(a,b){a.U=b>>8&255;a.X=b&255}function G(a,b){a.N=b&65535}function Sc(a){return a.aa&256?1:0}function Tc(a,b){a.aa=a.aa&255|b}function Uc(a){return pb[a.ca&255]?4:0}function Vc(a){return(a.ca^a.ua)&16?16:0}function Wc(a){return a.aa&255?0:64}function Xc(a){return a.ca&128?128:0}function Mc(a){return a.ta&-214|Xc(a)|Wc(a)|Vc(a)|Uc(a)|Sc(a)}function Kc(a,b){a.aa=a.ca=a.ua=0;b&1&&(a.aa|=256);b&4||(a.ca|=1);b&16&&(a.ua|=16);b&64||(a.aa|=255);b&128&&(a.ca^=192);a.ta=a.ta&-726|b&512|2} -function Yc(a,b){a.ua=a.j^b;return a.ca=(a.aa=a.j+b)&255}function Zc(a,b){a.ua=a.j^b;return a.ca=(a.aa=a.j+b+(a.aa&256?1:0))&255}function $c(a,b){a.aa=a.ca=a.ua=a.j&b;(a.j|b)&8&&(a.ua^=16);return a.aa}function ad(a,b){a.ua=b^255;b=a.ca=b+255&255;a.aa=a.aa&-256|b;return b}function bd(a,b){a.ua=b;b=a.ca=b+1&255;a.aa=a.aa&-256|b;return b}function cd(a,b){return a.ca=a.aa=a.ua=a.j|b}function L(a,b){b^=255;a.ua=a.j^b;return a.ca=(a.aa=a.j+b+1^256)&255} -function wd(a,b){b^=255;a.ua=a.j^b;return a.ca=(a.aa=a.j+b+(a.aa&256?0:1)^256)&255}function xd(a,b){return a.ca=a.aa=a.ua=a.j^b}m.Y=function(a){return this.A.Y(a)};m.qa=function(a,b){this.A.qa(a,b)};function M(a){var b=a.Y(a.N);G(a,a.N+1);return b}function N(a){var b=a.A.Pa(a.N);G(a,a.N+2);return b}function P(a){var b=a.A.Pa(a.ia);a.ia=a.ia+2&65535;return b}function Q(a,b){a.ia=a.ia-2&65535;a.A.Qb(a.ia,b)} -function R(a,b,c,d){d=d||2;a.M[b]&&(void 0===c&&(nb(a,"Value for "+b+" is invalid"),a.ja()),c=!a.C.va||a.C.pc?n(c,d):"--------".substr(0,d),a.M[b].textContent!=c&&(a.M[b].textContent=c))} -m.Da=function(a){this.Z&&(a||!this.C.va||this.C.pc)&&(R(this,"A",this.j),R(this,"B",this.P),R(this,"C",this.R),R(this,"BC",Nc(this),4),R(this,"D",this.S),R(this,"E",this.T),R(this,"DE",Pc(this),4),R(this,"H",this.U),R(this,"L",this.X),R(this,"HL",K(this),4),R(this,"SP",this.ia,4),R(this,"PC",this.N,4),a=Mc(this),R(this,"PS",a,4),R(this,"IF",a&512?1:0,1),R(this,"SF",a&128?1:0,1),R(this,"ZF",a&64?1:0,1),R(this,"AF",a&16?1:0,1),R(this,"PF",a&4?1:0,1),R(this,"CF",a&1?1:0,1));if(a=this.M.speed)a.textContent= +this.ga=function(a){this.g(a,this.ab)}),!0;default:return!1}},log:function(){},g:function(){},status:function(a){this.g(this.ab+": "+a)},ga:function(a,b,c){Ka(a,b,c||this.type)},Ca:function(){return this.C.sa=!0},Ja:function(a,b){b&&(this.C.sa=!1);return!0}};function D(a,b,c,d,e,f){var h=!0;a.H&&(!0===h?h=0:null==h&&(h=a.na),eb(a.H,a,b,c,d,e,f,h))}function fb(a,b,c){a.H&&(!0===c||gb(a,c|0))&&a.H.message(b,void 0)} +function gb(a,b){if(a.H){a===a.H?b|=0:b=b||a.na;var c=a.H.na&b;return!!b&&c===b||!!(c&a.H.gd)}return!1}function hb(a,b){if(a.C.Tb)return a.C.gb&&(a.C.gb=!1),a.C.Tb=!1;if(a.C.ib)return a.g(a.toString()+" error"),!1;a.C.gb=b;return a.C.gb}function ib(a,b){a.C.gb&&(b?a.C.Tb=!0:void 0===b&&a.g(a.toString()+" busy"));return a.C.gb}function E(a){if(!a.C.ib&&(a.C.jb=!0,a.C.jb)){var b=a.Lb;a.Lb=null;b&&b()}}function jb(a,b){b&&(a.C.jb?b():a.Lb=b);return a.C.jb}function kb(a,b){a.C.ib=!0;a.ga(b)} +var nb="undefined"!==typeof ArrayBuffer,ob=[1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1, +0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1];function pb(a){w.call(this,"Panel",a,pb)}Za(pb);m=pb.prototype;m.pa=function(a,b,c,d){return this.w&&this.w.pa(a,b,c,d)||this.b&&this.b.pa(a,b,c,d)||this.ea&&this.ea.pa(a,b,c,d)||this.H&&this.H.pa(a,b,c,d)?!0:this.parent.pa.call(this,a,b,c,d)};m.Oa=function(a,b,c,d){this.w=a;this.A=b;this.b=c;this.H=d;this.ea=qb(a,"Keyboard")};m.Ca=function(a,b){b||rb();return!0};m.Ja=function(){return!0};m.Da=function(){}; +function rb(){for(var a=!1,b=B(document,"pc8080","panel"),c=0;c=this.J?10:20>=this.J?12:24>=this.J?14:15;this.Ba=1<>2;this.A=this.Ba-1;this.L=this.O/this.Ba|0;this.K=this.L-1;this.w=[];this.u=[];this.D=this.I=!1;this.Z=[];this.ba=[];a=new F;tb(a,this.H);this.V=Array(this.L);for(b=0;b>>a.la;0f&&(l=f);if(g&&g.size){if(g.type==d){if(e+f<=g.F)return g.Fb+=g.F-e,g.F=e,!0;if(e>=g.F+g.Fb){l=g.size-(e-k);l>f&&(l=f);g.Fb=e-g.F+l;e=k+a.Ba;f-=l;h++;continue}}return vb(1,e,f)}e=new F(e,l,a.Ba,d);tb(e,a.H,g);a.V[h++]=e;e=k+a.Ba;f-=l}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+wb[d]+" at "+r(b)),!0):vb(2,b,c)}m.Y=function(a){return this.V[(a&this.G)>>>this.la].qb(a&this.A,a)}; +function xb(a,b){return a.V[(b&a.G)>>>a.la].Db(b&a.A,b)}m.Pa=function(a){var b=a&this.A,c=(a&this.G)>>>this.la;return b!=this.A?this.V[c].xc(b,a):this.V[c++].qb(b,a)|this.V[c&this.K].qb(0,a+1)<<8};function yb(a,b){var c=b&a.A,d=(b&a.G)>>>a.la;return c!=a.A?a.V[d].Zb(c,b):a.V[d++].Db(c,b)|a.V[d&a.K].Db(0,b+1)<<8}m.qa=function(a,b){this.V[(a&this.G)>>>this.la].sb(a&this.A,b&255,a)};function zb(a,b,c){a.V[(b&a.G)>>>a.la].Gb(b&a.A,c&255,b)} +m.Qb=function(a,b){var c=a&this.A,d=(a&this.G)>>>this.la;c!=this.A?this.V[d].zc(c,b&65535,a):(this.V[d++].sb(c,b&255,a),this.V[d&this.K].sb(0,b>>8&255,a+1))};function Ab(a,b){if(void 0===b)return a.D=!a.D,a.D;void 0===a.w[b]&&(a.w[b]=[null,!1]);a.w[b][1]=!a.w[b][1];return a.w[b][1]}function Bb(a,b,c){var d;void 0===d&&(d=0);if(c)for(var e in c){var f=a,h=+e+d,g=c[e].bind(b);if(void 0!==g)for(var k=+e+d;k<=h;k++)void 0!==f.w[k]?t("Input port "+r(k)+" already registered"):f.w[k]=[g,!1]}} +function Cb(a,b,c){for(var d=1,e=0,f=0;0>>=f)&k;if(void 0!==h){if(h[0])h[0](b,k,d);a.H&&a.I!=h[1]&&Hb(a.H,b,k)}else a.H&&(eb(a.H,a,b,k,d),a.I&&Hb(a.H,b,k));f+=g<<3;b+=g;e-=g}} +function vb(a,b,c){t("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1}var Ib;if(nb){var Jb=new ArrayBuffer(2);(new DataView(Jb)).setUint16(0,256,!0);Ib=256===(new Uint16Array(Jb))[0]}else Ib=!1;var Sb=Ib; +function F(a,b,c,d){this.id=Tb+=2;this.b=null;this.F=a;this.Fb=b;this.size=c||0;this.type=d||Ub;this.M=d==Vb;tb(this);this.La=this.qc=!1;if(c)if(nb)this.D=new ArrayBuffer(c),this.I=new DataView(this.D,0,c),this.A=new Uint8Array(this.D,0,c),this.K=new Uint16Array(this.D,0,c>>1),this.b=new Int32Array(this.D,0,c>>2),Wb(this,Sb?Xb:Yb);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},da:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ma: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},Ea:function(a,b){var c=a>>2,d=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2,d=(a&3)<<3;24>d?this.b[c]=this.b[c]&~(65535<>8);this.La=!0},Z:function(a,b){if(this.H&&null!=this.F){var c=this.H;cc(c,this.F+a,1,c.Z)&&c.ja(!0)}return this.Db(a,b)},fa:function(a,b){if(this.H&&null!=this.F){var c=this.H;cc(c,this.F+a,2,c.Z)&&c.ja(!0)}return this.Zb(a,b)},wa:function(a,b,c){if(this.H&&null!=this.F){var d=this.H;cc(d,this.F+a,1,d.I)&&d.ja(!0)}this.M?this.G(a,b,c):this.Gb(a,b,c)},Ga:function(a, +b,c){if(this.H&&null!=this.F){var d=this.H;cc(d,this.F+a,2,d.I)&&d.ja(!0)}this.M?this.G(a,b,c):this.$b(a,b,c)},W:function(a){return this.A[a]},ba:function(a){return this.A[a]},ea:function(a){return this.I.getUint16(a,!0)},ka:function(a){return a&1?this.A[a]|this.A[a+1]<<8:this.K[a>>1]},ra:function(a,b){this.A[a]=b;this.La=!0},za:function(a,b){this.A[a]=b;this.La=!0},Fa:function(a,b){this.I.setUint16(a,b,!0);this.La=!0},Ha:function(a,b){a&1?(this.A[a]=b,this.A[a+1]=b>>8):this.K[a>>1]=b;this.La=!0}}; +function tb(a,b,c){a.H=b;a.w=a.u=0;c&&((a.w=c.w)&&bc(a,ac,!1),(a.u=c.u)&&$b(a,ac,!1))}function dc(a,b){b?0===--a.u&&(a.sb=a.M?a.G:a.Gb,a.zc=a.M?a.J:a.$b):0===--a.w&&(a.qb=a.Db,a.xc=a.Zb)}function $b(a,b,c){c&&a.u||(a.sb=!a.M&&b[2]||a.G,a.zc=!a.M&&b[3]||a.J);if(c||void 0===c)a.Gb=b[2]||a.G,a.$b=b[3]||a.J}function bc(a,b,c){c&&a.w||(a.qb=b[0]||a.L,a.xc=b[1]||a.O);if(c||void 0===c)a.Db=b[0]||a.L,a.Zb=b[1]||a.O}function Wb(a,b){b||(b=ec);bc(a,b,void 0);$b(a,b,void 0)} +var ec=[],Zb=[F.prototype.da,F.prototype.ma,F.prototype.Ea,F.prototype.ab],ac=[F.prototype.Z,F.prototype.fa,F.prototype.wa,F.prototype.Ga];if(nb)var Yb=[F.prototype.W,F.prototype.ea,F.prototype.ra,F.prototype.Fa],Xb=[F.prototype.ba,F.prototype.ka,F.prototype.za,F.prototype.Ha]; +function fc(a,b){w.call(this,"CPU",a,fc,1);var c=a.cycles||b,d=a.multiplier||1;this.i={};this.i.pb=c;this.i.Nb=0;this.i.Za=d;this.i.Vb=Math.round(this.i.pb/1E4)/100;this.i.Xa=this.i.Vb*this.i.Za;this.C.va=!1;this.C.Ub=!1;this.C.pc=a.autoStart;this.C.rc=!1;this.C.hb=!1;this.i.xb=this.i.mb=0;this.i.yb=a.csStart;this.i.lb=a.csInterval;this.i.nb=a.csStop;this.ba=this.$a.bind(this);E(this)}Za(fc);var gc=["power","reset"];m=fc.prototype; +m.Oa=function(a,b,c,d){this.w=a;this.A=b;this.H=d;for(b=0;b=a.i.mb&&(a.i.mb+=a.i.lb,c=!0);0<=a.i.nb&&a.i.nb<=Ac(a)&&(a.i.lb=a.i.nb=-1,jc(a),a.ja(),c=!0);c&&a.g(Ac(a)+" cycles: checksum="+n(a.i.xb))}} +m.pa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.M[b]=c;a=!0;break;case "run":this.M[b]=c;c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.C.sa)a=!0;else{var b=null,c,g=bb(a.id);for(c=0;cc&&(c=2);var d=1;b&&1a.i.Wa/a.i.Xa?b=1:d=!0;a.i.Za=b;b=a.i.Vb*a.i.Za;if(a.i.Xa!=b){a.i.Xa=b;b=a.i.Xa.toFixed(2)+"Mhz";var e=a.M.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.w&&a.w.Eb()}Cc(a,a.I);a.I=0;a.i.kb=ka();a.i.Ya=0;Dc(a);return d} +m.$a=function(a){if(hb(this,!0)){if(!this.C.va){Bc(this);this.w&&this.w.start(this.i.kb,Ac(this));this.C.va=!0;this.C.Ub=!0;this.G&&this.G.start();var b=this.M.run;b&&(b.textContent="Halt");this.w&&(this.w.Da(!0),a&&this.w.Eb(!0))}this.i.Yb>=this.i.pb&&Dc(this,!0);this.i.Bb=0;this.i.Mb=ka();this.i.Ya&&(a=this.i.Mb-this.i.Ya,a>this.i.tc&&(this.i.kb+=a,this.i.kb>this.i.Mb&&(this.i.kb=this.i.Mb)));try{do{this.rb(this.C.hb?1:this.i.pd);var c=this.D-this.b;this.I+=c;this.i.Bb+=c;Cc(this,0,!0);nc(this, +c);this.i.Ab-=c;0>=this.i.Ab&&(this.i.Ab+=this.i.vc,this.w&&Ec(this.w,this.i.Nb++),this.i.Nb>this.L&&(this.i.Nb=0));this.i.zb-=c;0>=this.i.zb&&(this.i.zb+=this.i.uc,this.w&&this.w.Da());this.i.ob-=c;if(0>=this.i.ob){this.i.ob+=this.i.Xb;break}}while(this.C.va)}catch(e){this.ja();lc(this);this.w&&this.w.stop(ka(),Ac(this));hb(this,!1);kb(this,e.stack||e.message);return}c=setTimeout;a=this.ba;this.i.Ya=ka();b=this.i.tc;this.i.Bb&&(b=Math.round(b*this.i.Bb/this.i.Xb));var b=b-(this.i.Ya-this.i.Mb),d= +this.i.Ya-this.i.kb;d&&(this.i.Wa=Math.round(this.I/(10*d))/100,864E5<=d&&(this.J=0,Bc(this)));if(0>b||this.i.Wa>8&255;a.R=b&255}function Pc(a){return a.S<<8|a.T}function Qc(a,b){a.S=b>>8&255;a.T=b&255}function J(a){return a.U<<8|a.X} +function Rc(a,b){a.U=b>>8&255;a.X=b&255}function G(a,b){a.N=b&65535}function Sc(a){return a.aa&256?1:0}function Tc(a,b){a.aa=a.aa&255|b}function Uc(a){return ob[a.ca&255]?4:0}function Vc(a){return(a.ca^a.ua)&16?16:0}function Wc(a){return a.aa&255?0:64}function Xc(a){return a.ca&128?128:0}function Lc(a){return a.ta&-214|Xc(a)|Wc(a)|Vc(a)|Uc(a)|Sc(a)}function Jc(a,b){a.aa=a.ca=a.ua=0;b&1&&(a.aa|=256);b&4||(a.ca|=1);b&16&&(a.ua|=16);b&64||(a.aa|=255);b&128&&(a.ca^=192);a.ta=a.ta&-726|b&512|2} +function Yc(a,b){a.ua=a.j^b;return a.ca=(a.aa=a.j+b)&255}function Zc(a,b){a.ua=a.j^b;return a.ca=(a.aa=a.j+b+(a.aa&256?1:0))&255}function $c(a,b){a.aa=a.ca=a.ua=a.j&b;(a.j|b)&8&&(a.ua^=16);return a.aa}function ad(a,b){a.ua=b^255;b=a.ca=b+255&255;a.aa=a.aa&-256|b;return b}function bd(a,b){a.ua=b;b=a.ca=b+1&255;a.aa=a.aa&-256|b;return b}function cd(a,b){return a.ca=a.aa=a.ua=a.j|b}function K(a,b){b^=255;a.ua=a.j^b;return a.ca=(a.aa=a.j+b+1^256)&255} +function wd(a,b){b^=255;a.ua=a.j^b;return a.ca=(a.aa=a.j+b+(a.aa&256?0:1)^256)&255}function xd(a,b){return a.ca=a.aa=a.ua=a.j^b}m.Y=function(a){return this.A.Y(a)};m.qa=function(a,b){this.A.qa(a,b)};function L(a){var b=a.Y(a.N);G(a,a.N+1);return b}function M(a){var b=a.A.Pa(a.N);G(a,a.N+2);return b}function N(a){var b=a.A.Pa(a.ia);a.ia=a.ia+2&65535;return b}function P(a,b){a.ia=a.ia-2&65535;a.A.Qb(a.ia,b)} +function Q(a,b,c,d){d=d||2;a.M[b]&&(void 0===c&&(kb(a,"Value for "+b+" is invalid"),a.ja()),c=!a.C.va||a.C.rc?n(c,d):"--------".substr(0,d),a.M[b].textContent!=c&&(a.M[b].textContent=c))} +m.Da=function(a){this.Z&&(a||!this.C.va||this.C.rc)&&(Q(this,"A",this.j),Q(this,"B",this.P),Q(this,"C",this.R),Q(this,"BC",Nc(this),4),Q(this,"D",this.S),Q(this,"E",this.T),Q(this,"DE",Pc(this),4),Q(this,"H",this.U),Q(this,"L",this.X),Q(this,"HL",J(this),4),Q(this,"SP",this.ia,4),Q(this,"PC",this.N,4),a=Lc(this),Q(this,"PS",a,4),Q(this,"IF",a&512?1:0,1),Q(this,"SF",a&128?1:0,1),Q(this,"ZF",a&64?1:0,1),Q(this,"AF",a&16?1:0,1),Q(this,"PF",a&4?1:0,1),Q(this,"CF",a&1?1:0,1));if(a=this.M.speed)a.textContent= this.C.va&&this.i.Wa?this.i.Wa.toFixed(2)+"Mhz":"Stopped"}; -m.rb=function(a){this.C.Kb=!0;var b=this.C.fd=this.H&&yd(this.H),c=a?this.C.Ub?0:1:-1;this.C.Ub=!1;this.D=this.b=a;do{if(this.u){var d;this.u&8&&this.ta&512?(d=199|(this.u&7)<<3,this.u&=-16,this.ta&=-513,this.O[d].call(this),d=!0):d=!1;if(d){if(!a){this.g("interrupt dispatched");break}}else if(this.u&16){this.b=0;break}}if(b){if(zd(this.H,this.N,c)){this.ja();break}c=1}this.O[M(this)].call(this)}while(0>8;Tc(this,a&256);this.b-=4},Ad,function(){var a;Rc(this,a=K(this)+Nc(this));Tc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(Nc(this));this.b-=7},function(){Oc(this,Nc(this)-1);this.b-= -5},function(){this.R=bd(this,this.R);this.b-=5},function(){this.R=ad(this,this.R);this.b-=5},function(){this.R=M(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(a|this.j)>>1;Tc(this,a);this.b-=4},Ad,function(){Qc(this,N(this));this.b-=10},function(){this.qa(Pc(this),this.j);this.b-=7},function(){Qc(this,Pc(this)+1);this.b-=5},function(){this.S=bd(this,this.S);this.b-=5},function(){this.S=ad(this,this.S);this.b-=5},function(){this.S=M(this);this.b-=7},function(){var a=this.j<<1;this.j=a&255| -Sc(this);Tc(this,a&256);this.b-=4},Ad,function(){var a;Rc(this,a=K(this)+Pc(this));Tc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(Pc(this));this.b-=7},function(){Qc(this,Pc(this)-1);this.b-=5},function(){this.T=bd(this,this.T);this.b-=5},function(){this.T=ad(this,this.T);this.b-=5},function(){this.T=M(this);this.b-=7},function(){var a=this.j<<8;this.j=(Sc(this)<<8|this.j)>>1;Tc(this,a&256);this.b-=4},Ad,function(){Rc(this,N(this));this.b-=10},function(){var a=N(this);this.A.Qb(a,K(this)); -this.b-=16},function(){Rc(this,K(this)+1);this.b-=5},function(){this.U=bd(this,this.U);this.b-=5},function(){this.U=ad(this,this.U);this.b-=5},function(){this.U=M(this);this.b-=7},function(){var a=0,b=Sc(this);if(Vc(this)||9<(this.j&15))a|=6;if(b||154<=this.j)a|=96,b=1;this.j=Yc(this,a);Tc(this,b?256:0);this.b-=4},Ad,function(){var a;Rc(this,a=K(this)+K(this));Tc(this,a>>8&256);this.b-=10},function(){var a;a=N(this);a=this.A.Pa(a);Rc(this,a);this.b-=16},function(){Rc(this,K(this)-1);this.b-=5},function(){this.X= -bd(this,this.X);this.b-=5},function(){this.X=ad(this,this.X);this.b-=5},function(){this.X=M(this);this.b-=7},function(){this.j=~this.j&255;this.b-=4},Ad,function(){this.ia=N(this)&65535;this.b-=10},function(){this.qa(N(this),this.j);this.b-=13},function(){this.ia=this.ia+1&65535;this.b-=5},function(){var a=K(this);this.qa(a,bd(this,this.Y(a)));this.b-=10},function(){var a=K(this);this.qa(a,ad(this,this.Y(a)));this.b-=10},function(){this.qa(K(this),M(this));this.b-=10},function(){this.aa|=256;this.b-= -4},Ad,function(){var a;Rc(this,a=K(this)+this.ia);Tc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(N(this));this.b-=13},function(){this.ia=this.ia-1&65535;this.b-=5},function(){this.j=bd(this,this.j);this.b-=5},function(){this.j=ad(this,this.j);this.b-=5},function(){this.j=M(this);this.b-=7},function(){Tc(this,Sc(this)?0:256);this.b-=4},function(){this.b-=5},function(){this.P=this.R;this.b-=5},function(){this.P=this.S;this.b-=5},function(){this.P=this.T;this.b-=5},function(){this.P=this.U;this.b-= -5},function(){this.P=this.X;this.b-=5},function(){this.P=this.Y(K(this));this.b-=7},function(){this.P=this.j;this.b-=5},function(){this.R=this.P;this.b-=5},function(){this.b-=5},function(){this.R=this.S;this.b-=5},function(){this.R=this.T;this.b-=5},function(){this.R=this.U;this.b-=5},function(){this.R=this.X;this.b-=5},function(){this.R=this.Y(K(this));this.b-=7},function(){this.R=this.j;this.b-=5},function(){this.S=this.P;this.b-=5},function(){this.S=this.R;this.b-=5},function(){this.b-=5},function(){this.S= -this.T;this.b-=5},function(){this.S=this.U;this.b-=5},function(){this.S=this.X;this.b-=5},function(){this.S=this.Y(K(this));this.b-=7},function(){this.S=this.j;this.b-=5},function(){this.T=this.P;this.b-=5},function(){this.T=this.R;this.b-=5},function(){this.T=this.S;this.b-=5},function(){this.b-=5},function(){this.T=this.U;this.b-=5},function(){this.T=this.X;this.b-=5},function(){this.T=this.Y(K(this));this.b-=7},function(){this.T=this.j;this.b-=5},function(){this.U=this.P;this.b-=5},function(){this.U= -this.R;this.b-=5},function(){this.U=this.S;this.b-=5},function(){this.U=this.T;this.b-=5},function(){this.b-=5},function(){this.U=this.X;this.b-=5},function(){this.U=this.Y(K(this));this.b-=7},function(){this.U=this.j;this.b-=5},function(){this.X=this.P;this.b-=5},function(){this.X=this.R;this.b-=5},function(){this.X=this.S;this.b-=5},function(){this.X=this.T;this.b-=5},function(){this.X=this.U;this.b-=5},function(){this.b-=5},function(){this.X=this.Y(K(this));this.b-=7},function(){this.X=this.j; -this.b-=5},function(){this.qa(K(this),this.P);this.b-=7},function(){this.qa(K(this),this.R);this.b-=7},function(){this.qa(K(this),this.S);this.b-=7},function(){this.qa(K(this),this.T);this.b-=7},function(){this.qa(K(this),this.U);this.b-=7},function(){this.qa(K(this),this.X);this.b-=7},function(){var a=this.N-1;if(this.K.length)for(var b=0;b>8;this.b-=10},function(){var a=N(this);Xc(this)||G(this,a);this.b-=10},function(){this.ta&=-513;this.b-=4},function(){var a=N(this);Xc(this)||(Q(this,this.N),G(this,a),this.b-=6);this.b-=11},function(){Q(this,Mc(this)&255|this.j<<8);this.b-=11},function(){this.j=cd(this,M(this));this.b-=7},function(){Q(this,this.N);G(this,48);this.b-=11},function(){Xc(this)&&(G(this,P(this)), -this.b-=6);this.b-=5},function(){this.ia=K(this)&65535;this.b-=5},function(){var a=N(this);Xc(this)&&G(this,a);this.b-=10},function(){this.ta|=512;this.b-=4},function(){var a=N(this);Xc(this)&&(Q(this,this.N),G(this,a),this.b-=6);this.b-=11},Dd,function(){L(this,M(this));this.b-=7},function(){Q(this,this.N);G(this,56);this.b-=11}]; -function S(a){w.call(this,"ChipSet",a,S,32768);var b=a.model;b&&!Ed[b]&&La("Unrecognized ChipSet model: "+b);this.G=Ed[b]||{};a.sound&&(this.ba=null,window&&(this.ba=window.AudioContext||window.webkitAudioContext),this.ba&&new this.ba);E(this)}$a(S); -var T={xa:1978.1,Vc:{ya:0,Hd:1,Md:16,$d:32,ne:64,le:128,tb:14},Ua:{ya:1,Cc:1,Rc:2,Nc:4,Oc:16,Pc:32,Qc:64,tb:8},Wc:{ya:2,Gd:3,xe:4,Id:8,he:16,ie:32,je:64,Jd:128,tb:0},re:{ya:3},pe:{ya:2,be:7},te:{ya:3,ze:1,se:2,ke:4,Ud:8,Kd:16,yd:32},qe:{ya:4},ue:{ya:5,Nd:1,Od:2,Pd:4,Qd:8,Ae:16}},U={xa:100,bb:{ya:66,Ee:1,Lc:2,Mc:4,fe:8,de:16,cc:32,bc:64,Xd:128},Bc:{ya:66,INIT:0},Ia:{Zd:{ya:98},Qa:{Ac:0,zc:1,Tc:2,Zc:4,Fc:5,Sc:6,Uc:7},Jb:16383},Ec:{ya:162,INIT:0},Dc:{ya:194,INIT:0}},Ed={SI1978:T,VT100:U}; -S.prototype.pa=function(){return!1};S.prototype.Na=function(a,b,c,d){this.A=b;this.b=c;this.H=d;this.w=a;Cb(b,this,this.G.Ob);Gb(b,this,this.G.Pb)};S.prototype.Ca=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};S.prototype.Ja=function(a){return a?this.save():!0};T.INIT=[[T.Vc.tb,T.Ua.tb,T.Wc.tb,0,0,0,0]];U.INIT=[[U.Bc.INIT,U.bb.Lc|U.bb.Mc,U.Ec.INIT,U.Dc.INIT],[0,0,0,0,Array(100)]];m=S.prototype;m.reset=function(){this.G.INIT&&!this.restore(this.G.INIT)&&this.ga("reset error")}; -m.save=function(){var a=new I(this);switch(this.G.xa){case T.xa:J(a,0,[this.ra,this.D,this.wa,this.O,this.Z,this.ka,this.ma]);break;case U.xa:J(a,0,[this.da,this.J,this.fa,this.ea]),J(a,1,[this.L,this.u,this.K,this.W,this.I])}return a.data()}; -m.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.G.xa){case T.xa:return this.ra=b[0],this.D=b[1],this.wa=b[2],this.O=b[3],this.Z=b[4],this.ka=b[5],this.ma=b[6],!0;case U.xa:return this.da=b[0],this.J=b[2],this.fa=b[3],this.ea=b[4],b=a[1],this.L=b[0],this.u=b[1],this.K=b[2],this.W=b[3],this.I=b[4],!0}return!1};m.start=function(){};m.stop=function(){};function Fd(a,b,c){a.D&=~b;c&&(a.D|=b)}m.hd=function(a,b){var c=this.ra;D(this,a,null,b,"STATUS0",c);return c}; -m.jd=function(a,b){var c=this.D;D(this,a,null,b,"STATUS1",c);return c};m.kd=function(a,b){var c=this.wa;D(this,a,null,b,"STATUS2",c);return c};m.gd=function(a,b){var c=this.O>>8-this.Z&255;D(this,a,null,b,"SHIFT.RESULT",c);return c};m.od=function(a,b,c){D(this,a,b,c,"SHIFT.COUNT",null);this.Z=b};m.qd=function(a,b,c){D(this,a,b,c,"SOUND1",null);this.ka=b};m.pd=function(a,b,c){D(this,a,b,c,"SHIFT.DATA",null);this.O=b<<8|this.O>>8};m.rd=function(a,b,c){D(this,a,b,c,"SOUND2",null);this.ma=b}; -m.sd=function(a,b,c){D(this,a,b,c,"WATCHDOG",null)};function Gd(a){var b=0,c=0,d=~a.L;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} -m.ld=function(a,b){var c=this.J,c=c&~U.bb.bc;if((Bc(this.b)&64)<<1&&(c|=U.bb.bc,c!=this.J)){var d,e;d=this.K&1;e=this.K>>1&7;switch(e){case U.Ia.Qa.Uc:break;case U.Ia.Qa.zc:this.L=this.L<<1|d;break;case U.Ia.Qa.Fc:d=Gd(this);this.I[d]=U.Ia.Jb;gb(this,"doNVRCommand(): erase data at addr "+r(d));break;case U.Ia.Qa.Ac:this.u=this.u<<1|d;break;case U.Ia.Qa.Zc:d=Gd(this);e=this.u&U.Ia.Jb;this.I[d]=e;gb(this,"doNVRCommand(): write data "+r(e)+" to addr "+r(d));break;case U.Ia.Qa.Sc:d=Gd(this);e=this.I[d]; -null==e&&(e=U.Ia.Jb);this.u=e;gb(this,"doNVRCommand(): read data "+r(e)+" from addr "+r(d));break;case U.Ia.Qa.Tc:this.u<<=1;this.W=this.u&U.Ia.Jb+1;break;default:gb(this,"doNVRCommand(): unrecognized command 0x"+n(e,2))}}c&=~U.bb.cc;this.W&&(c|=U.bb.cc);this.J=c;D(this,a,null,b,"FLAGS.BUFFER",c);return c};m.td=function(a,b,c){D(this,a,b,c,"BRIGHTNESS",null);this.da=b};m.wd=function(a,b,c){D(this,a,b,c,"NVR.LATCH",null);this.K=b};m.vd=function(a,b,c){D(this,a,b,c,"DC012",null);this.fa=b}; -m.ud=function(a,b,c){D(this,a,b,c,"DC011",null);this.ea=b};T.Ob={0:S.prototype.hd,1:S.prototype.jd,2:S.prototype.kd,3:S.prototype.gd};T.Pb={2:S.prototype.od,3:S.prototype.qd,4:S.prototype.pd,5:S.prototype.rd,6:S.prototype.sd};U.Ob={66:S.prototype.ld};U.Pb={66:S.prototype.td,98:S.prototype.wd,162:S.prototype.vd,194:S.prototype.ud};Ja(function(){for(var a=A(document,"pc8080","chipset"),b=0;b>>0,h],q=ka(p,k,a.Sa);0>q&&p.splice(-(q+1),0,k)}l&&(g.a=l.replace(/''/g,'"'))}a.J.push({Te:b,F:c,md:d,Ma:e,lc:f})}delete this.Ma}return!0};Hd.prototype.Ja=function(){return!0}; -function Id(a,b,c,d){if(d)a.ga("Unable to load system ROM (error "+d+": "+b+")");else{bb(a.Rb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,h=e.data;if(f)a.w=f;else if(h)for(a.w=Array(4*h.length),d=c=0;c>8&255,a.w[d++]=h[c]>>16&255,a.w[d++]=h[c]>>24&255;else a.w=e;a.Ma=e.symbols;if(!a.w.length){t("Empty ROM: "+b);return}if(1==a.w.length){t(a.w[0]);return}}catch(g){a.ga("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm, +m.rb=function(a){this.C.Kb=!0;var b=this.C.hd=this.H&&yd(this.H),c=a?this.C.Ub?0:1:-1;this.C.Ub=!1;this.D=this.b=a;do{if(this.u){var d;this.u&8&&this.ta&512?(d=199|(this.u&7)<<3,this.u&=-16,this.ta&=-513,this.O[d].call(this),d=!0):d=!1;if(d){if(!a){this.g("interrupt dispatched");break}}else if(this.u&16){this.b=0;break}}if(b){if(zd(this.H,this.N,c)){this.ja();break}c=1}this.O[L(this)].call(this)}while(0>8;Tc(this,a&256);this.b-=4},Ad,function(){var a;Rc(this,a=J(this)+Nc(this));Tc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(Nc(this));this.b-=7},function(){Oc(this,Nc(this)-1);this.b-= +5},function(){this.R=bd(this,this.R);this.b-=5},function(){this.R=ad(this,this.R);this.b-=5},function(){this.R=L(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(a|this.j)>>1;Tc(this,a);this.b-=4},Ad,function(){Qc(this,M(this));this.b-=10},function(){this.qa(Pc(this),this.j);this.b-=7},function(){Qc(this,Pc(this)+1);this.b-=5},function(){this.S=bd(this,this.S);this.b-=5},function(){this.S=ad(this,this.S);this.b-=5},function(){this.S=L(this);this.b-=7},function(){var a=this.j<<1;this.j=a&255| +Sc(this);Tc(this,a&256);this.b-=4},Ad,function(){var a;Rc(this,a=J(this)+Pc(this));Tc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(Pc(this));this.b-=7},function(){Qc(this,Pc(this)-1);this.b-=5},function(){this.T=bd(this,this.T);this.b-=5},function(){this.T=ad(this,this.T);this.b-=5},function(){this.T=L(this);this.b-=7},function(){var a=this.j<<8;this.j=(Sc(this)<<8|this.j)>>1;Tc(this,a&256);this.b-=4},Ad,function(){Rc(this,M(this));this.b-=10},function(){var a=M(this);this.A.Qb(a,J(this)); +this.b-=16},function(){Rc(this,J(this)+1);this.b-=5},function(){this.U=bd(this,this.U);this.b-=5},function(){this.U=ad(this,this.U);this.b-=5},function(){this.U=L(this);this.b-=7},function(){var a=0,b=Sc(this);if(Vc(this)||9<(this.j&15))a|=6;if(b||154<=this.j)a|=96,b=1;this.j=Yc(this,a);Tc(this,b?256:0);this.b-=4},Ad,function(){var a;Rc(this,a=J(this)+J(this));Tc(this,a>>8&256);this.b-=10},function(){var a;a=M(this);a=this.A.Pa(a);Rc(this,a);this.b-=16},function(){Rc(this,J(this)-1);this.b-=5},function(){this.X= +bd(this,this.X);this.b-=5},function(){this.X=ad(this,this.X);this.b-=5},function(){this.X=L(this);this.b-=7},function(){this.j=~this.j&255;this.b-=4},Ad,function(){this.ia=M(this)&65535;this.b-=10},function(){this.qa(M(this),this.j);this.b-=13},function(){this.ia=this.ia+1&65535;this.b-=5},function(){var a=J(this);this.qa(a,bd(this,this.Y(a)));this.b-=10},function(){var a=J(this);this.qa(a,ad(this,this.Y(a)));this.b-=10},function(){this.qa(J(this),L(this));this.b-=10},function(){this.aa|=256;this.b-= +4},Ad,function(){var a;Rc(this,a=J(this)+this.ia);Tc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(M(this));this.b-=13},function(){this.ia=this.ia-1&65535;this.b-=5},function(){this.j=bd(this,this.j);this.b-=5},function(){this.j=ad(this,this.j);this.b-=5},function(){this.j=L(this);this.b-=7},function(){Tc(this,Sc(this)?0:256);this.b-=4},function(){this.b-=5},function(){this.P=this.R;this.b-=5},function(){this.P=this.S;this.b-=5},function(){this.P=this.T;this.b-=5},function(){this.P=this.U;this.b-= +5},function(){this.P=this.X;this.b-=5},function(){this.P=this.Y(J(this));this.b-=7},function(){this.P=this.j;this.b-=5},function(){this.R=this.P;this.b-=5},function(){this.b-=5},function(){this.R=this.S;this.b-=5},function(){this.R=this.T;this.b-=5},function(){this.R=this.U;this.b-=5},function(){this.R=this.X;this.b-=5},function(){this.R=this.Y(J(this));this.b-=7},function(){this.R=this.j;this.b-=5},function(){this.S=this.P;this.b-=5},function(){this.S=this.R;this.b-=5},function(){this.b-=5},function(){this.S= +this.T;this.b-=5},function(){this.S=this.U;this.b-=5},function(){this.S=this.X;this.b-=5},function(){this.S=this.Y(J(this));this.b-=7},function(){this.S=this.j;this.b-=5},function(){this.T=this.P;this.b-=5},function(){this.T=this.R;this.b-=5},function(){this.T=this.S;this.b-=5},function(){this.b-=5},function(){this.T=this.U;this.b-=5},function(){this.T=this.X;this.b-=5},function(){this.T=this.Y(J(this));this.b-=7},function(){this.T=this.j;this.b-=5},function(){this.U=this.P;this.b-=5},function(){this.U= +this.R;this.b-=5},function(){this.U=this.S;this.b-=5},function(){this.U=this.T;this.b-=5},function(){this.b-=5},function(){this.U=this.X;this.b-=5},function(){this.U=this.Y(J(this));this.b-=7},function(){this.U=this.j;this.b-=5},function(){this.X=this.P;this.b-=5},function(){this.X=this.R;this.b-=5},function(){this.X=this.S;this.b-=5},function(){this.X=this.T;this.b-=5},function(){this.X=this.U;this.b-=5},function(){this.b-=5},function(){this.X=this.Y(J(this));this.b-=7},function(){this.X=this.j; +this.b-=5},function(){this.qa(J(this),this.P);this.b-=7},function(){this.qa(J(this),this.R);this.b-=7},function(){this.qa(J(this),this.S);this.b-=7},function(){this.qa(J(this),this.T);this.b-=7},function(){this.qa(J(this),this.U);this.b-=7},function(){this.qa(J(this),this.X);this.b-=7},function(){var a=this.N-1;if(this.K.length)for(var b=0;b>8;this.b-=10},function(){var a=M(this);Xc(this)||G(this,a);this.b-=10},function(){this.ta&=-513;this.b-=4},function(){var a=M(this);Xc(this)||(P(this,this.N),G(this,a),this.b-=6);this.b-=11},function(){P(this,Lc(this)&255|this.j<<8);this.b-=11},function(){this.j=cd(this,L(this));this.b-=7},function(){P(this,this.N);G(this,48);this.b-=11},function(){Xc(this)&&(G(this,N(this)), +this.b-=6);this.b-=5},function(){this.ia=J(this)&65535;this.b-=5},function(){var a=M(this);Xc(this)&&G(this,a);this.b-=10},function(){this.ta|=512;this.b-=4},function(){var a=M(this);Xc(this)&&(P(this,this.N),G(this,a),this.b-=6);this.b-=11},Dd,function(){K(this,L(this));this.b-=7},function(){P(this,this.N);G(this,56);this.b-=11}]; +function R(a){w.call(this,"ChipSet",a,R,32768);var b=a.model;b&&!Ed[b]&&Ka("Unrecognized ChipSet model: "+b);this.G=Ed[b]||{};a.sound&&(this.ba=null,window&&(this.ba=window.AudioContext||window.webkitAudioContext),this.ba&&new this.ba);E(this)}Za(R); +var S={xa:1978.1,Xc:{ya:0,Jd:1,Od:16,be:32,pe:64,ne:128,tb:14},Ua:{ya:1,Ec:1,Tc:2,Pc:4,Qc:16,Rc:32,Sc:64,tb:8},Yc:{ya:2,Id:3,ze:4,Kd:8,je:16,ke:32,le:64,Ld:128,tb:0},te:{ya:3},re:{ya:2,de:7},ve:{ya:3,Be:1,ue:2,me:4,Wd:8,Md:16,Ad:32},se:{ya:4},we:{ya:5,Pd:1,Qd:2,Rd:4,Sd:8,Ce:16}},T={xa:100,bb:{ya:66,Ge:1,Nc:2,Oc:4,he:8,fe:16,dc:32,cc:64,Zd:128},Dc:{ya:66,INIT:0},Ia:{ae:{ya:98},Qa:{Cc:0,Bc:1,Vc:2,$c:4,Hc:5,Uc:6,Wc:7},Jb:16383},Gc:{ya:162,INIT:0},Fc:{ya:194,INIT:0}},Ed={SI1978:S,VT100:T}; +R.prototype.pa=function(){return!1};R.prototype.Oa=function(a,b,c,d){this.A=b;this.b=c;this.H=d;this.w=a;Bb(b,this,this.G.Ob);Fb(b,this,this.G.Pb)};R.prototype.Ca=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};R.prototype.Ja=function(a){return a?this.save():!0};S.INIT=[[S.Xc.tb,S.Ua.tb,S.Yc.tb,0,0,0,0]];T.INIT=[[T.Dc.INIT,T.bb.Nc|T.bb.Oc,T.Gc.INIT,T.Fc.INIT],[0,0,0,0,Array(100)]];m=R.prototype;m.reset=function(){this.G.INIT&&!this.restore(this.G.INIT)&&this.ga("reset error")}; +m.save=function(){var a=new Mc(this);switch(this.G.xa){case S.xa:H(a,0,[this.ra,this.D,this.wa,this.O,this.Z,this.ka,this.ma]);break;case T.xa:H(a,0,[this.da,this.J,this.fa,this.ea]),H(a,1,[this.L,this.u,this.K,this.W,this.I])}return a.data()}; +m.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.G.xa){case S.xa:return this.ra=b[0],this.D=b[1],this.wa=b[2],this.O=b[3],this.Z=b[4],this.ka=b[5],this.ma=b[6],!0;case T.xa:return this.da=b[0],this.J=b[2],this.fa=b[3],this.ea=b[4],b=a[1],this.L=b[0],this.u=b[1],this.K=b[2],this.W=b[3],this.I=b[4],!0}return!1};m.start=function(){};m.stop=function(){};function Fd(a,b,c){a.D&=~b;c&&(a.D|=b)}m.kd=function(a,b){var c=this.ra;D(this,a,null,b,"STATUS0",c);return c}; +m.ld=function(a,b){var c=this.D;D(this,a,null,b,"STATUS1",c);return c};m.md=function(a,b){var c=this.wa;D(this,a,null,b,"STATUS2",c);return c};m.jd=function(a,b){var c=this.O>>8-this.Z&255;D(this,a,null,b,"SHIFT.RESULT",c);return c};m.qd=function(a,b,c){D(this,a,b,c,"SHIFT.COUNT",null);this.Z=b};m.sd=function(a,b,c){D(this,a,b,c,"SOUND1",null);this.ka=b};m.rd=function(a,b,c){D(this,a,b,c,"SHIFT.DATA",null);this.O=b<<8|this.O>>8};m.td=function(a,b,c){D(this,a,b,c,"SOUND2",null);this.ma=b}; +m.ud=function(a,b,c){D(this,a,b,c,"WATCHDOG",null)};function Gd(a){var b=0,c=0,d=~a.L;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} +m.nd=function(a,b){var c=this.J,c=c&~T.bb.cc;if((Ac(this.b)&64)<<1&&(c|=T.bb.cc,c!=this.J)){var d,e;d=this.K&1;e=this.K>>1&7;switch(e){case T.Ia.Qa.Wc:break;case T.Ia.Qa.Bc:this.L=this.L<<1|d;break;case T.Ia.Qa.Hc:d=Gd(this);this.I[d]=T.Ia.Jb;fb(this,"doNVRCommand(): erase data at addr "+r(d));break;case T.Ia.Qa.Cc:this.u=this.u<<1|d;break;case T.Ia.Qa.$c:d=Gd(this);e=this.u&T.Ia.Jb;this.I[d]=e;fb(this,"doNVRCommand(): write data "+r(e)+" to addr "+r(d));break;case T.Ia.Qa.Uc:d=Gd(this);e=this.I[d]; +null==e&&(e=T.Ia.Jb);this.u=e;fb(this,"doNVRCommand(): read data "+r(e)+" from addr "+r(d));break;case T.Ia.Qa.Vc:this.u<<=1;this.W=this.u&T.Ia.Jb+1;break;default:fb(this,"doNVRCommand(): unrecognized command 0x"+n(e,2))}}c&=~T.bb.dc;this.W&&(c|=T.bb.dc);this.J=c;D(this,a,null,b,"FLAGS.BUFFER",c);return c};m.vd=function(a,b,c){D(this,a,b,c,"BRIGHTNESS",null);this.da=b};m.yd=function(a,b,c){D(this,a,b,c,"NVR.LATCH",null);this.K=b};m.xd=function(a,b,c){D(this,a,b,c,"DC012",null);this.fa=b}; +m.wd=function(a,b,c){D(this,a,b,c,"DC011",null);this.ea=b};S.Ob={0:R.prototype.kd,1:R.prototype.ld,2:R.prototype.md,3:R.prototype.jd};S.Pb={2:R.prototype.qd,3:R.prototype.sd,4:R.prototype.rd,5:R.prototype.td,6:R.prototype.ud};T.Ob={66:R.prototype.nd};T.Pb={66:R.prototype.vd,98:R.prototype.yd,162:R.prototype.xd,194:R.prototype.wd};Ia(function(){for(var a=B(document,"pc8080","chipset"),b=0;b>>0,h],q=ja(p,k,a.Sa);0>q&&p.splice(-(q+1),0,k)}l&&(g.a=l.replace(/''/g,'"'))}a.J.push({Ve:b,F:c,od:d,Na:e,nc:f})}delete this.Na}return!0};Hd.prototype.Ja=function(){return!0}; +function Id(a,b,c,d){if(d)a.ga("Unable to load system ROM (error "+d+": "+b+")");else{ab(a.Rb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,h=e.data;if(f)a.w=f;else if(h)for(a.w=Array(4*h.length),d=c=0;c>8&255,a.w[d++]=h[c]>>16&255,a.w[d++]=h[c]>>24&255;else a.w=e;a.Na=e.symbols;if(!a.w.length){t("Empty ROM: "+b);return}if(1==a.w.length){t(a.w[0]);return}}catch(g){a.ga("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm, " ").replace(/ +$/,"").split(" "),a.w=Array(b.length),e=0;e>>f.la;0>>=f.la;0":62,"?":63,"@":64,xd:65,zd:66,Ad:67,Fd:68,E:69,Ld:70,Rd:71,Sd:72,Td:73,Vd:74,Wd:75,Yd:76,ae:77,ce:78,ee:79,ge:80,Q:81,me:82,oe:83,we:84,ye:85,Be:86,Ce:87,De:88,Fe:89,Ge:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,He:97,Ie:98,Je:99,d:100,e:101,Ke:102,Le:103,Me:104,Ne:105,Oe:106,k:107,Pe:108, -Qe:109,n:110,Re:111,p:112,q:113,r:114,Se:115,t:116,Ue:117,Ve:118,We:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126},Qd={65:37,68:39,76:32},Rd={xa:1978.1,wb:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},W={xa:100,wb:{},Oa:{ya:130,Jc:1,Ic:2,Hc:4,Gc:8,Kc:16,ec:32,ve:64,Bd:128,INIT:0},B:{}};W.B[46]=3;W.B[80]=5;W.B[79]=6;W.B[89]=7;W.B[84]=8;W.B[87]=9;W.B[81]=10;W.B[39]=16;W.B[V["]"]]=20;W.B[V["["]]=21;W.B[73]=22;W.B[85]=23;W.B[82]=24;W.B[69]=25;W.B[V["1"]]=26;W.B[37]=32;W.B[40]=34; -W.B[19]=35;W.B[V["`"]]=36;W.B[V["-"]]=37;W.B[V["9"]]=38;W.B[V["7"]]=39;W.B[V["4"]]=40;W.B[V["3"]]=41;W.B[27]=42;W.B[38]=48;W.B[114]=49;W.B[112]=50;W.B[8]=51;W.B[V["="]]=52;W.B[V["0"]]=53;W.B[V["8"]]=54;W.B[V["6"]]=55;W.B[V["5"]]=56;W.B[V["2"]]=57;W.B[9]=58;W.B[103]=64;W.B[115]=65;W.B[113]=66;W.B[96]=67;W.B[10]=68;W.B[V["\\"]]=69;W.B[76]=70;W.B[75]=71;W.B[71]=72;W.B[70]=73;W.B[65]=74;W.B[104]=80;W.B[2013]=81;W.B[98]=82;W.B[97]=83;W.B[V["'"]]=85;W.B[V[";"]]=86;W.B[74]=87;W.B[72]=88;W.B[68]=89; -W.B[83]=90;W.B[110]=96;W.B[119]=97;W.B[101]=98;W.B[100]=99;W.B[13]=100;W.B[V["."]]=101;W.B[V[","]]=102;W.B[78]=103;W.B[66]=104;W.B[88]=105;W.B[120]=106;W.B[105]=112;W.B[99]=113;W.B[102]=114;W.B[109]=115;W.B[V["/"]]=117;W.B[77]=118;W.B[V[" "]]=119;W.B[86]=120;W.B[67]=121;W.B[90]=122;W.B[121]=123;W.B[17]=124;W.B[16]=125;W.B[20]=126;W.Hb={l4:W.Oa.Jc,l3:W.Oa.Ic,l2:W.Oa.Hc,l1:W.Oa.Gc,locked:W.Oa.Kc,online:W.Oa.ec,local:~W.Oa.ec};var Pd={SI1978:Rd,VT100:W}; +function Kd(a){if(!jb(a))if(!a.D)E(a);else if(a.w&&a.A){a.u||(a.u=a.w.length);if(a.w.length!=a.u)kb(a,"ROM size (0x"+n(a.w.length)+") does not match specified size ("+("0x"+n(a.u))+")");else if(Ld(a,a.I)){var b=[];"number"==typeof a.G?b.push(a.G):null!=a.G&&a.G.length&&(b=a.G);for(var c=0;c>>f.la;0>>=f.la;0":62,"?":63,"@":64,zd:65,Bd:66,Cd:67,Hd:68,E:69,Nd:70,Td:71,Ud:72,Vd:73,Xd:74,Yd:75,$d:76,ce:77,ee:78,ge:79,ie:80,Q:81,oe:82,qe:83,ye:84,Ae:85,De:86,Ee:87,Fe:88,He:89,Ie:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Je:97,Ke:98,Le:99,d:100,e:101,Me:102,Ne:103,Oe:104,Pe:105,Qe:106,k:107,Re:108, +Se:109,n:110,Te:111,p:112,q:113,r:114,Ue:115,t:116,We:117,Xe:118,Ye:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126},Qd={65:37,68:39,76:32},Rd={xa:1978.1,wb:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},V={xa:100,wb:{},Ka:{ya:130,Lc:1,Kc:2,Jc:4,Ic:8,Mc:16,fc:32,ac:63,xe:64,Dd:128,INIT:0},B:{}};V.B[46]=3;V.B[80]=5;V.B[79]=6;V.B[89]=7;V.B[84]=8;V.B[87]=9;V.B[81]=10;V.B[39]=16;V.B[U["]"]]=20;V.B[U["["]]=21;V.B[73]=22;V.B[85]=23;V.B[82]=24;V.B[69]=25;V.B[U["1"]]=26;V.B[37]=32;V.B[40]=34; +V.B[19]=35;V.B[U["`"]]=36;V.B[U["-"]]=37;V.B[U["9"]]=38;V.B[U["7"]]=39;V.B[U["4"]]=40;V.B[U["3"]]=41;V.B[27]=42;V.B[38]=48;V.B[114]=49;V.B[112]=50;V.B[8]=51;V.B[U["="]]=52;V.B[U["0"]]=53;V.B[U["8"]]=54;V.B[U["6"]]=55;V.B[U["5"]]=56;V.B[U["2"]]=57;V.B[9]=58;V.B[103]=64;V.B[115]=65;V.B[113]=66;V.B[96]=67;V.B[10]=68;V.B[U["\\"]]=69;V.B[76]=70;V.B[75]=71;V.B[71]=72;V.B[70]=73;V.B[65]=74;V.B[104]=80;V.B[2013]=81;V.B[98]=82;V.B[97]=83;V.B[U["'"]]=85;V.B[U[";"]]=86;V.B[74]=87;V.B[72]=88;V.B[68]=89; +V.B[83]=90;V.B[110]=96;V.B[119]=97;V.B[101]=98;V.B[100]=99;V.B[13]=100;V.B[U["."]]=101;V.B[U[","]]=102;V.B[78]=103;V.B[66]=104;V.B[88]=105;V.B[120]=106;V.B[105]=112;V.B[99]=113;V.B[102]=114;V.B[109]=115;V.B[U["/"]]=117;V.B[77]=118;V.B[U[" "]]=119;V.B[86]=120;V.B[67]=121;V.B[90]=122;V.B[121]=123;V.B[17]=124;V.B[16]=125;V.B[20]=126;V.Hb={l4:V.Ka.Lc,l3:V.Ka.Kc,l2:V.Ka.Jc,l1:V.Ka.Ic,locked:V.Ka.Mc,online:V.Ka.fc,local:~V.Ka.fc};var Pd={SI1978:Rd,VT100:V}; Od.prototype.pa=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.M[e]){if("led"==a&&this.b.Hb&&this.b.Hb[b])return this.M[e]=c,!0;switch(b){case "kbd":return c.onkeydown=function(a){return Sd(d,a,!0)},c.onkeyup=function(a){return Sd(d,a,!1)},!0;default:if(this.b.wb&&void 0!==this.b.wb[b])return this.M[e]=c,a=function(a,b){return function(){Td(a,b,!0)}}(this,b),b=function(a,b){return function(){Td(a,b,!1)}}(this,b),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b):(c.onmousedown=a,c.onmouseup= -c.onmouseout=b),!0}}return!1};Od.prototype.Na=function(a,b,c,d){this.H=d;this.G=rb(a,"ChipSet");Cb(b,this,this.b.Ob);Gb(b,this,this.b.Pb)};Od.prototype.Ca=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};Od.prototype.Ja=function(a){return a?this.save():!0};W.INIT=[[W.Oa.INIT]];Od.prototype.reset=function(){this.u={};this.A={};this.b.INIT&&!this.restore(this.b.INIT)&&this.ga("reset error")}; -Od.prototype.save=function(){var a=new I(this);switch(this.b.xa){case W.xa:J(a,0,[this.w])}return a.data()};Od.prototype.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.b.xa){case Rd.xa:return!0;case W.xa:return this.w=b[0],Ud(this),!0}return!1};function Ud(a){for(var b in a.b.Hb){var c=a.M["led-"+b];if(c){var d=a.b.Hb[b],e=!!(a.w&d);d&d-1&&(e=!(a.w&~d));c.style.backgroundColor=e?"#ff0000":"#000000"}}} +c.onmouseout=b),!0}}return!1};Od.prototype.Oa=function(a,b,c,d){this.H=d;this.G=qb(a,"ChipSet");Bb(b,this,this.b.Ob);Fb(b,this,this.b.Pb)};Od.prototype.Ca=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};Od.prototype.Ja=function(a){return a?this.save():!0};V.INIT=[[V.Ka.INIT]];Od.prototype.reset=function(){this.u={};this.A={};this.b.INIT&&!this.restore(this.b.INIT)&&this.ga("reset error")}; +Od.prototype.save=function(){var a=new Mc(this);switch(this.b.xa){case V.xa:H(a,0,[this.w])}return a.data()};Od.prototype.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.b.xa){case Rd.xa:return!0;case V.xa:return this.w=b[0],Ud(this,this.w&V.Ka.ac),!0}return!1};function Ud(a,b){for(var c in a.b.Hb){var d=a.M["led-"+c];if(d){var e=a.b.Hb[c],f=!!(b&e);e&e-1&&(f=!(b&~e));d.style.backgroundColor=f?"#ff0000":"#000000"}}} function Sd(a,b,c){var d=!0,e;a:{e=b.keyCode;e=Qd[e]||e;for(var f in a.b.wb)if(a.b.wb[f]===e){e=f;break a}e=null}e&&(d=Td(a,e,c),b.preventDefault());return d} -function Td(a,b,c){if(c)a.u[b]=Date.now(),delete a.A[b];else{var d=a.u[b];if(d&&100>Date.now()-d)return a.A[b]=d,Vd(a),!0;delete a.u[b]}if(a.G)switch(b){case "1p":Fd(a.G,T.Ua.Nc,c);break;case "2p":Fd(a.G,T.Ua.Rc,c);break;case "coin":Fd(a.G,T.Ua.Cc,c);break;case "left":Fd(a.G,T.Ua.Pc,c);break;case "right":Fd(a.G,T.Ua.Qc,c);break;case "fire":Fd(a.G,T.Ua.Oc,c)}return!0} -function Vd(a){for(var b=-1,c=Object.keys(a.A),d=0;db||b>f)b=f}else delete a.A[e],Td(a,e,!1)}0<=b&&setTimeout(function(){Vd(a)},b)}Od.prototype.D=function(a,b,c){D(this,a,b,c,"KBDUART.STATUS",null);this.w=b;Ud(this)};W.Ob={};W.Pb={130:Od.prototype.D};Ja(function(){for(var a=A(document,"pc8080","keyboard"),b=0;b>3)*this.da;if(this.ad||vb(this.A,this.Ea,this.Ta,3))1>1)),this.L=document.createElement("canvas"),this.L.width=b,this.L.height=c,this.eb= -this.L.getContext("2d"),this.ra={},this.Ha=1<=a.Xc?8:16,f=8>(7> -4)*c)}return k} -Wd.prototype.Ca=function(){if(2==this.Z){for(var a={0:[32,"SET-UP A"],2:[64,'TO EXIT PRESS "SET-UP"'],22:[96," T T T T T T T T T"],23:[96,"1234567890","1234567890","1234567890","1234567890","1234567890","1234567890","1234567890","1234567890"],24:[]},b=this.Ea,c=-1,d=-1,e,f=-(60==this.kc?2:5);f>8&15|16;Ab(this.A,b++,e);Ab(this.A,b++,c& -255);if(g)break}if(h)for(c=0,e=1;ec&&(a=Math.round(c/b*100)+"%")}this.fc?(this.O.style.width=a,this.O.style.width=a,this.O.style.display="block",this.O.style.margin="auto"):(this.u.style.width=a,this.u.style.height="auto");this.u.style.backgroundColor="black";this.u.fb();a=!0}this.Ga&&this.Ga.focus()}return a}; -function Zd(a,b){!b&&a.u&&(a.fc?a.O.style.width=a.O.style.height="":a.u.style.width=a.u.style.height="");gb(a,"notifyFullScreen("+b+")",!0)}function ae(a,b){a.hc=b;a.Fa=!1;if(void 0===a.ma||a.ma.length!=a.hc)a.ma=Array(a.hc)}function de(a,b,c,d,e){d=a.D?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.Z&&(208<=c&&236>c?e=a.Ha+0:28<=c&&72>c&&(e=a.Ha+1));a=a.wa[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 ee(a){for(var b=a.Ea,c=-1,d=0,e=60==a.kc?2:5,f=0,h=0;d>4)*p.ha,B=void 0,v=void 0,H=void 0,C=void 0,ia=p.oa,qa=p.ha;y?(B=k*q.oa,v=d*q.ha, -H=q.oa,C=q.ha):(B=k*q.Ib,v=d*q.dc,H=q.Ib,C=q.dc);p.oa>q.oa&&(B*=2,H*=2);p.ha>q.ha&&(0==l&&(x+=q.ha),qa=q.ha);y?y.drawImage(p.canvas,u,x,ia,qa,B,v,H,C):(B+=0,v+=0,q.I.drawImage(p.canvas,u,x,ia,qa,B,v,H,C))}h++}f++}d++}}a.Fa=!0;h&&a.eb&&a.I.drawImage(a.L,0,0,a.K,a.da-a.ha,0,0,a.Yc,a.$c)} -Ja(function(){for(var a=A(document,"pc8080","video"),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<=ra().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||Sa.aspect);f&&.3<=f&&3.33>=f&&(Ia("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");xa("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var h=e.getContext("2d"),d=new Wd(d,e,h,f,c);eb(d,c)}}); -function fe(a){w.call(this,"Debugger",a,fe);this.style=ge;this.da=this.Fa=this.L=0;this.W=X();this.Ta=X();this.D=-1;this.G=[];this.fa=!1;this.ea=X();this.J=[];this.ka={};this.u=this.Z=this.I=[];he(this);this.wa=0;ie(this);this.Ga=[];je(this,a.messages);this.Ha=a.commands;var b=this;window?void 0===window.$&&(window.$=function(a){return lc(b,a)}):void 0===global.$&&(global.$=function(a){return lc(b,a)})}$a(fe); +function Td(a,b,c){if(c)a.u[b]=Date.now(),delete a.A[b];else{var d=a.u[b];if(d&&100>Date.now()-d)return a.A[b]=d,Vd(a),!0;delete a.u[b]}if(a.G)switch(b){case "1p":Fd(a.G,S.Ua.Pc,c);break;case "2p":Fd(a.G,S.Ua.Tc,c);break;case "coin":Fd(a.G,S.Ua.Ec,c);break;case "left":Fd(a.G,S.Ua.Rc,c);break;case "right":Fd(a.G,S.Ua.Sc,c);break;case "fire":Fd(a.G,S.Ua.Qc,c)}return!0} +function Vd(a){for(var b=-1,c=Object.keys(a.A),d=0;db||b>f)b=f}else delete a.A[e],Td(a,e,!1)}0<=b&&setTimeout(function(){Vd(a)},b)}Od.prototype.D=function(a,b,c){D(this,a,b,c,"KBDUART.STATUS",null);this.w=b;Ud(this,b&V.Ka.ac)};V.Ob={};V.Pb={130:Od.prototype.D};Ia(function(){for(var a=B(document,"pc8080","keyboard"),b=0;b>3)*this.da;if(this.cd||ub(this.A,this.Ea,this.Ta,3))1>1)),this.O=document.createElement("canvas"),this.O.width=b,this.O.height=c,this.eb= +this.O.getContext("2d"),this.ra={},this.Ha=1<=a.Zc?8:16,f=8>(7>4)*c)}return k} +Wd.prototype.Ca=function(){if(2==this.L){for(var a={0:[32,"SET-UP A"],2:[64,'TO EXIT PRESS "SET-UP"'],22:[96," T T T T T T T T T"],23:[96,"1234567890","1234567890","1234567890","1234567890","1234567890","1234567890","1234567890","1234567890"],24:[]},b=this.Ea,c=-1,d=-1,e,f=-(60==this.mc?2:5);f>8&15|16;zb(this.A,b++,e);zb(this.A,b++,c& +255);if(g)break}if(h)for(c=0,e=1;ec&&(a=Math.round(c/b*100)+"%")}this.hc?(this.W.style.width=a,this.W.style.width=a,this.W.style.display="block",this.W.style.margin="auto"):(this.u.style.width=a,this.u.style.height="auto");this.u.style.backgroundColor="black";this.u.fb();a=!0}this.Ga&&this.Ga.focus()}return a}; +function Zd(a,b){!b&&a.u&&(a.hc?a.W.style.width=a.W.style.height="":a.u.style.width=a.u.style.height="");fb(a,"notifyFullScreen("+b+")",!0)}function ae(a,b){a.jc=b;a.Fa=!1;if(void 0===a.ma||a.ma.length!=a.jc)a.ma=Array(a.jc)}function de(a,b,c,d,e){d=a.D?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.L&&(208<=c&&236>c?e=a.Ha+0:28<=c&&72>c&&(e=a.Ha+1));a=a.wa[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 ee(a){for(var b=a.Ea,c=-1,d=0,e=60==a.mc?2:5,f=0,h=0;d>4)*p.ha,z=void 0,u=void 0,I=void 0,C=void 0,W=p.oa,qa=p.ha;y?(z=k*q.oa,u=d*q.ha,I= +q.oa,C=q.ha):(z=k*q.Ib,u=d*q.ec,I=q.Ib,C=q.ec);p.oa>q.oa&&(z*=2,I*=2);p.ha>q.ha&&(0==l&&(x+=q.ha),qa=q.ha);y?y.drawImage(p.canvas,v,x,W,qa,z,u,I,C):(z+=0,u+=0,q.I.drawImage(p.canvas,v,x,W,qa,z,u,I,C))}h++}f++}d++}}a.Fa=!0;h&&a.eb&&a.I.drawImage(a.O,0,0,a.K,a.da-a.ha,0,0,a.ad,a.bd)} +Ia(function(){for(var a=B(document,"pc8080","video"),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<=pa().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||Ra.aspect);f&&.3<=f&&3.33>=f&&(Ha("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");wa("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var h=e.getContext("2d"),d=new Wd(d,e,h,f,c);db(d,c)}}); +function fe(a){w.call(this,"Debugger",a,fe);this.style=ge;this.da=this.Fa=this.L=0;this.W=X();this.Ta=X();this.D=-1;this.G=[];this.fa=!1;this.ea=X();this.J=[];this.ka={};this.u=this.Z=this.I=[];he(this);this.wa=0;ie(this);this.Ga=[];je(this,a.messages);this.Ha=a.commands;var b=this;window?void 0===window.$&&(window.$=function(a){return kc(b,a)}):void 0===global.$&&(global.$=function(a){return kc(b,a)})}Za(fe); var ke={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory",f:"frequencies","g [#]":"go [to #]",h:"halt","i [#]":"input port #","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages","o [#]":"output port #",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble",v:"print version","var":"assign variable"}, ge=8080,le="NONE ACI ADC ADD ADI ANA ANI CALL CC CM CNC CNZ CP CPE CPO CZ CMA CMC CMP CPI DAA DAD DCR DCX DI EI HLT IN INR INX JMP JC JM JNC JNZ JP JPE JPO JZ LDA LDAX LHLD LXI MOV MVI NOP ORA ORI OUT PCHL POP PUSH RAL RAR RET RC RM RNC RNZ RP RPE RPO RZ RLC RRC RST SBB SBI SHLD SPHL STA STAX STC SUB SUI XCHG XRA XRI XTHL".split(" "),me="NONE ADC ADC ADD ADD AND AND CALL CALLC CALLS CALLNC CALLNZ CALLNS CALLP CALLNP CALLZ NOT CMC CMP CMP DAA ADD DEC DEC CLI STI HLT IN INC INC JMP JC JS JNC JNZ JNS JP JNP JZ MOV MOV MOV MOV MOV MOV NOP OR OR OUT JMP POP PUSH RCL RCR RET RETC RETS RETNC RETNZ RETNS RETP RETNP RETZ ROL ROR RST SBB SBB MOV MOV MOV MOV STC SUB SUB XCHG XOR XOR XCHG".split(" "), ne="B C D E H L M A BC DE HL SP PC PS PSW".split(" "),oe=[[45],[42,2067,32],[71,2131,18193],[29,2067],[28,17],[22,17],[44,17,32],[63],[45,32768],[21,18963,2067],[40,18193,2131],[23,2067],[28,273],[22,273],[44,273,32],[64],[45,32768],[42,2323,32],[71,2387,18193],[29,2323],[28,529],[22,529],[44,529,32],[52],[45,32768],[21,18963,2323],[40,18193,2387],[23,2323],[28,785],[22,785],[44,785,32],[53],[45,32768],[42,2579,32],[68,115,18963],[29,2579],[28,1041],[22,1041],[44,1041,32],[20],[45,32768],[21,18963, @@ -138,100 +138,100 @@ ne="B C D E H L M A BC DE HL SP PC PS PSW".split(" "),oe=[[45],[42,2067,32],[71, 18193,529],[66,18193,785],[66,18193,1041],[66,18193,1297],[66,18193,1617],[66,18193,1809],[5,18193,17],[5,18193,273],[5,18193,529],[5,18193,785],[5,18193,1041],[5,18193,1297],[5,18193,1617],[5,18193,1809],[76,18193,17],[76,18193,273],[76,18193,529],[76,18193,785],[76,18193,1041],[76,18193,1297],[76,18193,1617],[76,18193,1809],[46,18193,17],[46,18193,273],[46,18193,529],[46,18193,785],[46,18193,1041],[46,18193,1297],[46,18193,1617],[46,18193,1809],[18,18193,17],[18,18193,273],[18,18193,529],[18,18193, 785],[18,18193,1041],[18,18193,1297],[18,18193,1617],[18,18193,1809],[58],[50,2067],[34,51],[30,51],[11,51],[51,2067],[4,18193,33],[65,128],[62],[54],[38,51],[30,32819],[15,51],[7,51],[1,18193,33],[65,128],[57],[50,2323],[33,51],[48,33,18193],[10,51],[51,2323],[74,18193,33],[65,128],[55],[54,32768],[31,51],[27,18193,33],[8,51],[7,32819],[67,18193,33],[65,128],[61],[50,2579],[37,51],[78,19283,18963],[14,51],[51,2579],[6,18193,33],[65,128],[60],[49,2579],[36,51],[75,18963,18707],[13,51],[7,32819],[77, 18193,33],[65,128],[59],[50,3603],[35,51],[24],[12,51],[51,3603],[47,18193,33],[65,128],[56],[69,19219,18963],[32,51],[25],[9,51],[7,32819],[19,18193,33],[65,128]],pe={cpu:1,bus:64,mem:128,port:256,chipset:32768,keyboard:65536,key:131072,video:262144,fdc:524288,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};m=fe.prototype; -m.Na=function(a,b,c,d){this.A=b;this.b=c;this.w=a;(a=ic(a,"messages"))&&je(this,a);this.Ra=oe;qe(this,function(a){a:{var b=d.A.V,c=a[0],g=a=0,k=b.length;if(c){a=re(se(d,c));if(-1===a){d.g("invalid address: "+c);break a}g=a>>>d.A.la;k=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,l=0;k--;){var p=b[g];p.type==c?l++||d.g("..."):(c=p.type,l=xb[c],p&&d.g(n(p.id)+" %"+n(g<>>e.la;f!=e.A?e.V[h].$b(f,b&65535,d):(e.V[h++].Gb(f,b&255,d),e.V[h&e.K].Gb(0,b>>8&255,d+1));c&&te(a,c);mc(this.b,!0)}};function X(a){return{F:a,La:!1}}function ue(a){return[a.F,a.La]}function ve(a){return{F:a[0],La:a[1]}} -function se(a,b,c){var d;c=(c?a.W:a.Ta).F;if(void 0!==b){d=b=we(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=na(ne,a.substr(b,1))));return c}function Ce(a,b){var c=0,d=De(a,b);if(void 0!==d)switch(b){case 7:case 0:case 1:case 2:case 3:case 4:case 5:case 6:c=2;break;case 8:case 9:case 10:case 11:case 12:case 13:case 14:c=4}return c?n(d,c):"??"} -function De(a,b){var c;if(0<=b){var d=a.b;switch(b){case 7:c=d.j;break;case 0:c=d.P;break;case 1:c=d.R;break;case 8:c=Nc(d);break;case 2:c=d.S;break;case 3:c=d.T;break;case 9:c=Pc(d);break;case 4:c=d.U;break;case 5:c=d.X;break;case 10:c=K(d);break;case 6:c=d.Y(K(d));break;case 11:c=d.ia;break;case 12:c=d.N;break;case 13:c=Mc(d);break;case 14:c=Mc(d)&255|d.j<<8}}return c} +m.Oa=function(a,b,c,d){this.A=b;this.b=c;this.w=a;(a=hc(a,"messages"))&&je(this,a);this.Ra=oe;qe(this,function(a){a:{var b=d.A.V,c=a[0],g=a=0,k=b.length;if(c){a=re(se(d,c));if(-1===a){d.g("invalid address: "+c);break a}g=a>>>d.A.la;k=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,l=0;k--;){var p=b[g];p.type==c?l++||d.g("..."):(c=p.type,l=wb[c],p&&d.g(n(p.id)+" %"+n(g<>>e.la;f!=e.A?e.V[h].$b(f,b&65535,d):(e.V[h++].Gb(f,b&255,d),e.V[h&e.K].Gb(0,b>>8&255,d+1));c&&te(a,c);lc(this.b,!0)}};function X(a){return{F:a,Ma:!1}}function ue(a){return[a.F,a.Ma]}function ve(a){return{F:a[0],Ma:a[1]}} +function se(a,b,c){var d;c=(c?a.W:a.Ta).F;if(void 0!==b){d=b=we(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=ma(ne,a.substr(b,1))));return c}function Ce(a,b){var c=0,d=De(a,b);if(void 0!==d)switch(b){case 7:case 0:case 1:case 2:case 3:case 4:case 5:case 6:c=2;break;case 8:case 9:case 10:case 11:case 12:case 13:case 14:c=4}return c?n(d,c):"??"} +function De(a,b){var c;if(0<=b){var d=a.b;switch(b){case 7:c=d.j;break;case 0:c=d.P;break;case 1:c=d.R;break;case 8:c=Nc(d);break;case 2:c=d.S;break;case 3:c=d.T;break;case 9:c=Pc(d);break;case 4:c=d.U;break;case 5:c=d.X;break;case 10:c=J(d);break;case 6:c=d.Y(J(d));break;case 11:c=d.ia;break;case 12:c=d.N;break;case 13:c=Lc(d);break;case 14:c=Lc(d)&255|d.j<<8}}return c} function Ee(a,b){b=we(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=Be(b,c+1),0<=e&&(b=b.substr(0,c)+Ce(a,e)+b.substr(c+1+ne[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=aa(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=se(a,e))?(d=e+' "'+Ae(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=se(a,e))?(te(d),d=e+' "'+ -Ae(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}m.message=function(a,b){b&&(a+=" at "+Z(X(this.b.N).F));if(this.na&1073741824)this.Ea.push(a);else if(!this.za||a!=this.za)if(this.za=a,this.na&-2147483648&&(this.ja(),a+=" (cpu halted)"),this.g(a),this.b){var c=this.b;c.i.ob=0;c.D-=c.b;c.b=0;mc(c)}}; -function fb(a,b,c,d,e,f,h,g){g|=256;null!=f&&(a.na&g)!=g||a.message(b.ab+"."+(null!=d?"outPort":"inPort")+"("+r(c)+","+(f?f:"unknown")+(null!=d?",0x"+n(d,2):"")+")"+(null!=h?": 0x"+n(h,2):"")+(null!=e?" at "+Z(e):""))} +Ae(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}m.message=function(a,b){b&&(a+=" at "+Y(X(this.b.N).F));if(this.na&1073741824)this.Ea.push(a);else if(!this.za||a!=this.za)if(this.za=a,this.na&-2147483648&&(this.ja(),a+=" (cpu halted)"),this.g(a),this.b){var c=this.b;c.i.ob=0;c.D-=c.b;c.b=0;lc(c)}}; +function eb(a,b,c,d,e,f,h,g){g|=256;null!=f&&(a.na&g)!=g||a.message(b.ab+"."+(null!=d?"outPort":"inPort")+"("+r(c)+","+(f?f:"unknown")+(null!=d?",0x"+n(d,2):"")+")"+(null!=h?": 0x"+n(h,2):"")+(null!=e?" at "+Y(e):""))} function ie(a){var b;if(yd(a)){if(!a.O||!a.O.length){a.O=Array(1E3);for(b=0;b>>d.la],!1)}a.Z=["br"];if(void 0!==a.I)for(b=1;b>>d.la],!0);a.I=["bw"];a.cb=0}m.Va=function(a,b,c){var d=!0;c||Je(this,a,b,!1,!0);if(a!=this.u){var e=re(b);if(-1===e)this.g("invalid address: "+Z(b.F)),d=!1;else{var f=this.A;f.V[e>>>f.la].Va(e&f.A,a==this.I)}}d&&(a.push(b),c?b.La=!0:(Ke(this,a,a.length-1,"set"),ie(this)));return d}; -function Je(a,b,c,d,e){var f=!1;c=re(c);for(var h=1;h>>d.la],b==a.I));g.La||ie(a);break}}return f}function kf(a,b){for(var c=1;c>24,4);break;case 3:v=n(x.Pa(B,2),4);break;default:x="imm("+r(u)+")";break a}8086==x.style&&u&64?v="["+v+"]":u&16||(v=(x.style==ge?"$":"0x")+v);x=v}else u& -16?(x=(q&3840)>>8,u=ne[x],8086==a.style&&q&64&&(6==x&&(u="HL"),u="["+u+"]"),x=u):u&128&&(x=(f>>3&7).toString());if(!x||!x.length){g="INVALID";break}0>>d.la],!1)}a.Z=["br"];if(void 0!==a.I)for(b=1;b>>d.la],!0);a.I=["bw"];a.cb=0}m.Va=function(a,b,c){var d=!0;c||Je(this,a,b,!1,!0);if(a!=this.u){var e=re(b);if(-1===e)this.g("invalid address: "+Y(b.F)),d=!1;else{var f=this.A;f.V[e>>>f.la].Va(e&f.A,a==this.I)}}d&&(a.push(b),c?b.Ma=!0:(Ke(this,a,a.length-1,"set"),ie(this)));return d}; +function Je(a,b,c,d,e){var f=!1;c=re(c);for(var h=1;h>>d.la],b==a.I));g.Ma||ie(a);break}}return f}function kf(a,b){for(var c=1;c>24,4);break;case 3:u=n(x.Pa(z,2),4);break;default:x="imm("+r(v)+")";break a}8086==x.style&&v&64?u="["+u+"]":v&16||(u=(x.style==ge?"$":"0x")+u);x=u}else v& +16?(x=(q&3840)>>8,v=ne[x],8086==a.style&&q&64&&(6==x&&(v="HL"),v="["+v+"]"),x=v):v&128&&(x=(f>>3&7).toString());if(!x||!x.length){g="INVALID";break}0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; function rf(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 xe(a,b,c){var d;if(b){b=we(a,b);for(var e=0,f=!1,h=b,g=[],k=[],l=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;h=p+"b"+h;d>>=8}d="0x"+n(c)+" "+c+". ("+h+")"}a.g((null!=b?b+": ":"")+d);return e}function uf(a,b){if(b)return tf(a,b,a.ka[b]);var c=0;for(b in a.ka)tf(a,b,a.ka[b]),c++;return 0b[0]?1:a[0]>>0;for(b=0;b>>0,g=f.md;if(e>=h&&e>>0;for(b=0;b>>0,g=f.od;if(e>=h&&e>8&255;case "C":d.R=g&255;break;case "D":d.S= -g&255;break;case "DE":d.S=g>>8&255;case "E":d.T=g&255;break;case "H":d.U=g&255;break;case "HL":d.U=g>>8&255;case "L":d.X=g&255;break;case "SP":d.ia=g&65535;break;case "PC":G(d,g);a.W=X(d.N);break;case "PS":Kc(d,g);break;case "PSW":Kc(d,g&255|d.ta&-256);d.j=g>>8;break;case "CF":d.aa=g?d.aa|256:d.aa&255;break;case "PF":g?Uc(d)||(d.ca^=1):Uc(d)&&(d.ca^=1);break;case "AF":d.ua=g?~d.ca&16|d.ua&-17:d.ca&16|d.ua&-17;break;case "ZF":d.aa=g?d.aa&-256:d.aa|255;break;case "SF":g?Xc(d)||(d.ca^=192):Xc(d)&&(d.ca^= -192);break;case "IF":d.ta=g?d.ta|512:d.ta&-513;break;default:a.g("unknown register: "+e);return}if(!h){a.g("invalid value: "+f);return}mc(d);a.g("updated registers:")}a.g(pf(a));c&&(a.W=X(d.N),He(a,Z(a.W.F)))}}function Bf(a,b){b=ja(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(Ee(a,c[2])):xe(a,b,!0)}function Cf(a,b,c){var d="t"!=b;c=sf(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);ya(c,function(){return ib(a,!0)&&a.rb(e,d,!1)},function(){mc(a.b);ib(a,!1)})} -function He(a,b,c,d){if(b=se(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=se(a,c,!0);if(!d||d.Fg[0].indexOf("+"))){var l=g[0]+":";g[2]&&(l+=" "+g[2]);a.g(l)}g[3]&&(h=g[3],f=null);f=mf(a,b,h,f);a.g(f);a.W=b;e-=b.F-k;c++}}} -function ze(a,b,c,d){if(c)if(b){0>a.D&&a.G.length&&(a.D=0);if(0>a.D||b!=a.G[a.D])a.G.splice(0,0,b),a.D=0;a.D--}else a.fa?b="end":b=a.G[a.D+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var h=b.charAt(f);if('"'==h||"'"==h)e?h==e&&(e=null):e=h;else if(h==d&&!e||!h)a.push(ja(b.substring(c,f))),c=f+1}}return a} -function lf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.fa&&(a.g("ended assemble at "+Z(a.ea.F)),a.W=a.ea,a.fa=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.za=null;if(kb(a)&&0l||"z"Ca.length&&(a.g("note: only "+Ca.length+" available"),ea=Ca.length);Y-=ea;0>Y&&(null==Ca[Ca.length-1].F?(ea=Y+ea,Y=0):Y+=Ca.length); -var fd=[];"call"==Qe&&(mb=1E5,fd=["CALL"]);for(void 0!==Pe&&a.g(ea+" instructions earlier:");0=Ca.length&&(Y=0);a.eb=ea;Se++;mb--}}Se||(a.g("no "+Re+"history available"),a.eb=void 0)}else{var oc=se(a,Aa);if(oc){var pc=0;Va&&("l"==Va.charAt(0)&&(Va=Va.substr(1)||Xf),pc=sf(a,Va)>>>0,65536>4||1;Zf--&&0tc?String.fromCharCode(tc):".";rc--}Wa&&(Wa+="\n");Wa+=Aa+" "+Mb+(0==Lb?" "+hd:"")}Wa&&a.g(Wa);a.Ta=oc}}}}break;case "e":if("else"==f[0])break;var uc=1,Ve=255,We=a.Y,Xe=a.qa;"ew"==f[0]&&(uc=2,Ve=65535,We=a.Pa,Xe=a.Qb);var Ye=uc<<1,Ze=f[1];if(null==Ze)a.g("edit memory commands:"), -a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a");else{var vc=se(a,Ze);if(vc)for(var wc=2;wcod;){for(var Xa=null,eg=256;65536>Pb.F>>>0;){bf.F=a.Pa(Pb,2);if(null==Pb.F||!eg--)break;for(var fg=a,yc=bf,cf=null,Qb=yc.F,df=Qb,pd=1;6>=pd&&Qb;pd++){if(2>8&255;case "E":d.T=g&255;break;case "H":d.U=g&255;break;case "HL":d.U=g>>8&255;case "L":d.X=g&255;break;case "SP":d.ia=g&65535;break;case "PC":G(d,g);a.W=X(d.N);break;case "PS":Jc(d,g);break;case "PSW":Jc(d,g&255|d.ta&-256);d.j=g>>8;break;case "CF":d.aa=g?d.aa|256:d.aa&255;break;case "PF":g?Uc(d)||(d.ca^=1):Uc(d)&&(d.ca^=1);break;case "AF":d.ua=g?~d.ca&16|d.ua&-17:d.ca&16|d.ua&-17;break;case "ZF":d.aa=g?d.aa&-256:d.aa|255;break;case "SF":g?Xc(d)||(d.ca^=192):Xc(d)&&(d.ca^= +192);break;case "IF":d.ta=g?d.ta|512:d.ta&-513;break;default:a.g("unknown register: "+e);return}if(!h){a.g("invalid value: "+f);return}lc(d);a.g("updated registers:")}a.g(pf(a));c&&(a.W=X(d.N),He(a,Y(a.W.F)))}}function Bf(a,b){b=ia(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(Ee(a,c[2])):xe(a,b,!0)}function Cf(a,b,c){var d="t"!=b;c=sf(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);xa(c,function(){return hb(a,!0)&&a.rb(e,d,!1)},function(){lc(a.b);hb(a,!1)})} +function He(a,b,c,d){if(b=se(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=se(a,c,!0);if(!d||d.Fg[0].indexOf("+"))){var l=g[0]+":";g[2]&&(l+=" "+g[2]);a.g(l)}g[3]&&(h=g[3],f=null);f=mf(a,b,h,f);a.g(f);a.W=b;e-=b.F-k;c++}}} +function ze(a,b,c,d){if(c)if(b){0>a.D&&a.G.length&&(a.D=0);if(0>a.D||b!=a.G[a.D])a.G.splice(0,0,b),a.D=0;a.D--}else a.fa?b="end":b=a.G[a.D+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var h=b.charAt(f);if('"'==h||"'"==h)e?h==e&&(e=null):e=h;else if(h==d&&!e||!h)a.push(ia(b.substring(c,f))),c=f+1}}return a} +function lf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.fa&&(a.g("ended assemble at "+Y(a.ea.F)),a.W=a.ea,a.fa=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.za=null;if(jb(a)&&0l||"z"Ca.length&&(a.g("note: only "+Ca.length+" available"),fa=Ca.length);Z-=fa;0>Z&&(null==Ca[Ca.length-1].F?(fa=Z+fa,Z=0):Z+=Ca.length);var fd= +[];"call"==Qe&&(mb=1E5,fd=["CALL"]);for(void 0!==Pe&&a.g(fa+" instructions earlier:");0=Ca.length&&(Z=0);a.eb=fa;Se++;mb--}}Se||(a.g("no "+Re+"history available"),a.eb=void 0)}else{var oc=se(a,Aa);if(oc){var pc=0;Va&&("l"==Va.charAt(0)&&(Va=Va.substr(1)||Xf),pc=sf(a,Va)>>>0,65536>4||1;Zf--&&0tc?String.fromCharCode(tc):".";rc--}Wa&&(Wa+="\n");Wa+=Aa+" "+Mb+(0==Lb?" "+hd:"")}Wa&&a.g(Wa);a.Ta=oc}}}}break;case "e":if("else"==f[0])break;var uc=1,Ve=255,We=a.Y,Xe=a.qa;"ew"==f[0]&&(uc=2,Ve=65535,We=a.Pa,Xe=a.Qb);var Ye=uc<<1,Ze=f[1];if(null==Ze)a.g("edit memory commands:"), +a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a");else{var vc=se(a,Ze);if(vc)for(var wc=2;wcod;){for(var Xa=null,eg=256;65536>Pb.F>>>0;){bf.F=a.Pa(Pb,2);if(null==Pb.F||!eg--)break;for(var fg=a,yc=bf,cf=null,Qb=yc.F,df=Qb,pd=1;6>=pd&&Qb;pd++){if(2\nLicense: GPL version 3 or later ");for(b=0;bMf){if(If(d,this.W)){this.I=new I(this,"1.23.3","failsafe");If(this.I)&&(Rf(this,d),a=2,Ff(this.I));J(this.I,"timestamp",ma());Gf(this.I);var e=this.w&&!this.K;if(1==a||sa("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=Hf(d)){var f=Jf(d,"code"),h=Jf(d,"data");f&&("ok"==f?If(d,h):("error"==f&& -"no machine state"!=h?(this.ga("Error: "+h),"unable to verify user"==h&&(wa("user",""),this.u=null)):this.g(f+": "+h),Ff(d),If(d)?(c=Hf(d),e=!0):c=!1))}e&&Qf(this,c?d:null)}else 2==a&&d.clear()}else Qf(this);delete this.W;delete this.Z}e=cb(this.id);for(f=0;fa[1];a=a[2];this.ra=!0;this.C.sa=!0;var d=this.M.power;d&&(d.textContent="Shutdown");this.b&&(Sf(this,this.b,b,c,a),nc(this.b));this.ea&&(Rf(this,b),b.clear());!c&&this.I&&(this.I.clear(),delete this.I);this.G=0}; -function Rf(a,b){if(sa("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.u||"",d=b.toString(),e={app:"PC8080",ver:"1.23.3"};e.url=a.ma;e.user=c;e.type="bug";e.data=d;oa("http://www.pcjs.org/api/v1/report",e,!0)}} -function Df(a,b,c){var d,e="none";if(a.G)return null;a.G--;var f=new I(a,"1.23.3"),h=new I(a,"1.23.3","validate"),g=ma();J(h,"timestamp",g);J(f,"timestamp",g);J(f,"version","1.23.3");J(f,"url",window?window.location.href:null);J(f,"browser",ra());a.b&&a.b.Ja&&(c&&a.b.ja(),d=a.b.Ja(b,c),"object"===typeof d&&J(f,a.b.id,d),c&&(a.b.C.sa=!1,!1===d&&(e=null)));for(var g=cb(a.id),k=0;k\nLicense: GPL version 3 or later ");for(b=0;bMf){if(If(d,this.W)){this.I=new Mc(this,"1.23.3","failsafe");If(this.I)&&(Rf(this,d),a=2,Ff(this.I));H(this.I,"timestamp",la());Gf(this.I);var e=this.w&&!this.K;if(1==a||ra("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=Hf(d)){var f=Jf(d,"code"),h=Jf(d,"data");f&&("ok"==f?If(d,h):("error"== +f&&"no machine state"!=h?(this.ga("Error: "+h),"unable to verify user"==h&&(va("user",""),this.u=null)):this.g(f+": "+h),Ff(d),If(d)?(c=Hf(d),e=!0):c=!1))}e&&Qf(this,c?d:null)}else 2==a&&d.clear()}else Qf(this);delete this.W;delete this.Z}e=bb(this.id);for(f=0;fa[1];a=a[2];this.ra=!0;this.C.sa=!0;var d=this.M.power;d&&(d.textContent="Shutdown");this.b&&(Sf(this,this.b,b,c,a),mc(this.b));this.ea&&(Rf(this,b),b.clear());!c&&this.I&&(this.I.clear(),delete this.I);this.G=0}; +function Rf(a,b){if(ra("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.u||"",d=b.toString(),e={app:"PC8080",ver:"1.23.3"};e.url=a.ma;e.user=c;e.type="bug";e.data=d;na("http://www.pcjs.org/api/v1/report",e,!0)}} +function Df(a,b,c){var d,e="none";if(a.G)return null;a.G--;var f=new Mc(a,"1.23.3"),h=new Mc(a,"1.23.3","validate"),g=la();H(h,"timestamp",g);H(f,"timestamp",g);H(f,"version","1.23.3");H(f,"url",window?window.location.href:null);H(f,"browser",pa());a.b&&a.b.Ja&&(c&&a.b.ja(),d=a.b.Ja(b,c),"object"===typeof d&&H(f,a.b.id,d),c&&(a.b.C.sa=!1,!1===d&&(e=null)));for(var g=bb(a.id),k=0;k>>f.la;0>8|(v&255)<<8);p>H&B;de(d,d.gc,p++,q,ia);H+=u}p>y&&(y=p);q=h&&(h=q+1)}g+=2;l++;if(p>=d.K&&(p=0,q++,q>d.da))break}d.Fa=!0;eg.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1pc8080$2")); +function Nf(a,b){var c=a.u;c||(c=ua("user"),void 0!==c?!c&&b&&(c=null,window&&(c=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&&((c=Uf(a,c))||a.ga("The user ID is invalid."))):b&&a.ga("Browser local storage is not available"));return c} +function Uf(a,b){a.u=null;var c=na(oa()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(va("user",c.data),a.u=c.data)}catch(e){t(e.message+" ("+d+")")}return a.u}function Of(a){var b=null;a.u&&(b=oa()+"/api/v1/user?req=load&user="+a.u+"&state="+Ef(a,"1.23.3"));return b} +function Tf(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Ef(a,"1.23.3");d.data=c;b=na(oa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0>>f.la;0>8|(u&255)<<8);p>I&z;de(d,d.ic,p++,q,W);I+=v}p>y&&(y=p);q=h&&(h=q+1)}g+=2;l++;if(p>=d.K&&(p=0,q++,q>d.da))break}d.Fa=!0;eg.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1pc8080$2")); g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){g=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");oa(e,null,!0,function(f,h,g){if(g||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+g+")");else{if(f=d[3])if(g=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=g[0],l,p=/( [a-z]+=)(['"])(.*?)\2/g;l=p.exec(f);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);g[0]!=k&&(h=h.replace(g[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/, +function lg(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");na(e,null,!0,function(f,h,g){if(g||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+g+")");else{if(f=d[3])if(g=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=g[0],l,p=/( [a-z]+=)(['"])(.*?)\2/g;l=p.exec(f);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);g[0]!=k&&(h=h.replace(g[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/, "");a=a.replace(d[0],h);lg(a,b,c)}})}else c(a,null)} -function mg(a,b,c,d){function e(a){if(void 0===g){var b=h&&A(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ga(a))}function f(a){e("Error: "+a);k&&(--Vf||Oa(!0));k=!1}var h,g,k=!0;Vf++;ab[a]={};try{if(h=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=l:q.appendChild(document.createTextNode(l));p.appendChild(q)}c|| -(c="/versions/pc8080/1.23.3/components.xsl");l=function(d,g){g?Wf(c,null,null,!1,e,function(d,k){if(k)if(bb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=g.transformNode(k);l?(h.outerHTML=l,--Vf||Oa(!0)):f("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(l=new XSLTProcessor,l.importStylesheet(k),(l=l.transformToFragment(g,document))?h.parentNode?(h.parentNode.replaceChild(l,h),--Vf||Oa(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?Wf(b,a,d,!0,e,l):kg(b,null,a,d,!1,e,l)}else f("missing machine element: "+a)}catch(y){f(y.message)}return k}window.embedPC8080=function(a,b,c,d){Oa(!1);return mg(a,b,c,d)};window.enableEvents=Oa;window.sendEvent=Pa; -function ng(a,b,c,d){if(!c&&b){d.push(b);a=ab[d[0]];b=null;for(var e in a)if(da(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?oa(b,null,!0,function(a,b){og(b,d)}):og(null,d)}else t("Error ("+c+") requesting "+a)} -function og(a,b){var c,d,e,f=b[0],h=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var g=ab[f],k={},l;for(l in g){var p=g[l],q=ca(l);if("xml"==q){for(q=/[ \t]*]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=q.exec(g[l]);){var y=d[2];y&&(g[y]||(p=p.replace(d[0],"")))}d=l=ba(l)}else"xsl"==q&&(e=l=ba(l));k[l]=p}a&&(k[l="css"]=a);b[2]&&(k[l="parms"]=b[2]);b[3]&&(k[l="state"]=b[3]);d&&e?(l=JSON.stringify(k),h+=".js",c=c[1]+"var resources="+l+";"+c[2]+c[3],c=c.replace(/\u00A9/g, -"©"),l=h,g=null,k="data:application/javascript,",k=xa("Firefox")?k+encodeURIComponent(c):k+encodeURI(c),l&&(g=document.createElement("a"),"string"!=typeof g.download&&(g=null)),g?(g.href=k,g.download=l,document.body.appendChild(g),g.click(),document.body.removeChild(g),c="Check your Downloads folder for "+l+"."):(window.open(k),c="Check your browser for a new window/tab containing the requested data"+(l?" ("+l+")":"")+"."),c+=', copy it to your web server as "'+h+'", and then add the following to your web page:\n\n', +function mg(a,b,c,d){function e(a){if(void 0===g){var b=h&&B(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ga(a))}function f(a){e("Error: "+a);k&&(--Vf||La(!0));k=!1}var h,g,k=!0;Vf++;$a[a]={};try{if(h=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=l:q.appendChild(document.createTextNode(l));p.appendChild(q)}c|| +(c="/versions/pc8080/1.23.3/components.xsl");l=function(d,g){g?Wf(c,null,null,!1,e,function(d,k){if(k)if(ab(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=g.transformNode(k);l?(h.outerHTML=l,--Vf||La(!0)):f("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(l=new XSLTProcessor,l.importStylesheet(k),(l=l.transformToFragment(g,document))?h.parentNode?(h.parentNode.replaceChild(l,h),--Vf||La(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?Wf(b,a,d,!0,e,l):kg(b,null,a,d,!1,e,l)}else f("missing machine element: "+a)}catch(y){f(y.message)}return k}window.embedPC8080=function(a,b,c,d){La(!1);return mg(a,b,c,d)};window.enableEvents=La;window.sendEvent=Oa; +function ng(a,b,c,d){if(!c&&b){d.push(b);a=$a[d[0]];b=null;for(var e in a)if(da(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?na(b,null,!0,function(a,b){og(b,d)}):og(null,d)}else t("Error ("+c+") requesting "+a)} +function og(a,b){var c,d,e,f=b[0],h=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var g=$a[f],k={},l;for(l in g){var p=g[l],q=ca(l);if("xml"==q){for(q=/[ \t]*]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=q.exec(g[l]);){var y=d[2];y&&(g[y]||(p=p.replace(d[0],"")))}d=l=ba(l)}else"xsl"==q&&(e=l=ba(l));k[l]=p}a&&(k[l="css"]=a);b[2]&&(k[l="parms"]=b[2]);b[3]&&(k[l="state"]=b[3]);d&&e?(l=JSON.stringify(k),h+=".js",c=c[1]+"var resources="+l+";"+c[2]+c[3],c=c.replace(/\u00A9/g, +"©"),l=h,g=null,k="data:application/javascript,",k=wa("Firefox")?k+encodeURIComponent(c):k+encodeURI(c),l&&(g=document.createElement("a"),"string"!=typeof g.download&&(g=null)),g?(g.href=k,g.download=l,document.body.appendChild(g),g.click(),document.body.removeChild(g),c="Check your Downloads folder for "+l+"."):(window.open(k),c="Check your browser for a new window/tab containing the requested data"+(l?" ("+l+")":"")+"."),c+=', copy it to your web server as "'+h+'", and then add the following to your web page:\n\n', c+='
\n',c+="...\n",c+='