diff --git a/devices/pc8080/machine/vt100/debugger/README.md b/devices/pc8080/machine/vt100/debugger/README.md index 888a44eca..71ad74bde 100644 --- a/devices/pc8080/machine/vt100/debugger/README.md +++ b/devices/pc8080/machine/vt100/debugger/README.md @@ -22,7 +22,6 @@ maps modern keys to VT100 key addresses, and most of the mappings are 1-1. Func - F2: PF2 - F3: PF3 - F4: PF4 -- F5: KEYPAD COMMA - F6: BREAK - F7: LINE FEED - F8: NO SCROLL @@ -222,12 +221,10 @@ at column 1, line 1, and the microprocessor enters its background routine, ready Some additional observations: -- During the NVR test, a "WAIT" message is displayed in the top-left corner of the screen. -- Following the NVR test, code at 0x00D2 loops for 0xFFF (4095) times with the CLICK bit (0x80) set in the keyboard STATUS -port (0x82), generating a "bell" (beep), presumably because the NVR test failed. And one would expect the NVR checksum test -to fail, since we initialize all NVR words with the freshly-erased value of 0x3fff. Also, at some point before arriving at the -preceding loop, the "WAIT" message has been cleared. - +- During the NVR test, a "WAIT" message is displayed in the top-left corner of the screen; it's cleared after the test. +- Following the NVR test, if an error was detected, code at 0x00D2 loops for 0xFFF (4095) times with the CLICK bit (0x80) +set in the keyboard STATUS port (0x82), generating a "bell" (beep). The NVR checksum test used to fail when we initialized all +NVR words with the freshly-erased value of 0x3fff; now we initialize them with canned values (see ChipSet.VT100.INIT). Additional VT100 Resources -------------------------- diff --git a/modules/pc8080/lib/keyboard.js b/modules/pc8080/lib/keyboard.js index e1c0b513d..78123677b 100644 --- a/modules/pc8080/lib/keyboard.js +++ b/modules/pc8080/lib/keyboard.js @@ -329,57 +329,41 @@ Keyboard.VT100.KEYMAP[Keyboard.ASCII.T] = 0x08; Keyboard.VT100.KEYMAP[Keyboard.ASCII.W] = 0x09; Keyboard.VT100.KEYMAP[Keyboard.ASCII.Q] = 0x0A; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.RIGHT] = 0x10; -Keyboard.VT100.KEYMAP[Keyboard.ASCII[']']] = 0x14; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['}']] = 0x94; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['[']] = 0x15; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['{']] = 0x95; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.RBRACK] = 0x14; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.LBRACK] = 0x15; Keyboard.VT100.KEYMAP[Keyboard.ASCII.I] = 0x16; Keyboard.VT100.KEYMAP[Keyboard.ASCII.U] = 0x17; Keyboard.VT100.KEYMAP[Keyboard.ASCII.R] = 0x18; Keyboard.VT100.KEYMAP[Keyboard.ASCII.E] = 0x19; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['1']] = 0x1A; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['!']] = 0x9A; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.ONE] = 0x1A; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.LEFT] = 0x20; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.DOWN] = 0x22; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F6] = 0x23; // aka BREAK Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.PAUSE] = 0x23; // aka BREAK -Keyboard.VT100.KEYMAP[Keyboard.ASCII['`']] = 0x24; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['~']] = 0xA4; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['-']] = 0x25; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['_']] = 0xA5; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['9']] = 0x26; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['(']] = 0xA6; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['7']] = 0x27; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['&']] = 0xA7; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['4']] = 0x28; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['$']] = 0xA8; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['3']] = 0x29; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['#']] = 0xA9; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.BQUOTE] = 0x24; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.DASH] = 0x25; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NINE] = 0x26; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.SEVEN] = 0x27; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.FOUR] = 0x28; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.THREE] = 0x29; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.ESC] = 0x2A; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.UP] = 0x30; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F3] = 0x31; // aka PF3 Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F1] = 0x32; // aka PF1 Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.BS] = 0x33; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['=']] = 0x34; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['+']] = 0xB4; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['0']] = 0x35; -Keyboard.VT100.KEYMAP[Keyboard.ASCII[')']] = 0xB5; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['8']] = 0x36; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['*']] = 0xB6; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['6']] = 0x37; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['^']] = 0xB7; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['5']] = 0x38; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['%']] = 0xB8; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['2']] = 0x39; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['@']] = 0xB9; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.EQUALS] = 0x34; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.ZERO] = 0x35; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.EIGHT] = 0x36; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.SIX] = 0x37; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.FIVE] = 0x38; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.TWO] = 0x39; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.TAB] = 0x3A; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_7] = 0x40; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F4] = 0x41; // aka PF4 Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F2] = 0x42; // aka PF2 Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_0] = 0x43; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F7] = 0x44; // aka LINE FEED -Keyboard.VT100.KEYMAP[Keyboard.ASCII['\\']] = 0x45; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['|']] = 0xC5; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.BSLASH] = 0x45; Keyboard.VT100.KEYMAP[Keyboard.ASCII.L] = 0x46; Keyboard.VT100.KEYMAP[Keyboard.ASCII.K] = 0x47; Keyboard.VT100.KEYMAP[Keyboard.ASCII.G] = 0x48; @@ -389,10 +373,8 @@ Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_8] = 0x50; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_CR] = 0x51; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_2] = 0x52; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_1] = 0x53; -Keyboard.VT100.KEYMAP[Keyboard.ASCII["'"]] = 0x55; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['"']] = 0xD5; -Keyboard.VT100.KEYMAP[Keyboard.ASCII[';']] = 0x56; -Keyboard.VT100.KEYMAP[Keyboard.ASCII[':']] = 0xD6; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.QUOTE] = 0x55; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.SEMI] = 0x56; Keyboard.VT100.KEYMAP[Keyboard.ASCII.J] = 0x57; Keyboard.VT100.KEYMAP[Keyboard.ASCII.H] = 0x58; Keyboard.VT100.KEYMAP[Keyboard.ASCII.D] = 0x59; @@ -402,10 +384,8 @@ Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F5] = 0x61; // aka KEYPAD COMMA Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_5] = 0x62; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_4] = 0x63; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.CR] = 0x64; // TODO: Figure out why the Technical Manual lists CR at both 0x04 and 0x64 -Keyboard.VT100.KEYMAP[Keyboard.ASCII['.']] = 0x65; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['>']] = 0xE5; -Keyboard.VT100.KEYMAP[Keyboard.ASCII[',']] = 0x66; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['<']] = 0xE6; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.PERIOD] = 0x65; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.COMMA] = 0x66; Keyboard.VT100.KEYMAP[Keyboard.ASCII.N] = 0x67; Keyboard.VT100.KEYMAP[Keyboard.ASCII.B] = 0x68; Keyboard.VT100.KEYMAP[Keyboard.ASCII.X] = 0x69; @@ -414,8 +394,7 @@ Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_9] = 0x70; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_3] = 0x71; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_6] = 0x72; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_SUB] = 0x73; // aka KEYPAD MINUS -Keyboard.VT100.KEYMAP[Keyboard.ASCII['/']] = 0x75; -Keyboard.VT100.KEYMAP[Keyboard.ASCII['?']] = 0xF5; +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.SLASH] = 0x75; Keyboard.VT100.KEYMAP[Keyboard.ASCII.M] = 0x76; Keyboard.VT100.KEYMAP[Keyboard.ASCII[' ']] = 0x77; Keyboard.VT100.KEYMAP[Keyboard.ASCII.V] = 0x78; diff --git a/versions/pc8080/1.23.3/pc8080-dbg.js b/versions/pc8080/1.23.3/pc8080-dbg.js index 3b819ee06..25d5c0022 100644 --- a/versions/pc8080/1.23.3/pc8080-dbg.js +++ b/versions/pc8080/1.23.3/pc8080-dbg.js @@ -1,243 +1,241 @@ -(function(){var m;function ca(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 t(a){return"0x"+n(a,4)}function da(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function ia(a){return a.replace(/[&<>"']/g,function(a){return ha[a]})}function ja(a,b){return(a+" ").slice(0,b)}function ka(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} -function la(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 oa(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.Ca=1<>2;this.B=this.Ca-1;this.M=this.O/this.Ca|0;this.K=this.M-1;this.w=[];this.A=[];this.F=this.H=!1;this.Z=[];this.ba=[];a=new E;ub(a,this.I);this.W=Array(this.M);for(b=0;b>>a.ma;0f&&(l=f);if(g&&g.size){if(g.type==d){if(e+f<=g.G)return g.Fb+=g.G-e,g.G=e,!0;if(e>=g.G+g.Fb){l=g.size-(e-k);l>f&&(l=f);g.Fb=e-g.G+l;e=k+a.Ca;f-=l;h++;continue}}return wb(1,e,f)}e=new E(e,l,a.Ca,d);ub(e,a.I,g);a.W[h++]=e;e=k+a.Ca;f-=l}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+xb[d]+" at "+t(b)),!0):wb(2,b,c)}m.Y=function(a){return this.W[(a&this.D)>>>this.ma].qb(a&this.B,a)}; -function yb(a,b){return a.W[(b&a.D)>>>a.ma].Db(b&a.B,b)}m.Qa=function(a){var b=a&this.B,c=(a&this.D)>>>this.ma;return b!=this.B?this.W[c].Ac(b,a):this.W[c++].qb(b,a)|this.W[c&this.K].qb(0,a+1)<<8};function zb(a,b){var c=b&a.B,d=(b&a.D)>>>a.ma;return c!=a.B?a.W[d].ac(c,b):a.W[d++].Db(c,b)|a.W[d&a.K].Db(0,b+1)<<8}m.qa=function(a,b){this.W[(a&this.D)>>>this.ma].sb(a&this.B,b&255,a)};function Ab(a,b,c){a.W[(b&a.D)>>>a.ma].Gb(b&a.B,c&255,b)} -m.Rb=function(a,b){var c=a&this.B,d=(a&this.D)>>>this.ma;c!=this.B?this.W[d].Cc(c,b&65535,a):(this.W[d++].sb(c,b&255,a),this.W[d&this.K].sb(0,b>>8&255,a+1))};function Bb(a,b){if(void 0===b)return a.F=!a.F,a.F;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,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]?u("Input port "+t(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.I&&a.H!=h[1]&&Ib(a.I,b,k)}else a.I&&(fb(a.I,a,b,k,d),a.H&&Ib(a.I,b,k));f+=g<<3;b+=g;e-=g}} -function wb(a,b,c){u("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1}var Jb;if(mb){var Kb=new ArrayBuffer(2);(new DataView(Kb)).setUint16(0,256,!0);Jb=256===(new Uint16Array(Kb))[0]}else Jb=!1;var Lb=Jb; -function E(a,b,c,d){this.id=Ub+=2;this.b=null;this.G=a;this.Fb=b;this.size=c||0;this.type=d||Vb;this.L=d==Wb;ub(this);this.La=this.sc=!1;if(c)if(mb)this.F=new ArrayBuffer(c),this.H=new DataView(this.F,0,c),this.B=new Uint8Array(this.F,0,c),this.K=new Uint16Array(this.F,0,c>>1),this.b=new Int32Array(this.F,0,c>>2),Xb(this,Lb?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},na: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},Fa: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.I&&null!=this.G){var c=this.I;dc(c,this.G+a,1,c.Z)&&c.ka(!0)}return this.Db(a,b)},fa:function(a,b){if(this.I&&null!=this.G){var c=this.I;dc(c,this.G+a,2,c.Z)&&c.ka(!0)}return this.ac(a,b)},wa:function(a,b,c){if(this.I&&null!=this.G){var d=this.I;dc(d,this.G+a,1,d.H)&&d.ka(!0)}this.L?this.D(a,b,c):this.Gb(a,b,c)},Ha:function(a, -b,c){if(this.I&&null!=this.G){var d=this.I;dc(d,this.G+a,2,d.H)&&d.ka(!0)}this.L?this.D(a,b,c):this.cc(a,b,c)},P:function(a){return this.B[a]},ba:function(a){return this.B[a]},ea:function(a){return this.H.getUint16(a,!0)},la:function(a){return a&1?this.B[a]|this.B[a+1]<<8:this.K[a>>1]},ra:function(a,b){this.B[a]=b;this.La=!0},xa:function(a,b){this.B[a]=b;this.La=!0},Ga:function(a,b){this.H.setUint16(a,b,!0);this.La=!0},Ka:function(a,b){a&1?(this.B[a]=b,this.B[a+1]=b>>8):this.K[a>>1]=b;this.La=!0}}; -function ub(a,b,c){a.I=b;a.w=a.A=0;c&&((a.w=c.w)&&cc(a,bc,!1),(a.A=c.A)&&ac(a,bc,!1))}function ec(a,b){b?0===--a.A&&(a.sb=a.L?a.D:a.Gb,a.Cc=a.L?a.J:a.cc):0===--a.w&&(a.qb=a.Db,a.Ac=a.ac)}function ac(a,b,c){c&&a.A||(a.sb=!a.L&&b[2]||a.D,a.Cc=!a.L&&b[3]||a.J);if(c||void 0===c)a.Gb=b[2]||a.D,a.cc=b[3]||a.J}function cc(a,b,c){c&&a.w||(a.qb=b[0]||a.M,a.Ac=b[1]||a.O);if(c||void 0===c)a.Db=b[0]||a.M,a.ac=b[1]||a.O}function Xb(a,b){b||(b=fc);cc(a,b,void 0);ac(a,b,void 0)} -var fc=[],$b=[E.prototype.da,E.prototype.na,E.prototype.Fa,E.prototype.ab],bc=[E.prototype.Z,E.prototype.fa,E.prototype.wa,E.prototype.Ha];if(mb)var Zb=[E.prototype.P,E.prototype.ea,E.prototype.ra,E.prototype.Ga],Yb=[E.prototype.ba,E.prototype.la,E.prototype.xa,E.prototype.Ka]; -function gc(a,b){v.call(this,"CPU",a,gc,1);var c=a.cycles||b,d=a.multiplier||1;this.i={};this.i.pb=c;this.i.Ob=0;this.i.Za=d;this.i.Xb=Math.round(this.i.pb/1E4)/100;this.i.Xa=this.i.Xb*this.i.Za;this.C.va=!1;this.C.Wb=!1;this.C.rc=a.autoStart;this.C.tc=!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);D(this)}$a(gc);var hc=["power","reset"];m=gc.prototype; -m.Na=function(a,b,c,d){this.w=a;this.B=b;this.I=d;for(b=0;b=a.i.mb&&(a.i.mb+=a.i.lb,c=!0);0<=a.i.nb&&a.i.nb<=pc(a)&&(a.i.lb=a.i.nb=-1,kc(a),a.ka(),c=!0);c&&a.g(pc(a)+" cycles: checksum="+n(a.i.xb))}} -m.ja=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.L[b]=c;a=!0;break;case "run":this.L[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.Xb*a.i.Za;if(a.i.Xa!=b){a.i.Xa=b;b=a.i.Xa.toFixed(2)+"Mhz";var e=a.L.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.w&&a.w.Eb()}Dc(a,a.H);a.H=0;a.i.kb=ma();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,pc(this));this.C.va=!0;this.C.Wb=!0;this.D&&this.D.start();var b=this.L.run;b&&(b.textContent="Halt");this.w&&(this.w.Ea(!0),a&&this.w.Eb(!0))}this.i.$b>=this.i.pb&&Ec(this,!0);this.i.Bb=0;this.i.Nb=ma();this.i.Ya&&(a=this.i.Nb-this.i.Ya,a>this.i.wc&&(this.i.kb+=a,this.i.kb>this.i.Nb&&(this.i.kb=this.i.Nb)));try{do{this.rb(this.C.hb?1:this.i.yd);var c=this.F-this.b;this.H+=c;this.i.Bb+=c;Dc(this,0,!0);oc(this, -c);this.i.Ab-=c;0>=this.i.Ab&&(this.i.Ab+=this.i.yc,this.w&&Fc(this.w,this.i.Ob++),this.i.Ob>this.M&&(this.i.Ob=0));this.i.zb-=c;0>=this.i.zb&&(this.i.zb+=this.i.xc,this.w&&this.w.Ea());this.i.ob-=c;if(0>=this.i.ob){this.i.ob+=this.i.Zb;break}}while(this.C.va)}catch(e){this.ka();mc(this);this.w&&this.w.stop(ma(),pc(this));ib(this,!1);lb(this,e.stack||e.message);return}c=setTimeout;a=this.ba;this.i.Ya=ma();b=this.i.wc;this.i.Bb&&(b=Math.round(b*this.i.Bb/this.i.Zb));var b=b-(this.i.Ya-this.i.Nb),d= -this.i.Ya-this.i.kb;d&&(this.i.Wa=Math.round(this.H/(10*d))/100,864E5<=d&&(this.J=0,Cc(this)));if(0>b||this.i.Wa>8&255;a.S=b&255}function Pc(a){return a.T<<8|a.U}function Qc(a,b){a.T=b>>8&255;a.U=b&255}function I(a){return a.V<<8|a.X} -function Rc(a,b){a.V=b>>8&255;a.X=b&255}function F(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 dd(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 ed(a,b){return a.ca=a.aa=a.ua=a.j^b}m.Y=function(a){return this.B.Y(a)};m.qa=function(a,b){this.B.qa(a,b)};function M(a){var b=a.Y(a.N);F(a,a.N+1);return b}function N(a){var b=a.B.Qa(a.N);F(a,a.N+2);return b}function O(a){var b=a.B.Qa(a.ia);a.ia=a.ia+2&65535;return b}function Q(a,b){a.ia=a.ia-2&65535;a.B.Rb(a.ia,b)}function fd(a,b){a.A=a.A&-8|b|8} -function R(a,b,c,d){d=d||2;a.L[b]&&(void 0===c&&(lb(a,"Value for "+b+" is invalid"),a.ka()),c=!a.C.va||a.C.tc?n(c,d):"--------".substr(0,d),a.L[b].textContent!=c&&(a.L[b].textContent=c))} -m.Ea=function(a){this.Z&&(a||!this.C.va||this.C.tc)&&(R(this,"A",this.j),R(this,"B",this.R),R(this,"C",this.S),R(this,"BC",Nc(this),4),R(this,"D",this.T),R(this,"E",this.U),R(this,"DE",Pc(this),4),R(this,"H",this.V),R(this,"L",this.X),R(this,"HL",I(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.L.speed)a.textContent= -this.C.va&&this.i.Wa?this.i.Wa.toFixed(2)+"Mhz":"Stopped"};m.rb=function(a){this.C.Lb=!0;var b=this.C.od=this.I&&gd(this.I),c=a?this.C.Wb?0:1:-1;this.C.Wb=!1;this.F=this.b=a;do{if(this.A){if(a&&this.A&8&&this.ta&512){var d=199|(this.A&7)<<3;this.A&=-17;this.A&=-16;this.ta&=-513;this.O[d].call(this)}if(this.A&16){this.b=0;break}}if(b){if(Ad(this.I,this.N,c)){this.ka();break}c=1}this.O[M(this)].call(this)}while(0>8;Tc(this,a&256);this.b-=4},Bd,function(){var a;Rc(this,a=I(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.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<<8&256;this.j=(a|this.j)>>1;Tc(this,a);this.b-=4},Bd,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.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<<1;this.j=a&255| -Sc(this);Tc(this,a&256);this.b-=4},Bd,function(){var a;Rc(this,a=I(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.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=this.j<<8;this.j=(Sc(this)<<8|this.j)>>1;Tc(this,a&256);this.b-=4},Bd,function(){Rc(this,N(this));this.b-=10},function(){var a=N(this);this.B.Rb(a,I(this)); -this.b-=16},function(){Rc(this,I(this)+1);this.b-=5},function(){this.V=bd(this,this.V);this.b-=5},function(){this.V=ad(this,this.V);this.b-=5},function(){this.V=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},Bd,function(){var a;Rc(this,a=I(this)+I(this));Tc(this,a>>8&256);this.b-=10},function(){var a;a=N(this);a=this.B.Qa(a);Rc(this,a);this.b-=16},function(){Rc(this,I(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},Bd,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=I(this);this.qa(a,bd(this,this.Y(a)));this.b-=10},function(){var a=I(this);this.qa(a,ad(this,this.Y(a)));this.b-=10},function(){this.qa(I(this),M(this));this.b-=10},function(){this.aa|=256;this.b-= -4},Bd,function(){var a;Rc(this,a=I(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.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.V;this.b-= -5},function(){this.R=this.X;this.b-=5},function(){this.R=this.Y(I(this));this.b-=7},function(){this.R=this.j;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.V;this.b-=5},function(){this.S=this.X;this.b-=5},function(){this.S=this.Y(I(this));this.b-=7},function(){this.S=this.j;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.V;this.b-=5},function(){this.T=this.X;this.b-=5},function(){this.T=this.Y(I(this));this.b-=7},function(){this.T=this.j;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.V;this.b-=5},function(){this.U=this.X;this.b-=5},function(){this.U=this.Y(I(this));this.b-=7},function(){this.U=this.j;this.b-=5},function(){this.V=this.R;this.b-=5},function(){this.V= -this.S;this.b-=5},function(){this.V=this.T;this.b-=5},function(){this.V=this.U;this.b-=5},function(){this.b-=5},function(){this.V=this.X;this.b-=5},function(){this.V=this.Y(I(this));this.b-=7},function(){this.V=this.j;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.X=this.V;this.b-=5},function(){this.b-=5},function(){this.X=this.Y(I(this));this.b-=7},function(){this.X=this.j; -this.b-=5},function(){this.qa(I(this),this.R);this.b-=7},function(){this.qa(I(this),this.S);this.b-=7},function(){this.qa(I(this),this.T);this.b-=7},function(){this.qa(I(this),this.U);this.b-=7},function(){this.qa(I(this),this.V);this.b-=7},function(){this.qa(I(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)||F(this,a);this.b-=10},function(){this.ta&=-513;this.b-=4},function(){var a=N(this);Xc(this)||(Q(this,this.N),F(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);F(this,48);this.b-=11},function(){Xc(this)&&(F(this,O(this)), -this.b-=6);this.b-=5},function(){this.ia=I(this)&65535;this.b-=5},function(){var a=N(this);Xc(this)&&F(this,a);this.b-=10},function(){this.ta|=512;this.b-=4},function(){var a=N(this);Xc(this)&&(Q(this,this.N),F(this,a),this.b-=6);this.b-=11},Ed,function(){L(this,M(this));this.b-=7},function(){Q(this,this.N);F(this,56);this.b-=11}]; -function T(a){v.call(this,"ChipSet",a,T,32768);var b=a.model;b&&!Fd[b]&&La("Unrecognized ChipSet model: "+b);this.D=Fd[b]||{};a.sound&&(this.da=null,window&&(this.da=window.AudioContext||window.webkitAudioContext),this.da&&new this.da);D(this)}$a(T); -var U={ya:1978.1,cd:{za:0,Wd:1,ae:16,ne:32,Be:64,ze:128,tb:14},Ua:{za:1,Ic:1,Yc:2,Uc:4,Vc:16,Wc:32,Xc:64,tb:8},dd:{za:2,Vd:3,Ke:4,Xd:8,ve:16,we:32,xe:64,Yd:128,tb:0},Fe:{za:3},De:{za:2,pe:7},He:{za:3,Me:1,Ge:2,ye:4,ie:8,Zd:16,Nd:32},Ee:{za:4},Ie:{za:5,be:1,ce:2,de:4,ee:8,Ne:16}},V={ya:100,Pa:{za:66,Re:1,Sc:2,Tc:4,te:8,re:16,hc:32,gc:64,dc:128},Hc:{za:66,INIT:0},Ia:{me:{za:98},Ra:{Fc:0,Ec:1,$c:2,gd:4,Lc:5,Zc:6,ad:7},Jb:16383},Kc:{za:162,INIT:0},Jc:{za:194,INIT:0}},Fd={SI1978:U,VT100:V}; -T.prototype.ja=function(){return!1};T.prototype.Na=function(a,b,c,d){this.B=b;this.b=c;this.I=d;this.w=a;this.M=rb(a,"Keyboard");Cb(b,this,this.D.Pb);Gb(b,this,this.D.Qb)};T.prototype.Aa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};T.prototype.Da=function(a){return a?this.save():!0};U.INIT=[[U.cd.tb,U.Ua.tb,U.dd.tb,0,0,0,0]]; -V.INIT=[[V.Hc.INIT,V.Pa.Sc|V.Pa.Tc,V.Kc.INIT,V.Jc.INIT],[0,0,0,0,[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11776,11856,11824,11840,11808,11776,12E3,12E3,11857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]];m=T.prototype; -m.reset=function(){this.D.INIT&&!this.restore(this.D.INIT)&&this.ga("reset error")};m.save=function(){var a=new G(this);switch(this.D.ya){case U.ya:H(a,0,[this.wa,this.F,this.xa,this.P,this.ba,this.na,this.ra]);break;case V.ya:H(a,0,[this.ea,this.J,this.la,this.fa]),H(a,1,[this.O,this.A,this.K,this.Z,this.H])}return a.data()}; -m.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.D.ya){case U.ya:return this.wa=b[0],this.F=b[1],this.xa=b[2],this.P=b[3],this.ba=b[4],this.na=b[5],this.ra=b[6],!0;case V.ya:return this.ea=b[0],this.J=b[1],this.la=b[2],this.fa=b[3],b=a[1],this.O=b[0],this.A=b[1],this.K=b[2],this.Z=b[3],this.H=b[4],!0}return!1};m.start=function(){};m.stop=function(){};function Gd(a,b,c){a.F&=~b;c&&(a.F|=b)}m.sd=function(a,b){var c=this.wa;C(this,a,null,b,"STATUS0",c,!0);return c}; -m.td=function(a,b){var c=this.F;C(this,a,null,b,"STATUS1",c,!0);return c};m.ud=function(a,b){var c=this.xa;C(this,a,null,b,"STATUS2",c,!0);return c};m.rd=function(a,b){var c=this.P>>8-this.ba&255;C(this,a,null,b,"SHIFT.RESULT",c,!0);return c};m.Cd=function(a,b,c){C(this,a,b,c,"SHIFT.COUNT",null,!0);this.ba=b};m.Ed=function(a,b,c){C(this,a,b,c,"SOUND1",null,!0);this.na=b};m.Dd=function(a,b,c){C(this,a,b,c,"SHIFT.DATA",null,!0);this.P=b<<8|this.P>>8}; -m.Fd=function(a,b,c){C(this,a,b,c,"SOUND2",null,!0);this.ra=b};m.Gd=function(a,b,c){C(this,a,b,c,"WATCHDOG",null,!0)};function Hd(a){var b=0,c=0,d=~a.O;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.vd=function(a,b){var c=this.J,c=c&~V.Pa.gc;if((pc(this.b)&64)<<1&&(c|=V.Pa.gc,c!=this.J)){var d,e;d=this.K&1;e=this.K>>1&7;switch(e){case V.Ia.Ra.ad:break;case V.Ia.Ra.Ec:this.O=this.O<<1|d;break;case V.Ia.Ra.Lc:d=Hd(this);this.H[d]=V.Ia.Jb;gb(this,"doNVRCommand(): erase data at addr "+t(d));break;case V.Ia.Ra.Fc:this.A=this.A<<1|d;break;case V.Ia.Ra.gd:d=Hd(this);e=this.A&V.Ia.Jb;this.H[d]=e;gb(this,"doNVRCommand(): write data "+t(e)+" to addr "+t(d));break;case V.Ia.Ra.Zc:d=Hd(this);e=this.H[d]; -null==e&&(e=V.Ia.Jb);this.A=e;gb(this,"doNVRCommand(): read data "+t(e)+" from addr "+t(d));break;case V.Ia.Ra.$c:this.A<<=1;this.Z=this.A&V.Ia.Jb+1;break;default:gb(this,"doNVRCommand(): unrecognized command 0x"+n(e,2))}}c&=~V.Pa.hc;this.Z&&(c|=V.Pa.hc);c&=~V.Pa.dc;this.M&&(c|=V.Pa.dc);this.J=c;C(this,a,null,b,"FLAGS.BUFFER",c);return c};m.Hd=function(a,b,c){C(this,a,b,c,"BRIGHTNESS");this.ea=b};m.Kd=function(a,b,c){C(this,a,b,c,"NVR.LATCH");this.K=b}; -m.Jd=function(a,b,c){C(this,a,b,c,"DC012");this.la=b};m.Id=function(a,b,c){C(this,a,b,c,"DC011");this.fa=b};U.Pb={0:T.prototype.sd,1:T.prototype.td,2:T.prototype.ud,3:T.prototype.rd};U.Qb={2:T.prototype.Cd,3:T.prototype.Ed,4:T.prototype.Dd,5:T.prototype.Fd,6:T.prototype.Gd};V.Pb={66:T.prototype.vd};V.Qb={66:T.prototype.Hd,98:T.prototype.Kd,162:T.prototype.Jd,194:T.prototype.Id};Ja(function(){for(var a=A(document,"pc8080","chipset"),b=0;b>>0,h],q=la(p,k,a.Ta);0>q&&p.splice(-(q+1),0,k)}l&&(g.a=l.replace(/''/g,'"'))}a.J.push({ff:b,G:c,xd:d,Oa:e,pc:f})}delete this.Oa}return!0};Id.prototype.Da=function(){return!0}; -function Jd(a,b,c,d){if(d)a.ga("Unable to load system ROM (error "+d+": "+b+")");else{bb(a.Sb,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.Oa=e.symbols;if(!a.w.length){u("Empty ROM: "+b);return}if(1==a.w.length){u(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.ma;0>>=f.ma;0":62,"?":63,"@":64,Md:65,Od:66,Pd:67,Ud:68,E:69,$d:70,fe:71,ge:72,he:73,je:74,ke:75,le:76,oe:77,qe:78,se:79,ue:80,Q:81,Ae:82,Ce:83,Je:84,Le:85,Oe:86,Pe:87,Qe:88,Se:89,Te:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ue:97,Ve:98,We:99,d:100,e:101,Xe:102,Ye:103,Ze:104,$e:105,af:106,k:107,bf:108, -cf:109,n:110,df:111,p:112,q:113,r:114,ef:115,t:116,gf:117,hf:118,jf:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126},Rd={65:37,68:39,76:32},Sd={ya:1978.1,u:{},vb:{},wb:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},X={ya:100,u:{},vb:{},wb:{},Gc:{za:130,INIT:127},Ja:{za:130,Qc:1,Pc:2,Oc:4,Nc:8,Rc:16,ic:32,ec:63,bd:64,Qd:128,INIT:0},Mc:127};X.u[46]=3;X.u[80]=5;X.u[79]=6;X.u[89]=7;X.u[84]=8;X.u[87]=9;X.u[81]=10;X.u[39]=16;X.u[W["]"]]=20;X.u[W["}"]]=148;X.u[W["["]]=21;X.u[W["{"]]=149; -X.u[73]=22;X.u[85]=23;X.u[82]=24;X.u[69]=25;X.u[W["1"]]=26;X.u[W["!"]]=154;X.u[37]=32;X.u[40]=34;X.u[117]=35;X.u[19]=35;X.u[W["`"]]=36;X.u[W["~"]]=164;X.u[W["-"]]=37;X.u[W._]=165;X.u[W["9"]]=38;X.u[W["("]]=166;X.u[W["7"]]=39;X.u[W["&"]]=167;X.u[W["4"]]=40;X.u[W.$]=168;X.u[W["3"]]=41;X.u[W["#"]]=169;X.u[27]=42;X.u[38]=48;X.u[114]=49;X.u[112]=50;X.u[8]=51;X.u[W["="]]=52;X.u[W["+"]]=180;X.u[W["0"]]=53;X.u[W[")"]]=181;X.u[W["8"]]=54;X.u[W["*"]]=182;X.u[W["6"]]=55;X.u[W["^"]]=183;X.u[W["5"]]=56; -X.u[W["%"]]=184;X.u[W["2"]]=57;X.u[W["@"]]=185;X.u[9]=58;X.u[103]=64;X.u[115]=65;X.u[113]=66;X.u[96]=67;X.u[118]=68;X.u[W["\\"]]=69;X.u[W["|"]]=197;X.u[76]=70;X.u[75]=71;X.u[71]=72;X.u[70]=73;X.u[65]=74;X.u[104]=80;X.u[2013]=81;X.u[98]=82;X.u[97]=83;X.u[W["'"]]=85;X.u[W['"']]=213;X.u[W[";"]]=86;X.u[W[":"]]=214;X.u[74]=87;X.u[72]=88;X.u[68]=89;X.u[83]=90;X.u[110]=96;X.u[116]=97;X.u[101]=98;X.u[100]=99;X.u[13]=100;X.u[W["."]]=101;X.u[W[">"]]=229;X.u[W[","]]=102;X.u[W["<"]]=230;X.u[78]=103;X.u[66]=104; -X.u[88]=105;X.u[119]=106;X.u[105]=112;X.u[99]=113;X.u[102]=114;X.u[109]=115;X.u[W["/"]]=117;X.u[W["?"]]=245;X.u[77]=118;X.u[W[" "]]=119;X.u[86]=120;X.u[67]=121;X.u[90]=122;X.u[120]=123;X.u[17]=124;X.u[16]=125;X.u[20]=126;X.vb={l4:X.Ja.Qc,l3:X.Ja.Pc,l2:X.Ja.Oc,l1:X.Ja.Nc,locked:X.Ja.Rc,online:X.Ja.ic,local:~X.Ja.ic};var Qd={SI1978:Sd,VT100:X}; -Pd.prototype.ja=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.L[e]){if("led"==a&&this.w.vb[b])return this.L[e]=c,!0;switch(b){case "kbd":return c.onkeydown=function(a){return Td(d,a,!0)},c.onkeyup=function(a){return Td(d,a,!1)},!0;default:if(this.w.wb&&void 0!==this.w.wb[b])return this.L[e]=c,a=function(a,b){return function(){Ud(a,b,!0)}}(this,b),b=function(a,b){return function(){Ud(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};Pd.prototype.Na=function(a,b,c,d){this.b=c;this.I=d;this.D=rb(a,"ChipSet");Cb(b,this,this.w.Pb);Gb(b,this,this.w.Qb)};Pd.prototype.Aa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};Pd.prototype.Da=function(a){return a?this.save():!0};X.INIT=[[X.Ja.INIT,X.Gc.INIT,-1]];m=Pd.prototype;m.reset=function(){this.B=[];this.w.INIT&&!this.restore(this.w.INIT)&&this.ga("reset error")}; -m.save=function(){var a=new G(this);switch(this.w.ya){case X.ya:H(a,0,[this.H,this.F,-1])}return a.data()};m.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.w.ya){case Sd.ya:return!0;case X.ya:return this.H=b[0],Vd(this,this.H&X.Ja.ec),this.F=b[1],this.A=b[2],!0}return!1};function Vd(a,b){for(var c in a.w.vb){var d=a.L["led-"+c];if(d){var e=a.w.vb[c],f=!!(b&e);e&e-1&&(f=!(b&~e));d.style.backgroundColor=f?"#ff0000":"#000000"}}} -function Td(a,b,c){var d=!0,e;a:if(e=b.keyCode,e=Rd[e]||e,!a.w.u[e]){for(var f in a.w.wb)if(a.w.wb[f]===e){e=f;break a}e=null}e&&(d=Ud(a,e,c),b.preventDefault());return d} -function Ud(a,b,c){var d;a:{for(d=0;dd?a.B.push({bc:b,Yb:Date.now(),Kb:!1}):(a.B[d].Yb=Date.now(),a.B[d].Kb=!1);else if(0<=d){if(!a.B[d].Kb){var e=a.B[d].Yb;if(e&&100>Date.now()-e)return a.B[d].Kb=!0,Wd(a),!0}a.B.splice(d,1)}if(a.D)switch(b){case "1p":Gd(a.D,U.Ua.Uc,c);break;case "2p":Gd(a.D,U.Ua.Yc,c);break;case "coin":Gd(a.D,U.Ua.Ic,c);break;case "left":Gd(a.D,U.Ua.Wc,c);break;case "right":Gd(a.D,U.Ua.Xc,c);break;case "fire":Gd(a.D,U.Ua.Vc,c)}return!0} -function Wd(a){for(var b=0,c=-1;bc||c>e)c=e}else{Ud(a,d,!1);b=0;continue}}b++}0<=c&&setTimeout(function(){Wd(a)},c)}m.wd=function(a,b){var c=this.F;0<=this.A&&(this.A>3)*this.da;if(this.jd||vb(this.B,this.wa,this.Ta,3))1>1)),this.O=document.createElement("canvas"),this.O.width=b,this.O.height=c,this.cb=this.O.getContext("2d"),this.na={},this.Ga=1<=a.ed?8:16,f=8>(7=d?48:55),c=String.fromCharCode(d)+c;a>>=4}return c}function t(a){return"0x"+n(a,4)}function ca(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function ha(a){return a.replace(/[&<>"']/g,function(a){return ga[a]})}function ia(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=this.J?10:20>=this.J?12:24>=this.J?14:15;this.Ea=1<>2;this.A=this.Ea-1;this.M=this.O/this.Ea|0;this.K=this.M-1;this.u=[];this.w=[];this.F=this.H=!1;this.Z=[];this.ba=[];a=new E;tb(a,this.I);this.W=Array(this.M);for(b=0;b>>a.na;0f&&(l=f);if(g&&g.size){if(g.type==d){if(e+f<=g.G)return g.Fb+=g.G-e,g.G=e,!0;if(e>=g.G+g.Fb){l=g.size-(e-k);l>f&&(l=f);g.Fb=e-g.G+l;e=k+a.Ea;f-=l;h++;continue}}return vb(1,e,f)}e=new E(e,l,a.Ea,d);tb(e,a.I,g);a.W[h++]=e;e=k+a.Ea;f-=l}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+wb[d]+" at "+t(b)),!0):vb(2,b,c)}m.Y=function(a){return this.W[(a&this.D)>>>this.na].qb(a&this.A,a)}; +function xb(a,b){return a.W[(b&a.D)>>>a.na].Db(b&a.A,b)}m.Qa=function(a){var b=a&this.A,c=(a&this.D)>>>this.na;return b!=this.A?this.W[c].Ac(b,a):this.W[c++].qb(b,a)|this.W[c&this.K].qb(0,a+1)<<8};function yb(a,b){var c=b&a.A,d=(b&a.D)>>>a.na;return c!=a.A?a.W[d].ac(c,b):a.W[d++].Db(c,b)|a.W[d&a.K].Db(0,b+1)<<8}m.ra=function(a,b){this.W[(a&this.D)>>>this.na].sb(a&this.A,b&255,a)};function zb(a,b,c){a.W[(b&a.D)>>>a.na].Gb(b&a.A,c&255,b)} +m.Rb=function(a,b){var c=a&this.A,d=(a&this.D)>>>this.na;c!=this.A?this.W[d].Cc(c,b&65535,a):(this.W[d++].sb(c,b&255,a),this.W[d&this.K].sb(0,b>>8&255,a+1))};function Ab(a,b){if(void 0===b)return a.F=!a.F,a.F;void 0===a.u[b]&&(a.u[b]=[null,!1]);a.u[b][1]=!a.u[b][1];return a.u[b][1]}function Bb(a,b,c,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.u[k]?u("Input port "+t(k)+" already registered"):f.u[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.I&&a.H!=h[1]&&Hb(a.I,b,k)}else a.I&&(eb(a.I,a,b,k,d),a.H&&Hb(a.I,b,k));f+=g<<3;b+=g;e-=g}} +function vb(a,b,c){u("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1}var Ib;if(lb){var Jb=new ArrayBuffer(2);(new DataView(Jb)).setUint16(0,256,!0);Ib=256===(new Uint16Array(Jb))[0]}else Ib=!1;var Kb=Ib; +function E(a,b,c,d){this.id=Tb+=2;this.b=null;this.G=a;this.Fb=b;this.size=c||0;this.type=d||Ub;this.L=d==Vb;tb(this);this.La=this.lc=!1;if(c)if(lb)this.F=new ArrayBuffer(c),this.H=new DataView(this.F,0,c),this.A=new Uint8Array(this.F,0,c),this.K=new Uint16Array(this.F,0,c>>1),this.b=new Int32Array(this.F,0,c>>2),Wb(this,Kb?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},Ba: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.I&&null!=this.G){var c=this.I;cc(c,this.G+a,1,c.Z)&&c.la(!0)}return this.Db(a,b)},fa:function(a,b){if(this.I&&null!=this.G){var c=this.I;cc(c,this.G+a,2,c.Z)&&c.la(!0)}return this.ac(a,b)},va:function(a,b,c){if(this.I&&null!=this.G){var d=this.I;cc(d,this.G+a,1,d.H)&&d.la(!0)}this.L?this.D(a,b,c):this.Gb(a,b,c)},Ja:function(a, +b,c){if(this.I&&null!=this.G){var d=this.I;cc(d,this.G+a,2,d.H)&&d.la(!0)}this.L?this.D(a,b,c):this.cc(a,b,c)},P:function(a){return this.A[a]},ba:function(a){return this.A[a]},ea:function(a){return this.H.getUint16(a,!0)},ha:function(a){return a&1?this.A[a]|this.A[a+1]<<8:this.K[a>>1]},oa:function(a,b){this.A[a]=b;this.La=!0},wa:function(a,b){this.A[a]=b;this.La=!0},Ca:function(a,b){this.H.setUint16(a,b,!0);this.La=!0},Ka: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.I=b;a.u=a.w=0;c&&((a.u=c.u)&&bc(a,ac,!1),(a.w=c.w)&&$b(a,ac,!1))}function dc(a,b){b?0===--a.w&&(a.sb=a.L?a.D:a.Gb,a.Cc=a.L?a.J:a.cc):0===--a.u&&(a.qb=a.Db,a.Ac=a.ac)}function $b(a,b,c){c&&a.w||(a.sb=!a.L&&b[2]||a.D,a.Cc=!a.L&&b[3]||a.J);if(c||void 0===c)a.Gb=b[2]||a.D,a.cc=b[3]||a.J}function bc(a,b,c){c&&a.u||(a.qb=b[0]||a.M,a.Ac=b[1]||a.O);if(c||void 0===c)a.Db=b[0]||a.M,a.ac=b[1]||a.O}function Wb(a,b){b||(b=ec);bc(a,b,void 0);$b(a,b,void 0)} +var ec=[],Zb=[E.prototype.da,E.prototype.ma,E.prototype.Ba,E.prototype.ab],ac=[E.prototype.Z,E.prototype.fa,E.prototype.va,E.prototype.Ja];if(lb)var Yb=[E.prototype.P,E.prototype.ea,E.prototype.oa,E.prototype.Ca],Xb=[E.prototype.ba,E.prototype.ha,E.prototype.wa,E.prototype.Ka]; +function fc(a,b){x.call(this,"CPU",a,fc,1);var c=a.cycles||b,d=a.multiplier||1;this.i={};this.i.pb=c;this.i.Ob=0;this.i.Za=d;this.i.Xb=Math.round(this.i.pb/1E4)/100;this.i.Xa=this.i.Xb*this.i.Za;this.C.xa=!1;this.C.Vb=!1;this.C.kc=a.autoStart;this.C.mc=!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);D(this)}Za(fc);var gc=["power","reset"];m=fc.prototype; +m.Na=function(a,b,c,d){this.u=a;this.A=b;this.I=d;for(b=0;b=a.i.mb&&(a.i.mb+=a.i.lb,c=!0);0<=a.i.nb&&a.i.nb<=oc(a)&&(a.i.lb=a.i.nb=-1,jc(a),a.la(),c=!0);c&&a.g(oc(a)+" cycles: checksum="+n(a.i.xb))}} +m.ka=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.L[b]=c;a=!0;break;case "run":this.L[b]=c;c.onclick=function(){var a;if(a=d.u)if(a=d.u,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.Xb*a.i.Za;if(a.i.Xa!=b){a.i.Xa=b;b=a.i.Xa.toFixed(2)+"Mhz";var e=a.L.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.u&&a.u.Eb()}Cc(a,a.H);a.H=0;a.i.kb=la();a.i.Ya=0;Dc(a);return d} +m.$a=function(a){if(hb(this,!0)){if(!this.C.xa){Bc(this);this.u&&this.u.start(this.i.kb,oc(this));this.C.xa=!0;this.C.Vb=!0;this.D&&this.D.start();var b=this.L.run;b&&(b.textContent="Halt");this.u&&(this.u.Ga(!0),a&&this.u.Eb(!0))}this.i.$b>=this.i.pb&&Dc(this,!0);this.i.Bb=0;this.i.Nb=la();this.i.Ya&&(a=this.i.Nb-this.i.Ya,a>this.i.tc&&(this.i.kb+=a,this.i.kb>this.i.Nb&&(this.i.kb=this.i.Nb)));try{do{this.rb(this.C.hb?1:this.i.rd);var c=this.F-this.b;this.H+=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.u&&Ec(this.u,this.i.Ob++),this.i.Ob>this.M&&(this.i.Ob=0));this.i.zb-=c;0>=this.i.zb&&(this.i.zb+=this.i.uc,this.u&&this.u.Ga());this.i.ob-=c;if(0>=this.i.ob){this.i.ob+=this.i.Zb;break}}while(this.C.xa)}catch(e){this.la();lc(this);this.u&&this.u.stop(la(),oc(this));hb(this,!1);kb(this,e.stack||e.message);return}c=setTimeout;a=this.ba;this.i.Ya=la();b=this.i.tc;this.i.Bb&&(b=Math.round(b*this.i.Bb/this.i.Zb));var b=b-(this.i.Ya-this.i.Nb),d= +this.i.Ya-this.i.kb;d&&(this.i.Wa=Math.round(this.H/(10*d))/100,864E5<=d&&(this.J=0,Bc(this)));if(0>b||this.i.Wa>8&255;a.S=b&255}function Oc(a){return a.T<<8|a.U}function Pc(a,b){a.T=b>>8&255;a.U=b&255}function K(a){return a.V<<8|a.X} +function Qc(a,b){a.V=b>>8&255;a.X=b&255}function F(a,b){a.N=b&65535}function Rc(a){return a.aa&256?1:0}function Sc(a,b){a.aa=a.aa&255|b}function Tc(a){return ob[a.ca&255]?4:0}function Uc(a){return(a.ca^a.ua)&16?16:0}function Vc(a){return a.aa&255?0:64}function Wc(a){return a.ca&128?128:0}function Lc(a){return a.ta&-214|Wc(a)|Vc(a)|Uc(a)|Tc(a)|Rc(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 Xc(a,b){a.ua=a.j^b;return a.ca=(a.aa=a.j+b)&255}function Yc(a,b){a.ua=a.j^b;return a.ca=(a.aa=a.j+b+(a.aa&256?1:0))&255}function Zc(a,b){a.aa=a.ca=a.ua=a.j&b;(a.j|b)&8&&(a.ua^=16);return a.aa}function $c(a,b){a.ua=b^255;b=a.ca=b+255&255;a.aa=a.aa&-256|b;return b}function ad(a,b){a.ua=b;b=a.ca=b+1&255;a.aa=a.aa&-256|b;return b}function bd(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 cd(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 dd(a,b){return a.ca=a.aa=a.ua=a.j^b}m.Y=function(a){return this.A.Y(a)};m.ra=function(a,b){this.A.ra(a,b)};function M(a){var b=a.Y(a.N);F(a,a.N+1);return b}function N(a){var b=a.A.Qa(a.N);F(a,a.N+2);return b}function P(a){var b=a.A.Qa(a.ja);a.ja=a.ja+2&65535;return b}function Q(a,b){a.ja=a.ja-2&65535;a.A.Rb(a.ja,b)}function ed(a,b){a.w=a.w&-8|b|8} +function S(a,b,c,d){d=d||2;a.L[b]&&(void 0===c&&(kb(a,"Value for "+b+" is invalid"),a.la()),c=!a.C.xa||a.C.mc?n(c,d):"--------".substr(0,d),a.L[b].textContent!=c&&(a.L[b].textContent=c))} +m.Ga=function(a){this.Z&&(a||!this.C.xa||this.C.mc)&&(S(this,"A",this.j),S(this,"B",this.R),S(this,"C",this.S),S(this,"BC",Mc(this),4),S(this,"D",this.T),S(this,"E",this.U),S(this,"DE",Oc(this),4),S(this,"H",this.V),S(this,"L",this.X),S(this,"HL",K(this),4),S(this,"SP",this.ja,4),S(this,"PC",this.N,4),a=Lc(this),S(this,"PS",a,4),S(this,"IF",a&512?1:0,1),S(this,"SF",a&128?1:0,1),S(this,"ZF",a&64?1:0,1),S(this,"AF",a&16?1:0,1),S(this,"PF",a&4?1:0,1),S(this,"CF",a&1?1:0,1));if(a=this.L.speed)a.textContent= +this.C.xa&&this.i.Wa?this.i.Wa.toFixed(2)+"Mhz":"Stopped"};m.rb=function(a){this.C.Jb=!0;var b=this.C.gd=this.I&&fd(this.I),c=a?this.C.Vb?0:1:-1;this.C.Vb=!1;this.F=this.b=a;do{if(this.w){if(a&&this.w&8&&this.ta&512){var d=199|(this.w&7)<<3;this.w&=-17;this.w&=-16;this.ta&=-513;this.O[d].call(this)}if(this.w&16){this.b=0;break}}if(b){if(zd(this.I,this.N,c)){this.la();break}c=1}this.O[M(this)].call(this)}while(0>8;Sc(this,a&256);this.b-=4},Ad,function(){var a;Qc(this,a=K(this)+Mc(this));Sc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(Mc(this));this.b-=7},function(){Nc(this,Mc(this)-1);this.b-= +5},function(){this.S=ad(this,this.S);this.b-=5},function(){this.S=$c(this,this.S);this.b-=5},function(){this.S=M(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(a|this.j)>>1;Sc(this,a);this.b-=4},Ad,function(){Pc(this,N(this));this.b-=10},function(){this.ra(Oc(this),this.j);this.b-=7},function(){Pc(this,Oc(this)+1);this.b-=5},function(){this.T=ad(this,this.T);this.b-=5},function(){this.T=$c(this,this.T);this.b-=5},function(){this.T=M(this);this.b-=7},function(){var a=this.j<<1;this.j=a&255| +Rc(this);Sc(this,a&256);this.b-=4},Ad,function(){var a;Qc(this,a=K(this)+Oc(this));Sc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(Oc(this));this.b-=7},function(){Pc(this,Oc(this)-1);this.b-=5},function(){this.U=ad(this,this.U);this.b-=5},function(){this.U=$c(this,this.U);this.b-=5},function(){this.U=M(this);this.b-=7},function(){var a=this.j<<8;this.j=(Rc(this)<<8|this.j)>>1;Sc(this,a&256);this.b-=4},Ad,function(){Qc(this,N(this));this.b-=10},function(){var a=N(this);this.A.Rb(a,K(this)); +this.b-=16},function(){Qc(this,K(this)+1);this.b-=5},function(){this.V=ad(this,this.V);this.b-=5},function(){this.V=$c(this,this.V);this.b-=5},function(){this.V=M(this);this.b-=7},function(){var a=0,b=Rc(this);if(Uc(this)||9<(this.j&15))a|=6;if(b||154<=this.j)a|=96,b=1;this.j=Xc(this,a);Sc(this,b?256:0);this.b-=4},Ad,function(){var a;Qc(this,a=K(this)+K(this));Sc(this,a>>8&256);this.b-=10},function(){var a;a=N(this);a=this.A.Qa(a);Qc(this,a);this.b-=16},function(){Qc(this,K(this)-1);this.b-=5},function(){this.X= +ad(this,this.X);this.b-=5},function(){this.X=$c(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.ja=N(this)&65535;this.b-=10},function(){this.ra(N(this),this.j);this.b-=13},function(){this.ja=this.ja+1&65535;this.b-=5},function(){var a=K(this);this.ra(a,ad(this,this.Y(a)));this.b-=10},function(){var a=K(this);this.ra(a,$c(this,this.Y(a)));this.b-=10},function(){this.ra(K(this),M(this));this.b-=10},function(){this.aa|=256;this.b-= +4},Ad,function(){var a;Qc(this,a=K(this)+this.ja);Sc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(N(this));this.b-=13},function(){this.ja=this.ja-1&65535;this.b-=5},function(){this.j=ad(this,this.j);this.b-=5},function(){this.j=$c(this,this.j);this.b-=5},function(){this.j=M(this);this.b-=7},function(){Sc(this,Rc(this)?0:256);this.b-=4},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.V;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.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.V;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.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.V;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.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.V;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.V=this.R;this.b-=5},function(){this.V= +this.S;this.b-=5},function(){this.V=this.T;this.b-=5},function(){this.V=this.U;this.b-=5},function(){this.b-=5},function(){this.V=this.X;this.b-=5},function(){this.V=this.Y(K(this));this.b-=7},function(){this.V=this.j;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.X=this.V;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.ra(K(this),this.R);this.b-=7},function(){this.ra(K(this),this.S);this.b-=7},function(){this.ra(K(this),this.T);this.b-=7},function(){this.ra(K(this),this.U);this.b-=7},function(){this.ra(K(this),this.V);this.b-=7},function(){this.ra(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);Wc(this)||F(this,a);this.b-=10},function(){this.ta&=-513;this.b-=4},function(){var a=N(this);Wc(this)||(Q(this,this.N),F(this,a),this.b-=6);this.b-=11},function(){Q(this,Lc(this)&255|this.j<<8);this.b-=11},function(){this.j=bd(this,M(this));this.b-=7},function(){Q(this,this.N);F(this,48);this.b-=11},function(){Wc(this)&&(F(this,P(this)), +this.b-=6);this.b-=5},function(){this.ja=K(this)&65535;this.b-=5},function(){var a=N(this);Wc(this)&&F(this,a);this.b-=10},function(){this.ta|=512;this.b-=4},function(){var a=N(this);Wc(this)&&(Q(this,this.N),F(this,a),this.b-=6);this.b-=11},Dd,function(){L(this,M(this));this.b-=7},function(){Q(this,this.N);F(this,56);this.b-=11}]; +function T(a){x.call(this,"ChipSet",a,T,32768);var b=a.model;b&&!Ed[b]&&Ka("Unrecognized ChipSet model: "+b);this.D=Ed[b]||{};a.sound&&(this.da=null,window&&(this.da=window.AudioContext||window.webkitAudioContext),this.da&&new this.da);D(this)}Za(T); +var U={ya:1978.1,bd:{za:0,Pd:1,Td:16,$d:32,ie:64,he:128,tb:14},Sa:{za:1,Hc:1,Xc:2,Tc:4,Uc:16,Vc:32,Wc:64,tb:8},cd:{za:2,Od:3,pe:4,Qd:8,de:16,ee:32,fe:64,Rd:128,tb:0},le:{za:3},je:{za:2,ae:7},ne:{za:3,qe:1,me:2,ge:4,Yd:8,Sd:16,Md:32},ke:{za:4},oe:{za:5,Ud:1,Vd:2,Wd:4,Xd:8,re:16}},V={ya:100,Pa:{za:66,se:1,Rc:2,Sc:4,ce:8,be:16,gc:32,fc:64,dc:128},Gc:{za:66,INIT:0},Ha:{Zd:{za:98},Ra:{Ec:0,Dc:1,Zc:2,dd:4,Kc:5,Yc:6,$c:7},Hb:16383},Jc:{za:162,INIT:0},Ic:{za:194,INIT:0}},Ed={SI1978:U,VT100:V}; +T.prototype.ka=function(){return!1};T.prototype.Na=function(a,b,c,d){this.A=b;this.b=c;this.I=d;this.u=a;this.M=qb(a,"Keyboard");Bb(b,this,this.D.Pb);Fb(b,this,this.D.Qb)};T.prototype.Aa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};T.prototype.Fa=function(a){return a?this.save():!0};U.INIT=[[U.bd.tb,U.Sa.tb,U.cd.tb,0,0,0,0]]; +V.INIT=[[V.Gc.INIT,V.Pa.Rc|V.Pa.Sc,V.Jc.INIT,V.Ic.INIT],[0,0,0,0,[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11776,11856,11824,11840,11808,11776,12E3,12E3,11857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]];m=T.prototype; +m.reset=function(){this.D.INIT&&!this.restore(this.D.INIT)&&this.ga("reset error")};m.save=function(){var a=new G(this);switch(this.D.ya){case U.ya:H(a,0,[this.va,this.F,this.wa,this.P,this.ba,this.ma,this.oa]);break;case V.ya:H(a,0,[this.ea,this.J,this.ha,this.fa]),H(a,1,[this.O,this.w,this.K,this.Z,this.H])}return a.data()}; +m.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.D.ya){case U.ya:return this.va=b[0],this.F=b[1],this.wa=b[2],this.P=b[3],this.ba=b[4],this.ma=b[5],this.oa=b[6],!0;case V.ya:return this.ea=b[0],this.J=b[1],this.ha=b[2],this.fa=b[3],b=a[1],this.O=b[0],this.w=b[1],this.K=b[2],this.Z=b[3],this.H=b[4],!0}return!1};m.start=function(){};m.stop=function(){};function Fd(a,b,c){a.F&=~b;c&&(a.F|=b)}m.ld=function(a,b){var c=this.va;C(this,a,null,b,"STATUS0",c,!0);return c}; +m.md=function(a,b){var c=this.F;C(this,a,null,b,"STATUS1",c,!0);return c};m.nd=function(a,b){var c=this.wa;C(this,a,null,b,"STATUS2",c,!0);return c};m.kd=function(a,b){var c=this.P>>8-this.ba&255;C(this,a,null,b,"SHIFT.RESULT",c,!0);return c};m.vd=function(a,b,c){C(this,a,b,c,"SHIFT.COUNT",null,!0);this.ba=b};m.xd=function(a,b,c){C(this,a,b,c,"SOUND1",null,!0);this.ma=b};m.wd=function(a,b,c){C(this,a,b,c,"SHIFT.DATA",null,!0);this.P=b<<8|this.P>>8}; +m.yd=function(a,b,c){C(this,a,b,c,"SOUND2",null,!0);this.oa=b};m.zd=function(a,b,c){C(this,a,b,c,"WATCHDOG",null,!0)};function Gd(a){var b=0,c=0,d=~a.O;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.od=function(a,b){var c=this.J,c=c&~V.Pa.fc;if((oc(this.b)&64)<<1&&(c|=V.Pa.fc,c!=this.J)){var d,e;d=this.K&1;e=this.K>>1&7;switch(e){case V.Ha.Ra.$c:break;case V.Ha.Ra.Dc:this.O=this.O<<1|d;break;case V.Ha.Ra.Kc:d=Gd(this);this.H[d]=V.Ha.Hb;fb(this,"doNVRCommand(): erase data at addr "+t(d));break;case V.Ha.Ra.Ec:this.w=this.w<<1|d;break;case V.Ha.Ra.dd:d=Gd(this);e=this.w&V.Ha.Hb;this.H[d]=e;fb(this,"doNVRCommand(): write data "+t(e)+" to addr "+t(d));break;case V.Ha.Ra.Yc:d=Gd(this);e=this.H[d]; +null==e&&(e=V.Ha.Hb);this.w=e;fb(this,"doNVRCommand(): read data "+t(e)+" from addr "+t(d));break;case V.Ha.Ra.Zc:this.w<<=1;this.Z=this.w&V.Ha.Hb+1;break;default:fb(this,"doNVRCommand(): unrecognized command 0x"+n(e,2))}}c&=~V.Pa.gc;this.Z&&(c|=V.Pa.gc);c&=~V.Pa.dc;this.M&&(c|=V.Pa.dc);this.J=c;C(this,a,null,b,"FLAGS.BUFFER",c);return c};m.Ad=function(a,b,c){C(this,a,b,c,"BRIGHTNESS");this.ea=b};m.Dd=function(a,b,c){C(this,a,b,c,"NVR.LATCH");this.K=b}; +m.Cd=function(a,b,c){C(this,a,b,c,"DC012");this.ha=b};m.Bd=function(a,b,c){C(this,a,b,c,"DC011");this.fa=b};U.Pb={0:T.prototype.ld,1:T.prototype.md,2:T.prototype.nd,3:T.prototype.kd};U.Qb={2:T.prototype.vd,3:T.prototype.xd,4:T.prototype.wd,5:T.prototype.yd,6:T.prototype.zd};V.Pb={66:T.prototype.od};V.Qb={66:T.prototype.Ad,98:T.prototype.Dd,162:T.prototype.Cd,194:T.prototype.Bd};Ia(function(){for(var a=B(document,"pc8080","chipset"),b=0;b>>0,h],q=ka(p,k,a.Ua);0>q&&p.splice(-(q+1),0,k)}l&&(g.a=l.replace(/''/g,'"'))}a.J.push({te:b,G:c,qd:d,Oa:e,ic:f})}delete this.Oa}return!0};Hd.prototype.Fa=function(){return!0}; +function Id(a,b,c,d){if(d)a.ga("Unable to load system ROM (error "+d+": "+b+")");else{ab(a.Tb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,h=e.data;if(f)a.u=f;else if(h)for(a.u=Array(4*h.length),d=c=0;c>8&255,a.u[d++]=h[c]>>16&255,a.u[d++]=h[c]>>24&255;else a.u=e;a.Oa=e.symbols;if(!a.u.length){u("Empty ROM: "+b);return}if(1==a.u.length){u(a.u[0]);return}}catch(g){a.ga("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm, +" ").replace(/ +$/,"").split(" "),a.u=Array(b.length),e=0;e>>f.na;0>>=f.na;0d?a.A.push({bc:b,Yb:Date.now(),Ib:!1}):(a.A[d].Yb=Date.now(),a.A[d].Ib=!1);else if(0<=d){if(!a.A[d].Ib){var e=a.A[d].Yb;if(e&&100>Date.now()-e)return a.A[d].Ib=!0,Vd(a),!0}a.A.splice(d,1)}if(a.D)switch(b){case "1p":Fd(a.D,U.Sa.Tc,c);break;case "2p":Fd(a.D,U.Sa.Xc,c);break;case "coin":Fd(a.D,U.Sa.Hc,c);break;case "left":Fd(a.D,U.Sa.Vc,c);break;case "right":Fd(a.D,U.Sa.Wc,c);break;case "fire":Fd(a.D,U.Sa.Uc,c)}return!0} +function Vd(a){for(var b=0,c=-1;bc||c>e)c=e}else{Td(a,d,!1);b=0;continue}}b++}0<=c&&setTimeout(function(){Vd(a)},c)}m.pd=function(a,b){var c=this.F;0<=this.w&&(this.w>3)*this.da;if(this.Id||ub(this.A,this.va,this.Ua,3))1>1)),this.O=document.createElement("canvas"),this.O.width=b,this.O.height=c,this.cb=this.O.getContext("2d"),this.ma={},this.Ca=1<=a.Fd?8:16,f=8>(7>4)*c)}return k} -Xd.prototype.Aa=function(){if(2==this.ea){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.wa,c=-1,d=-1,e,f=-(60==this.oc?2:5);f>8&15|16;Ab(this.B,b++,e);Ab(this.B,b++, -c&255);if(g)break}if(h)for(c=0,e=1;ec&&(a=Math.round(c/b*100)+"%")}this.kc?(this.P.style.width=a,this.P.style.width=a,this.P.style.display="block",this.P.style.margin="auto"):(this.A.style.width=a,this.A.style.height="auto");this.A.style.backgroundColor="black";this.A.fb();a=!0}this.Fa&&this.Fa.focus()}return a}; -function $d(a,b){!b&&a.A&&(a.kc?a.P.style.width=a.P.style.height="":a.A.style.width=a.A.style.height="");gb(a,"notifyFullScreen("+b+")",!0)}function be(a,b){a.mc=b;a.xa=!1;if(void 0===a.J||a.J.length!=a.mc)a.J=Array(a.mc)}function ee(a,b,c,d,e){d=a.D?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.ea&&(208<=c&&236>c?e=a.Ga+0:28<=c&&72>c&&(e=a.Ga+1));a=a.ra[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 fe(a){for(var b=a.wa,c=-1,d=0,e=60==a.oc?2:5,f=0,h=0;d>=1);;){var q=yb(a.B,k++);if(127==(q&127)){var r=yb(a.B,k++),c=r&96,b=(r&15)<<8|yb(a.B,k),b=b+(r&16?8192:16384);break}if(g>4)*q.ha,x=void 0,K=void 0,B=void 0, -S=void 0,Aa=q.pa,aa=q.ha;z?(x=p*r.pa,K=d*r.ha,B=r.pa,S=r.ha):(x=p*r.Hb,K=d*r.Ib,B=r.Hb,S=r.Ib);q.pa>r.pa&&(x*=2,B*=2);q.ha>r.ha&&(0==l&&(w+=r.ha),aa=r.ha);z?z.drawImage(q.canvas,J,w,Aa,aa,x,K,B,S):(x+=0,K+=0,r.F.drawImage(q.canvas,J,w,Aa,aa,x,K,B,S))}h++}f++}d++}}a.xa=!0;h&&a.cb&&a.F.drawImage(a.O,0,0,a.K,a.da-a.ha,0,0,a.fd,a.hd)} -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 Xd(d,e,h,f,c);eb(d,c)}}); -function ge(a){this.H=+a.adapter;switch(this.H){case 0:this.J=0;break;default:u("Unrecognized serial adapter #"+this.H);return}v.call(this,"SerialPort",a,ge,8388608);var b=a.binding;if("console"!=b){var c;a=he;b&&(void 0===c&&(c="Panel"),(c=db(c,this.id))&&(b=c.L[b])&&this.ja(null,a,b))}}$a(ge);var he="buffer";m=ge.prototype; -m.ja=function(a,b,c){switch(b){case he:return this.L[b]=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;(8===b||a.ctrlKey&&65<=b&&90>=b)&&a.preventDefault&&a.preventDefault();return!0},c.onkeypress=function(a){a=a||window.event;a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};m.Na=function(a,b,c,d){this.B=b;this.b=c;this.I=d;this.D=rb(a,"ChipSet");Cb(b,this,ie,this.J);Gb(b,this,je,this.J);D(this)}; -m.Aa=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};m.Da=function(a){return a?this.save():!0};m.reset=function(){ke(this)};m.save=function(){var a=new G(this),b=0,c=[];c[b++]=this.A;c[b++]=this.w;c[b++]=this.F;H(a,0,c);return a.data()};m.restore=function(a){return ke(this,a[0])};function ke(a,b){var c=0;void 0===b&&(b=[0,0,0]);a.A=b[c++];a.w=b[c++];a.F=b[c++];return!0}m.qd=function(a,b){var c=this.A;C(this,a,null,b,"DATA",c);return c}; -m.pd=function(a,b){var c=this.w;C(this,a,null,b,"COMMAND",c);return c};m.Bd=function(a,b,c){C(this,a,b,c,"DATA");this.A=b};m.Ad=function(a,b,c){C(this,a,b,c,"COMMAND");this.w=b};m.zd=function(a,b,c){C(this,a,b,c,"BAUDRATE");this.F=b};var ie={0:ge.prototype.qd,1:ge.prototype.pd},je={0:ge.prototype.Bd,1:ge.prototype.Ad,2:ge.prototype.zd};Ja(function(){for(var a=A(document,"pc8080","serial"),b=0;b>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.qc?(this.P.style.width=a,this.P.style.width=a,this.P.style.display="block",this.P.style.margin="auto"):(this.w.style.width=a,this.w.style.height="auto");this.w.style.backgroundColor="black";this.w.fb();a=!0}this.Ba&&this.Ba.focus()}return a}; +function Zd(a,b){!b&&a.w&&(a.qc?a.P.style.width=a.P.style.height="":a.w.style.width=a.w.style.height="");fb(a,"notifyFullScreen("+b+")",!0)}function ae(a,b){a.wc=b;a.wa=!1;if(void 0===a.J||a.J.length!=a.wc)a.J=Array(a.wc)}function de(a,b,c,d,e){d=a.D?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.ea&&(208<=c&&236>c?e=a.Ca+0:28<=c&&72>c&&(e=a.Ca+1));a=a.oa[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.va,c=-1,d=0,e=60==a.yc?2:5,f=0,h=0;d>=1);;){var q=xb(a.A,k++);if(127==(q&127)){var r=xb(a.A,k++),c=r&96,b=(r&15)<<8|xb(a.A,k),b=b+(r&16?8192:16384);break}if(g>4)*q.ia,w=void 0,J=void 0,A=void 0, +R=void 0,za=q.qa,Z=q.ia;y?(w=p*r.qa,J=d*r.ia,A=r.qa,R=r.ia):(w=p*r.Lb,J=d*r.Mb,A=r.Lb,R=r.Mb);q.qa>r.qa&&(w*=2,A*=2);q.ia>r.ia&&(0==l&&(v+=r.ia),Z=r.ia);y?y.drawImage(q.canvas,I,v,za,Z,w,J,A,R):(w+=0,J+=0,r.F.drawImage(q.canvas,I,v,za,Z,w,J,A,R))}h++}f++}d++}}a.wa=!0;h&&a.cb&&a.F.drawImage(a.O,0,0,a.K,a.da-a.ia,0,0,a.Gd,a.Hd)} +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<=qa().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){this.H=+a.adapter;switch(this.H){case 0:this.J=0;break;default:u("Unrecognized serial adapter #"+this.H);return}x.call(this,"SerialPort",a,fe,8388608);var b=a.binding;if("console"!=b){var c;a=ge;b&&(void 0===c&&(c="Panel"),(c=cb(c,this.id))&&(b=c.L[b])&&this.ka(null,a,b))}}Za(fe);var ge="buffer";m=fe.prototype; +m.ka=function(a,b,c){switch(b){case ge:return this.L[b]=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;(8===b||a.ctrlKey&&65<=b&&90>=b)&&a.preventDefault&&a.preventDefault();return!0},c.onkeypress=function(a){a=a||window.event;a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};m.Na=function(a,b,c,d){this.A=b;this.b=c;this.I=d;this.D=qb(a,"ChipSet");Bb(b,this,he,this.J);Fb(b,this,ie,this.J);D(this)}; +m.Aa=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};m.Fa=function(a){return a?this.save():!0};m.reset=function(){je(this)};m.save=function(){var a=new G(this),b=0,c=[];c[b++]=this.w;c[b++]=this.u;c[b++]=this.F;H(a,0,c);return a.data()};m.restore=function(a){return je(this,a[0])};function je(a,b){var c=0;void 0===b&&(b=[0,0,0]);a.w=b[c++];a.u=b[c++];a.F=b[c++];return!0}m.jd=function(a,b){var c=this.w;C(this,a,null,b,"DATA",c);return c}; +m.hd=function(a,b){var c=this.u;C(this,a,null,b,"COMMAND",c);return c};m.ud=function(a,b,c){C(this,a,b,c,"DATA");this.w=b};m.td=function(a,b,c){C(this,a,b,c,"COMMAND");this.u=b};m.sd=function(a,b,c){C(this,a,b,c,"BAUDRATE");this.F=b};var he={0:fe.prototype.jd,1:fe.prototype.hd},ie={0:fe.prototype.ud,1:fe.prototype.td,2:fe.prototype.sd};Ia(function(){for(var a=B(document,"pc8080","serial"),b=0;b>>d.B.ma;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.ma;f!=e.B?e.W[h].cc(f,b&65535,d):(e.W[h++].Gb(f,b&255,d),e.W[h&e.K].Gb(0,b>>8&255,d+1));c&&ze(a,c);mc(this.b,!0)}};function Y(a){return{G:a,Ma:!1}}function Ae(a){return[a.G,a.Ma]}function Be(a){return{G:a[0],Ma:a[1]}} -function ye(a,b,c){var d;c=(c?a.P:a.bb).G;if(void 0!==b){d=b=Ce(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=oa(te,a.substr(b,1))));return c}function Ie(a,b){var c=0,d=Je(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 Je(a,b){var c;if(0<=b){var d=a.b;switch(b){case 7:c=d.j;break;case 0:c=d.R;break;case 1:c=d.S;break;case 8:c=Nc(d);break;case 2:c=d.T;break;case 3:c=d.U;break;case 9:c=Pc(d);break;case 4:c=d.V;break;case 5:c=d.X;break;case 10:c=I(d);break;case 6:c=d.Y(I(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} -function Ke(a,b){b=Ce(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=He(b,c+1),0<=e&&(b=b.substr(0,c)+Ie(a,e)+b.substr(c+1+te[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=ca(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=ye(a,e))?(d=e+' "'+Ge(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=ye(a,e))?(ze(d),d=e+' "'+ -Ge(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}m.message=function(a,b){b&&(a+=" at "+Z(Y(this.b.N).G));if(this.oa&1073741824)this.Fa.push(a);else if(!this.xa||a!=this.xa)if(this.xa=a,this.oa&-2147483648&&(this.ka(),a+=" (cpu halted)"),this.g(a),this.b){var c=this.b;c.i.ob=0;c.F-=c.b;c.b=0;mc(c)}}; -function fb(a,b,c,d,e,f,h,g){g|=256;null!=f&&(a.oa&g)!=g||a.message(b.ab+"."+(null!=d?"outPort":"inPort")+"("+t(c)+","+(f?f:"unknown")+(null!=d?",0x"+n(d,2):"")+")"+(null!=h?": 0x"+n(h,2):"")+(null!=e?" at "+Z(e):""))} -function oe(a){var b;if(gd(a)){if(!a.O||!a.O.length){a.O=Array(1E3);for(b=0;b>>d.ma],!1)}a.Z=["br"];if(void 0!==a.H)for(b=1;b>>d.ma],!0);a.H=["bw"];a.cb=0}m.Va=function(a,b,c){var d=!0;c||nf(this,a,b,!1,!0);if(a!=this.A){var e=xe(b);if(-1===e)this.g("invalid address: "+Z(b.G)),d=!1;else{var f=this.B;f.W[e>>>f.ma].Va(e&f.B,a==this.H)}}d&&(a.push(b),c?b.Ma=!0:(of(this,a,a.length-1,"set"),oe(this)));return d}; -function nf(a,b,c,d,e){var f=!1;c=xe(c);for(var h=1;h>>d.ma],b==a.H));g.Ma||oe(a);break}}return f}function pf(a,b){for(var c=1;c>24,4);break;case 3:x=n(z.Qa(J,2),4);break;default:z="imm("+t(w)+")";break a}8086==z.style&&w&64?x="["+x+"]":w&16||(x=(z.style==me?"$":"0x")+x);z=x}else w& -16?(z=(q&3840)>>8,w=te[z],8086==a.style&&q&64&&(6==z&&(w="HL"),w="["+w+"]"),z=w):w&128&&(z=(f>>3&7).toString());if(!z||!z.length){g="INVALID";break}0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function wf(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; +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]],ue={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=ke.prototype; +m.Na=function(a,b,c,d){this.A=b;this.b=c;this.u=a;(a=hc(a,"messages"))&&oe(this,a);this.Ta=te;ve(this,function(a){a:{var b=d.A.W,c=a[0],g=a=0,k=b.length;if(c){a=we(xe(d,c));if(-1===a){d.g("invalid address: "+c);break a}g=a>>>d.A.na;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.na;f!=e.A?e.W[h].cc(f,b&65535,d):(e.W[h++].Gb(f,b&255,d),e.W[h&e.K].Gb(0,b>>8&255,d+1));c&&ye(a,c);lc(this.b,!0)}};function X(a){return{G:a,Ma:!1}}function ze(a){return[a.G,a.Ma]}function Ae(a){return{G:a[0],Ma:a[1]}} +function xe(a,b,c){var d;c=(c?a.P:a.bb).G;if(void 0!==b){d=b=Be(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=na(se,a.substr(b,1))));return c}function He(a,b){var c=0,d=Ie(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 Ie(a,b){var c;if(0<=b){var d=a.b;switch(b){case 7:c=d.j;break;case 0:c=d.R;break;case 1:c=d.S;break;case 8:c=Mc(d);break;case 2:c=d.T;break;case 3:c=d.U;break;case 9:c=Oc(d);break;case 4:c=d.V;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.ja;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 Je(a,b){b=Be(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=Ge(b,c+1),0<=e&&(b=b.substr(0,c)+He(a,e)+b.substr(c+1+se[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=ba(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=xe(a,e))?(d=e+' "'+Fe(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=xe(a,e))?(ye(d),d=e+' "'+ +Fe(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).G));if(this.pa&1073741824)this.Ba.push(a);else if(!this.wa||a!=this.wa)if(this.wa=a,this.pa&-2147483648&&(this.la(),a+=" (cpu halted)"),this.g(a),this.b){var c=this.b;c.i.ob=0;c.F-=c.b;c.b=0;lc(c)}}; +function eb(a,b,c,d,e,f,h,g){g|=256;null!=f&&(a.pa&g)!=g||a.message(b.ab+"."+(null!=d?"outPort":"inPort")+"("+t(c)+","+(f?f:"unknown")+(null!=d?",0x"+n(d,2):"")+")"+(null!=h?": 0x"+n(h,2):"")+(null!=e?" at "+Y(e):""))} +function ne(a){var b;if(fd(a)){if(!a.O||!a.O.length){a.O=Array(1E3);for(b=0;b>>d.na],!1)}a.Z=["br"];if(void 0!==a.H)for(b=1;b>>d.na],!0);a.H=["bw"];a.cb=0}m.Va=function(a,b,c){var d=!0;c||mf(this,a,b,!1,!0);if(a!=this.w){var e=we(b);if(-1===e)this.g("invalid address: "+Y(b.G)),d=!1;else{var f=this.A;f.W[e>>>f.na].Va(e&f.A,a==this.H)}}d&&(a.push(b),c?b.Ma=!0:(nf(this,a,a.length-1,"set"),ne(this)));return d}; +function mf(a,b,c,d,e){var f=!1;c=we(c);for(var h=1;h>>d.na],b==a.H));g.Ma||ne(a);break}}return f}function of(a,b){for(var c=1;c>24,4);break;case 3:w=n(y.Qa(I,2),4);break;default:y="imm("+t(v)+")";break a}8086==y.style&&v&64?w="["+w+"]":v&16||(w=(y.style==le?"$":"0x")+w);y=w}else v& +16?(y=(q&3840)>>8,v=se[y],8086==a.style&&q&64&&(6==y&&(v="HL"),v="["+v+"]"),y=v):v&128&&(y=(f>>3&7).toString());if(!y||!y.length){g="INVALID";break}0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; +function vf(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 De(a,b,c){var d;if(b){b=Ce(a,b);for(var e=0,f=!1,h=b,g=[],k=[],l=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;h=p+"b"+h;d>>=8}d="0x"+n(c)+" "+c+". ("+h+")"}a.g((null!=b?b+": ":"")+d);return e}function zf(a,b){if(b)return yf(a,b,a.la[b]);var c=0;for(b in a.la)yf(a,b,a.la[b]),c++;return 0b[0]?1:a[0]>>0;for(b=0;b>>0,g=f.xd;if(e>=h&&e=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;h=p+"b"+h;d>>=8}d="0x"+n(c)+" "+c+". ("+h+")"}a.g((null!=b?b+": ":"")+d);return e}function yf(a,b){if(b)return xf(a,b,a.ha[b]);var c=0;for(b in a.ha)xf(a,b,a.ha[b]),c++;return 0b[0]?1:a[0]>>0;for(b=0;b>>0,g=f.qd;if(e>=h&&e>8&255;case "C":d.S=g&255;break;case "D":d.T= -g&255;break;case "DE":d.T=g>>8&255;case "E":d.U=g&255;break;case "H":d.V=g&255;break;case "HL":d.V=g>>8&255;case "L":d.X=g&255;break;case "SP":d.ia=g&65535;break;case "PC":F(d,g);a.P=Y(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(uf(a));c&&(a.P=Y(d.N),Ne(a,Z(a.P.G)))}}function Gf(a,b){b=ka(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(Ke(a,c[2])):De(a,b,!0)}function Hf(a,b,c){var d="t"!=b;c=xf(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 Ne(a,b,c,d){if(b=ye(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=ye(a,c,!0);if(!d||d.Gg[0].indexOf("+"))){var l=g[0]+":";g[2]&&(l+=" "+g[2]);a.g(l)}g[3]&&(h=g[3],f=null);f=rf(a,b,h,f);a.g(f);a.P=b;e-=b.G-k;c++}}} -function Fe(a,b,c,d){if(c)if(b){0>a.F&&a.D.length&&(a.F=0);if(0>a.F||b!=a.D[a.F])a.D.splice(0,0,b),a.F=0;a.F--}else a.fa?b="end":b=a.D[a.F+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(ka(b.substring(c,f))),c=f+1}}return a} -function qf(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.G)),a.P=a.ea,a.fa=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.xa=null;if(kb(a)&&0l||"z"Da.length&&(a.g("note: only "+Da.length+" available"),ga=Da.length);ba-=ga;0>ba&&(null==Da[Da.length-1].G?(ga=ba+ga,ba=0):ba+=Da.length); -var jd=[];"call"==Ue&&(ob=1E5,jd=["CALL"]);for(void 0!==Te&&a.g(ga+" instructions earlier:");0=Da.length&&(ba=0);a.eb=ga;We++;ob--}}We||(a.g("no "+Ve+"history available"),a.eb=void 0)}else{var qc=ye(a,aa);if(qc){var rc=0;Wa&&("l"==Wa.charAt(0)&&(Wa=Wa.substr(1)||bg),rc=xf(a,Wa)>>>0,65536>4||1;dg--&&0vc?String.fromCharCode(vc):".";tc--}Xa&&(Xa+="\n");Xa+=aa+" "+Ob+(0==Nb?" "+ld:"")}Xa&&a.g(Xa);a.bb=qc}}}}break;case "e":if("else"==f[0])break;var wc=1,Ze=255,$e=a.Y,af=a.qa;"ew"==f[0]&&(wc=2,Ze=65535,$e=a.Qa,af=a.Rb);var bf=wc<<1,cf=f[1];if(null== -cf)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 xc=ye(a,cf);if(xc)for(var yc=2;ycsd;){for(var Ya=null,jg=256;65536>Rb.G>>>0;){ef.G=a.Qa(Rb,2);if(null==Rb.G||!jg--)break;for(var kg=a,Ac=ef,ff=null,Sb=Ac.G,gf=Sb,td=1;6>=td&&Sb;td++){if(2\nLicense: GPL version 3 or later ");for(b=0;bRf){if(Nf(d,this.P)){this.H=new G(this,"1.23.3","failsafe");Nf(this.H)&&(Wf(this,d),a=2,Kf(this.H));H(this.H,"timestamp",na());Lf(this.H);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=Mf(d)){var f=Of(d,"code"),h=Of(d,"data");f&&("ok"==f?Nf(d,h):("error"==f&& -"no machine state"!=h?(this.ga("Error: "+h),"unable to verify user"==h&&(wa("user",""),this.A=null)):this.g(f+": "+h),Kf(d),Nf(d)?(c=Mf(d),e=!0):c=!1))}e&&Vf(this,c?d:null)}else 2==a&&d.clear()}else Vf(this);delete this.P;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.L.power;d&&(d.textContent="Shutdown");this.b&&(Xf(this,this.b,b,c,a),nc(this.b));this.ea&&(Wf(this,b),b.clear());!c&&this.H&&(this.H.clear(),delete this.H);this.D=0}; -function Wf(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.A||"",d=b.toString(),e={app:"PC8080",ver:"1.23.3"};e.url=a.na;e.user=c;e.type="bug";e.data=d;pa("http://www.pcjs.org/api/v1/report",e,!0)}} -function If(a,b,c){var d,e="none";if(a.D)return null;a.D--;var f=new G(a,"1.23.3"),h=new G(a,"1.23.3","validate"),g=na();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",ra());a.b&&a.b.Da&&(c&&a.b.ka(),d=a.b.Da(b,c),"object"===typeof d&&H(f,a.b.id,d),c&&(a.b.C.sa=!1,!1===d&&(e=null)));for(var g=cb(a.id),k=0;k>>f.ma;0>8|(x&255)<<8);p>K&J;ee(d,d.lc,p++,q,S);K+=w}p>r&&(r=p);q=h&&(h=q+1)}g+=2;l++;if(p>=d.K&&(p=0,q++,q>d.da))break}d.xa=!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+"...");pa(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);qg(a,b,c)}})}else c(a,null)} -function rg(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=ia(a))}function f(a){e("Error: "+a);k&&(--$f||Ma(!0));k=!1}var h,g,k=!0;$f++;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?ag(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,--$f||Ma(!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),--$f||Ma(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?ag(b,a,d,!0,e,l):pg(b,null,a,d,!1,e,l)}else f("missing machine element: "+a)}catch(r){f(r.message)}return k}window.embedPC8080=function(a,b,c,d){Ma(!1);return rg(a,b,c,d)};window.enableEvents=Ma;window.sendEvent=Na; -function sg(a,b,c,d){if(!c&&b){d.push(b);a=ab[d[0]];b=null;for(var e in a)if(fa(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?pa(b,null,!0,function(a,b){tg(b,d)}):tg(null,d)}else u("Error ("+c+") requesting "+a)} -function tg(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=ea(l);if("xml"==q){for(q=/[ \t]*]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=q.exec(g[l]);){var r=d[2];r&&(g[r]||(p=p.replace(d[0],"")))}d=l=da(l)}else"xsl"==q&&(e=l=da(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 Le(a,b){var c;if(b&&"?"==b[1])a.g("register commands:"),a.g("\tr\tdump registers"),a.g("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(null!=b&&1>8&255;case "C":d.S=g&255;break;case "D":d.T= +g&255;break;case "DE":d.T=g>>8&255;case "E":d.U=g&255;break;case "H":d.V=g&255;break;case "HL":d.V=g>>8&255;case "L":d.X=g&255;break;case "SP":d.ja=g&65535;break;case "PC":F(d,g);a.P=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?Tc(d)||(d.ca^=1):Tc(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?Wc(d)||(d.ca^=192):Wc(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(tf(a));c&&(a.P=X(d.N),Me(a,Y(a.P.G)))}}function Ff(a,b){b=ja(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(Je(a,c[2])):Ce(a,b,!0)}function Gf(a,b,c){var d="t"!=b;c=wf(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 Me(a,b,c,d){if(b=xe(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=xe(a,c,!0);if(!d||d.Gg[0].indexOf("+"))){var l=g[0]+":";g[2]&&(l+=" "+g[2]);a.g(l)}g[3]&&(h=g[3],f=null);f=qf(a,b,h,f);a.g(f);a.P=b;e-=b.G-k;c++}}} +function Ee(a,b,c,d){if(c)if(b){0>a.F&&a.D.length&&(a.F=0);if(0>a.F||b!=a.D[a.F])a.D.splice(0,0,b),a.F=0;a.F--}else a.fa?b="end":b=a.D[a.F+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 pf(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.G)),a.P=a.ea,a.fa=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.wa=null;if(jb(a)&&0l||"z"Ca.length&&(a.g("note: only "+Ca.length+" available"),fa=Ca.length);aa-=fa;0>aa&&(null==Ca[Ca.length-1].G?(fa=aa+fa,aa=0):aa+=Ca.length);var id=[];"call"== +Te&&(nb=1E5,id=["CALL"]);for(void 0!==Se&&a.g(fa+" instructions earlier:");0=Ca.length&&(aa=0);a.eb=fa;Ve++;nb--}}Ve||(a.g("no "+Ue+"history available"),a.eb=void 0)}else{var pc=xe(a,Z);if(pc){var qc=0;Va&&("l"==Va.charAt(0)&&(Va=Va.substr(1)||ag),qc=wf(a,Va)>>>0,65536>4||1;cg--&&0uc?String.fromCharCode(uc):".";sc--}Wa&&(Wa+="\n");Wa+=Z+" "+Nb+(0==Mb?" "+kd:"")}Wa&&a.g(Wa);a.bb=pc}}}}break;case "e":if("else"==f[0])break;var vc=1,Ye=255,Ze=a.Y,$e=a.ra;"ew"==f[0]&&(vc=2,Ye=65535,Ze=a.Qa,$e=a.Rb);var af=vc<<1,bf=f[1];if(null==bf)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 wc=xe(a,bf);if(wc)for(var xc=2;xcrd;){for(var Xa=null,ig=256;65536>Qb.G>>>0;){df.G= +a.Qa(Qb,2);if(null==Qb.G||!ig--)break;for(var jg=a,zc=df,ef=null,Rb=zc.G,ff=Rb,sd=1;6>=sd&&Rb;sd++){if(2\nLicense: GPL version 3 or later ");for(b=0;bQf){if(Mf(d,this.P)){this.H=new G(this,"1.23.3","failsafe");Mf(this.H)&&(Vf(this,d),a=2,Jf(this.H));H(this.H,"timestamp",ma());Kf(this.H);var e=this.u&&!this.K;if(1==a||ra("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=Lf(d)){var f=Nf(d,"code"),h=Nf(d,"data");f&&("ok"==f?Mf(d,h):("error"==f&& +"no machine state"!=h?(this.ga("Error: "+h),"unable to verify user"==h&&(va("user",""),this.w=null)):this.g(f+": "+h),Jf(d),Mf(d)?(c=Lf(d),e=!0):c=!1))}e&&Uf(this,c?d:null)}else 2==a&&d.clear()}else Uf(this);delete this.P;delete this.Z}e=bb(this.id);for(f=0;fa[1];a=a[2];this.oa=!0;this.C.sa=!0;var d=this.L.power;d&&(d.textContent="Shutdown");this.b&&(Wf(this,this.b,b,c,a),mc(this.b));this.ea&&(Vf(this,b),b.clear());!c&&this.H&&(this.H.clear(),delete this.H);this.D=0}; +function Vf(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.w||"",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 Hf(a,b,c){var d,e="none";if(a.D)return null;a.D--;var f=new G(a,"1.23.3"),h=new G(a,"1.23.3","validate"),g=ma();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",qa());a.b&&a.b.Fa&&(c&&a.b.la(),d=a.b.Fa(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.na;0>8|(w&255)<<8);p>J&I;de(d,d.rc,p++,q,R);J+=v}p>r&&(r=p);q=h&&(h=q+1)}g+=2;l++;if(p>=d.K&&(p=0,q++,q>d.da))break}d.wa=!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]*/, +"");a=a.replace(d[0],h);pg(a,b,c)}})}else c(a,null)} +function qg(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=ha(a))}function f(a){e("Error: "+a);k&&(--Zf||La(!0));k=!1}var h,g,k=!0;Zf++;$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?$f(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,--Zf||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),--Zf||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)?$f(b,a,d,!0,e,l):og(b,null,a,d,!1,e,l)}else f("missing machine element: "+a)}catch(r){f(r.message)}return k}window.embedPC8080=function(a,b,c,d){La(!1);return qg(a,b,c,d)};window.enableEvents=La;window.sendEvent=Ma; +function rg(a,b,c,d){if(!c&&b){d.push(b);a=$a[d[0]];b=null;for(var e in a)if(ea(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?oa(b,null,!0,function(a,b){sg(b,d)}):sg(null,d)}else u("Error ("+c+") requesting "+a)} +function sg(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=da(l);if("xml"==q){for(q=/[ \t]*]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=q.exec(g[l]);){var r=d[2];r&&(g[r]||(p=p.replace(d[0],"")))}d=l=ca(l)}else"xsl"==q&&(e=l=ca(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+='