From 422c89f93f3ad9b8f3bfcebb9694969dcf69489d Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Tue, 9 Aug 2016 16:56:03 -0700 Subject: [PATCH] Updated VT100 keymap --- devices/pc8080/rom/vt100/VT100.asm | 2 +- modules/pc8080/lib/chipset.js | 9 + modules/pc8080/lib/cpustate.js | 33 +- modules/pc8080/lib/keyboard.js | 91 ++++-- versions/pc8080/1.23.3/pc8080-dbg.js | 466 +++++++++++++-------------- versions/pc8080/1.23.3/pc8080.js | 245 +++++++------- 6 files changed, 457 insertions(+), 389 deletions(-) diff --git a/devices/pc8080/rom/vt100/VT100.asm b/devices/pc8080/rom/vt100/VT100.asm index 9044a6870..5ef6426ed 100644 --- a/devices/pc8080/rom/vt100/VT100.asm +++ b/devices/pc8080/rom/vt100/VT100.asm @@ -4818,7 +4818,7 @@ X2065 equ 2065h X2067 equ 2067h X2068 equ 2068h ; Keys flag buffer X2069 equ 2069h -X206a equ 206ah +X206a equ 206ah ; Start of the "three place New Key Address Buffer" X206e equ 206eh X2072 equ 2072h X2073 equ 2073h diff --git a/modules/pc8080/lib/chipset.js b/modules/pc8080/lib/chipset.js index 1c1d9bec3..87a93ad0c 100644 --- a/modules/pc8080/lib/chipset.js +++ b/modules/pc8080/lib/chipset.js @@ -386,6 +386,7 @@ ChipSet.prototype.initBus = function(cmp, bus, cpu, dbg) this.cpu = cpu; this.dbg = dbg; this.cmp = cmp; + this.kbd = cmp.getMachineComponent("Keyboard"); bus.addPortInputTable(this, this.config.portsInput); bus.addPortOutputTable(this, this.config.portsOutput); }; @@ -852,6 +853,10 @@ ChipSet.prototype.inVT100FlagsBuffer = function(port, addrFrom) if (this.bNVROut) { b |= ChipSet.VT100.FLAGS_BUFFER.NVR_DATA; } + b &= ~ChipSet.VT100.FLAGS_BUFFER.KBD_XMIT; + if (this.kbd && !this.kbd.checkBusy()) { + b |= ChipSet.VT100.FLAGS_BUFFER.KBD_XMIT; + } this.bFlagsBuffer = b; this.printMessageIO(port, null, addrFrom, "FLAGS.BUFFER", b); return b; @@ -888,6 +893,10 @@ ChipSet.prototype.outVT100NVRLatch = function(port, b, addrFrom) /** * outVT100DC012(port, b, addrFrom) * + * TODO: Consider whether we should disable any interrupts (eg, vertical retrace) until the + * this port is initialized at runtime. We initialize it ourselves at start-up, but our initial + * value is just a guess. + * * @this {ChipSet} * @param {number} port (0xA2) * @param {number} b diff --git a/modules/pc8080/lib/cpustate.js b/modules/pc8080/lib/cpustate.js index 424221eb2..8803b193d 100644 --- a/modules/pc8080/lib/cpustate.js +++ b/modules/pc8080/lib/cpustate.js @@ -939,6 +939,7 @@ CPUState.prototype.checkINTR = function() { if ((this.intFlags & CPUDef.INTFLAG.INTR) && this.getIF()) { var bRST = CPUDef.OPCODE.RST0 | ((this.intFlags & CPUDef.INTFLAG.INTL) << 3); + this.intFlags &= ~CPUDef.INTFLAG.HALT; this.clearINTR(); this.clearIF(); this.aOps[bRST].call(this); @@ -1096,16 +1097,30 @@ CPUState.prototype.stepCPU = function(nMinCycles) do { if (this.intFlags) { - if (this.checkINTR()) { - if (!nMinCycles) { - this.assert(DEBUGGER); // nMinCycles of zero should be generated ONLY by the Debugger - if (DEBUGGER) { - this.println("interrupt dispatched"); - break; - } - } + /* + * We no longer call checkINTR() if the Debugger is single-stepping; you'll have to let the + * CPU run with a "g" (or a "p" on a call instruction) if you want interrupts to be processed. + */ + if (nMinCycles) { + /* + * NOTE: If checkINTR() returns true, it also clears INTFLAG.HALT, so we don't have to worry + * about the INTFLAG.HALT code below triggering. + */ + this.checkINTR(); + /* + * If the Debugger is running, consider some new notification mechanism(s) regarding interrupt + * dispatches; the following code no longer applies, due to changes above. + * + * if (!nMinCycles && this.checkINTR()) { + * this.assert(DEBUGGER); // nMinCycles of zero should be generated ONLY by the Debugger + * if (DEBUGGER) { + * this.println("interrupt dispatched"); + * break; + * } + * } + */ } - else if (this.intFlags & CPUDef.INTFLAG.HALT) { + if (this.intFlags & CPUDef.INTFLAG.HALT) { /* * As discussed in opHLT(), the CPU is never REALLY halted by a HLT instruction; instead, * opHLT() sets CPUDef.INTFLAG.HALT, signalling to us that we're free to end the current burst diff --git a/modules/pc8080/lib/keyboard.js b/modules/pc8080/lib/keyboard.js index 903fc97bb..1c2cde37f 100644 --- a/modules/pc8080/lib/keyboard.js +++ b/modules/pc8080/lib/keyboard.js @@ -286,7 +286,7 @@ Keyboard.VT100 = { * * Every time a keyboard scan is initiated (by setting the START bit of the status byte), * an internal address index is reset to zero, and an interrupt is generated for each entry - * in the aKeysPressed array, along with a final interrupt for KEYLAST. + * in the aKeysActive array, along with a final interrupt for KEYLAST. */ ADDRESS: { PORT: 0x82 @@ -329,32 +329,48 @@ 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.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.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.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.TAB] = 0x3A; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_7] = 0x40; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F4] = 0x41; // aka PF4 @@ -362,6 +378,7 @@ Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F2] = 0x42; // aka PF2 Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_0] = 0x43; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.LF] = 0x44; Keyboard.VT100.KEYMAP[Keyboard.ASCII['\\']] = 0x45; +Keyboard.VT100.KEYMAP[Keyboard.ASCII['|']] = 0xC5; Keyboard.VT100.KEYMAP[Keyboard.ASCII.L] = 0x46; Keyboard.VT100.KEYMAP[Keyboard.ASCII.K] = 0x47; Keyboard.VT100.KEYMAP[Keyboard.ASCII.G] = 0x48; @@ -372,33 +389,38 @@ 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.ASCII.J] = 0x57; Keyboard.VT100.KEYMAP[Keyboard.ASCII.H] = 0x58; Keyboard.VT100.KEYMAP[Keyboard.ASCII.D] = 0x59; Keyboard.VT100.KEYMAP[Keyboard.ASCII.S] = 0x5A; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_DEL] = 0x60; // keypad period -Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F8] = 0x61; // aka keypad comma +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F7] = 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.ASCII.N] = 0x67; Keyboard.VT100.KEYMAP[Keyboard.ASCII.B] = 0x68; Keyboard.VT100.KEYMAP[Keyboard.ASCII.X] = 0x69; -Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F9] = 0x6A; // aka NO SCROLL +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F8] = 0x6A; // aka NO SCROLL 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; Keyboard.VT100.KEYMAP[Keyboard.ASCII['/']] = 0x75; +Keyboard.VT100.KEYMAP[Keyboard.ASCII['?']] = 0xF5; Keyboard.VT100.KEYMAP[Keyboard.ASCII.M] = 0x76; Keyboard.VT100.KEYMAP[Keyboard.ASCII[' ']] = 0x77; Keyboard.VT100.KEYMAP[Keyboard.ASCII.V] = 0x78; Keyboard.VT100.KEYMAP[Keyboard.ASCII.C] = 0x79; Keyboard.VT100.KEYMAP[Keyboard.ASCII.Z] = 0x7A; -Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F10] = 0x7B; // aka SET-UP +Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F9] = 0x7B; // aka SET-UP Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.CTRL] = 0x7C; Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.SHIFT] = 0x7D; // either shift key (doesn't matter) Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.CAPSLOCK]= 0x7E; @@ -561,7 +583,7 @@ Keyboard.prototype.powerDown = function(fSave, fShutdown) Keyboard.VT100.INIT = [ [ Keyboard.VT100.STATUS.INIT, - 0 // iKeyNext + -1 // iKeyNext ] ]; @@ -574,7 +596,7 @@ Keyboard.prototype.reset = function() { /* * As keyDown events are encountered, a corresponding "softCode" is looked up. If one is found, - * then an entry for the key is added to the aKeysPressed array. Each entry contains: + * then an entry for the key is added to the aKeysActive array. Each "key" entry contains: * * softCode: number or string representing the key pressed * msDown: timestamp of the most recent "down" event @@ -582,7 +604,7 @@ Keyboard.prototype.reset = function() * * When the key is finally released (or auto-released), its entry is removed from the array. */ - this.aKeysPressed = []; + this.aKeysActive = []; if (this.config.INIT && !this.restore(this.config.INIT)) { this.notice("reset error"); @@ -728,13 +750,13 @@ Keyboard.prototype.onKeyDown = function(event, fDown) * * @this {Keyboard} * @param {number|string} softCode - * @return {number} index of softCode in aKeysPressed, or -1 if not found + * @return {number} index of softCode in aKeysActive, or -1 if not found */ Keyboard.prototype.indexOfSoftKey = function(softCode) { var i; - for (i = 0; i < this.aKeysPressed.length; i++) { - if (this.aKeysPressed[i].softCode == softCode) return i; + for (i = 0; i < this.aKeysActive.length; i++) { + if (this.aKeysActive[i].softCode == softCode) return i; } return -1; }; @@ -753,30 +775,30 @@ Keyboard.prototype.onSoftKeyDown = function(softCode, fDown) if (fDown) { // this.println(softCode + " down"); if (i < 0) { - this.aKeysPressed.push({ + this.aKeysActive.push({ softCode: softCode, msDown: Date.now(), fAutoRelease: false }); } else { - this.aKeysPressed[i].msDown = Date.now(); - this.aKeysPressed[i].fAutoRelease = false; + this.aKeysActive[i].msDown = Date.now(); + this.aKeysActive[i].fAutoRelease = false; } } else if (i >= 0) { // this.println(softCode + " up"); - if (!this.aKeysPressed[i].fAutoRelease) { - var msDown = this.aKeysPressed[i].msDown; + if (!this.aKeysActive[i].fAutoRelease) { + var msDown = this.aKeysActive[i].msDown; if (msDown) { var msElapsed = Date.now() - msDown; if (msElapsed < Keyboard.MINPRESSTIME) { // this.println(softCode + " released after only " + msElapsed + "ms"); - this.aKeysPressed[i].fAutoRelease = true; + this.aKeysActive[i].fAutoRelease = true; this.checkSoftKeysToRelease(); return true; } } } - this.aKeysPressed.splice(i, 1); + this.aKeysActive.splice(i, 1); } else { // this.println(softCode + " up with no down?"); } @@ -820,10 +842,10 @@ Keyboard.prototype.checkSoftKeysToRelease = function() { var i = 0; var msDelayMin = -1; - while (i < this.aKeysPressed.length) { - if (this.aKeysPressed[i].fAutoRelease) { - var softCode = this.aKeysPressed[i].softCode; - var msDown = this.aKeysPressed[i].msDown; + while (i < this.aKeysActive.length) { + if (this.aKeysActive[i].fAutoRelease) { + var softCode = this.aKeysActive[i].softCode; + var msDown = this.aKeysActive[i].msDown; var msElapsed = Date.now() - msDown; var msDelay = Keyboard.MINPRESSTIME - msElapsed; if (msDelay > 0) { @@ -849,6 +871,20 @@ Keyboard.prototype.checkSoftKeysToRelease = function() } }; +/** + * checkBusy() + * + * Called whenever a ChipSet circuit needs the keyboard's UART status. + * Currently, we have no busy conditions (our virtual keyboard is infinitely fast). + * + * @this {Keyboard} + * @return {boolean} + */ +Keyboard.prototype.checkBusy = function() +{ + return false; +}; + /** * inVT100UARTAddress(port, addrFrom) * @@ -860,9 +896,16 @@ Keyboard.prototype.checkSoftKeysToRelease = function() Keyboard.prototype.inVT100UARTAddress = function(port, addrFrom) { var b = 0; - if (this.iKeyNext >= 0 && this.iKeyNext < this.aKeysPressed.length - 1) { - var softCode = this.aKeysPressed[this.iKeyNext++]; - b = Keyboard.VT100.KEYMAP[softCode]; + if (this.iKeyNext >= 0 && this.iKeyNext < this.aKeysActive.length) { + var key = this.aKeysActive[this.iKeyNext++]; + b = Keyboard.VT100.KEYMAP[key.softCode]; + if (b & 0x80) { + /* + * TODO: This code is supposed to be accompanied by a SHIFT key; make sure that it is. + */ + b &= 0x7F; + } + this.println("keymap: " + str.toHexByte(b)); } if (!b) b = Keyboard.VT100.KEYLAST; this.printMessageIO(port, null, addrFrom, "KBDUART.ADDRESS", b); diff --git a/versions/pc8080/1.23.3/pc8080-dbg.js b/versions/pc8080/1.23.3/pc8080-dbg.js index d3442ff38..d2c058cba 100644 --- a/versions/pc8080/1.23.3/pc8080-dbg.js +++ b/versions/pc8080/1.23.3/pc8080-dbg.js @@ -1,242 +1,242 @@ (function(){var m;function ba(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 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.Ca=1<>2;this.w=this.Ca-1;this.M=this.O/this.Ca|0;this.K=this.M-1;this.u=[];this.A=[];this.F=this.I=!1;this.Z=[];this.ba=[];a=new F;ub(a,this.H);this.V=Array(this.M);for(b=0;b>>a.la;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 F(e,l,a.Ca,d);ub(e,a.H,g);a.V[h++]=e;e=k+a.Ca;f-=l}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+xb[d]+" at "+r(b)),!0):wb(2,b,c)}m.X=function(a){return this.V[(a&this.B)>>>this.la].qb(a&this.w,a)}; -function yb(a,b){return a.V[(b&a.B)>>>a.la].Db(b&a.w,b)}m.Pa=function(a){var b=a&this.w,c=(a&this.B)>>>this.la;return b!=this.w?this.V[c].yc(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.w,d=(b&a.B)>>>a.la;return c!=a.w?a.V[d].ac(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.B)>>>this.la].sb(a&this.w,b&255,a)};function Ab(a,b,c){a.V[(b&a.B)>>>a.la].Gb(b&a.w,c&255,b)} -m.Rb=function(a,b){var c=a&this.w,d=(a&this.B)>>>this.la;c!=this.w?this.V[d].Bc(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.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 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.u[k]?t("Input port "+r(k)+" already registered"):f.u[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 Kb=new ArrayBuffer(2);(new DataView(Kb)).setUint16(0,256,!0);Jb=256===(new Uint16Array(Kb))[0]}else Jb=!1;var Lb=Jb; -function F(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.qc=!1;if(c)if(ob)this.F=new ArrayBuffer(c),this.I=new DataView(this.F,0,c),this.w=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.H&&null!=this.G){var c=this.H;dc(c,this.G+a,1,c.Z)&&c.ka(!0)}return this.Db(a,b)},fa:function(a,b){if(this.H&&null!=this.G){var c=this.H;dc(c,this.G+a,2,c.Z)&&c.ka(!0)}return this.ac(a,b)},wa:function(a,b,c){if(this.H&&null!=this.G){var d=this.H;dc(d,this.G+a,1,d.I)&&d.ka(!0)}this.L?this.B(a,b,c):this.Gb(a,b,c)},Ha:function(a, -b,c){if(this.H&&null!=this.G){var d=this.H;dc(d,this.G+a,2,d.I)&&d.ka(!0)}this.L?this.B(a,b,c):this.bc(a,b,c)},Y:function(a){return this.w[a]},ba:function(a){return this.w[a]},ea:function(a){return this.I.getUint16(a,!0)},ma:function(a){return a&1?this.w[a]|this.w[a+1]<<8:this.K[a>>1]},ra:function(a,b){this.w[a]=b;this.La=!0},Aa:function(a,b){this.w[a]=b;this.La=!0},Ga:function(a,b){this.I.setUint16(a,b,!0);this.La=!0},$a:function(a,b){a&1?(this.w[a]=b,this.w[a+1]=b>>8):this.K[a>>1]=b;this.La=!0}}; -function ub(a,b,c){a.H=b;a.u=a.A=0;c&&((a.u=c.u)&&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.B:a.Gb,a.Bc=a.L?a.J:a.bc):0===--a.u&&(a.qb=a.Db,a.yc=a.ac)}function ac(a,b,c){c&&a.A||(a.sb=!a.L&&b[2]||a.B,a.Bc=!a.L&&b[3]||a.J);if(c||void 0===c)a.Gb=b[2]||a.B,a.bc=b[3]||a.J}function cc(a,b,c){c&&a.u||(a.qb=b[0]||a.M,a.yc=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=[F.prototype.da,F.prototype.na,F.prototype.Fa,F.prototype.Ka],bc=[F.prototype.Z,F.prototype.fa,F.prototype.wa,F.prototype.Ha];if(ob)var Zb=[F.prototype.Y,F.prototype.ea,F.prototype.ra,F.prototype.Ga],Yb=[F.prototype.ba,F.prototype.ma,F.prototype.Aa,F.prototype.$a]; -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.Ob=0;this.i.Ya=d;this.i.Xb=Math.round(this.i.pb/1E4)/100;this.i.Wa=this.i.Xb*this.i.Ya;this.D.va=!1;this.D.Wb=!1;this.D.pc=a.autoStart;this.D.rc=!1;this.D.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.Za.bind(this);E(this)}$a(gc);var hc=["power","reset"];m=gc.prototype; -m.Na=function(a,b,c,d){this.u=a;this.w=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<=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.u)if(a=d.u,a.D.sa)a=!0;else{var b=null,c,g=cb(a.id);for(c=0;cc&&(c=2);var d=1;b&&1a.i.Va/a.i.Wa?b=1:d=!0;a.i.Ya=b;b=a.i.Xb*a.i.Ya;if(a.i.Wa!=b){a.i.Wa=b;b=a.i.Wa.toFixed(2)+"Mhz";var e=a.L.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.u&&a.u.Eb()}Dc(a,a.I);a.I=0;a.i.kb=la();a.i.Xa=0;Ec(a);return d} -m.Za=function(a){if(ib(this,!0)){if(!this.D.va){Cc(this);this.u&&this.u.start(this.i.kb,pc(this));this.D.va=!0;this.D.Wb=!0;this.A&&this.A.start();var b=this.L.run;b&&(b.textContent="Halt");this.u&&(this.u.Ea(!0),a&&this.u.Eb(!0))}this.i.$b>=this.i.pb&&Ec(this,!0);this.i.Bb=0;this.i.Nb=la();this.i.Xa&&(a=this.i.Nb-this.i.Xa,a>this.i.uc&&(this.i.kb+=a,this.i.kb>this.i.Nb&&(this.i.kb=this.i.Nb)));try{do{this.rb(this.D.hb?1:this.i.wd);var c=this.F-this.b;this.I+=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.wc,this.u&&Fc(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.vc,this.u&&this.u.Ea());this.i.ob-=c;if(0>=this.i.ob){this.i.ob+=this.i.Zb;break}}while(this.D.va)}catch(e){this.ka();mc(this);this.u&&this.u.stop(la(),pc(this));ib(this,!1);lb(this,e.stack||e.message);return}c=setTimeout;a=this.ba;this.i.Xa=la();b=this.i.uc;this.i.Bb&&(b=Math.round(b*this.i.Bb/this.i.Zb));var b=b-(this.i.Xa-this.i.Nb),d= -this.i.Xa-this.i.kb;d&&(this.i.Va=Math.round(this.I/(10*d))/100,864E5<=d&&(this.J=0,Cc(this)));if(0>b||this.i.Va>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.W} -function Rc(a,b){a.U=b>>8&255;a.W=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 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.X=function(a){return this.w.X(a)};m.qa=function(a,b){this.w.qa(a,b)};function M(a){var b=a.X(a.N);G(a,a.N+1);return b}function N(a){var b=a.w.Pa(a.N);G(a,a.N+2);return b}function O(a){var b=a.w.Pa(a.ia);a.ia=a.ia+2&65535;return b}function Q(a,b){a.ia=a.ia-2&65535;a.w.Rb(a.ia,b)}function fd(a,b){a.B=a.B&-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.D.va||a.D.rc?n(c,d):"--------".substr(0,d),a.L[b].textContent!=c&&(a.L[b].textContent=c))} -m.Ea=function(a){this.Z&&(a||!this.D.va||this.D.rc)&&(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.W),R(this,"HL",J(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.D.va&&this.i.Va?this.i.Va.toFixed(2)+"Mhz":"Stopped"}; -m.rb=function(a){this.D.Lb=!0;var b=this.D.md=this.H&&gd(this.H),c=a?this.D.Wb?0:1:-1;this.D.Wb=!1;this.F=this.b=a;do{if(this.B){var d;this.B&8&&this.ta&512?(d=199|(this.B&7)<<3,this.B&=-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.B&16){this.b=0;break}}if(b){if(Ad(this.H,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=J(this)+Nc(this));Tc(this,a>>8&256);this.b-=10},function(){this.j=this.X(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},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.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},Bd,function(){var a;Rc(this,a=J(this)+Pc(this));Tc(this,a>>8&256);this.b-=10},function(){this.j=this.X(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},Bd,function(){Rc(this,N(this));this.b-=10},function(){var a=N(this);this.w.Rb(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=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=J(this)+J(this));Tc(this,a>>8&256);this.b-=10},function(){var a;a=N(this);a=this.w.Pa(a);Rc(this,a);this.b-=16},function(){Rc(this,J(this)-1);this.b-=5},function(){this.W= -bd(this,this.W);this.b-=5},function(){this.W=ad(this,this.W);this.b-=5},function(){this.W=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=J(this);this.qa(a,bd(this,this.X(a)));this.b-=10},function(){var a=J(this);this.qa(a,ad(this,this.X(a)));this.b-=10},function(){this.qa(J(this),M(this));this.b-=10},function(){this.aa|=256;this.b-= -4},Bd,function(){var a;Rc(this,a=J(this)+this.ia);Tc(this,a>>8&256);this.b-=10},function(){this.j=this.X(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.W;this.b-=5},function(){this.P=this.X(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.W;this.b-=5},function(){this.R=this.X(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.W;this.b-=5},function(){this.S=this.X(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.W;this.b-=5},function(){this.T=this.X(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.W;this.b-=5},function(){this.U=this.X(J(this));this.b-=7},function(){this.U=this.j;this.b-=5},function(){this.W=this.P;this.b-=5},function(){this.W=this.R;this.b-=5},function(){this.W=this.S;this.b-=5},function(){this.W=this.T;this.b-=5},function(){this.W=this.U;this.b-=5},function(){this.b-=5},function(){this.W=this.X(J(this));this.b-=7},function(){this.W=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.W);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,O(this)), -this.b-=6);this.b-=5},function(){this.ia=J(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},Ed,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&&!Fd[b]&&La("Unrecognized ChipSet model: "+b);this.B=Fd[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,ad:{ya:0,Vd:1,$d:16,ne:32,Be:64,ze:128,tb:14},Ta:{ya:1,Gc:1,Wc:2,Sc:4,Tc:16,Uc:32,Vc:64,tb:8},bd:{ya:2,Ud:3,Ke:4,Wd:8,ve:16,we:32,xe:64,Xd:128,tb:0},Fe:{ya:3},De:{ya:2,pe:7},He:{ya:3,Me:1,Ge:2,ye:4,he:8,Yd:16,Md:32},Ee:{ya:4},Ie:{ya:5,ae:1,be:2,ce:4,de:8,Ne:16}},U={xa:100,ab:{ya:66,Re:1,Qc:2,Rc:4,te:8,re:16,fc:32,ec:64,ke:128},Fc:{ya:66,INIT:0},Ia:{me:{ya:98},Qa:{Ec:0,Dc:1,Yc:2,ed:4,Jc:5,Xc:6,Zc:7},Jb:16383},Ic:{ya:162,INIT:0},Hc:{ya:194,INIT:0}},Fd={SI1978:T,VT100:U}; -S.prototype.ja=function(){return!1};S.prototype.Na=function(a,b,c,d){this.w=b;this.b=c;this.H=d;this.u=a;Cb(b,this,this.B.Pb);Gb(b,this,this.B.Qb)};S.prototype.za=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};S.prototype.Da=function(a){return a?this.save():!0};T.INIT=[[T.ad.tb,T.Ta.tb,T.bd.tb,0,0,0,0]]; -U.INIT=[[U.Fc.INIT,U.ab.Qc|U.ab.Rc,U.Ic.INIT,U.Hc.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=S.prototype; -m.reset=function(){this.B.INIT&&!this.restore(this.B.INIT)&&this.ga("reset error")};m.save=function(){var a=new H(this);switch(this.B.xa){case T.xa:I(a,0,[this.ra,this.F,this.wa,this.O,this.Z,this.ma,this.na]);break;case U.xa:I(a,0,[this.da,this.J,this.fa,this.ea]),I(a,1,[this.M,this.A,this.K,this.Y,this.I])}return a.data()}; -m.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.B.xa){case T.xa:return this.ra=b[0],this.F=b[1],this.wa=b[2],this.O=b[3],this.Z=b[4],this.ma=b[5],this.na=b[6],!0;case U.xa:return this.da=b[0],this.J=b[1],this.fa=b[2],this.ea=b[3],b=a[1],this.M=b[0],this.A=b[1],this.K=b[2],this.Y=b[3],this.I=b[4],!0}return!1};m.start=function(){};m.stop=function(){};function Gd(a,b,c){a.F&=~b;c&&(a.F|=b)}m.qd=function(a,b){var c=this.ra;D(this,a,null,b,"STATUS0",c,!0);return c}; -m.rd=function(a,b){var c=this.F;D(this,a,null,b,"STATUS1",c,!0);return c};m.sd=function(a,b){var c=this.wa;D(this,a,null,b,"STATUS2",c,!0);return c};m.pd=function(a,b){var c=this.O>>8-this.Z&255;D(this,a,null,b,"SHIFT.RESULT",c,!0);return c};m.Ad=function(a,b,c){D(this,a,b,c,"SHIFT.COUNT",null,!0);this.Z=b};m.Cd=function(a,b,c){D(this,a,b,c,"SOUND1",null,!0);this.ma=b};m.Bd=function(a,b,c){D(this,a,b,c,"SHIFT.DATA",null,!0);this.O=b<<8|this.O>>8}; -m.Dd=function(a,b,c){D(this,a,b,c,"SOUND2",null,!0);this.na=b};m.Ed=function(a,b,c){D(this,a,b,c,"WATCHDOG",null,!0)};function Hd(a){var b=0,c=0,d=~a.M;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.td=function(a,b){var c=this.J,c=c&~U.ab.ec;if((pc(this.b)&64)<<1&&(c|=U.ab.ec,c!=this.J)){var d,e;d=this.K&1;e=this.K>>1&7;switch(e){case U.Ia.Qa.Zc:break;case U.Ia.Qa.Dc:this.M=this.M<<1|d;break;case U.Ia.Qa.Jc:d=Hd(this);this.I[d]=U.Ia.Jb;gb(this,"doNVRCommand(): erase data at addr "+r(d));break;case U.Ia.Qa.Ec:this.A=this.A<<1|d;break;case U.Ia.Qa.ed:d=Hd(this);e=this.A&U.Ia.Jb;this.I[d]=e;gb(this,"doNVRCommand(): write data "+r(e)+" to addr "+r(d));break;case U.Ia.Qa.Xc:d=Hd(this);e=this.I[d]; -null==e&&(e=U.Ia.Jb);this.A=e;gb(this,"doNVRCommand(): read data "+r(e)+" from addr "+r(d));break;case U.Ia.Qa.Yc:this.A<<=1;this.Y=this.A&U.Ia.Jb+1;break;default:gb(this,"doNVRCommand(): unrecognized command 0x"+n(e,2))}}c&=~U.ab.fc;this.Y&&(c|=U.ab.fc);this.J=c;D(this,a,null,b,"FLAGS.BUFFER",c);return c};m.Fd=function(a,b,c){D(this,a,b,c,"BRIGHTNESS");this.da=b};m.Id=function(a,b,c){D(this,a,b,c,"NVR.LATCH");this.K=b};m.Hd=function(a,b,c){D(this,a,b,c,"DC012");this.fa=b}; -m.Gd=function(a,b,c){D(this,a,b,c,"DC011");this.ea=b};T.Pb={0:S.prototype.qd,1:S.prototype.rd,2:S.prototype.sd,3:S.prototype.pd};T.Qb={2:S.prototype.Ad,3:S.prototype.Cd,4:S.prototype.Bd,5:S.prototype.Dd,6:S.prototype.Ed};U.Pb={66:S.prototype.td};U.Qb={66:S.prototype.Fd,98:S.prototype.Id,162:S.prototype.Hd,194:S.prototype.Gd};Ja(function(){for(var a=B(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({ff:b,G:c,vd:d,Oa:e,nc: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.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){t("Empty ROM: "+b);return}if(1==a.u.length){t(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.la;0>>=f.la;0":62,"?":63,"@":64,Kd:65,Nd:66,Od:67,Td:68,E:69,Zd:70,ee:71,fe:72,ge:73,ie:74,je: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={xa:1978.1,C:{},vb:{},wb:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},W={xa:100,C:{},vb:{},wb:{},Ld:{ya:130},Ja:{ya:130,Oc:1,Nc:2,Mc:4,Lc:8,Pc:16,gc:32,cc:63,$c:64,Pd:128,INIT:0},Kc:127};W.C[46]=3;W.C[80]=5;W.C[79]=6;W.C[89]=7;W.C[84]=8;W.C[87]=9;W.C[81]=10;W.C[39]=16;W.C[V["]"]]=20;W.C[V["["]]=21;W.C[73]=22;W.C[85]=23;W.C[82]=24;W.C[69]=25; -W.C[V["1"]]=26;W.C[37]=32;W.C[40]=34;W.C[19]=35;W.C[V["`"]]=36;W.C[V["-"]]=37;W.C[V["9"]]=38;W.C[V["7"]]=39;W.C[V["4"]]=40;W.C[V["3"]]=41;W.C[27]=42;W.C[38]=48;W.C[114]=49;W.C[112]=50;W.C[8]=51;W.C[V["="]]=52;W.C[V["0"]]=53;W.C[V["8"]]=54;W.C[V["6"]]=55;W.C[V["5"]]=56;W.C[V["2"]]=57;W.C[9]=58;W.C[103]=64;W.C[115]=65;W.C[113]=66;W.C[96]=67;W.C[10]=68;W.C[V["\\"]]=69;W.C[76]=70;W.C[75]=71;W.C[71]=72;W.C[70]=73;W.C[65]=74;W.C[104]=80;W.C[2013]=81;W.C[98]=82;W.C[97]=83;W.C[V["'"]]=85;W.C[V[";"]]=86; -W.C[74]=87;W.C[72]=88;W.C[68]=89;W.C[83]=90;W.C[110]=96;W.C[119]=97;W.C[101]=98;W.C[100]=99;W.C[13]=100;W.C[V["."]]=101;W.C[V[","]]=102;W.C[78]=103;W.C[66]=104;W.C[88]=105;W.C[120]=106;W.C[105]=112;W.C[99]=113;W.C[102]=114;W.C[109]=115;W.C[V["/"]]=117;W.C[77]=118;W.C[V[" "]]=119;W.C[86]=120;W.C[67]=121;W.C[90]=122;W.C[121]=123;W.C[17]=124;W.C[16]=125;W.C[20]=126;W.vb={l4:W.Ja.Oc,l3:W.Ja.Nc,l2:W.Ja.Mc,l1:W.Ja.Lc,locked:W.Ja.Pc,online:W.Ja.gc,local:~W.Ja.gc};var Qd={SI1978:Sd,VT100:W}; -Pd.prototype.ja=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.L[e]){if("led"==a&&this.u.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.u.wb&&void 0!==this.u.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.H=d;this.A=rb(a,"ChipSet");Cb(b,this,this.u.Pb);Gb(b,this,this.u.Qb)};Pd.prototype.za=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};W.INIT=[[W.Ja.INIT,0]];m=Pd.prototype;m.reset=function(){this.w=[];this.u.INIT&&!this.restore(this.u.INIT)&&this.ga("reset error")};m.save=function(){var a=new H(this);switch(this.u.xa){case W.xa:I(a,0,[this.F])}return a.data()}; -m.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.u.xa){case Sd.xa:return!0;case W.xa:return this.F=b[0],Vd(this,this.F&W.Ja.cc),this.B=b[1],!0}return!1};function Vd(a,b){for(var c in a.u.vb){var d=a.L["led-"+c];if(d){var e=a.u.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.u.C[e]){for(var f in a.u.wb)if(a.u.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.w.push({Ac:b,Yb:Date.now(),Kb:!1}):(a.w[d].Yb=Date.now(),a.w[d].Kb=!1);else if(0<=d){if(!a.w[d].Kb){var e=a.w[d].Yb;if(e&&100>Date.now()-e)return a.w[d].Kb=!0,Wd(a),!0}a.w.splice(d,1)}if(a.A)switch(b){case "1p":Gd(a.A,T.Ta.Sc,c);break;case "2p":Gd(a.A,T.Ta.Wc,c);break;case "coin":Gd(a.A,T.Ta.Gc,c);break;case "left":Gd(a.A,T.Ta.Uc,c);break;case "right":Gd(a.A,T.Ta.Vc,c);break;case "fire":Gd(a.A,T.Ta.Tc,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.ud=function(a,b){var c=0;0<=this.B&&this.B>3)*this.Z;if(this.gd||vb(this.w,this.Aa,this.Sa,3))1>1)),this.K=document.createElement("canvas"),this.K.width=b,this.K.height=c,this.cb=this.K.getContext("2d"),this.na={},this.Ha=1<=a.cd?8:16,f=8>(7=d?48:55),c=String.fromCharCode(d)+c;a>>=4}return c}function ca(a){return"0x"+n(a,2)}function r(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.L=this.O/this.Ca|0;this.M=this.L-1;this.w=[];this.A=[];this.F=this.I=!1;this.Z=[];this.ba=[];a=new F;vb(a,this.H);this.W=Array(this.L);for(b=0;b>>a.la;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 xb(1,e,f)}e=new F(e,l,a.Ca,d);vb(e,a.H,g);a.W[h++]=e;e=k+a.Ca;f-=l}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+yb[d]+" at "+r(b)),!0):xb(2,b,c)}m.Y=function(a){return this.W[(a&this.D)>>>this.la].qb(a&this.B,a)}; +function zb(a,b){return a.W[(b&a.D)>>>a.la].Db(b&a.B,b)}m.Qa=function(a){var b=a&this.B,c=(a&this.D)>>>this.la;return b!=this.B?this.W[c].Ac(b,a):this.W[c++].qb(b,a)|this.W[c&this.M].qb(0,a+1)<<8};function Ab(a,b){var c=b&a.B,d=(b&a.D)>>>a.la;return c!=a.B?a.W[d].ac(c,b):a.W[d++].Db(c,b)|a.W[d&a.M].Db(0,b+1)<<8}m.qa=function(a,b){this.W[(a&this.D)>>>this.la].sb(a&this.B,b&255,a)};function Bb(a,b,c){a.W[(b&a.D)>>>a.la].Gb(b&a.B,c&255,b)} +m.Rb=function(a,b){var c=a&this.B,d=(a&this.D)>>>this.la;c!=this.B?this.W[d].Cc(c,b&65535,a):(this.W[d++].sb(c,b&255,a),this.W[d&this.M].sb(0,b>>8&255,a+1))};function Cb(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 Db(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]?t("Input port "+r(k)+" already registered"):f.w[k]=[g,!1]}} +function Eb(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]&&Jb(a.H,b,k)}else a.H&&(gb(a.H,a,b,k,d),a.I&&Jb(a.H,b,k));f+=g<<3;b+=g;e-=g}} +function xb(a,b,c){t("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1}var Kb;if(pb){var Lb=new ArrayBuffer(2);(new DataView(Lb)).setUint16(0,256,!0);Kb=256===(new Uint16Array(Lb))[0]}else Kb=!1;var Mb=Kb; +function F(a,b,c,d){this.id=Vb+=2;this.b=null;this.G=a;this.Fb=b;this.size=c||0;this.type=d||Wb;this.K=d==Xb;vb(this);this.La=this.sc=!1;if(c)if(pb)this.F=new ArrayBuffer(c),this.I=new DataView(this.F,0,c),this.B=new Uint8Array(this.F,0,c),this.M=new Uint16Array(this.F,0,c>>1),this.b=new Int32Array(this.F,0,c>>2),Yb(this,Mb?Zb:$b);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.H&&null!=this.G){var c=this.H;ec(c,this.G+a,1,c.Z)&&c.ka(!0)}return this.Db(a,b)},fa:function(a,b){if(this.H&&null!=this.G){var c=this.H;ec(c,this.G+a,2,c.Z)&&c.ka(!0)}return this.ac(a,b)},wa:function(a,b,c){if(this.H&&null!=this.G){var d=this.H;ec(d,this.G+a,1,d.I)&&d.ka(!0)}this.K?this.D(a,b,c):this.Gb(a,b,c)},Ha:function(a, +b,c){if(this.H&&null!=this.G){var d=this.H;ec(d,this.G+a,2,d.I)&&d.ka(!0)}this.K?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.I.getUint16(a,!0)},ma:function(a){return a&1?this.B[a]|this.B[a+1]<<8:this.M[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.I.setUint16(a,b,!0);this.La=!0},ab:function(a,b){a&1?(this.B[a]=b,this.B[a+1]=b>>8):this.M[a>>1]=b;this.La=!0}}; +function vb(a,b,c){a.H=b;a.w=a.A=0;c&&((a.w=c.w)&&dc(a,cc,!1),(a.A=c.A)&&bc(a,cc,!1))}function fc(a,b){b?0===--a.A&&(a.sb=a.K?a.D:a.Gb,a.Cc=a.K?a.J:a.cc):0===--a.w&&(a.qb=a.Db,a.Ac=a.ac)}function bc(a,b,c){c&&a.A||(a.sb=!a.K&&b[2]||a.D,a.Cc=!a.K&&b[3]||a.J);if(c||void 0===c)a.Gb=b[2]||a.D,a.cc=b[3]||a.J}function dc(a,b,c){c&&a.w||(a.qb=b[0]||a.L,a.Ac=b[1]||a.O);if(c||void 0===c)a.Db=b[0]||a.L,a.ac=b[1]||a.O}function Yb(a,b){b||(b=gc);dc(a,b,void 0);bc(a,b,void 0)} +var gc=[],ac=[F.prototype.da,F.prototype.na,F.prototype.Fa,F.prototype.Ka],cc=[F.prototype.Z,F.prototype.fa,F.prototype.wa,F.prototype.Ha];if(pb)var $b=[F.prototype.P,F.prototype.ea,F.prototype.ra,F.prototype.Ga],Zb=[F.prototype.ba,F.prototype.ma,F.prototype.xa,F.prototype.ab]; +function hc(a,b){u.call(this,"CPU",a,hc,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);E(this)}ab(hc);var ic=["power","reset"];m=hc.prototype; +m.Na=function(a,b,c,d){this.w=a;this.B=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<=qc(a)&&(a.i.lb=a.i.nb=-1,lc(a),a.ka(),c=!0);c&&a.g(qc(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.K[b]=c;a=!0;break;case "run":this.K[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=db(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.K.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.w&&a.w.Eb()}Ec(a,a.I);a.I=0;a.i.kb=ma();a.i.Ya=0;Fc(a);return d} +m.$a=function(a){if(jb(this,!0)){if(!this.C.va){Dc(this);this.w&&this.w.start(this.i.kb,qc(this));this.C.va=!0;this.C.Wb=!0;this.D&&this.D.start();var b=this.K.run;b&&(b.textContent="Halt");this.w&&(this.w.Ea(!0),a&&this.w.Eb(!0))}this.i.$b>=this.i.pb&&Fc(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.xd);var c=this.F-this.b;this.I+=c;this.i.Bb+=c;Ec(this,0,!0);pc(this, +c);this.i.Ab-=c;0>=this.i.Ab&&(this.i.Ab+=this.i.yc,this.w&&Gc(this.w,this.i.Ob++),this.i.Ob>this.L&&(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();nc(this);this.w&&this.w.stop(ma(),qc(this));jb(this,!1);mb(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.I/(10*d))/100,864E5<=d&&(this.J=0,Dc(this)));if(0>b||this.i.Wa>8&255;a.S=b&255}function Qc(a){return a.T<<8|a.U}function Rc(a,b){a.T=b>>8&255;a.U=b&255}function J(a){return a.V<<8|a.X} +function Sc(a,b){a.V=b>>8&255;a.X=b&255}function G(a,b){a.N=b&65535}function Tc(a){return a.aa&256?1:0}function Uc(a,b){a.aa=a.aa&255|b}function Vc(a){return qb[a.ca&255]?4:0}function Wc(a){return(a.ca^a.ua)&16?16:0}function Xc(a){return a.aa&255?0:64}function Yc(a){return a.ca&128?128:0}function Nc(a){return a.ta&-214|Yc(a)|Xc(a)|Wc(a)|Vc(a)|Tc(a)}function Lc(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 Zc(a,b){a.ua=a.j^b;return a.ca=(a.aa=a.j+b)&255}function $c(a,b){a.ua=a.j^b;return a.ca=(a.aa=a.j+b+(a.aa&256?1:0))&255}function ad(a,b){a.aa=a.ca=a.ua=a.j&b;(a.j|b)&8&&(a.ua^=16);return a.aa}function bd(a,b){a.ua=b^255;b=a.ca=b+255&255;a.aa=a.aa&-256|b;return b}function cd(a,b){a.ua=b;b=a.ca=b+1&255;a.aa=a.aa&-256|b;return b}function dd(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 ed(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 fd(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);G(a,a.N+1);return b}function N(a){var b=a.B.Qa(a.N);G(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 gd(a,b){a.A=a.A&-8|b|8} +function R(a,b,c,d){d=d||2;a.K[b]&&(void 0===c&&(mb(a,"Value for "+b+" is invalid"),a.ka()),c=!a.C.va||a.C.tc?n(c,d):"--------".substr(0,d),a.K[b].textContent!=c&&(a.K[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",Oc(this),4),R(this,"D",this.T),R(this,"E",this.U),R(this,"DE",Qc(this),4),R(this,"H",this.V),R(this,"L",this.X),R(this,"HL",J(this),4),R(this,"SP",this.ia,4),R(this,"PC",this.N,4),a=Nc(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.K.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.nd=this.H&&hd(this.H),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(Bd(this.H,this.N,c)){this.ka();break}c=1}this.O[M(this)].call(this)}while(0>8;Uc(this,a&256);this.b-=4},Cd,function(){var a;Sc(this,a=J(this)+Oc(this));Uc(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.S=cd(this,this.S);this.b-=5},function(){this.S=bd(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;Uc(this,a);this.b-=4},Cd,function(){Rc(this,N(this));this.b-=10},function(){this.qa(Qc(this),this.j);this.b-=7},function(){Rc(this,Qc(this)+1);this.b-=5},function(){this.T=cd(this,this.T);this.b-=5},function(){this.T=bd(this,this.T);this.b-=5},function(){this.T=M(this);this.b-=7},function(){var a=this.j<<1;this.j=a&255| +Tc(this);Uc(this,a&256);this.b-=4},Cd,function(){var a;Sc(this,a=J(this)+Qc(this));Uc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(Qc(this));this.b-=7},function(){Rc(this,Qc(this)-1);this.b-=5},function(){this.U=cd(this,this.U);this.b-=5},function(){this.U=bd(this,this.U);this.b-=5},function(){this.U=M(this);this.b-=7},function(){var a=this.j<<8;this.j=(Tc(this)<<8|this.j)>>1;Uc(this,a&256);this.b-=4},Cd,function(){Sc(this,N(this));this.b-=10},function(){var a=N(this);this.B.Rb(a,J(this)); +this.b-=16},function(){Sc(this,J(this)+1);this.b-=5},function(){this.V=cd(this,this.V);this.b-=5},function(){this.V=bd(this,this.V);this.b-=5},function(){this.V=M(this);this.b-=7},function(){var a=0,b=Tc(this);if(Wc(this)||9<(this.j&15))a|=6;if(b||154<=this.j)a|=96,b=1;this.j=Zc(this,a);Uc(this,b?256:0);this.b-=4},Cd,function(){var a;Sc(this,a=J(this)+J(this));Uc(this,a>>8&256);this.b-=10},function(){var a;a=N(this);a=this.B.Qa(a);Sc(this,a);this.b-=16},function(){Sc(this,J(this)-1);this.b-=5},function(){this.X= +cd(this,this.X);this.b-=5},function(){this.X=bd(this,this.X);this.b-=5},function(){this.X=M(this);this.b-=7},function(){this.j=~this.j&255;this.b-=4},Cd,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=J(this);this.qa(a,cd(this,this.Y(a)));this.b-=10},function(){var a=J(this);this.qa(a,bd(this,this.Y(a)));this.b-=10},function(){this.qa(J(this),M(this));this.b-=10},function(){this.aa|=256;this.b-= +4},Cd,function(){var a;Sc(this,a=J(this)+this.ia);Uc(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=cd(this,this.j);this.b-=5},function(){this.j=bd(this,this.j);this.b-=5},function(){this.j=M(this);this.b-=7},function(){Uc(this,Tc(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(J(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(J(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(J(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(J(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(J(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(J(this));this.b-=7},function(){this.X=this.j; +this.b-=5},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.V);this.b-=7},function(){this.qa(J(this),this.X);this.b-=7},function(){var a=this.N-1;if(this.M.length)for(var b=0;b>8;this.b-=10},function(){var a=N(this);Yc(this)||G(this,a);this.b-=10},function(){this.ta&=-513;this.b-=4},function(){var a=N(this);Yc(this)||(Q(this,this.N),G(this,a),this.b-=6);this.b-=11},function(){Q(this,Nc(this)&255|this.j<<8);this.b-=11},function(){this.j=dd(this,M(this));this.b-=7},function(){Q(this,this.N);G(this,48);this.b-=11},function(){Yc(this)&&(G(this,O(this)), +this.b-=6);this.b-=5},function(){this.ia=J(this)&65535;this.b-=5},function(){var a=N(this);Yc(this)&&G(this,a);this.b-=10},function(){this.ta|=512;this.b-=4},function(){var a=N(this);Yc(this)&&(Q(this,this.N),G(this,a),this.b-=6);this.b-=11},Fd,function(){L(this,M(this));this.b-=7},function(){Q(this,this.N);G(this,56);this.b-=11}]; +function S(a){u.call(this,"ChipSet",a,S,32768);var b=a.model;b&&!Gd[b]&&Ma("Unrecognized ChipSet model: "+b);this.D=Gd[b]||{};a.sound&&(this.da=null,window&&(this.da=window.AudioContext||window.webkitAudioContext),this.da&&new this.da);E(this)}ab(S); +var T={ya:1978.1,bd:{za:0,Wd:1,ae:16,ne:32,Be:64,ze:128,tb:14},Ua:{za:1,Hc:1,Xc:2,Tc:4,Uc:16,Vc:32,Wc:64,tb:8},cd:{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}},U={ya:100,Pa:{za:66,Re:1,Rc:2,Sc:4,te:8,re:16,hc:32,gc:64,dc:128},Gc:{za:66,INIT:0},Ia:{me:{za:98},Ra:{Fc:0,Ec:1,Zc:2,fd:4,Kc:5,Yc:6,$c:7},Jb:16383},Jc:{za:162,INIT:0},Ic:{za:194,INIT:0}},Gd={SI1978:T,VT100:U}; +S.prototype.ja=function(){return!1};S.prototype.Na=function(a,b,c,d){this.B=b;this.b=c;this.H=d;this.w=a;this.M=sb(a,"Keyboard");Db(b,this,this.D.Pb);Hb(b,this,this.D.Qb)};S.prototype.Aa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};S.prototype.Da=function(a){return a?this.save():!0};T.INIT=[[T.bd.tb,T.Ua.tb,T.cd.tb,0,0,0,0]]; +U.INIT=[[U.Gc.INIT,U.Pa.Rc|U.Pa.Sc,U.Jc.INIT,U.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=S.prototype; +m.reset=function(){this.D.INIT&&!this.restore(this.D.INIT)&&this.ga("reset error")};m.save=function(){var a=new H(this);switch(this.D.ya){case T.ya:I(a,0,[this.wa,this.F,this.xa,this.P,this.ba,this.na,this.ra]);break;case U.ya:I(a,0,[this.ea,this.J,this.ma,this.fa]),I(a,1,[this.O,this.A,this.L,this.Z,this.I])}return a.data()}; +m.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.D.ya){case T.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 U.ya:return this.ea=b[0],this.J=b[1],this.ma=b[2],this.fa=b[3],b=a[1],this.O=b[0],this.A=b[1],this.L=b[2],this.Z=b[3],this.I=b[4],!0}return!1};m.start=function(){};m.stop=function(){};function Hd(a,b,c){a.F&=~b;c&&(a.F|=b)}m.rd=function(a,b){var c=this.wa;C(this,a,null,b,"STATUS0",c,!0);return c}; +m.sd=function(a,b){var c=this.F;C(this,a,null,b,"STATUS1",c,!0);return c};m.td=function(a,b){var c=this.xa;C(this,a,null,b,"STATUS2",c,!0);return c};m.qd=function(a,b){var c=this.P>>8-this.ba&255;C(this,a,null,b,"SHIFT.RESULT",c,!0);return c};m.Bd=function(a,b,c){C(this,a,b,c,"SHIFT.COUNT",null,!0);this.ba=b};m.Dd=function(a,b,c){C(this,a,b,c,"SOUND1",null,!0);this.na=b};m.Cd=function(a,b,c){C(this,a,b,c,"SHIFT.DATA",null,!0);this.P=b<<8|this.P>>8}; +m.Ed=function(a,b,c){C(this,a,b,c,"SOUND2",null,!0);this.ra=b};m.Fd=function(a,b,c){C(this,a,b,c,"WATCHDOG",null,!0)};function Id(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.ud=function(a,b){var c=this.J,c=c&~U.Pa.gc;if((qc(this.b)&64)<<1&&(c|=U.Pa.gc,c!=this.J)){var d,e;d=this.L&1;e=this.L>>1&7;switch(e){case U.Ia.Ra.$c:break;case U.Ia.Ra.Ec:this.O=this.O<<1|d;break;case U.Ia.Ra.Kc:d=Id(this);this.I[d]=U.Ia.Jb;hb(this,"doNVRCommand(): erase data at addr "+r(d));break;case U.Ia.Ra.Fc:this.A=this.A<<1|d;break;case U.Ia.Ra.fd:d=Id(this);e=this.A&U.Ia.Jb;this.I[d]=e;hb(this,"doNVRCommand(): write data "+r(e)+" to addr "+r(d));break;case U.Ia.Ra.Yc:d=Id(this);e=this.I[d]; +null==e&&(e=U.Ia.Jb);this.A=e;hb(this,"doNVRCommand(): read data "+r(e)+" from addr "+r(d));break;case U.Ia.Ra.Zc:this.A<<=1;this.Z=this.A&U.Ia.Jb+1;break;default:hb(this,"doNVRCommand(): unrecognized command "+ca(e))}}c&=~U.Pa.hc;this.Z&&(c|=U.Pa.hc);c&=~U.Pa.dc;this.M&&(c|=U.Pa.dc);this.J=c;C(this,a,null,b,"FLAGS.BUFFER",c);return c};m.Gd=function(a,b,c){C(this,a,b,c,"BRIGHTNESS");this.ea=b};m.Jd=function(a,b,c){C(this,a,b,c,"NVR.LATCH");this.L=b}; +m.Id=function(a,b,c){C(this,a,b,c,"DC012");this.ma=b};m.Hd=function(a,b,c){C(this,a,b,c,"DC011");this.fa=b};T.Pb={0:S.prototype.rd,1:S.prototype.sd,2:S.prototype.td,3:S.prototype.qd};T.Qb={2:S.prototype.Bd,3:S.prototype.Dd,4:S.prototype.Cd,5:S.prototype.Ed,6:S.prototype.Fd};U.Pb={66:S.prototype.ud};U.Qb={66:S.prototype.Gd,98:S.prototype.Jd,162:S.prototype.Id,194:S.prototype.Hd};Ka(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,wd:d,Oa:e,pc:f})}delete this.Oa}return!0};Jd.prototype.Da=function(){return!0}; +function Kd(a,b,c,d){if(d)a.ga("Unable to load system ROM (error "+d+": "+b+")");else{cb(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){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,Ld: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},Sd={65:37,68:39,76:32},Td={ya:1978.1,u:{},vb:{},wb:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},W={ya:100,u:{},vb:{},wb:{},Md:{za:130},Ja:{za:130,Pc:1,Oc:2,Nc:4,Mc:8,Qc:16,ic:32,ec:63,ad:64,Qd:128,INIT:0},Lc:127};W.u[46]=3;W.u[80]=5;W.u[79]=6;W.u[89]=7;W.u[84]=8;W.u[87]=9;W.u[81]=10;W.u[39]=16;W.u[V["]"]]=20;W.u[V["}"]]=148;W.u[V["["]]=21;W.u[V["{"]]=149;W.u[73]=22; +W.u[85]=23;W.u[82]=24;W.u[69]=25;W.u[V["1"]]=26;W.u[V["!"]]=154;W.u[37]=32;W.u[40]=34;W.u[117]=35;W.u[19]=35;W.u[V["`"]]=36;W.u[V["~"]]=164;W.u[V["-"]]=37;W.u[V._]=165;W.u[V["9"]]=38;W.u[V["("]]=166;W.u[V["7"]]=39;W.u[V["&"]]=167;W.u[V["4"]]=40;W.u[V.$]=168;W.u[V["3"]]=41;W.u[V["#"]]=169;W.u[27]=42;W.u[38]=48;W.u[114]=49;W.u[112]=50;W.u[8]=51;W.u[V["="]]=52;W.u[V["+"]]=180;W.u[V["0"]]=53;W.u[V[")"]]=181;W.u[V["8"]]=54;W.u[V["*"]]=182;W.u[V["6"]]=55;W.u[V["^"]]=183;W.u[V["5"]]=56;W.u[V["%"]]=184; +W.u[V["2"]]=57;W.u[V["@"]]=185;W.u[9]=58;W.u[103]=64;W.u[115]=65;W.u[113]=66;W.u[96]=67;W.u[10]=68;W.u[V["\\"]]=69;W.u[V["|"]]=197;W.u[76]=70;W.u[75]=71;W.u[71]=72;W.u[70]=73;W.u[65]=74;W.u[104]=80;W.u[2013]=81;W.u[98]=82;W.u[97]=83;W.u[V["'"]]=85;W.u[V['"']]=213;W.u[V[";"]]=86;W.u[V[":"]]=214;W.u[74]=87;W.u[72]=88;W.u[68]=89;W.u[83]=90;W.u[110]=96;W.u[118]=97;W.u[101]=98;W.u[100]=99;W.u[13]=100;W.u[V["."]]=101;W.u[V[">"]]=229;W.u[V[","]]=102;W.u[V["<"]]=230;W.u[78]=103;W.u[66]=104;W.u[88]=105; +W.u[119]=106;W.u[105]=112;W.u[99]=113;W.u[102]=114;W.u[109]=115;W.u[V["/"]]=117;W.u[V["?"]]=245;W.u[77]=118;W.u[V[" "]]=119;W.u[86]=120;W.u[67]=121;W.u[90]=122;W.u[120]=123;W.u[17]=124;W.u[16]=125;W.u[20]=126;W.vb={l4:W.Ja.Pc,l3:W.Ja.Oc,l2:W.Ja.Nc,l1:W.Ja.Mc,locked:W.Ja.Qc,online:W.Ja.ic,local:~W.Ja.ic};var Rd={SI1978:Td,VT100:W}; +Qd.prototype.ja=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.K[e]){if("led"==a&&this.w.vb[b])return this.K[e]=c,!0;switch(b){case "kbd":return c.onkeydown=function(a){return Ud(d,a,!0)},c.onkeyup=function(a){return Ud(d,a,!1)},!0;default:if(this.w.wb&&void 0!==this.w.wb[b])return this.K[e]=c,a=function(a,b){return function(){Vd(a,b,!0)}}(this,b),b=function(a,b){return function(){Vd(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};Qd.prototype.Na=function(a,b,c,d){this.b=c;this.H=d;this.D=sb(a,"ChipSet");Db(b,this,this.w.Pb);Hb(b,this,this.w.Qb)};Qd.prototype.Aa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};Qd.prototype.Da=function(a){return a?this.save():!0};W.INIT=[[W.Ja.INIT,-1]];m=Qd.prototype;m.reset=function(){this.B=[];this.w.INIT&&!this.restore(this.w.INIT)&&this.ga("reset error")};m.save=function(){var a=new H(this);switch(this.w.ya){case W.ya:I(a,0,[this.F])}return a.data()}; +m.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.w.ya){case Td.ya:return!0;case W.ya:return this.F=b[0],Wd(this,this.F&W.Ja.ec),this.A=b[1],!0}return!1};function Wd(a,b){for(var c in a.w.vb){var d=a.K["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 Ud(a,b,c){var d=!0,e;a:if(e=b.keyCode,e=Sd[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=Vd(a,e,c),b.preventDefault());return d} +function Vd(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,Xd(a),!0}a.B.splice(d,1)}if(a.D)switch(b){case "1p":Hd(a.D,T.Ua.Tc,c);break;case "2p":Hd(a.D,T.Ua.Xc,c);break;case "coin":Hd(a.D,T.Ua.Hc,c);break;case "left":Hd(a.D,T.Ua.Vc,c);break;case "right":Hd(a.D,T.Ua.Wc,c);break;case "fire":Hd(a.D,T.Ua.Uc,c)}return!0} +function Xd(a){for(var b=0,c=-1;bc||c>e)c=e}else{Vd(a,d,!1);b=0;continue}}b++}0<=c&&setTimeout(function(){Xd(a)},c)}m.vd=function(a,b){var c=0;0<=this.A&&this.A>3)*this.ba;if(this.hd||wb(this.B,this.xa,this.Ta,3))1>1)),this.L=document.createElement("canvas"),this.L.width=b,this.L.height=c,this.cb=this.L.getContext("2d"),this.na={},this.Ha=1<=a.dd?8:16,f=8>(7>4)*c)}return k} -Xd.prototype.za=function(){if(2==this.da){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.Aa,c=-1,d=-1,e,f=-(60==this.mc?2:5);f>8&15|16;Ab(this.w,b++,e);Ab(this.w,b++, -c&255);if(g)break}if(h)for(c=0,e=1;ec&&(a=Math.round(c/b*100)+"%")}this.ic?(this.M.style.width=a,this.M.style.width=a,this.M.style.display="block",this.M.style.margin="auto"):(this.A.style.width=a,this.A.style.height="auto");this.A.style.backgroundColor="black";this.A.fb();a=!0}this.Ga&&this.Ga.focus()}return a}; -function $d(a,b){!b&&a.A&&(a.ic?a.M.style.width=a.M.style.height="":a.A.style.width=a.A.style.height="");gb(a,"notifyFullScreen("+b+")",!0)}function be(a,b){a.kc=b;a.Fa=!1;if(void 0===a.ma||a.ma.length!=a.kc)a.ma=Array(a.kc)}function ee(a,b,c,d,e){d=a.B?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.da&&(208<=c&&236>c?e=a.Ha+0:28<=c&&72>c&&(e=a.Ha+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.Aa,c=-1,d=0,e=60==a.mc?2:5,f=0,h=0;d>4)*p.ha,z=void 0,u=void 0,K=void 0,C=void 0,Y=p.pa,sa=p.ha;y?(z=k*q.pa,u=d*q.ha,K= -q.pa,C=q.ha):(z=k*q.Hb,u=d*q.Ib,K=q.Hb,C=q.Ib);p.pa>q.pa&&(z*=2,K*=2);p.ha>q.ha&&(0==l&&(x+=q.ha),sa=q.ha);y?y.drawImage(p.canvas,v,x,Y,sa,z,u,K,C):(z+=0,u+=0,q.F.drawImage(p.canvas,v,x,Y,sa,z,u,K,C))}h++}f++}d++}}a.Fa=!0;h&&a.cb&&a.F.drawImage(a.K,0,0,a.J,a.Z-a.ha,0,0,a.dd,a.fd)} -Ja(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||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.I=+a.adapter;switch(this.I){case 0:this.J=0;break;default:t("Unrecognized serial adapter #"+this.I);return}w.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.w=b;this.b=c;this.H=d;this.A=rb(a,"ChipSet");Cb(b,this,ie,this.J);Gb(b,this,je,this.J);E(this)}; -m.za=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 H(this),b=0,c=[];c[b++]=this.B;c[b++]=this.u;c[b++]=this.F;I(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.B=b[c++];a.u=b[c++];a.F=b[c++];return!0}m.od=function(a,b){var c=this.B;D(this,a,null,b,"DATA",c);return c}; -m.nd=function(a,b){var c=this.u;D(this,a,null,b,"COMMAND",c);return c};m.zd=function(a,b,c){D(this,a,b,c,"DATA");this.B=b};m.yd=function(a,b,c){D(this,a,b,c,"COMMAND");this.u=b};m.xd=function(a,b,c){D(this,a,b,c,"BAUDRATE");this.F=b};var ie={0:ge.prototype.od,1:ge.prototype.nd},je={0:ge.prototype.zd,1:ge.prototype.yd,2:ge.prototype.xd};Ja(function(){for(var a=B(document,"pc8080","serial"),b=0;b>8&15|16;Bb(this.B,b++,e);Bb(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.O.style.width=a,this.O.style.width=a,this.O.style.display="block",this.O.style.margin="auto"):(this.A.style.width=a,this.A.style.height="auto");this.A.style.backgroundColor="black";this.A.fb();a=!0}this.Ga&&this.Ga.focus()}return a}; +function ae(a,b){!b&&a.A&&(a.kc?a.O.style.width=a.O.style.height="":a.A.style.width=a.A.style.height="");hb(a,"notifyFullScreen("+b+")",!0)}function ce(a,b){a.mc=b;a.Fa=!1;if(void 0===a.ma||a.ma.length!=a.mc)a.ma=Array(a.mc)}function fe(a,b,c,d,e){d=a.D?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.da&&(208<=c&&236>c?e=a.Ha+0:28<=c&&72>c&&(e=a.Ha+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 ge(a){for(var b=a.xa,c=-1,d=0,e=60==a.oc?2:5,f=0,h=0;d>4)*p.ha,B=void 0,v=void 0,K=void 0,D=void 0,Y=p.pa,sa=p.ha;y?(B=k*q.pa,v=d*q.ha,K= +q.pa,D=q.ha):(B=k*q.Hb,v=d*q.Ib,K=q.Hb,D=q.Ib);p.pa>q.pa&&(B*=2,K*=2);p.ha>q.ha&&(0==l&&(x+=q.ha),sa=q.ha);y?y.drawImage(p.canvas,w,x,Y,sa,B,v,K,D):(B+=0,v+=0,q.F.drawImage(p.canvas,w,x,Y,sa,B,v,K,D))}h++}f++}d++}}a.Fa=!0;h&&a.cb&&a.F.drawImage(a.L,0,0,a.J,a.ba-a.ha,0,0,a.ed,a.gd)} +Ka(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||Ta.aspect);f&&.3<=f&&3.33>=f&&(Ja("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");ya("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var h=e.getContext("2d"),d=new Yd(d,e,h,f,c);fb(d,c)}}); +function he(a){this.I=+a.adapter;switch(this.I){case 0:this.J=0;break;default:t("Unrecognized serial adapter #"+this.I);return}u.call(this,"SerialPort",a,he,8388608);var b=a.binding;if("console"!=b){var c;a=ie;b&&(void 0===c&&(c="Panel"),(c=eb(c,this.id))&&(b=c.K[b])&&this.ja(null,a,b))}}ab(he);var ie="buffer";m=he.prototype; +m.ja=function(a,b,c){switch(b){case ie:return this.K[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.H=d;this.D=sb(a,"ChipSet");Db(b,this,je,this.J);Hb(b,this,ke,this.J);E(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(){le(this)};m.save=function(){var a=new H(this),b=0,c=[];c[b++]=this.A;c[b++]=this.w;c[b++]=this.F;I(a,0,c);return a.data()};m.restore=function(a){return le(this,a[0])};function le(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.pd=function(a,b){var c=this.A;C(this,a,null,b,"DATA",c);return c}; +m.od=function(a,b){var c=this.w;C(this,a,null,b,"COMMAND",c);return c};m.Ad=function(a,b,c){C(this,a,b,c,"DATA");this.A=b};m.zd=function(a,b,c){C(this,a,b,c,"COMMAND");this.w=b};m.yd=function(a,b,c){C(this,a,b,c,"BAUDRATE");this.F=b};var je={0:he.prototype.pd,1:he.prototype.od},ke={0:he.prototype.Ad,1:he.prototype.zd,2:he.prototype.yd};Ka(function(){for(var a=A(document,"pc8080","serial"),b=0;b>>d.w.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.w?e.V[h].bc(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&&ze(a,c);mc(this.b,!0)}};function X(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.Y: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=na(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.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.W;break;case 10:c=J(d);break;case 6:c=d.X(J(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=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=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(X(this.b.N).G));if(this.oa&1073741824)this.Fa.push(a);else if(!this.Aa||a!=this.Aa)if(this.Aa=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.$a+"."+(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):""))} -function oe(a){var b;if(gd(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.Ua=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.w;f.V[e>>>f.la].Ua(e&f.w,a==this.I)}}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.la],b==a.I));g.Ma||oe(a);break}}return f}function pf(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==me?"$":"0x")+u);x=u}else v& -16?(x=(q&3840)>>8,v=te[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 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]],we={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=me.prototype; +m.Na=function(a,b,c,d){this.B=b;this.b=c;this.w=a;(a=jc(a,"messages"))&&qe(this,a);this.Sa=ve;xe(this,function(a){a:{var b=d.B.W,c=a[0],g=a=0,k=b.length;if(c){a=ye(ze(d,c));if(-1===a){d.g("invalid address: "+c);break a}g=a>>>d.B.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=yb[c],p&&d.g(n(p.id)+" %"+n(g<>>e.la;f!=e.B?e.W[h].cc(f,b&65535,d):(e.W[h++].Gb(f,b&255,d),e.W[h&e.M].Gb(0,b>>8&255,d+1));c&&Ae(a,c);nc(this.b,!0)}};function X(a){return{G:a,Ma:!1}}function Be(a){return[a.G,a.Ma]}function Ce(a){return{G:a[0],Ma:a[1]}} +function ze(a,b,c){var d;c=(c?a.P:a.bb).G;if(void 0!==b){d=b=De(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=oa(ue,a.substr(b,1))));return c}function Je(a,b){var c=0,d=Ke(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 Ke(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=Oc(d);break;case 2:c=d.T;break;case 3:c=d.U;break;case 9:c=Qc(d);break;case 4:c=d.V;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=Nc(d);break;case 14:c=Nc(d)&255|d.j<<8}}return c} +function Le(a,b){b=De(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=Ie(b,c+1),0<=e&&(b=b.substr(0,c)+Je(a,e)+b.substr(c+1+ue[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=ze(a,e))?(d=e+' "'+He(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=ze(a,e))?(Ae(d),d=e+' "'+ +He(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).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;nc(c)}}; +function gb(a,b,c,d,e,f,h,g){g|=256;null!=f&&(a.oa&g)!=g||a.message(b.ab+"."+(null!=d?"outPort":"inPort")+"("+r(c)+","+(f?f:"unknown")+(null!=d?","+ca(d):"")+")"+(null!=h?": "+ca(h):"")+(null!=e?" at "+Z(e):""))} +function pe(a){var b;if(hd(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||of(this,a,b,!1,!0);if(a!=this.A){var e=ye(b);if(-1===e)this.g("invalid address: "+Z(b.G)),d=!1;else{var f=this.B;f.W[e>>>f.la].Va(e&f.B,a==this.I)}}d&&(a.push(b),c?b.Ma=!0:(pf(this,a,a.length-1,"set"),pe(this)));return d}; +function of(a,b,c,d,e){var f=!1;c=ye(c);for(var h=1;h>>d.la],b==a.I));g.Ma||pe(a);break}}return f}function qf(a,b){for(var c=1;c>24,4);break;case 3:v=n(x.Qa(B,2),4);break;default:x="imm("+r(w)+")";break a}8086==x.style&&w&64?v="["+v+"]":w&16||(v=(x.style==ne?"$":"0x")+v);x=v}else w& +16?(x=(q&3840)>>8,w=ue[x],8086==a.style&&q&64&&(6==x&&(w="HL"),w="["+w+"]"),x=w):w&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 xf(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.ma[b]);var c=0;for(b in a.ma)yf(a,b,a.ma[b]),c++;return 0b[0]?1:a[0]>>0;for(b=0;b>>0,g=f.vd;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.W=g&255;break;case "SP":d.ia=g&65535;break;case "PC":G(d,g);a.Y=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(uf(a));c&&(a.Y=X(d.N),Ne(a,Z(a.Y.G)))}}function Gf(a,b){b=ja(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.Y=b;e-=b.G-k;c++}}} -function Fe(a,b,c,d){if(c)if(b){0>a.F&&a.B.length&&(a.F=0);if(0>a.F||b!=a.B[a.F])a.B.splice(0,0,b),a.F=0;a.F--}else a.fa?b="end":b=a.B[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 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.Y=a.ea,a.fa=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.Aa=null;if(kb(a)&&0l||"z"Da.length&&(a.g("note: only "+Da.length+" available"),fa=Da.length);aa-=fa;0>aa&&(null==Da[Da.length-1].G?(fa=aa+fa,aa=0):aa+=Da.length); -var jd=[];"call"==Ue&&(nb=1E5,jd=["CALL"]);for(void 0!==Te&&a.g(fa+" instructions earlier:");0=Da.length&&(aa=0);a.eb=fa;We++;nb--}}We||(a.g("no "+Ve+"history available"),a.eb=void 0)}else{var qc=ye(a,Ba);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+=Ba+" "+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.X,af=a.qa;"ew"==f[0]&&(wc=2,Ze=65535,$e=a.Pa,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.Pa(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.Y)){this.I=new H(this,"1.23.3","failsafe");Nf(this.I)&&(Wf(this,d),a=2,Kf(this.I));I(this.I,"timestamp",ma());Lf(this.I);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=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.Y;delete this.Z}e=cb(this.id);for(f=0;fa[1];a=a[2];this.ra=!0;this.D.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.I&&(this.I.clear(),delete this.I);this.B=0}; -function Wf(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.A||"",d=b.toString(),e={app:"PC8080",ver:"1.23.3"};e.url=a.na;e.user=c;e.type="bug";e.data=d;oa("http://www.pcjs.org/api/v1/report",e,!0)}} -function If(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new H(a,"1.23.3"),h=new H(a,"1.23.3","validate"),g=ma();I(h,"timestamp",g);I(f,"timestamp",g);I(f,"version","1.23.3");I(f,"url",window?window.location.href:null);I(f,"browser",qa());a.b&&a.b.Da&&(c&&a.b.ka(),d=a.b.Da(b,c),"object"===typeof d&&I(f,a.b.id,d),c&&(a.b.D.sa=!1,!1===d&&(e=null)));for(var g=cb(a.id),k=0;k>>f.la;0>8|(u&255)<<8);p>K&z;ee(d,d.jc,p++,q,Y);K+=v}p>y&&(y=p);q=h&&(h=q+1)}g+=2;l++;if(p>=d.J&&(p=0,q++,q>d.Z))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]*/, -"");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&&B(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ha(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(y){f(y.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(ea(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?oa(b,null,!0,function(a,b){tg(b,d)}):tg(null,d)}else t("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=da(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=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=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 Ee(a,b,c){var d;if(b){b=De(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 Af(a,b){if(b)return zf(a,b,a.ma[b]);var c=0;for(b in a.ma)zf(a,b,a.ma[b]),c++;return 0b[0]?1:a[0]>>0;for(b=0;b>>0,g=f.wd;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":G(d,g);a.P=X(d.N);break;case "PS":Lc(d,g);break;case "PSW":Lc(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?Vc(d)||(d.ca^=1):Vc(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?Yc(d)||(d.ca^=192):Yc(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}nc(d);a.g("updated registers:")}a.g(vf(a));c&&(a.P=X(d.N),Oe(a,Z(a.P.G)))}}function Hf(a,b){b=ka(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(Le(a,c[2])):Ee(a,b,!0)}function If(a,b,c){var d="t"!=b;c=yf(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);za(c,function(){return jb(a,!0)&&a.rb(e,d,!1)},function(){nc(a.b);jb(a,!1)})} +function Oe(a,b,c,d){if(b=ze(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=ze(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=sf(a,b,h,f);a.g(f);a.P=b;e-=b.G-k;c++}}} +function Ge(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 rf(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(lb(a)&&0l||"z"Da.length&&(a.g("note: only "+Da.length+" available"),fa=Da.length);aa-=fa;0>aa&&(null==Da[Da.length-1].G?(fa=aa+fa,aa=0):aa+=Da.length); +var kd=[];"call"==Ve&&(ob=1E5,kd=["CALL"]);for(void 0!==Ue&&a.g(fa+" instructions earlier:");0=Da.length&&(aa=0);a.eb=fa;Xe++;ob--}}Xe||(a.g("no "+We+"history available"),a.eb=void 0)}else{var rc=ze(a,Ba);if(rc){var sc=0;Xa&&("l"==Xa.charAt(0)&&(Xa=Xa.substr(1)||cg),sc=yf(a,Xa)>>>0,65536>4||1;eg--&&0wc?String.fromCharCode(wc):".";uc--}Ya&&(Ya+="\n");Ya+=Ba+" "+Pb+(0==Ob?" "+md:"")}Ya&&a.g(Ya);a.bb=rc}}}}break;case "e":if("else"==f[0])break;var xc=1,$e=255,af=a.Y,bf=a.qa;"ew"==f[0]&&(xc=2,$e=65535,af=a.Qa,bf=a.Rb);var cf=xc<<1,df=f[1];if(null== +df)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 yc=ze(a,df);if(yc)for(var zc=2;zctd;){for(var Za=null,kg=256;65536>Sb.G>>>0;){ff.G=a.Qa(Sb,2);if(null==Sb.G||!kg--)break;for(var lg=a,Bc=ff,gf=null,Tb=Bc.G,hf=Tb,ud=1;6>=ud&&Tb;ud++){if(2\nLicense: GPL version 3 or later ");for(b=0;bSf){if(Of(d,this.P)){this.I=new H(this,"1.23.3","failsafe");Of(this.I)&&(Xf(this,d),a=2,Lf(this.I));I(this.I,"timestamp",na());Mf(this.I);var e=this.w&&!this.M;if(1==a||ta("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=Nf(d)){var f=Pf(d,"code"),h=Pf(d,"data");f&&("ok"==f?Of(d,h):("error"==f&& +"no machine state"!=h?(this.ga("Error: "+h),"unable to verify user"==h&&(xa("user",""),this.A=null)):this.g(f+": "+h),Lf(d),Of(d)?(c=Nf(d),e=!0):c=!1))}e&&Wf(this,c?d:null)}else 2==a&&d.clear()}else Wf(this);delete this.P;delete this.Z}e=db(this.id);for(f=0;fa[1];a=a[2];this.ra=!0;this.C.sa=!0;var d=this.K.power;d&&(d.textContent="Shutdown");this.b&&(Yf(this,this.b,b,c,a),oc(this.b));this.ea&&(Xf(this,b),b.clear());!c&&this.I&&(this.I.clear(),delete this.I);this.D=0}; +function Xf(a,b){if(ta("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 Jf(a,b,c){var d,e="none";if(a.D)return null;a.D--;var f=new H(a,"1.23.3"),h=new H(a,"1.23.3","validate"),g=na();I(h,"timestamp",g);I(f,"timestamp",g);I(f,"version","1.23.3");I(f,"url",window?window.location.href:null);I(f,"browser",ra());a.b&&a.b.Da&&(c&&a.b.ka(),d=a.b.Da(b,c),"object"===typeof d&&I(f,a.b.id,d),c&&(a.b.C.sa=!1,!1===d&&(e=null)));for(var g=db(a.id),k=0;k>>f.la;0>8|(v&255)<<8);p>K&B;fe(d,d.lc,p++,q,Y);K+=w}p>y&&(y=p);q=h&&(h=q+1)}g+=2;l++;if(p>=d.J&&(p=0,q++,q>d.ba))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+"...");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);rg(a,b,c)}})}else c(a,null)} +function sg(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&&(--ag||Na(!0));k=!1}var h,g,k=!0;ag++;bb[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?bg(c,null,null,!1,e,function(d,k){if(k)if(cb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=g.transformNode(k);l?(h.outerHTML=l,--ag||Na(!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),--ag||Na(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?bg(b,a,d,!0,e,l):qg(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){Na(!1);return sg(a,b,c,d)};window.enableEvents=Na;window.sendEvent=Oa; +function tg(a,b,c,d){if(!c&&b){d.push(b);a=bb[d[0]];b=null;for(var e in a)if(ga(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?pa(b,null,!0,function(a,b){ug(b,d)}):ug(null,d)}else t("Error ("+c+") requesting "+a)} +function ug(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=bb[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 y=d[2];y&&(g[y]||(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=ya("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+='