From a56f1cfde1da94222b65ee9c6b7b33f48bf11ddd Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Mon, 2 May 2016 12:54:55 -0700 Subject: [PATCH] The 8080 CPU goes through the Bus interfaces for all memory accesses now. The PCjs CPU maintained its own copy of Bus memory structures and interfaces, partly for improved performance but also because some CPUs can turn on address translation (ie, paging), making separate interfaces a necessity. However, PC8080 has much lower performance requirements and no address translation requirements, so we should revert to the original Bus interfaces. --- modules/pc8080/lib/bus.js | 65 +++-- modules/pc8080/lib/cpusim.js | 81 +----- modules/pc8080/lib/debugger.js | 38 +-- modules/pc8080/lib/video.js | 14 +- versions/pc8080/1.22.0/pc8080-dbg.js | 366 +++++++++++++-------------- versions/pc8080/1.22.0/pc8080.js | 246 +++++++++--------- 6 files changed, 376 insertions(+), 434 deletions(-) diff --git a/modules/pc8080/lib/bus.js b/modules/pc8080/lib/bus.js index 6fb9714d4..763e0d6ef 100644 --- a/modules/pc8080/lib/bus.js +++ b/modules/pc8080/lib/bus.js @@ -135,7 +135,7 @@ function Bus(parmsBus, cpu, dbg) * [0]: registered function to call for every I/O access * * The registered function is called with the port address, and if the access was triggered by the CPU, - * the linear instruction pointer (LIP) at the point of access. + * the instruction pointer (IP) at the point of access. * * WARNING: Unlike the (old) read and write memory notification functions, these support only one * pair of input/output functions per port. A more sophisticated architecture could support a list @@ -225,7 +225,6 @@ Bus.prototype.initMemory = function() for (var iBlock = 0; iBlock < this.nBlockTotal; iBlock++) { this.aMemBlocks[iBlock] = block; } - this.cpu.initMemory(this.aMemBlocks, this.nBlockShift, this.nBusMask); }; /** @@ -492,8 +491,6 @@ Bus.prototype.setMemoryBlocks = function(addr, size, aBlocks, type) /** * getByte(addr) * - * For physical addresses only; for linear addresses, use cpu.getByte(). - * * @this {Bus} * @param {number} addr is a physical address * @return {number} byte (8-bit) value at that address @@ -520,8 +517,6 @@ Bus.prototype.getByteDirect = function(addr) /** * getShort(addr) * - * For physical addresses only; for linear addresses, use cpu.getShort(). - * * @this {Bus} * @param {number} addr is a physical address * @return {number} word (16-bit) value at that address @@ -558,8 +553,6 @@ Bus.prototype.getShortDirect = function(addr) /** * setByte(addr, b) * - * For physical addresses only; for linear addresses, use cpu.setByte(). - * * @this {Bus} * @param {number} addr is a physical address * @param {number} b is the byte (8-bit) value to write (we truncate it to 8 bits to be safe) @@ -587,8 +580,6 @@ Bus.prototype.setByteDirect = function(addr, b) /** * setShort(addr, w) * - * For physical addresses only; for linear addresses, use cpu.setShort(). - * * @this {Bus} * @param {number} addr is a physical address * @param {number} w is the word (16-bit) value to write (we truncate it to 16 bits to be safe) @@ -627,6 +618,36 @@ Bus.prototype.setShortDirect = function(addr, w) this.aMemBlocks[iBlock & this.nBlockMask].writeByteDirect(0, (w >> 8) & 0xff, addr + 1); }; +/** + * addMemBreak(addr, fWrite) + * + * @this {Bus} + * @param {number} addr + * @param {boolean} fWrite is true for a memory write breakpoint, false for a memory read breakpoint + */ +Bus.prototype.addMemBreak = function(addr, fWrite) +{ + if (DEBUGGER) { + var iBlock = addr >>> this.nBlockShift; + this.aMemBlocks[iBlock].addBreakpoint(addr & this.nBlockLimit, fWrite); + } +}; + +/** + * removeMemBreak(addr, fWrite) + * + * @this {Bus} + * @param {number} addr + * @param {boolean} fWrite is true for a memory write breakpoint, false for a memory read breakpoint + */ +Bus.prototype.removeMemBreak = function(addr, fWrite) +{ + if (DEBUGGER) { + var iBlock = addr >>> this.nBlockShift; + this.aMemBlocks[iBlock].removeBreakpoint(addr & this.nBlockLimit, fWrite); + } +}; + /** * saveMemory(fAll) * @@ -745,7 +766,7 @@ Bus.prototype.addPortInputBreak = function(port) * @this {Bus} * @param {number} start port address * @param {number} end port address - * @param {function(number,number)} fn is called with the port and LIP values at the time of the input + * @param {function(number,number)} fn is called with the port and IP values at the time of the input */ Bus.prototype.addPortInputNotify = function(start, end, fn) { @@ -794,18 +815,18 @@ Bus.prototype.addPortInputWidth = function(port, size) }; /** - * checkPortInputNotify(port, size, addrLIP) + * checkPortInputNotify(port, size, addrIP) * * @this {Bus} * @param {number} port * @param {number} size (1, 2 or 4) - * @param {number} [addrLIP] is the LIP value at the time of the input + * @param {number} [addrIP] is the IP value at the time of the input * @return {number} simulated port data * * NOTE: It seems that parts of the ROM BIOS (like the RS-232 probes around F000:E5D7 in the 5150 BIOS) * assume that ports for non-existent hardware return 0xff rather than 0x00, hence my new default (0xff) below. */ -Bus.prototype.checkPortInputNotify = function(port, size, addrLIP) +Bus.prototype.checkPortInputNotify = function(port, size, addrIP) { var data = 0, shift = 0; @@ -827,7 +848,7 @@ Bus.prototype.checkPortInputNotify = function(port, size, addrLIP) if (aNotify !== undefined) { if (aNotify[0]) { - dataPort = aNotify[0](port, addrLIP); + dataPort = aNotify[0](port, addrIP); if (dataPort === undefined) { dataPort = maskPort; } else { @@ -840,7 +861,7 @@ Bus.prototype.checkPortInputNotify = function(port, size, addrLIP) } else { if (DEBUGGER && this.dbg) { - this.dbg.messageIO(this, port, null, addrLIP); + this.dbg.messageIO(this, port, null, addrIP); if (this.fPortInputBreakAll) this.dbg.checkPortInput(port, size, dataPort); } } @@ -902,7 +923,7 @@ Bus.prototype.addPortOutputBreak = function(port) * @this {Bus} * @param {number} start port address * @param {number} end port address - * @param {function(number,number)} fn is called with the port and LIP values at the time of the output + * @param {function(number,number)} fn is called with the port and IP values at the time of the output */ Bus.prototype.addPortOutputNotify = function(start, end, fn) { @@ -951,15 +972,15 @@ Bus.prototype.addPortOutputWidth = function(port, size) }; /** - * checkPortOutputNotify(port, size, data, addrLIP) + * checkPortOutputNotify(port, size, data, addrIP) * * @this {Bus} * @param {number} port * @param {number} size * @param {number} data - * @param {number} [addrLIP] is the LIP value at the time of the output + * @param {number} [addrIP] is the IP value at the time of the output */ -Bus.prototype.checkPortOutputNotify = function(port, size, data, addrLIP) +Bus.prototype.checkPortOutputNotify = function(port, size, data, addrIP) { var shift = 0; @@ -981,7 +1002,7 @@ Bus.prototype.checkPortOutputNotify = function(port, size, data, addrLIP) if (aNotify !== undefined) { if (aNotify[0]) { - aNotify[0](port, dataPort, addrLIP); + aNotify[0](port, dataPort, addrIP); } if (DEBUGGER && this.dbg && this.fPortOutputBreakAll != aNotify[1]) { this.dbg.checkPortOutput(port, size, dataPort); @@ -989,7 +1010,7 @@ Bus.prototype.checkPortOutputNotify = function(port, size, data, addrLIP) } else { if (DEBUGGER && this.dbg) { - this.dbg.messageIO(this, port, dataPort, addrLIP); + this.dbg.messageIO(this, port, dataPort, addrIP); if (this.fPortOutputBreakAll) this.dbg.checkPortOutput(port, size, dataPort); } } diff --git a/modules/pc8080/lib/cpusim.js b/modules/pc8080/lib/cpusim.js index ceca098d8..2bc94d7fc 100644 --- a/modules/pc8080/lib/cpusim.js +++ b/modules/pc8080/lib/cpusim.js @@ -92,14 +92,6 @@ function CPUSim(parmsCPU) */ this.cLiveRegs = 0; - /* - * We're just declaring aBusBlocks and associated Bus parameters here; they'll be initialized by initMemory() - * when the Bus is initialized. - */ - this.aBusBlocks = []; - this.nBusMask = 0; - this.nBlockShift = this.nBlockSize = this.nBlockLimit = this.nBlockTotal = this.nBlockMask = 0; - /* * Array of halt handlers, if any (see addHaltCheck) */ @@ -115,27 +107,6 @@ function CPUSim(parmsCPU) Component.subclass(CPUSim, CPU); -/** - * initMemory(aBusBlocks, nBlockShift, nBusMask) - * - * Notification from Bus.initMemory(), giving us direct access to the entire memory space. - * - * @this {CPUSim} - * @param {Array} aBusBlocks - * @param {number} nBlockShift - * @param {number} nBusMask - */ -CPUSim.prototype.initMemory = function(aBusBlocks, nBlockShift, nBusMask) -{ - this.aBusBlocks = aBusBlocks; - this.nBlockShift = nBlockShift; - this.nBlockSize = 1 << this.nBlockShift; - this.nBlockLimit = this.nBlockSize - 1; - this.nBlockTotal = aBusBlocks.length; - this.nBlockMask = this.nBlockTotal - 1; - this.nBusMask = nBusMask; -}; - /** * addHaltCheck(fn) * @@ -149,36 +120,6 @@ CPUSim.prototype.addHaltCheck = function(fn) this.afnHalt.push(fn); }; -/** - * addMemBreak(addr, fWrite) - * - * @this {CPUSim} - * @param {number} addr - * @param {boolean} fWrite is true for a memory write breakpoint, false for a memory read breakpoint - */ -CPUSim.prototype.addMemBreak = function(addr, fWrite) -{ - if (DEBUGGER) { - var iBlock = addr >>> this.nBlockShift; - this.aBusBlocks[iBlock].addBreakpoint(addr & this.nBlockLimit, fWrite); - } -}; - -/** - * removeMemBreak(addr, fWrite) - * - * @this {CPUSim} - * @param {number} addr - * @param {boolean} fWrite is true for a memory write breakpoint, false for a memory read breakpoint - */ -CPUSim.prototype.removeMemBreak = function(addr, fWrite) -{ - if (DEBUGGER) { - var iBlock = addr >>> this.nBlockShift; - this.aBusBlocks[iBlock].removeBreakpoint(addr & this.nBlockLimit, fWrite); - } -}; - /** * initProcessor() * @@ -889,7 +830,7 @@ CPUSim.prototype.xorByte = function(src) */ CPUSim.prototype.getByte = function(addr) { - return this.aBusBlocks[(addr & this.nBusMask) >>> this.nBlockShift].readByte(addr & this.nBlockLimit, addr); + return this.bus.getByte(addr); }; /** @@ -901,14 +842,7 @@ CPUSim.prototype.getByte = function(addr) */ CPUSim.prototype.getWord = function(addr) { - var off = addr & this.nBlockLimit; - var iBlock = (addr & this.nBusMask) >>> this.nBlockShift; - if (off < this.nBlockLimit) { - return this.aBusBlocks[iBlock].readShort(off, addr); - } - var w = this.aBusBlocks[iBlock].readByte(off, addr); - w |= this.aBusBlocks[(iBlock + 1) & this.nBlockMask].readByte(0, addr + 1) << 8; - return w; + return this.bus.getShort(addr); }; /** @@ -920,7 +854,7 @@ CPUSim.prototype.getWord = function(addr) */ CPUSim.prototype.setByte = function(addr, b) { - this.aBusBlocks[(addr & this.nBusMask) >>> this.nBlockShift].writeByte(addr & this.nBlockLimit, b & 0xff, addr); + this.bus.setByte(addr, b); }; /** @@ -932,14 +866,7 @@ CPUSim.prototype.setByte = function(addr, b) */ CPUSim.prototype.setWord = function(addr, w) { - var off = addr & this.nBlockLimit; - var iBlock = (addr & this.nBusMask) >>> this.nBlockShift; - if (off < this.nBlockLimit) { - this.aBusBlocks[iBlock].writeShort(off, w & 0xffff, addr); - return; - } - this.aBusBlocks[iBlock++].writeByte(off, w & 0xff, addr); - this.aBusBlocks[iBlock & this.nBlockMask].writeByte(0, (w >> 8) & 0xff, addr + 1); + this.bus.setShort(addr, w); }; /** diff --git a/modules/pc8080/lib/debugger.js b/modules/pc8080/lib/debugger.js index 332183a8e..e58ea61e9 100644 --- a/modules/pc8080/lib/debugger.js +++ b/modules/pc8080/lib/debugger.js @@ -1114,14 +1114,13 @@ if (DEBUGGER) { }; /** - * dumpBlocks(aBlocks, sAddr, fLinear) + * dumpBlocks(aBlocks, sAddr) * * @this {Debugger} * @param {Array} aBlocks * @param {string} [sAddr] (optional block address) - * @param {boolean} [fLinear] (true if linear, physical otherwise) */ - Debugger.prototype.dumpBlocks = function(aBlocks, sAddr, fLinear) + Debugger.prototype.dumpBlocks = function(aBlocks, sAddr) { var addr = 0, i = 0, n = aBlocks.length; @@ -1131,11 +1130,11 @@ if (DEBUGGER) { this.println("invalid address: " + sAddr); return; } - i = addr >>> this.cpu.nBlockShift; + i = addr >>> this.bus.nBlockShift; n = 1; } - this.println("blockid " + (fLinear? "linear " : "physical") + " blockaddr used size type"); + this.println("blockid physical blockaddr used size type"); this.println("-------- --------- ---------- ------ ------ ----"); var typePrev = -1, cPrev = 0; @@ -1147,12 +1146,12 @@ if (DEBUGGER) { typePrev = block.type; var sType = Memory.TYPE.NAMES[typePrev]; if (block) { - this.println(str.toHex(block.id) + " %" + str.toHex(i << this.cpu.nBlockShift) + " %%" + str.toHex(block.addr) + " " + str.toHexWord(block.used) + " " + str.toHexWord(block.size) + " " + sType); + this.println(str.toHex(block.id) + " %" + str.toHex(i << this.bus.nBlockShift) + " %%" + str.toHex(block.addr) + " " + str.toHexWord(block.used) + " " + str.toHexWord(block.size) + " " + sType); } if (typePrev != Memory.TYPE.NONE) typePrev = -1; cPrev = 0; } - addr += this.cpu.nBlockSize; + addr += this.bus.nBlockSize; i++; } }; @@ -1167,20 +1166,7 @@ if (DEBUGGER) { */ Debugger.prototype.dumpBus = function(asArgs) { - this.dumpBlocks(this.cpu.aBusBlocks, asArgs[0]); - }; - - /** - * dumpMem(asArgs) - * - * Dumps page allocations. - * - * @this {Debugger} - * @param {Array.} asArgs (asArgs[0] is an optional block address) - */ - Debugger.prototype.dumpMem = function(asArgs) - { - this.dumpBlocks(this.cpu.aMemBlocks, asArgs[0], this.cpu.aMemBlocks !== this.cpu.aBusBlocks); + this.dumpBlocks(this.bus.aMemBlocks, asArgs[0]); }; /** @@ -2122,14 +2108,14 @@ if (DEBUGGER) { if (this.aBreakRead !== undefined) { for (i = 1; i < this.aBreakRead.length; i++) { dbgAddr = this.aBreakRead[i]; - this.cpu.removeMemBreak(this.getAddr(dbgAddr), false); + this.bus.removeMemBreak(this.getAddr(dbgAddr), false); } } this.aBreakRead = ["br"]; if (this.aBreakWrite !== undefined) { for (i = 1; i < this.aBreakWrite.length; i++) { dbgAddr = this.aBreakWrite[i]; - this.cpu.removeMemBreak(this.getAddr(dbgAddr), true); + this.bus.removeMemBreak(this.getAddr(dbgAddr), true); } } this.aBreakWrite = ["bw"]; @@ -2192,7 +2178,7 @@ if (DEBUGGER) { this.println("invalid address: " + this.toHexAddr(dbgAddr)); fSuccess = false; } else { - this.cpu.addMemBreak(addr, aBreak == this.aBreakWrite); + this.bus.addMemBreak(addr, aBreak == this.aBreakWrite); } } @@ -2238,7 +2224,7 @@ if (DEBUGGER) { } aBreak.splice(i, 1); if (aBreak != this.aBreakExec) { - this.cpu.removeMemBreak(addr, aBreak == this.aBreakWrite); + this.bus.removeMemBreak(addr, aBreak == this.aBreakWrite); } /* * We'll mirror the logic in addBreakpoint() and leave the history buffer alone if this @@ -2275,8 +2261,6 @@ if (DEBUGGER) { /** * printBreakpoint(aBreak, i, sAction) * - * TODO: We may need to start printing linear addresses also (if any), because segmented address can be ambiguous. - * * @this {Debugger} * @param {Array} aBreak * @param {number} i diff --git a/modules/pc8080/lib/video.js b/modules/pc8080/lib/video.js index e2e4d0388..1290702df 100644 --- a/modules/pc8080/lib/video.js +++ b/modules/pc8080/lib/video.js @@ -56,14 +56,24 @@ if (NODE) { * bufferCols: the width of a single frame buffer row, in pixels (eg, 256) * bufferRows: the number of frame buffer rows (eg, 224) * bufferBits: the number of bits per pixel (default is 1 if omitted) - * interruptRate: normally the same as (or some multiple of) the refreshRate (eg, 120) - * refreshRate: how many times updateScreen() should be called per second (eg, 60) + * interruptRate: normally the same as (or some multiple of) refreshRate (eg, 120) + * refreshRate: how many times updateScreen() should be performed per second (eg, 60) * * We record all the above values now, but we defer creation of the frame buffer until our initBus() * handler is called. At that point, we will also compute the extent of the frame buffer, determine the * appropriate "cell" size (ie, the number of pixels that updateScreen() will fetch and process at once), * and allocate our cell cache. * + * Why interruptRate in addition to refreshRate? A higher interrupt rate is required for Space Invaders, + * because even though the CRT refreshes at 60Hz, the CRT controller interrupts the CPU *twice* per + * refresh (once after the top half of the screen has been redrawn, and again after the bottom half has + * been redrawn), so we need an interrupt rate of 120Hz. We pass the higher rate on to the CPU, so that + * it will call updateScreen() more frequently, but we limit our screen updates to every *other* call. + * + * TODO: Consider alternatives to screenRotation; it's expedient, but I'm not sure how efficient it is, + * and it might be nice (especially for debugging) if we created our own rotated image buffer which we could + * then blast directly to the screen canvas. + * * @constructor * @extends Component * @param {Object} parmsVideo diff --git a/versions/pc8080/1.22.0/pc8080-dbg.js b/versions/pc8080/1.22.0/pc8080-dbg.js index 6eb276555..5f63c7454 100644 --- a/versions/pc8080/1.22.0/pc8080-dbg.js +++ b/versions/pc8080/1.22.0/pc8080-dbg.js @@ -1,206 +1,206 @@ (function(){var m;function aa(a,b){var c;if(a){b||(b=16);if("$"==a.charAt(0))b=16,a=a.substr(1);else if("0x"==a.substr(0,2))b=16,a=a.substr(2);else{var d=a.charAt(a.length-1).toLowerCase();"h"==d?(b=16,d=null):"."==d&&(b=10,d=null);null==d&&(a=a.substr(0,a.length-1))}var e,d=a,f=b;(f&&10!=f?16==f?null!==d.match(/^[0-9a-f]+$/i):2==f&&null!==d.match(/^[01]+$/i):null!==d.match(/^[0-9]+$/))&&!isNaN(e=parseInt(a,b))&&(c=e|0)}return c} -function q(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"+q(a,4)}function ba(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0=d?48:55),c=String.fromCharCode(d)+c;a>>=4}return c}function r(a){return"0x"+q(a,4)}function ca(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function ga(a){return a.replace(/[&<>"']/g,function(a){return fa[a]})}function ha(a,b){return(a+" ").slice(0,b)}function ia(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} function ja(a,b,c){var d=0,e=a.length,f=0;for(void 0===c&&(c=function(a,b){return a>b?1:a>1,g;g=c(b,a[h]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function ma(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;c=this.M?10:20>=this.M?12:24>=this.M?14:15;this.la=1<>2;this.D=this.la-1;this.K=this.X/this.la|0;this.V=this.K-1;this.w=[];this.u=[];this.H=this.J=!1;this.ba=[];this.ca=[];a=new F;qb(a,this.F);this.B=Array(this.K);for(b=0;b>>a.aa;0c&&(g=c);if(f&&f.size){if(f.type==d){if(b+c<=f.C)return f.kb+=f.C-b,f.C=b,!0;if(b>=f.C+f.kb){g=f.size-(b-h);g>c&&(g=c);f.kb=b-f.C+g;b=h+a.la;c-=g;e++;continue}}return sb(1,b,c)}b=new F(b,g,a.la,d);qb(b,a.F,f);a.B[e++]=b;b=h+a.la;c-=g}return 0>=c?!0:sb(2,b,c)} -pb.prototype.W=function(a){return this.B[(a&this.G)>>>this.aa].Ka(a&this.D,a)};function tb(a,b){return a.B[(b&a.G)>>>a.aa].ib(b&a.D,b)}function ub(a,b){var c=b&a.D,d=(b&a.G)>>>a.aa;return c!=a.D?a.B[d].yb(c,b):a.B[d++].ib(c,b)|a.B[d&a.V].ib(0,b+1)<<8}function vb(a,b,c){a.B[(b&a.G)>>>a.aa].lb(b&a.D,c&255,b)}function wb(a,b){if(void 0===b)return a.H=!a.H,a.H;void 0===a.w[b]&&(a.w[b]=[null,!1]);a.w[b][1]=!a.w[b][1];return a.w[b][1]} -function xb(a,b,c){for(var d=1,e=0,f=0;0>>=f)&l;if(void 0!==h){if(h[0])h[0](b,l,d);a.F&&a.J!=h[1]&&Jb(a.F,b,l)}else a.F&&(eb(a.F,a,b,l,d),a.J&&Jb(a.F,b,l));f+=g<<3;b+=g;e-=g}}function sb(a,b,c){t("Memory block error ("+a+": "+q(b)+","+q(c)+")");return!1}var Kb;if(kb){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=Nb+=2;this.b=null;this.C=a;this.kb=b;this.size=c||0;this.type=d||Ob;this.w=d==Pb;qb(this);this.va=this.Jb=!1;if(c)if(kb)this.G=new ArrayBuffer(c),this.H=new DataView(this.G,0,c),this.B=new Uint8Array(this.G,0,c),this.K=new Uint16Array(this.G,0,c>>1),this.b=new Int32Array(this.G,0,c>>2),Qb(this,Mb?Rb:Sb);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},ca:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ra: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},Da: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.va=!0},Z:function(a,b){if(this.F&&null!=this.C){var c=this.F;Yb(c,this.C+a,1,c.ba)&&c.ea(!0)}return this.ib(a,b)},ja:function(a,b){if(this.F&&null!=this.C){var c=this.F;Yb(c,this.C+a,2,c.ba)&&c.ea(!0)}return this.yb(a,b)},Aa:function(a,b,c){if(this.F&&null!=this.C){var d=this.F;Yb(d,this.C+a,1,d.H)&&d.ea(!0)}this.w?this.D(a,b,c):this.lb(a,b,c)},Ma:function(a, -b,c){if(this.F&&null!=this.C){var d=this.F;Yb(d,this.C+a,2,d.H)&&d.ea(!0)}this.w?this.D(a,b,c):this.zb(a,b,c)},X:function(a){return this.B[a]},ba:function(a){return this.B[a]},fa:function(a){return this.H.getUint16(a,!0)},ma:function(a){return a&1?this.B[a]|this.B[a+1]<<8:this.K[a>>1]},ua:function(a,b){this.B[a]=b;this.va=!0},Ca:function(a,b){this.B[a]=b;this.va=!0},Ea:function(a,b){this.H.setUint16(a,b,!0);this.va=!0},$a:function(a,b){a&1?(this.B[a]=b,this.B[a+1]=b>>8):this.K[a>>1]=b;this.va=!0}}; -function qb(a,b,c){a.F=b;a.U=a.u=0;c&&((a.U=c.U)&&Xb(a,Wb,!1),(a.u=c.u)&&Vb(a,Wb,!1))}function Zb(a,b){b?0===--a.u&&(a.Za=a.w?a.D:a.lb,a.Ub=a.w?a.J:a.zb):0===--a.U&&(a.Ka=a.ib,a.Sb=a.yb)}function Vb(a,b,c){c&&a.u||(a.Za=!a.w&&b[2]||a.D,a.Ub=!a.w&&b[3]||a.J);if(c||void 0===c)a.lb=b[2]||a.D,a.zb=b[3]||a.J}function Xb(a,b,c){c&&a.U||(a.Ka=b[0]||a.M,a.Sb=b[1]||a.V);if(c||void 0===c)a.ib=b[0]||a.M,a.yb=b[1]||a.V}function Qb(a,b){b||(b=$b);Xb(a,b,void 0);Vb(a,b,void 0)} -var $b=[],Tb=[F.prototype.ca,F.prototype.ra,F.prototype.Da,F.prototype.ab],Wb=[F.prototype.Z,F.prototype.ja,F.prototype.Aa,F.prototype.Ma];if(kb)var Sb=[F.prototype.X,F.prototype.fa,F.prototype.ua,F.prototype.Ea],Rb=[F.prototype.ba,F.prototype.ma,F.prototype.Ca,F.prototype.$a]; -function ac(a,b){v.call(this,"CPU",a,ac,1);var c=a.cycles||b,d=a.multiplier||1;this.i={};this.i.Xa=c;this.i.qb=0;this.i.Ja=d;this.i.vb=Math.round(this.i.Xa/1E4)/100;this.i.Ha=this.i.vb*this.i.Ja;this.A.ka=!1;this.A.ub=!1;this.A.Ib=a.autoStart;this.A.Kb=!1;this.A.Oa=!1;this.i.bb=this.i.Ua=0;this.i.cb=a.csStart;this.i.Ta=a.csInterval;this.i.Va=a.csStop;this.ja=this.La.bind(this);E(this)}z(ac);var bc=["power","reset"];m=ac.prototype; -m.Ba=function(a,b,c,d){this.w=a;this.B=b;this.F=d;for(b=0;b=a.i.Ua&&(a.i.Ua+=a.i.Ta,c=!0);0<=a.i.Va&&a.i.Va<=uc(a)&&(a.i.Ta=a.i.Va=-1,pc(a),a.ea(),c=!0);c&&a.g(uc(a)+" cycles: checksum="+q(a.i.bb))}} -m.qa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.U[b]=c;a=!0;break;case "run":this.U[b]=c;c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.A.ha)a=!0;else{var b=null,c,g=Za(a.id);for(c=0;cc&&(c=2);var d=1;b&&1a.i.Ga/a.i.Ha?b=1:d=!0;a.i.Ja=b;b=a.i.vb*a.i.Ja;if(a.i.Ha!=b){a.i.Ha=b;b=a.i.Ha.toFixed(2)+"Mhz";var e=a.U.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.w&&a.w.jb()}wc(a,a.H);a.H=0;a.i.Sa=ka();a.i.Ia=0;xc(a);return d} -m.La=function(a){if(gb(this,!0)){if(!this.A.ka){vc(this);this.w&&this.w.start(this.i.Sa,uc(this));this.A.ka=!0;this.A.ub=!0;this.V&&this.V.start();var b=this.U.run;b&&(b.textContent="Halt");this.w&&(this.w.ta(!0),a&&this.w.jb(!0))}this.i.xb>=this.i.Xa&&xc(this,!0);this.i.gb=0;this.i.pb=ka();this.i.Ia&&(a=this.i.pb-this.i.Ia,a>this.i.Ob&&(this.i.Sa+=a,this.i.Sa>this.i.pb&&(this.i.Sa=this.i.pb)));try{do{var c=this.A.Oa?1:this.i.hc;try{this.Ya(c)}catch(e){if("number"!=typeof e)throw e;}var d=this.D- -this.b;this.H+=d;this.i.gb+=d;wc(this,0,!0);tc(this,d);this.i.fb-=d;0>=this.i.fb&&(this.i.fb+=this.i.Qb,this.w&&yc(this.w,this.i.qb++),this.i.qb>this.Aa&&(this.i.qb=0));this.i.eb-=d;0>=this.i.eb&&(this.i.eb+=this.i.Pb,this.w&&this.w.ta());this.i.Wa-=d;if(0>=this.i.Wa){this.i.Wa+=this.i.wb;break}}while(this.A.ka)}catch(e){this.ea();rc(this);this.w&&this.w.stop(ka(),uc(this));gb(this,!1);jb(this,e.stack||e.message);return}c=setTimeout;d=this.ja;this.i.Ia=ka();a=this.i.Ob;this.i.gb&&(a=Math.round(a* -this.i.gb/this.i.wb));a-=this.i.Ia-this.i.pb;if(b=this.i.Ia-this.i.Sa)this.i.Ga=Math.round(this.H/(10*b))/100,864E5<=b&&(this.J=0,vc(this));if(0>a||this.i.Ga>8&255;a.O=b&255}function Jc(a){return a.P<<8|a.R}function Kc(a,b){a.P=b>>8&255;a.R=b&255}function J(a){return a.S<<8|a.T} -function Lc(a,b){a.S=b>>8&255;a.T=b&255}function H(a,b){a.L=b&65535}function Mc(a){return a.I&256?1:0}function Nc(a){return lb[a.Y&255]?4:0}function Oc(a){return(a.Y^a.ia)&16?16:0}function Pc(a){return a.I&255?0:64}function Qc(a){return a.Y&128?128:0}function Fc(a){return a.pa&-214|Qc(a)|Pc(a)|Oc(a)|Nc(a)|Mc(a)}function Dc(a,b){a.I=a.Y=a.ia=0;b&1&&(a.I|=256);b&4||(a.Y|=1);b&16&&(a.ia|=16);b&64||(a.I|=255);b&128&&(a.Y^=192);a.pa=a.pa&-513|b&512|2} -function Rc(a,b){a.ia=a.j^b;return a.Y=(a.I=a.j+b)&255}function Sc(a,b){a.ia=a.j^b;return a.Y=(a.I=a.j+b+(a.I&256?1:0))&255}function Tc(a,b){a.I=a.Y=a.ia=a.j&b;(a.j|b)&8&&(a.ia^=16);return a.I}function kd(a,b){a.ia=b^255;b=a.Y=b+255&255;a.I=a.I&-256|b;return b}function ld(a,b){a.ia=b;b=a.Y=b+1&255;a.I=a.I&-256|b;return b}function md(a,b){return a.Y=a.I=a.ia=a.j|b}function K(a,b){b^=255;a.ia=a.j^b;return a.Y=(a.I=a.j+b+1^256)&255} -function nd(a,b){b^=255;a.ia=a.j^b;return a.Y=(a.I=a.j+b+(a.I&256?0:1)^256)&255}function od(a,b){return a.Y=a.I=a.ia=a.j^b}m.W=function(a){return this.na[(a&this.K)>>>this.aa].Ka(a&this.G,a)};function pd(a,b){var c=b&a.G,d=(b&a.K)>>>a.aa;if(c>>a.aa].Za(b&a.G,c&255,b)} -function qd(a,b,c){var d=b&a.G,e=(b&a.K)>>>a.aa;d>8&255,b+1))}function M(a){var b=a.W(a.L);H(a,a.L+1);return b}function N(a){var b=pd(a,a.L);H(a,a.L+2);return b}function O(a){var b=pd(a,a.da);a.da=a.da+2&65535;return b}function P(a,b){a.da=a.da-2&65535;qd(a,a.da,b)} -function Q(a,b,c,d){d=d||2;a.U[b]&&(void 0===c&&(jb(a,"Value for "+b+" is invalid"),a.ea()),c=!a.A.ka||a.A.Kb?q(c,d):"--------".substr(0,d),a.U[b].textContent!=c&&(a.U[b].textContent=c))} -m.ta=function(a){this.fa&&(a||!this.A.ka||this.A.Kb)&&(Q(this,"A",this.j),Q(this,"B",this.N),Q(this,"C",this.O),Q(this,"BC",Hc(this),4),Q(this,"D",this.P),Q(this,"E",this.R),Q(this,"DE",Jc(this),4),Q(this,"H",this.S),Q(this,"L",this.T),Q(this,"HL",J(this),4),Q(this,"SP",this.da,4),Q(this,"PC",this.L,4),a=Fc(this),Q(this,"PS",a,4),Q(this,"SF",a&128?1:0,1),Q(this,"ZF",a&64?1:0,1),Q(this,"AF",a&16?1:0,1),Q(this,"PF",a&4?1:0,1),Q(this,"CF",a&1?1:0,1));if(a=this.U.speed)a.textContent=this.A.ka&&this.i.Ga? -this.i.Ga.toFixed(2)+"Mhz":"Stopped"}; -m.Ya=function(a){this.A.nb=!0;var b=this.A.Yb=this.F&&rd(this.F),c=a?this.A.ub?0:1:-1;this.A.ub=!1;this.D=this.b=a;do{if(this.u){var d;this.u&8&&this.pa&512?(d=199|(this.u&7)<<3,this.u&=-16,this.pa&=-513,this.ba[d].call(this),d=!0):d=!1;if(d){if(!a){this.g("interrupt dispatched");break}}else if(this.u&16){this.b=0;break}}if(b){if(sd(this.F,this.L,c)){this.ea();break}c=1}this.ba[M(this)].call(this)}while(0>8;this.I=this.I&255|a&256;this.b-=4},td,function(){var a;Lc(this,a=J(this)+Hc(this));this.I=this.I&255|a>>8&256;this.b-=10},function(){this.j=this.W(Hc(this));this.b-=7},function(){Ic(this,Hc(this)- -1);this.b-=5},function(){this.O=ld(this,this.O);this.b-=5},function(){this.O=kd(this,this.O);this.b-=5},function(){this.O=M(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(a|this.j)>>1;this.I=this.I&255|a;this.b-=4},td,function(){Kc(this,N(this));this.b-=10},function(){L(this,Jc(this),this.j);this.b-=7},function(){Kc(this,Jc(this)+1);this.b-=5},function(){this.P=ld(this,this.P);this.b-=5},function(){this.P=kd(this,this.P);this.b-=5},function(){this.P=M(this);this.b-=7},function(){var a=this.j<< -1;this.j=a&255|this.I>>8;this.I=this.I&255|a&256;this.b-=4},td,function(){var a;Lc(this,a=J(this)+Jc(this));this.I=this.I&255|a>>8&256;this.b-=10},function(){this.j=this.W(Jc(this));this.b-=7},function(){Kc(this,Jc(this)-1);this.b-=5},function(){this.R=ld(this,this.R);this.b-=5},function(){this.R=kd(this,this.R);this.b-=5},function(){this.R=M(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(this.I&256|this.j)>>1;this.I=this.I&255|a;this.b-=4},td,function(){Lc(this,N(this));this.b-=10},function(){qd(this, -N(this),J(this));this.b-=16},function(){Lc(this,J(this)+1);this.b-=5},function(){this.S=ld(this,this.S);this.b-=5},function(){this.S=kd(this,this.S);this.b-=5},function(){this.S=M(this);this.b-=7},function(){var a=0,b=Mc(this);if(Oc(this)||9<(this.j&15))a|=6;if(b||154<=this.j)a|=96,b=1;this.j=Rc(this,a);this.I=b?this.I|256:this.I&-257;this.b-=4},td,function(){var a;Lc(this,a=J(this)+J(this));this.I=this.I&255|a>>8&256;this.b-=10},function(){Lc(this,pd(this,N(this)));this.b-=16},function(){Lc(this, -J(this)-1);this.b-=5},function(){this.T=ld(this,this.T);this.b-=5},function(){this.T=kd(this,this.T);this.b-=5},function(){this.T=M(this);this.b-=7},function(){this.j=~this.j&255;this.b-=4},td,function(){this.da=N(this)&65535;this.b-=10},function(){L(this,N(this),this.j);this.b-=13},function(){this.da=this.da+1&65535;this.b-=5},function(){var a=J(this);L(this,a,ld(this,this.W(a)));this.b-=10},function(){var a=J(this);L(this,a,kd(this,this.W(a)));this.b-=10},function(){L(this,J(this),M(this));this.b-= -10},function(){this.I|=256;this.b-=4},td,function(){var a;Lc(this,a=J(this)+this.da);this.I=this.I&255|a>>8&256;this.b-=10},function(){this.j=this.W(N(this));this.b-=13},function(){this.da=this.da-1&65535;this.b-=5},function(){this.j=ld(this,this.j);this.b-=5},function(){this.j=kd(this,this.j);this.b-=5},function(){this.j=M(this);this.b-=7},function(){this.I=Mc(this)?this.I&-257:this.I|256;this.b-=4},function(){this.b-=5},function(){this.N=this.O;this.b-=5},function(){this.N=this.P;this.b-=5},function(){this.N= -this.R;this.b-=5},function(){this.N=this.S;this.b-=5},function(){this.N=this.T;this.b-=5},function(){this.N=this.W(J(this));this.b-=7},function(){this.N=this.j;this.b-=5},function(){this.O=this.N;this.b-=5},function(){this.b-=5},function(){this.O=this.P;this.b-=5},function(){this.O=this.R;this.b-=5},function(){this.O=this.S;this.b-=5},function(){this.O=this.T;this.b-=5},function(){this.O=this.W(J(this));this.b-=7},function(){this.O=this.j;this.b-=5},function(){this.P=this.N;this.b-=5},function(){this.P= -this.O;this.b-=5},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.W(J(this));this.b-=7},function(){this.P=this.j;this.b-=5},function(){this.R=this.N;this.b-=5},function(){this.R=this.O;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.W(J(this));this.b-=7},function(){this.R=this.j; -this.b-=5},function(){this.S=this.N;this.b-=5},function(){this.S=this.O;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.W(J(this));this.b-=7},function(){this.S=this.j;this.b-=5},function(){this.T=this.N;this.b-=5},function(){this.T=this.O;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.W(J(this));this.b-=7},function(){this.T=this.j;this.b-=5},function(){L(this,J(this),this.N);this.b-=7},function(){L(this,J(this),this.O);this.b-=7},function(){L(this,J(this),this.P);this.b-=7},function(){L(this,J(this),this.R);this.b-=7},function(){L(this,J(this),this.S);this.b-=7},function(){L(this,J(this),this.T);this.b-=7},function(){var a=this.L-1;if(this.M.length)for(var b=0;b>8;this.b-=10},function(){var a=N(this);Qc(this)||H(this,a);this.b-=10},function(){this.pa&=-513;this.b-=4},function(){var a=N(this);Qc(this)||(P(this,this.L),H(this,a),this.b-=6);this.b-=11},function(){P(this,Fc(this)&255|this.j<<8);this.b-=11},function(){this.j=md(this,M(this));this.b-=7},function(){P(this,this.L);H(this,48);this.b-=11},function(){Qc(this)&&(H(this, -O(this)),this.b-=6);this.b-=5},function(){this.da=J(this)&65535;this.b-=5},function(){var a=N(this);Qc(this)&&H(this,a);this.b-=10},function(){this.pa|=512;this.b-=4},function(){var a=N(this);Qc(this)&&(P(this,this.L),H(this,a),this.b-=6);this.b-=11},wd,function(){K(this,M(this));this.b-=7},function(){P(this,this.L);H(this,56);this.b-=11}]; -function R(a){v.call(this,"ChipSet",a,R,32768);var b=a.model;b&&!xd[b]&&t("Unrecognized ChipSet model: "+b);this.Ra=xd[b]||yd;a.sound&&(this.V=null,window&&(this.V=window.AudioContext||window.webkitAudioContext),this.V&&new this.V);E(this)}z(R);var yd=1978.1,xd={SI1978:yd};m=R.prototype;m.qa=function(){return!1}; -m.Ba=function(a,b,c,d){this.B=b;this.b=c;this.F=d;this.w=a;if(this.Ra==yd){var e;a=zd;void 0===e&&(e=0);for(var f in a){c=b;d=+f+e;var h=a[f].bind(this);if(void 0!==h)for(var g=+f+e;g<=d;g++)void 0!==c.w[g]?t("Input port "+r(g)+" already registered"):c.w[g]=[h,!1]}var l;e=Ad;void 0===l&&(l=0);for(var k in e)if(f=b,a=+k+l,c=e[k].bind(this),void 0!==c)for(d=+k+l;d<=a;d++)void 0!==f.u[d]?t("Output port "+r(d)+" already registered"):f.u[d]=[c,!1]}}; -m.ya=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};m.xa=function(a){return a?this.save():!0};m.reset=function(){this.G=this.H=this.D=this.u=this.M=this.K=this.J=0};m.save=function(){var a=new Gc(this);this.Ra==yd&&I(a,0,[this.J,this.K,this.M,this.u,this.D,this.G,this.H]);return a.data()};m.restore=function(a){a=a[0];this.Ra==yd&&(this.J=a[0],this.K=a[1],this.M=a[2],this.u=a[3],this.D=a[4],this.G=a[5],this.H=a[6]);return!0};m.start=function(){};m.stop=function(){}; +0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1];function mb(a){v.call(this,"Panel",a,mb)}z(mb);m=mb.prototype;m.qa=function(a,b,c,d){return this.w&&this.w.qa(a,b,c,d)||this.b&&this.b.qa(a,b,c,d)||this.u&&this.u.qa(a,b,c,d)||this.F&&this.F.qa(a,b,c,d)?!0:this.parent.qa.call(this,a,b,c,d)};m.Da=function(a,b,c,d){this.w=a;this.B=b;this.b=c;this.F=d;this.u=nb(a,"Keyboard")};m.za=function(a,b){b||ob();return!0};m.ya=function(){return!0};m.va=function(){}; +function ob(){for(var a=!1,b=D(document,"pc8080","panel"),c=0;c=this.J?10:20>=this.J?12:24>=this.J?14:15;this.ua=1<>2;this.B=this.ua-1;this.M=this.X/this.ua|0;this.K=this.M-1;this.w=[];this.u=[];this.G=this.I=!1;this.aa=[];this.ba=[];a=new F;qb(a,this.F);this.T=Array(this.M);for(b=0;b>>a.ea;0c&&(g=c);if(f&&f.size){if(f.type==d){if(b+c<=f.C)return f.mb+=f.C-b,f.C=b,!0;if(b>=f.C+f.mb){g=f.size-(b-h);g>c&&(g=c);f.mb=b-f.C+g;b=h+a.ua;c-=g;e++;continue}}return sb(1,b,c)}b=new F(b,g,a.ua,d);qb(b,a.F,f);a.T[e++]=b;b=h+a.ua;c-=g}return 0>=c?!0:sb(2,b,c)}m.W=function(a){return this.T[(a&this.D)>>>this.ea].Za(a&this.B,a)};function tb(a,b){return a.T[(b&a.D)>>>a.ea].kb(b&a.B,b)} +m.Ca=function(a){var b=a&this.B,c=(a&this.D)>>>this.ea;return b!=this.B?this.T[c].Tb(b,a):this.T[c++].Za(b,a)|this.T[c&this.K].Za(0,a+1)<<8};function ub(a,b){var c=b&a.B,d=(b&a.D)>>>a.ea;return c!=a.B?a.T[d].Ab(c,b):a.T[d++].kb(c,b)|a.T[d&a.K].kb(0,b+1)<<8}m.fa=function(a,b){this.T[(a&this.D)>>>this.ea].ab(a&this.B,b&255,a)};function vb(a,b,c){a.T[(b&a.D)>>>a.ea].nb(b&a.B,c&255,b)} +m.sb=function(a,b){var c=a&this.B,d=(a&this.D)>>>this.ea;c!=this.B?this.T[d].Vb(c,b&65535,a):(this.T[d++].ab(c,b&255,a),this.T[d&this.K].ab(0,b>>8&255,a+1))};function Eb(a,b){if(void 0===b)return a.G=!a.G,a.G;void 0===a.w[b]&&(a.w[b]=[null,!1]);a.w[b][1]=!a.w[b][1];return a.w[b][1]} +function Fb(a,b,c){for(var d=1,e=0,f=0;0>>=f)&l;if(void 0!==h){if(h[0])h[0](b,l,d);a.F&&a.I!=h[1]&&Jb(a.F,b,l)}else a.F&&(eb(a.F,a,b,l,d),a.I&&Jb(a.F,b,l));f+=g<<3;b+=g;e-=g}}function sb(a,b,c){t("Memory block error ("+a+": "+q(b)+","+q(c)+")");return!1}var Kb;if(kb){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=Nb+=2;this.b=null;this.C=a;this.mb=b;this.size=c||0;this.type=d||Ob;this.w=d==Pb;qb(this);this.wa=this.Kb=!1;if(c)if(kb)this.G=new ArrayBuffer(c),this.I=new DataView(this.G,0,c),this.B=new Uint8Array(this.G,0,c),this.K=new Uint16Array(this.G,0,c>>1),this.b=new Int32Array(this.G,0,c>>2),Qb(this,Mb?Rb:Sb);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},ga:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ra: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.wa=!0},aa:function(a,b){if(this.F&&null!=this.C){var c=this.F;Yb(c,this.C+a,1,c.ba)&&c.da(!0)}return this.kb(a,b)},ma:function(a,b){if(this.F&&null!=this.C){var c=this.F;Yb(c,this.C+a,2,c.ba)&&c.da(!0)}return this.Ab(a,b)},Ba:function(a,b,c){if(this.F&&null!=this.C){var d=this.F;Yb(d,this.C+a,1,d.I)&&d.da(!0)}this.w?this.D(a,b,c):this.nb(a,b,c)},Na:function(a, +b,c){if(this.F&&null!=this.C){var d=this.F;Yb(d,this.C+a,2,d.I)&&d.da(!0)}this.w?this.D(a,b,c):this.Bb(a,b,c)},Y:function(a){return this.B[a]},ba:function(a){return this.B[a]},la:function(a){return this.I.getUint16(a,!0)},na:function(a){return a&1?this.B[a]|this.B[a+1]<<8:this.K[a>>1]},sa:function(a,b){this.B[a]=b;this.wa=!0},Ea:function(a,b){this.B[a]=b;this.wa=!0},Ga:function(a,b){this.I.setUint16(a,b,!0);this.wa=!0},bb:function(a,b){a&1?(this.B[a]=b,this.B[a+1]=b>>8):this.K[a>>1]=b;this.wa=!0}}; +function qb(a,b,c){a.F=b;a.V=a.u=0;c&&((a.V=c.V)&&Xb(a,Wb,!1),(a.u=c.u)&&Vb(a,Wb,!1))}function Zb(a,b){b?0===--a.u&&(a.ab=a.w?a.D:a.nb,a.Vb=a.w?a.J:a.Bb):0===--a.V&&(a.Za=a.kb,a.Tb=a.Ab)}function Vb(a,b,c){c&&a.u||(a.ab=!a.w&&b[2]||a.D,a.Vb=!a.w&&b[3]||a.J);if(c||void 0===c)a.nb=b[2]||a.D,a.Bb=b[3]||a.J}function Xb(a,b,c){c&&a.V||(a.Za=b[0]||a.M,a.Tb=b[1]||a.X);if(c||void 0===c)a.kb=b[0]||a.M,a.Ab=b[1]||a.X}function Qb(a,b){b||(b=$b);Xb(a,b,void 0);Vb(a,b,void 0)} +var $b=[],Tb=[F.prototype.ga,F.prototype.ra,F.prototype.Fa,F.prototype.cb],Wb=[F.prototype.aa,F.prototype.ma,F.prototype.Ba,F.prototype.Na];if(kb)var Sb=[F.prototype.Y,F.prototype.la,F.prototype.sa,F.prototype.Ga],Rb=[F.prototype.ba,F.prototype.na,F.prototype.Ea,F.prototype.bb]; +function ac(a,b){v.call(this,"CPU",a,ac,1);var c=a.cycles||b,d=a.multiplier||1;this.i={};this.i.Ya=c;this.i.rb=0;this.i.La=d;this.i.xb=Math.round(this.i.Ya/1E4)/100;this.i.Ja=this.i.xb*this.i.La;this.A.ka=!1;this.A.wb=!1;this.A.Jb=a.autoStart;this.A.Lb=!1;this.A.Pa=!1;this.i.eb=this.i.Va=0;this.i.fb=a.csStart;this.i.Ua=a.csInterval;this.i.Wa=a.csStop;this.aa=this.Ma.bind(this);E(this)}z(ac);var bc=["power","reset"];m=ac.prototype; +m.Da=function(a,b,c,d){this.w=a;this.B=b;this.F=d;for(b=0;b=a.i.Va&&(a.i.Va+=a.i.Ua,c=!0);0<=a.i.Wa&&a.i.Wa<=uc(a)&&(a.i.Ua=a.i.Wa=-1,pc(a),a.da(),c=!0);c&&a.g(uc(a)+" cycles: checksum="+q(a.i.eb))}} +m.qa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.V[b]=c;a=!0;break;case "run":this.V[b]=c;c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.A.ia)a=!0;else{var b=null,c,g=Za(a.id);for(c=0;cc&&(c=2);var d=1;b&&1a.i.Ia/a.i.Ja?b=1:d=!0;a.i.La=b;b=a.i.xb*a.i.La;if(a.i.Ja!=b){a.i.Ja=b;b=a.i.Ja.toFixed(2)+"Mhz";var e=a.V.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.w&&a.w.lb()}wc(a,a.G);a.G=0;a.i.Ta=ka();a.i.Ka=0;xc(a);return d} +m.Ma=function(a){if(gb(this,!0)){if(!this.A.ka){vc(this);this.w&&this.w.start(this.i.Ta,uc(this));this.A.ka=!0;this.A.wb=!0;this.K&&this.K.start();var b=this.V.run;b&&(b.textContent="Halt");this.w&&(this.w.va(!0),a&&this.w.lb(!0))}this.i.zb>=this.i.Ya&&xc(this,!0);this.i.ib=0;this.i.qb=ka();this.i.Ka&&(a=this.i.qb-this.i.Ka,a>this.i.Pb&&(this.i.Ta+=a,this.i.Ta>this.i.qb&&(this.i.Ta=this.i.qb)));try{do{var c=this.A.Pa?1:this.i.hc;try{this.$a(c)}catch(e){if("number"!=typeof e)throw e;}var d=this.D- +this.b;this.G+=d;this.i.ib+=d;wc(this,0,!0);tc(this,d);this.i.hb-=d;0>=this.i.hb&&(this.i.hb+=this.i.Rb,this.w&&yc(this.w,this.i.rb++),this.i.rb>this.Ba&&(this.i.rb=0));this.i.gb-=d;0>=this.i.gb&&(this.i.gb+=this.i.Qb,this.w&&this.w.va());this.i.Xa-=d;if(0>=this.i.Xa){this.i.Xa+=this.i.yb;break}}while(this.A.ka)}catch(e){this.da();rc(this);this.w&&this.w.stop(ka(),uc(this));gb(this,!1);jb(this,e.stack||e.message);return}c=setTimeout;d=this.aa;this.i.Ka=ka();a=this.i.Pb;this.i.ib&&(a=Math.round(a* +this.i.ib/this.i.yb));a-=this.i.Ka-this.i.qb;if(b=this.i.Ka-this.i.Ta)this.i.Ia=Math.round(this.G/(10*b))/100,864E5<=b&&(this.I=0,vc(this));if(0>a||this.i.Ia>8&255;a.O=b&255}function Ic(a){return a.P<<8|a.R}function Jc(a,b){a.P=b>>8&255;a.R=b&255}function K(a){return a.S<<8|a.U} +function Kc(a,b){a.S=b>>8&255;a.U=b&255}function H(a,b){a.L=b&65535}function Lc(a){return a.H&256?1:0}function Mc(a){return lb[a.Z&255]?4:0}function Nc(a){return(a.Z^a.ja)&16?16:0}function Oc(a){return a.H&255?0:64}function Pc(a){return a.Z&128?128:0}function Fc(a){return a.pa&-214|Pc(a)|Oc(a)|Nc(a)|Mc(a)|Lc(a)}function Dc(a,b){a.H=a.Z=a.ja=0;b&1&&(a.H|=256);b&4||(a.Z|=1);b&16&&(a.ja|=16);b&64||(a.H|=255);b&128&&(a.Z^=192);a.pa=a.pa&-513|b&512|2} +function Qc(a,b){a.ja=a.j^b;return a.Z=(a.H=a.j+b)&255}function Rc(a,b){a.ja=a.j^b;return a.Z=(a.H=a.j+b+(a.H&256?1:0))&255}function id(a,b){a.H=a.Z=a.ja=a.j&b;(a.j|b)&8&&(a.ja^=16);return a.H}function jd(a,b){a.ja=b^255;b=a.Z=b+255&255;a.H=a.H&-256|b;return b}function kd(a,b){a.ja=b;b=a.Z=b+1&255;a.H=a.H&-256|b;return b}function ld(a,b){return a.Z=a.H=a.ja=a.j|b}function L(a,b){b^=255;a.ja=a.j^b;return a.Z=(a.H=a.j+b+1^256)&255} +function md(a,b){b^=255;a.ja=a.j^b;return a.Z=(a.H=a.j+b+(a.H&256?0:1)^256)&255}function nd(a,b){return a.Z=a.H=a.ja=a.j^b}m.W=function(a){return this.B.W(a)};m.fa=function(a,b){this.B.fa(a,b)};function M(a){var b=a.W(a.L);H(a,a.L+1);return b}function N(a){var b=a.B.Ca(a.L);H(a,a.L+2);return b}function O(a){var b=a.B.Ca(a.ca);a.ca=a.ca+2&65535;return b}function P(a,b){a.ca=a.ca-2&65535;a.B.sb(a.ca,b)} +function Q(a,b,c,d){d=d||2;a.V[b]&&(void 0===c&&(jb(a,"Value for "+b+" is invalid"),a.da()),c=!a.A.ka||a.A.Lb?q(c,d):"--------".substr(0,d),a.V[b].textContent!=c&&(a.V[b].textContent=c))} +m.va=function(a){this.Y&&(a||!this.A.ka||this.A.Lb)&&(Q(this,"A",this.j),Q(this,"B",this.N),Q(this,"C",this.O),Q(this,"BC",Gc(this),4),Q(this,"D",this.P),Q(this,"E",this.R),Q(this,"DE",Ic(this),4),Q(this,"H",this.S),Q(this,"L",this.U),Q(this,"HL",K(this),4),Q(this,"SP",this.ca,4),Q(this,"PC",this.L,4),a=Fc(this),Q(this,"PS",a,4),Q(this,"SF",a&128?1:0,1),Q(this,"ZF",a&64?1:0,1),Q(this,"AF",a&16?1:0,1),Q(this,"PF",a&4?1:0,1),Q(this,"CF",a&1?1:0,1));if(a=this.V.speed)a.textContent=this.A.ka&&this.i.Ia? +this.i.Ia.toFixed(2)+"Mhz":"Stopped"}; +m.$a=function(a){this.A.ob=!0;var b=this.A.Yb=this.F&&od(this.F),c=a?this.A.wb?0:1:-1;this.A.wb=!1;this.D=this.b=a;do{if(this.u){var d;this.u&8&&this.pa&512?(d=199|(this.u&7)<<3,this.u&=-16,this.pa&=-513,this.M[d].call(this),d=!0):d=!1;if(d){if(!a){this.g("interrupt dispatched");break}}else if(this.u&16){this.b=0;break}}if(b){if(pd(this.F,this.L,c)){this.da();break}c=1}this.M[M(this)].call(this)}while(0>8;this.H=this.H&255|a&256;this.b-=4},qd,function(){var a;Kc(this,a=K(this)+Gc(this));this.H=this.H&255|a>>8&256;this.b-=10},function(){this.j=this.W(Gc(this));this.b-=7},function(){Hc(this,Gc(this)- +1);this.b-=5},function(){this.O=kd(this,this.O);this.b-=5},function(){this.O=jd(this,this.O);this.b-=5},function(){this.O=M(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(a|this.j)>>1;this.H=this.H&255|a;this.b-=4},qd,function(){Jc(this,N(this));this.b-=10},function(){this.fa(Ic(this),this.j);this.b-=7},function(){Jc(this,Ic(this)+1);this.b-=5},function(){this.P=kd(this,this.P);this.b-=5},function(){this.P=jd(this,this.P);this.b-=5},function(){this.P=M(this);this.b-=7},function(){var a=this.j<< +1;this.j=a&255|this.H>>8;this.H=this.H&255|a&256;this.b-=4},qd,function(){var a;Kc(this,a=K(this)+Ic(this));this.H=this.H&255|a>>8&256;this.b-=10},function(){this.j=this.W(Ic(this));this.b-=7},function(){Jc(this,Ic(this)-1);this.b-=5},function(){this.R=kd(this,this.R);this.b-=5},function(){this.R=jd(this,this.R);this.b-=5},function(){this.R=M(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(this.H&256|this.j)>>1;this.H=this.H&255|a;this.b-=4},qd,function(){Kc(this,N(this));this.b-=10},function(){var a= +N(this);this.B.sb(a,K(this));this.b-=16},function(){Kc(this,K(this)+1);this.b-=5},function(){this.S=kd(this,this.S);this.b-=5},function(){this.S=jd(this,this.S);this.b-=5},function(){this.S=M(this);this.b-=7},function(){var a=0,b=Lc(this);if(Nc(this)||9<(this.j&15))a|=6;if(b||154<=this.j)a|=96,b=1;this.j=Qc(this,a);this.H=b?this.H|256:this.H&-257;this.b-=4},qd,function(){var a;Kc(this,a=K(this)+K(this));this.H=this.H&255|a>>8&256;this.b-=10},function(){var a;a=N(this);a=this.B.Ca(a);Kc(this,a);this.b-= +16},function(){Kc(this,K(this)-1);this.b-=5},function(){this.U=kd(this,this.U);this.b-=5},function(){this.U=jd(this,this.U);this.b-=5},function(){this.U=M(this);this.b-=7},function(){this.j=~this.j&255;this.b-=4},qd,function(){this.ca=N(this)&65535;this.b-=10},function(){this.fa(N(this),this.j);this.b-=13},function(){this.ca=this.ca+1&65535;this.b-=5},function(){var a=K(this);this.fa(a,kd(this,this.W(a)));this.b-=10},function(){var a=K(this);this.fa(a,jd(this,this.W(a)));this.b-=10},function(){this.fa(K(this), +M(this));this.b-=10},function(){this.H|=256;this.b-=4},qd,function(){var a;Kc(this,a=K(this)+this.ca);this.H=this.H&255|a>>8&256;this.b-=10},function(){this.j=this.W(N(this));this.b-=13},function(){this.ca=this.ca-1&65535;this.b-=5},function(){this.j=kd(this,this.j);this.b-=5},function(){this.j=jd(this,this.j);this.b-=5},function(){this.j=M(this);this.b-=7},function(){this.H=Lc(this)?this.H&-257:this.H|256;this.b-=4},function(){this.b-=5},function(){this.N=this.O;this.b-=5},function(){this.N=this.P; +this.b-=5},function(){this.N=this.R;this.b-=5},function(){this.N=this.S;this.b-=5},function(){this.N=this.U;this.b-=5},function(){this.N=this.W(K(this));this.b-=7},function(){this.N=this.j;this.b-=5},function(){this.O=this.N;this.b-=5},function(){this.b-=5},function(){this.O=this.P;this.b-=5},function(){this.O=this.R;this.b-=5},function(){this.O=this.S;this.b-=5},function(){this.O=this.U;this.b-=5},function(){this.O=this.W(K(this));this.b-=7},function(){this.O=this.j;this.b-=5},function(){this.P= +this.N;this.b-=5},function(){this.P=this.O;this.b-=5},function(){this.b-=5},function(){this.P=this.R;this.b-=5},function(){this.P=this.S;this.b-=5},function(){this.P=this.U;this.b-=5},function(){this.P=this.W(K(this));this.b-=7},function(){this.P=this.j;this.b-=5},function(){this.R=this.N;this.b-=5},function(){this.R=this.O;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.U;this.b-=5},function(){this.R=this.W(K(this)); +this.b-=7},function(){this.R=this.j;this.b-=5},function(){this.S=this.N;this.b-=5},function(){this.S=this.O;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.U;this.b-=5},function(){this.S=this.W(K(this));this.b-=7},function(){this.S=this.j;this.b-=5},function(){this.U=this.N;this.b-=5},function(){this.U=this.O;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.b-=5},function(){this.U=this.W(K(this));this.b-=7},function(){this.U=this.j;this.b-=5},function(){this.fa(K(this),this.N);this.b-=7},function(){this.fa(K(this),this.O);this.b-=7},function(){this.fa(K(this),this.P);this.b-=7},function(){this.fa(K(this),this.R);this.b-=7},function(){this.fa(K(this),this.S);this.b-=7},function(){this.fa(K(this),this.U);this.b-=7},function(){var a=this.L-1;if(this.J.length)for(var b=0;b>8;this.b-=10},function(){var a=N(this);Pc(this)||H(this,a);this.b-=10},function(){this.pa&=-513;this.b-=4},function(){var a=N(this);Pc(this)||(P(this,this.L),H(this,a),this.b-=6);this.b-=11},function(){P(this,Fc(this)&255|this.j<<8);this.b-=11},function(){this.j=ld(this,M(this));this.b-=7},function(){P(this, +this.L);H(this,48);this.b-=11},function(){Pc(this)&&(H(this,O(this)),this.b-=6);this.b-=5},function(){this.ca=K(this)&65535;this.b-=5},function(){var a=N(this);Pc(this)&&H(this,a);this.b-=10},function(){this.pa|=512;this.b-=4},function(){var a=N(this);Pc(this)&&(P(this,this.L),H(this,a),this.b-=6);this.b-=11},td,function(){L(this,M(this));this.b-=7},function(){P(this,this.L);H(this,56);this.b-=11}]; +function T(a){v.call(this,"ChipSet",a,T,32768);var b=a.model;b&&!ud[b]&&t("Unrecognized ChipSet model: "+b);this.Sa=ud[b]||vd;a.sound&&(this.X=null,window&&(this.X=window.AudioContext||window.webkitAudioContext),this.X&&new this.X);E(this)}z(T);var vd=1978.1,ud={SI1978:vd};m=T.prototype;m.qa=function(){return!1}; +m.Da=function(a,b,c,d){this.B=b;this.b=c;this.F=d;this.w=a;if(this.Sa==vd){var e;a=wd;void 0===e&&(e=0);for(var f in a){c=b;d=+f+e;var h=a[f].bind(this);if(void 0!==h)for(var g=+f+e;g<=d;g++)void 0!==c.w[g]?t("Input port "+r(g)+" already registered"):c.w[g]=[h,!1]}var l;e=xd;void 0===l&&(l=0);for(var k in e)if(f=b,a=+k+l,c=e[k].bind(this),void 0!==c)for(d=+k+l;d<=a;d++)void 0!==f.u[d]?t("Output port "+r(d)+" already registered"):f.u[d]=[c,!1]}}; +m.za=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};m.ya=function(a){return a?this.save():!0};m.reset=function(){this.G=this.I=this.D=this.u=this.M=this.K=this.J=0};m.save=function(){var a=new I(this);this.Sa==vd&&J(a,0,[this.J,this.K,this.M,this.u,this.D,this.G,this.I]);return a.data()};m.restore=function(a){a=a[0];this.Sa==vd&&(this.J=a[0],this.K=a[1],this.M=a[2],this.u=a[3],this.D=a[4],this.G=a[5],this.I=a[6]);return!0};m.start=function(){};m.stop=function(){}; m.bc=function(a,b){var c=this.J;db(this,a,null,b,"STATUS0",c);return c};m.cc=function(a,b){var c=this.K;db(this,a,null,b,"STATUS1",c);return c};m.dc=function(a,b){var c=this.M;db(this,a,null,b,"STATUS2",c);return c};m.ac=function(a,b){var c=this.u>>8-this.D&255;db(this,a,null,b,"SHIFT.RESULT",c);return c};m.ic=function(a,b,c){db(this,a,b,c,"SHIFT.COUNT",null);this.D=b};m.kc=function(a,b,c){db(this,a,b,c,"SOUND1",null);this.G=b}; -m.jc=function(a,b,c){db(this,a,b,c,"SHIFT.DATA",null);this.u=b<<8|this.u>>8};m.lc=function(a,b,c){db(this,a,b,c,"SOUND2",null);this.H=b};m.mc=function(a,b,c){db(this,a,b,c,"WATCHDOG",null)};var zd={0:R.prototype.bc,1:R.prototype.cc,2:R.prototype.dc,3:R.prototype.ac},Ad={2:R.prototype.ic,3:R.prototype.kc,4:R.prototype.jc,5:R.prototype.lc,6:R.prototype.mc};Ja(function(){for(var a=D(document,"pc8080","chipset"),b=0;b>>0,h],p=ja(n,l,a.Eb);0>p&&n.splice(-(p+1),0,l)}k&&(g.a=k.replace(/''/g,'"'))}a.J.push({nc:b,C:c,gc:d,za:e,Bb:f})}delete this.za}return!0};Bd.prototype.xa=function(){return!0}; -function Cd(a,b,c,d){if(d)a.oa("Unable to load system ROM (error "+d+": "+b+")");else{Ya(a.Hb,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.za=e.symbols;if(!a.w.length){t("Empty ROM: "+b);return}if(1==a.w.length){t(a.w[0]);return}}catch(g){a.oa("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm, -" ").replace(/ +$/,"").split(" "),a.w=Array(b.length),e=0;e>>f.aa;0>>=f.aa;0>3)*this.D;rb(this.B,this.K,this.J,3)&&(this.ba=this.J>>1,this.ca=16/this.Z|0,this.M=!1,void 0===this.G||this.G.length!=this.ba)&&(this.G=Array(this.ba));E(this)}; +m.jc=function(a,b,c){db(this,a,b,c,"SHIFT.DATA",null);this.u=b<<8|this.u>>8};m.lc=function(a,b,c){db(this,a,b,c,"SOUND2",null);this.I=b};m.mc=function(a,b,c){db(this,a,b,c,"WATCHDOG",null)};var wd={0:T.prototype.bc,1:T.prototype.cc,2:T.prototype.dc,3:T.prototype.ac},xd={2:T.prototype.ic,3:T.prototype.kc,4:T.prototype.jc,5:T.prototype.lc,6:T.prototype.mc};Ja(function(){for(var a=D(document,"pc8080","chipset"),b=0;b>>0,h],p=ja(n,l,a.Fb);0>p&&n.splice(-(p+1),0,l)}k&&(g.a=k.replace(/''/g,'"'))}a.J.push({nc:b,C:c,gc:d,Aa:e,Cb:f})}delete this.Aa}return!0};yd.prototype.ya=function(){return!0}; +function zd(a,b,c,d){if(d)a.oa("Unable to load system ROM (error "+d+": "+b+")");else{Ya(a.Ib,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.Aa=e.symbols;if(!a.w.length){t("Empty ROM: "+b);return}if(1==a.w.length){t(a.w[0]);return}}catch(g){a.oa("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm, +" ").replace(/ +$/,"").split(" "),a.w=Array(b.length),e=0;e>>f.ea;0>>=f.ea;0>3)*this.D;rb(this.B,this.X,this.M,3)&&(this.la=this.M>>1,this.ma=16/this.ga|0,this.aa=!1,void 0===this.I||this.I.length!=this.la)&&(this.I=Array(this.la));E(this)}; Ja(function(){for(var a=D(document,"pc8080","video"),b=0;bMissing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=pa().indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height= -(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||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");Ba("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);e=e.getContext("2d");d=new Jd(d,0,e);ab(d,c)}}); -function Kd(a){v.call(this,"Debugger",a,Kd);this.Z=Ld;this.fa=this.Ma=this.M=0;this.X=U();this.Fb=U();this.G=-1;this.D=[];this.ma=!1;this.ja=U();this.J=[];this.ra={};this.u=this.ba=this.H=[];Md(this);this.Da=0;Nd(this);this.$a=[];Od(this,a.messages);this.rb=a.commands;var b=this;window?void 0===window.$&&(window.$=function(a){return qc(b,a)}):void 0===global.$&&(global.$=function(a){return qc(b,a)})}z(Kd); -var Pd={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory",f:"frequencies","g [#]":"go [to #]",h:"halt","i [#]":"input port #","if":"eval expression",k:"stack trace",ln:"list nearest symbol(s)",m:"messages","o [#]":"output port #",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble",v:"print version","var":"assign variable"},Ld=8080,Qd="NONE ACI ADC ADD ADI ANA ANI CALL CC CM CNC CNZ CP CPE CPO CZ CMA CMC CMP CPI DAA DAD DCR DCX DI EI HLT IN INR INX JMP JC JM JNC JNZ JP JPE JPO JZ LDA LDAX LHLD LXI MOV MVI NOP ORA ORI OUT PCHL POP PUSH RAL RAR RET RC RM RNC RNZ RP RPE RPO RZ RLC RRC RST SBB SBI SHLD SPHL STA STAX STC SUB SUI XCHG XRA XRI XTHL".split(" "), -Rd="NONE ADC ADC ADD ADD AND AND CALL CALLC CALLS CALLNC CALLNZ CALLNS CALLP CALLNP CALLZ NOT CMC CMP CMP DAA ADD DEC DEC CLI STI HLT IN INC INC JMP JC JS JNC JNZ JNS JP JNP JZ MOV MOV MOV MOV MOV MOV NOP OR OR OUT JMP POP PUSH RCL RCR RET RETC RETS RETNC RETNZ RETNS RETP RETNP RETZ ROL ROR RST SBB SBB MOV MOV MOV MOV STC SUB SUB XCHG XOR XOR XCHG".split(" "),Sd="B C D E H L M A BC DE HL SP PC PSW".split(" "),Td=[[45],[42,2067,32],[71,2131,18193],[29,2067],[28,17],[22,17],[44,17,32],[63],[45,32768], +(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");Ba("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);e=e.getContext("2d");d=new Gd(d,0,e);cb(d,c)}}); +function Hd(a){v.call(this,"Debugger",a,Hd);this.aa=Id;this.la=this.Na=this.M=0;this.Y=U();this.Gb=U();this.G=-1;this.D=[];this.na=!1;this.ma=U();this.J=[];this.ra={};this.u=this.ba=this.I=[];Jd(this);this.Fa=0;Kd(this);this.bb=[];Ld(this,a.messages);this.tb=a.commands;var b=this;window?void 0===window.$&&(window.$=function(a){return qc(b,a)}):void 0===global.$&&(global.$=function(a){return qc(b,a)})}z(Hd); +var Md={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory",f:"frequencies","g [#]":"go [to #]",h:"halt","i [#]":"input port #","if":"eval expression",k:"stack trace",ln:"list nearest symbol(s)",m:"messages","o [#]":"output port #",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble",v:"print version","var":"assign variable"},Id=8080,Nd="NONE ACI ADC ADD ADI ANA ANI CALL CC CM CNC CNZ CP CPE CPO CZ CMA CMC CMP CPI DAA DAD DCR DCX DI EI HLT IN INR INX JMP JC JM JNC JNZ JP JPE JPO JZ LDA LDAX LHLD LXI MOV MVI NOP ORA ORI OUT PCHL POP PUSH RAL RAR RET RC RM RNC RNZ RP RPE RPO RZ RLC RRC RST SBB SBI SHLD SPHL STA STAX STC SUB SUI XCHG XRA XRI XTHL".split(" "), +Od="NONE ADC ADC ADD ADD AND AND CALL CALLC CALLS CALLNC CALLNZ CALLNS CALLP CALLNP CALLZ NOT CMC CMP CMP DAA ADD DEC DEC CLI STI HLT IN INC INC JMP JC JS JNC JNZ JNS JP JNP JZ MOV MOV MOV MOV MOV MOV NOP OR OR OUT JMP POP PUSH RCL RCR RET RETC RETS RETNC RETNZ RETNS RETP RETNP RETZ ROL ROR RST SBB SBB MOV MOV MOV MOV STC SUB SUB XCHG XOR XOR XCHG".split(" "),Pd="B C D E H L M A BC DE HL SP PC PSW".split(" "),Qd=[[45],[42,2067,32],[71,2131,18193],[29,2067],[28,17],[22,17],[44,17,32],[63],[45,32768], [21,18963,2067],[40,18193,2131],[23,2067],[28,273],[22,273],[44,273,32],[64],[45,32768],[42,2323,32],[71,2387,18193],[29,2323],[28,529],[22,529],[44,529,32],[52],[45,32768],[21,18963,2323],[40,18193,2387],[23,2323],[28,785],[22,785],[44,785,32],[53],[45,32768],[42,2579,32],[68,115,18963],[29,2579],[28,1041],[22,1041],[44,1041,32],[20],[45,32768],[21,18963,2579],[41,18963,115],[23,2579],[28,1297],[22,1297],[44,1297,32],[16,18193],[45,32768],[42,2835,32],[70,115,18193],[29,2835],[28,1617],[22,1617], [44,1617,32],[72],[45,32768],[21,18963,2835],[39,18193,115],[23,2835],[28,1809],[22,1809],[44,1809,32],[17],[43,17,17],[43,17,273],[43,17,529],[43,17,785],[43,17,1041],[43,17,1297],[43,17,1617],[43,17,1809],[43,273,17],[43,273,273],[43,273,529],[43,273,785],[43,273,1041],[43,273,1297],[43,273,1617],[43,273,1809],[43,529,17],[43,529,273],[43,529,529],[43,529,785],[43,529,1041],[43,529,1297],[43,529,1617],[43,529,1809],[43,785,17],[43,785,273],[43,785,529],[43,785,785],[43,785,1041],[43,785,1297],[43, 785,1617],[43,785,1809],[43,1041,17],[43,1041,273],[43,1041,529],[43,1041,785],[43,1041,1041],[43,1041,1297],[43,1041,1617],[43,1041,1809],[43,1297,17],[43,1297,273],[43,1297,529],[43,1297,785],[43,1297,1041],[43,1297,1297],[43,1297,1617],[43,1297,1809],[43,1617,17],[43,1617,273],[43,1617,529],[43,1617,785],[43,1617,1041],[43,1617,1297],[26],[43,1617,1809],[43,1809,17],[43,1809,273],[43,1809,529],[43,1809,785],[43,1809,1041],[43,1809,1297],[43,1809,1617],[43,1809,1809],[3,18193,17],[3,18193,273], [3,18193,529],[3,18193,785],[3,18193,1041],[3,18193,1297],[3,18193,1617],[3,18193,1809],[2,18193,17],[2,18193,273],[2,18193,529],[2,18193,785],[2,18193,1041],[2,18193,1297],[2,18193,1617],[2,18193,1809],[73,18193,17],[73,18193,273],[73,18193,529],[73,18193,785],[73,18193,1041],[73,18193,1297],[73,18193,1617],[73,18193,1809],[66,18193,17],[66,18193,273],[66,18193,529],[66,18193,785],[66,18193,1041],[66,18193,1297],[66,18193,1617],[66,18193,1809],[5,18193,17],[5,18193,273],[5,18193,529],[5,18193,785], [5,18193,1041],[5,18193,1297],[5,18193,1617],[5,18193,1809],[76,18193,17],[76,18193,273],[76,18193,529],[76,18193,785],[76,18193,1041],[76,18193,1297],[76,18193,1617],[76,18193,1809],[46,18193,17],[46,18193,273],[46,18193,529],[46,18193,785],[46,18193,1041],[46,18193,1297],[46,18193,1617],[46,18193,1809],[18,18193,17],[18,18193,273],[18,18193,529],[18,18193,785],[18,18193,1041],[18,18193,1297],[18,18193,1617],[18,18193,1809],[58],[50,2067],[34,51],[30,51],[11,51],[51,2067],[4,18193,33],[65,128],[62], [54],[38,51],[30,32819],[15,51],[7,51],[1,18193,33],[65,128],[57],[50,2323],[33,51],[48,33,18193],[10,51],[51,2323],[74,18193,33],[65,128],[55],[54,32768],[31,51],[27,18193,33],[8,51],[7,32819],[67,18193,33],[65,128],[61],[50,2579],[37,51],[78,19283,18963],[14,51],[51,2579],[6,18193,33],[65,128],[60],[49,2579],[36,51],[75,18963,18707],[13,51],[7,32819],[77,18193,33],[65,128],[59],[50,3347],[35,51],[24],[12,51],[51,3347],[47,18193,33],[65,128],[56],[69,19219,18963],[32,51],[25],[9,51],[7,32819],[19, -18193,33],[65,128]],Ud={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:536870912,warn:1073741824,halt:-2147483648};m=Kd.prototype; -m.Ba=function(a,b,c,d){this.B=b;this.b=c;this.w=a;(a=cc(a,"messages"))&&Od(this,a);this.Cb=Td;Vd(this,function(a){a:{var b=d.b.na,c=a[0],g=a=0,l=b.length;if(c){a=V(Y(d,c));if(-1===a){d.g("invalid address: "+c);break a}g=a>>>d.b.aa;l=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,k=0;l--;){var n=b[g];n.type==c?k++||d.g("..."):(c=n.type,k=Ub[c],n&&d.g(q(n.id)+" %"+q(g<>>e.aa;f!=e.D?e.B[h].zb(f,b&65535,d):(e.B[h++].lb(f,b&255,d),e.B[h&e.V].lb(0,b>>8&255,d+1));c&&Wd(a,c);rc(this.b,!0)}};function U(a){return{C:a,wa:!1}}function Xd(a){return[a.C,a.wa]}function Yd(a){return{C:a[0],wa:a[1]}} -function Y(a,b,c){var d;c=(c?a.X:a.Fb).C;if(void 0!==b){d=b=Zd(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=ma(Sd,a.substr(b,2))));return c}function ee(a,b){var c=0,d=fe(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:c=4}return c?q(d,c):"??"} -function fe(a,b){var c;if(0<=b){var d=a.b;switch(b){case 7:c=d.j;break;case 0:c=d.N;break;case 1:c=d.O;break;case 8:c=Hc(d);break;case 2:c=d.P;break;case 3:c=d.R;break;case 9:c=Jc(d);break;case 4:c=d.S;break;case 5:c=d.T;break;case 10:c=J(d);break;case 6:c=d.W(J(d));break;case 11:c=d.da;break;case 12:c=d.L;break;case 13:c=d.j<<8|Fc(d)&255}}return c} -function ge(a,b){b=Zd(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=de(b,c+1),0<=e&&(b=b.substr(0,c)+ee(a,e)+b.substr(c+1+Sd[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=aa(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=Y(a,e))?(d=e+' "'+ce(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=Y(a,e))?(Wd(d),d=e+' "'+ -ce(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}m.message=function(a,b){b&&(a+=" at "+Z(U(this.b.L).C));if(!this.Ea||a!=this.Ea)if(this.Ea=a,this.ga&-2147483648&&(this.ea(),a+=" (cpu halted)"),this.g(a),this.b){var c=this.b;c.i.Wa=0;c.D-=c.b;c.b=0;rc(c)}};function eb(a,b,c,d,e,f,h,g){g|=256;null!=f&&(a.ga&g)!=g||a.message(b.ab+"."+(null!=d?"outPort":"inPort")+"("+r(c)+","+(f?f:"unknown")+(null!=d?",0x"+q(d,2):"")+")"+(null!=h?": 0x"+q(h,2):"")+(null!=e?" at "+Z(e):""))} -function Nd(a){var b;if(rd(a)){if(!a.V||!a.V.length){a.V=Array(1E3);for(b=0;b>>d.aa],!1)}a.ba=["br"];if(void 0!==a.H)for(b=1;b>>d.aa],!0);a.H=["bw"];a.Lb=0}m.Fa=function(a,b,c){var d=!0;c||le(this,a,b,!1,!0);if(a!=this.u){var e=V(b);if(-1===e)this.g("invalid address: "+Z(b.C)),d=!1;else{var f=this.b;f.na[e>>>f.aa].Fa(e&f.G,a==this.H)}}d&&(a.push(b),c?b.wa=!0:(me(this,a,a.length-1,"set"),Nd(this)));return d}; -function le(a,b,c,d,e){var f=!1;c=V(c);for(var h=1;h>>d.aa],b==a.H));g.wa||Nd(a);break}}return f}function ne(a,b){for(var c=1;c>24,4);break;case 3:C=q(A.mb(ca,2),4);break;default:A="imm("+r(u)+")";break a}8086==A.Z&&u&64?C="["+C+"]":u&16||(C=(A.Z==Ld?"$":"0x")+C);A=C}else u&16?(A= -(p&3840)>>8,u=Sd[A],8086==a.Z&&p&64&&(6==A&&(u="HL"),u="["+u+"]"),A=u):u&128&&(A=(f>>3&7).toString());if(!A||!A.length){g="INVALID";break}0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function Se(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]],Rd={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:536870912,warn:1073741824,halt:-2147483648};m=Hd.prototype; +m.Da=function(a,b,c,d){this.B=b;this.b=c;this.w=a;(a=nc(a,"messages"))&&Ld(this,a);this.Db=Qd;Sd(this,function(a){a:{var b=d.B.T,c=a[0],g=a=0,l=b.length;if(c){a=X(Y(d,c));if(-1===a){d.g("invalid address: "+c);break a}g=a>>>d.B.ea;l=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,k=0;l--;){var n=b[g];n.type==c?k++||d.g("..."):(c=n.type,k=Ub[c],n&&d.g(q(n.id)+" %"+q(g<>>e.ea;f!=e.B?e.T[h].Bb(f,b&65535,d):(e.T[h++].nb(f,b&255,d),e.T[h&e.K].nb(0,b>>8&255,d+1));c&&Td(a,c);rc(this.b,!0)}};function U(a){return{C:a,xa:!1}}function Ud(a){return[a.C,a.xa]}function Vd(a){return{C:a[0],xa:a[1]}} +function Y(a,b,c){var d;c=(c?a.Y:a.Gb).C;if(void 0!==b){d=b=Wd(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=ma(Pd,a.substr(b,2))));return c}function be(a,b){var c=0,d=ce(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:c=4}return c?q(d,c):"??"} +function ce(a,b){var c;if(0<=b){var d=a.b;switch(b){case 7:c=d.j;break;case 0:c=d.N;break;case 1:c=d.O;break;case 8:c=Gc(d);break;case 2:c=d.P;break;case 3:c=d.R;break;case 9:c=Ic(d);break;case 4:c=d.S;break;case 5:c=d.U;break;case 10:c=K(d);break;case 6:c=d.W(K(d));break;case 11:c=d.ca;break;case 12:c=d.L;break;case 13:c=d.j<<8|Fc(d)&255}}return c} +function de(a,b){b=Wd(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=ae(b,c+1),0<=e&&(b=b.substr(0,c)+be(a,e)+b.substr(c+1+Pd[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=aa(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=Y(a,e))?(d=e+' "'+$d(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=Y(a,e))?(Td(d),d=e+' "'+ +$d(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}m.message=function(a,b){b&&(a+=" at "+Z(U(this.b.L).C));if(!this.Ga||a!=this.Ga)if(this.Ga=a,this.ha&-2147483648&&(this.da(),a+=" (cpu halted)"),this.g(a),this.b){var c=this.b;c.i.Xa=0;c.D-=c.b;c.b=0;rc(c)}};function eb(a,b,c,d,e,f,h,g){g|=256;null!=f&&(a.ha&g)!=g||a.message(b.cb+"."+(null!=d?"outPort":"inPort")+"("+r(c)+","+(f?f:"unknown")+(null!=d?",0x"+q(d,2):"")+")"+(null!=h?": 0x"+q(h,2):"")+(null!=e?" at "+Z(e):""))} +function Kd(a){var b;if(od(a)){if(!a.X||!a.X.length){a.X=Array(1E3);for(b=0;b>>d.ea],!1)}a.ba=["br"];if(void 0!==a.I)for(b=1;b>>d.ea],!0);a.I=["bw"];a.Mb=0}m.Ha=function(a,b,c){var d=!0;c||ie(this,a,b,!1,!0);if(a!=this.u){var e=X(b);if(-1===e)this.g("invalid address: "+Z(b.C)),d=!1;else{var f=this.B;f.T[e>>>f.ea].Ha(e&f.B,a==this.I)}}d&&(a.push(b),c?b.xa=!0:(je(this,a,a.length-1,"set"),Kd(this)));return d}; +function ie(a,b,c,d,e){var f=!1;c=X(c);for(var h=1;h>>d.ea],b==a.I));g.xa||Kd(a);break}}return f}function ke(a,b){for(var c=1;c>24,4);break;case 3:C=q(A.Ca(ba,2),4);break;default:A="imm("+r(u)+")";break a}8086==A.aa&&u&64?C="["+C+"]":u&16||(C=(A.aa==Id?"$":"0x")+C);A=C}else u& +16?(A=(p&3840)>>8,u=Pd[A],8086==a.aa&&p&64&&(6==A&&(u="HL"),u="["+u+"]"),A=u):u&128&&(A=(f>>3&7).toString());if(!A||!A.length){g="INVALID";break}0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; +function Pe(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 $d(a,b,c){var d;if(b){b=Zd(a,b);for(var e=0,f=!1,h=b,g=[],l=[],k=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;h=n+"b"+h;d>>=8}d="0x"+q(c)+" "+c+". ("+h+")"}a.g((null!=b?b+": ":"")+d);return e}function Ve(a,b){if(b)return Ue(a,b,a.ra[b]);var c=0;for(b in a.ra)Ue(a,b,a.ra[b]),c++;return 0b[0]?1:a[0]>>0;for(b=0;b>>0,g=f.gc;if(e>=h&&e>8&255;case "C":d.O=g&255;break;case "D":d.P= -g&255;break;case "DE":d.P=g>>8&255;case "E":d.R=g&255;break;case "H":d.S=g&255;break;case "HL":d.S=g>>8&255;case "L":d.T=g&255;break;case "SP":d.da=g&65535;break;case "PC":H(d,g);a.X=U(d.L);break;case "PS":Dc(d,g);break;case "C":d.I=g?d.I|256:d.I&255;break;case "P":g?Nc(d)||(d.Y^=1):Nc(d)&&(d.Y^=1);break;case "A":d.ia=g?~d.Y&16|d.ia&-17:d.Y&16|d.ia&-17;break;case "Z":d.I=g?d.I&-256:d.I|255;break;case "S":g?Qc(d)||(d.Y^=192):Qc(d)&&(d.Y^=192);break;case "I":d.pa=g?d.pa|512:d.pa&-513;break;default:a.g("unknown register: "+ -e);return}if(!h){a.g("invalid value: "+f);return}rc(d);a.g("updated registers:")}a.g(Qe(a));c&&(a.X=U(d.L),je(a,Z(a.X.C)))}}function bf(a,b){b=ia(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(ge(a,c[2])):$d(a,b,!0)}function cf(a,b,c){var d="t"!=b;c=Te(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ca(c,function(){return gb(a,!0)&&a.Ya(e,d,!1)},function(){rc(a.b);gb(a,!1)})} -function je(a,b,c,d){if(b=Y(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=Y(a,c,!0);if(!d||d.Cg[0].indexOf("+"))){var k=g[0]+":";g[2]&&(k+=" "+g[2]);a.g(k)}g[3]&&(h=g[3],f=null);f=pe(a,b,h,f);a.g(f);a.X=b;e-=b.C-l;c++}}} -function be(a,b,c,d){if(c)if(b){0>a.G&&a.D.length&&(a.G=0);if(0>a.G||b!=a.D[a.G])a.D.splice(0,0,b),a.G=0;a.G--}else a.ma?b="end":b=a.D[a.G+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var h=b.charAt(f);if('"'==h||"'"==h)e?h==e&&(e=null):e=h;else if(h==d&&!e||!h)a.push(ia(b.substring(c,f))),c=f+1}}return a} -function oe(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.ma&&(a.g("ended assemble at "+Z(a.ja.C)),a.X=a.ja,a.ma=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.Ea=null;if(ib(a)&&0k||"z"ya.length&&(a.g("note: only "+ya.length+" available"),X=ya.length);T-=X;0>T&&(null==ya[ya.length-1].C?(X=T+X,T=0):T+=ya.length); -var Wc=[];"call"==ve&&(cb=1E5,Wc=["CALL"]);for(void 0!==ue&&a.g(X+" instructions earlier:");0=ya.length&&(T=0);a.Mb=X;xe++;cb--}}xe||(a.g("no "+we+"history available"),a.Mb=void 0)}else{var dc=Y(a,wa);if(dc){var ec=0;La&&("l"==La.charAt(0)&&(La=La.substr(1)||zf),ec=Te(a,La)>>>0,65536>4||1;Bf--&&0ic?String.fromCharCode(ic):".";gc--}Ma&&(Ma+="\n");Ma+=wa+" "+Ab+(0==zb?" "+Yc:"")}Ma&&a.g(Ma);a.Fb=dc}}}}break;case "e":if("else"==f[0])break;var jc=1,Ae=255,Be=a.W,Ce=a.Ab;"ew"==f[0]&&(jc=2,Ae=65535,Be=a.mb,Ce=a.Vb);var De=jc<<1,Ee=f[1];if(null==Ee)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 kc=Y(a,Ee);if(kc)for(var lc=2;lcdd;){for(var Na=null,Gf=256;65536>Db.C>>>0;){Ge.C=a.mb(Db,2);if(null==Db.C||!Gf--)break;for(var Hf=a,mc=Ge,He=null,Eb=mc.C,Ie=Eb,ed=1;6>=ed&&Eb;ed++){if(2nf){if(jf(d,this.V)){this.H=new Gc(this,pf,"failsafe");jf(this.H)&&(tf(this,d),a=2,ff(this.H));I(this.H,"timestamp",la());gf(this.H);var e=this.w&&!this.J;if(1==a||qa("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=hf(d)){var f=kf(d,"code"),h=kf(d,"data");f&&("ok"==f?jf(d,h):("error"==f&&"no machine state"!= -h?(this.oa("Error: "+h),"unable to verify user"==h&&(ua("user",""),this.u=null)):this.g(f+": "+h),ff(d),jf(d)?(c=hf(d),e=!0):c=!1))}e&&sf(this,c?d:null)}else 2==a&&d.clear()}else sf(this);delete this.V;delete this.X}e=Za(this.id);for(f=0;fa[1];a=a[2];this.A.ha=!0;var d=this.U.power;d&&(d.textContent="Shutdown");this.fa||(this.g("PC8080 v"+pf+"\nCopyright \u00a9 2012-2016 Jeff Parsons \nLicense: GPL version 3 or later "),this.fa=!0);this.b&&(uf(this,this.b,b,c,a),sc(this.b));this.ja&&(tf(this,b),b.clear());!c&&this.H&&(this.H.clear(),delete this.H);this.D=0}; -function tf(a,b){if(qa("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.ua,d=a.u||"",e=b.toString(),f={app:"PC8080"};f.ver=pf;f.url=c;f.user=d;f.type="bug";f.data=e;na("http://www.pcjs.org/api/v1/report",f,!0)}} -function df(a,b,c){var d,e="none";if(a.D)return null;a.D--;var f=new Gc(a,pf),h=new Gc(a,pf,"validate"),g=la();I(h,"timestamp",g);I(f,"timestamp",g);I(f,"version","1.22.0");I(f,"url",window?window.location.href:null);I(f,"browser",pa());a.b&&a.b.xa&&(c&&a.b.ea(),d=a.b.xa(b,c),"object"===typeof d&&I(f,a.b.id,d),c&&(a.b.A.ha=!1,!1===d&&(e=null)));for(var g=Za(a.id),l=0;l=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;h=n+"b"+h;d>>=8}d="0x"+q(c)+" "+c+". ("+h+")"}a.g((null!=b?b+": ":"")+d);return e}function Se(a,b){if(b)return Re(a,b,a.ra[b]);var c=0;for(b in a.ra)Re(a,b,a.ra[b]),c++;return 0b[0]?1:a[0]>>0;for(b=0;b>>0,g=f.gc;if(e>=h&&e>8&255;case "C":d.O=g&255;break;case "D":d.P= +g&255;break;case "DE":d.P=g>>8&255;case "E":d.R=g&255;break;case "H":d.S=g&255;break;case "HL":d.S=g>>8&255;case "L":d.U=g&255;break;case "SP":d.ca=g&65535;break;case "PC":H(d,g);a.Y=U(d.L);break;case "PS":Dc(d,g);break;case "C":d.H=g?d.H|256:d.H&255;break;case "P":g?Mc(d)||(d.Z^=1):Mc(d)&&(d.Z^=1);break;case "A":d.ja=g?~d.Z&16|d.ja&-17:d.Z&16|d.ja&-17;break;case "Z":d.H=g?d.H&-256:d.H|255;break;case "S":g?Pc(d)||(d.Z^=192):Pc(d)&&(d.Z^=192);break;case "I":d.pa=g?d.pa|512:d.pa&-513;break;default:a.g("unknown register: "+ +e);return}if(!h){a.g("invalid value: "+f);return}rc(d);a.g("updated registers:")}a.g(Ne(a));c&&(a.Y=U(d.L),ge(a,Z(a.Y.C)))}}function Ze(a,b){b=ia(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(de(a,c[2])):Xd(a,b,!0)}function $e(a,b,c){var d="t"!=b;c=Qe(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ca(c,function(){return gb(a,!0)&&a.$a(e,d,!1)},function(){rc(a.b);gb(a,!1)})} +function ge(a,b,c,d){if(b=Y(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=Y(a,c,!0);if(!d||d.Cg[0].indexOf("+"))){var k=g[0]+":";g[2]&&(k+=" "+g[2]);a.g(k)}g[3]&&(h=g[3],f=null);f=me(a,b,h,f);a.g(f);a.Y=b;e-=b.C-l;c++}}} +function Zd(a,b,c,d){if(c)if(b){0>a.G&&a.D.length&&(a.G=0);if(0>a.G||b!=a.D[a.G])a.D.splice(0,0,b),a.G=0;a.G--}else a.na?b="end":b=a.D[a.G+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var h=b.charAt(f);if('"'==h||"'"==h)e?h==e&&(e=null):e=h;else if(h==d&&!e||!h)a.push(ia(b.substring(c,f))),c=f+1}}return a} +function le(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.na&&(a.g("ended assemble at "+Z(a.ma.C)),a.Y=a.ma,a.na=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.Ga=null;if(ib(a)&&0k||"z"xa.length&&(a.g("note: only "+xa.length+" available"),W=xa.length);S-=W;0>S&&(null==xa[xa.length-1].C?(W=S+W,S=0):S+=xa.length); +var Uc=[];"call"==se&&(ab=1E5,Uc=["CALL"]);for(void 0!==re&&a.g(W+" instructions earlier:");0=xa.length&&(S=0);a.Nb=W;ue++;ab--}}ue||(a.g("no "+te+"history available"),a.Nb=void 0)}else{var cc=Y(a,va);if(cc){var dc=0;Ka&&("l"==Ka.charAt(0)&&(Ka=Ka.substr(1)||wf),dc=Qe(a,Ka)>>>0,65536>4||1;yf--&&0hc?String.fromCharCode(hc):".";fc--}La&&(La+="\n");La+=va+" "+yb+(0==xb?" "+Wc:"")}La&&a.g(La);a.Gb=cc}}}}break;case "e":if("else"==f[0])break;var ic=1,xe=255,ye=a.W,ze=a.fa;"ew"==f[0]&&(ic=2,xe=65535,ye=a.Ca,ze=a.sb);var Ae=ic<<1,Be=f[1];if(null==Be)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 jc=Y(a,Be);if(jc)for(var kc=2;kcbd;){for(var Ma=null,Df=256;65536>Bb.C>>>0;){De.C=a.Ca(Bb,2);if(null==Bb.C||!Df--)break;for(var Ef=a,lc=De,Ee=null,Cb=lc.C,Fe=Cb,cd=1;6>=cd&&Cb;cd++){if(2kf){if(ff(d,this.X)){this.I=new I(this,mf,"failsafe");ff(this.I)&&(qf(this,d),a=2,cf(this.I));J(this.I,"timestamp",la());df(this.I);var e=this.w&&!this.J;if(1==a||qa("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=ef(d)){var f=gf(d,"code"),h=gf(d,"data");f&&("ok"==f?ff(d,h):("error"==f&&"no machine state"!= +h?(this.oa("Error: "+h),"unable to verify user"==h&&(Aa("user",""),this.u=null)):this.g(f+": "+h),cf(d),ff(d)?(c=ef(d),e=!0):c=!1))}e&&pf(this,c?d:null)}else 2==a&&d.clear()}else pf(this);delete this.X;delete this.Y}e=Za(this.id);for(f=0;fa[1];a=a[2];this.A.ia=!0;var d=this.V.power;d&&(d.textContent="Shutdown");this.la||(this.g("PC8080 v"+mf+"\nCopyright \u00a9 2012-2016 Jeff Parsons \nLicense: GPL version 3 or later "),this.la=!0);this.b&&(rf(this,this.b,b,c,a),sc(this.b));this.ma&&(qf(this,b),b.clear());!c&&this.I&&(this.I.clear(),delete this.I);this.D=0}; +function qf(a,b){if(qa("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.sa,d=a.u||"",e=b.toString(),f={app:"PC8080"};f.ver=mf;f.url=c;f.user=d;f.type="bug";f.data=e;na("http://www.pcjs.org/api/v1/report",f,!0)}} +function af(a,b,c){var d,e="none";if(a.D)return null;a.D--;var f=new I(a,mf),h=new I(a,mf,"validate"),g=la();J(h,"timestamp",g);J(f,"timestamp",g);J(f,"version","1.22.0");J(f,"url",window?window.location.href:null);J(f,"browser",pa());a.b&&a.b.ya&&(c&&a.b.da(),d=a.b.ya(b,c),"object"===typeof d&&J(f,a.b.id,d),c&&(a.b.A.ia=!1,!1===d&&(e=null)));for(var g=Za(a.id),l=0;l>>e.aa;0>8|(u&255)<<8,ca=65536,C=16;l>=1))>>--C,W=d.X,S=l++, -x=g[x],S=(S+k*W.width)*x.length;W.data[S]=x[0];W.data[S+1]=x[1];W.data[S+2]=x[2];W.data[S+3]=x[3]}l>p&&(p=l);k=A&&(A=k+1)}e+=2;h++;if(l>=d.u&&(l=0,k++,k>d.D))break}d.M=!0;ng.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(p){g=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");na(e,null,!0,function(f,h,g){if(g||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+g+")");else{if(f=d[3])if(g=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=g[0],k,n=/( [a-z]+=)(['"])(.*?)\2/g;k=n.exec(f);)l=0>l.indexOf(k[1])?l.replace(">",k[0]+">"):l.replace(new RegExp(k[1]+"(['\"])(.*?)\\1"),k[0]);g[0]!=l&&(h=h.replace(g[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],h);Nf(a,b,c)}})}else c(a,null)} -function Of(a,b,c,d){function e(a){if(void 0===g){var b=h&&D(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ga(a))}function f(a){e("Error: "+a);l&&(--xf||Pa(!0));l=!1}var h,g,l=!0;xf++;Xa[a]={};try{if(h=document.getElementById(a)){var k;if("object"==typeof resources&&(k=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],p=document.createElement("style");p.type="text/css";p.styleSheet?p.styleSheet.cssText=k:p.appendChild(document.createTextNode(k));n.appendChild(p)}c|| -(c="/versions/pc8080/1.22.0/components.xsl");k=function(d,g){g?yf(c,null,null,!1,e,function(d,l){if(l)if(Ya(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var k=g.transformNode(l);k?(h.outerHTML=k,--xf||Pa(!0)):f("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(k=new XSLTProcessor,k.importStylesheet(l),(k=k.transformToFragment(g,document))?h.parentNode?(h.parentNode.replaceChild(k,h),--xf||Pa(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?yf(b,a,d,!0,e,k):Mf(b,null,a,d,!1,e,k)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPC8080=function(a,b,c,d){Pa(!1);return Of(a,b,c,d)};window.enableEvents=Pa;window.sendEvent=Qa; -function Pf(a,b,c,d){if(!c&&b){d.push(b);a=Xa[d[0]];b=null;for(var e in a)if(ea(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?na(b,null,!0,function(a,b){Qf(b,d)}):Qf(null,d)}else t("Error ("+c+") requesting "+a)} -function Qf(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=Xa[f],l={},k;for(k in g){var n=g[k],p=da(k);if("xml"==p){for(p=/[ \t]*]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=p.exec(g[k]);){var w=d[2];w&&(g[w]||(n=n.replace(d[0],"")))}d=k=ba(k)}else"xsl"==p&&(e=k=ba(k));l[k]=n}a&&(l[k="css"]=a);b[2]&&(l[k="parms"]=b[2]);b[3]&&(l[k="state"]=b[3]);d&&e?(k=JSON.stringify(l),h+=".js",c=c[1]+"var resources="+k+";"+c[2]+c[3],c=c.replace(/\u00A9/g, +m.qa=function(a,b,c){var d=this;switch(b){case "power":return this.V[b]=c,c.onclick=function(){d.D||(d.A.ia?af(d,!1,!0):of(d,d.jb))},!0;case "reset":return this.V[b]=c,c.onclick=function(){if(d.A.ia&&!d.D)if(d.w&&!d.M){var a=qa("Click OK to save changes to this PC8080 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");af(d,a,!0);!a&&d.ga?window&&window.location.reload():d.jb(kf)}else d.reset(),d.b&&sc(d.b)},!0;case "save":if(ea(oa(),"pcjs.org")){c.parentNode.removeChild(c); +break}this.V[b]=c;c.onclick=function(){var a=lf(d,!0);if(a){var b=!!(d.w&&!d.M||d.ga),c=af(d,b);b?sf(d,a,c):d.oa("Resume disabled, machine state not saved")}};return!0}return!1}; +function lf(a,b){var c=a.u;c||(c=ta("user"),void 0!==c?!c&&b&&(c=null,window&&(c=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c&&((c=tf(a,c))||a.oa("The user ID is invalid."))):b&&a.oa("Browser local storage is not available"));return c} +function tf(a,b){a.u=null;var c=na(oa()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(Aa("user",c.data),a.u=c.data)}catch(e){t(e.message+" ("+d+")")}return a.u}function nf(a){var b=null;a.u&&(b=oa()+"/api/v1/user?req=load&user="+a.u+"&state="+bf(a,mf));return b} +function sf(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=bf(a,mf);d.data=c;b=na(oa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0>>e.ea;0>8|(u&255)<<8,ba=65536,C=16;l>=1))>>--C,V=d.ba,R= +l++,x=g[x],R=(R+k*V.width)*x.length;V.data[R]=x[0];V.data[R+1]=x[1];V.data[R+2]=x[2];V.data[R+3]=x[3]}l>p&&(p=l);k=A&&(A=k+1)}e+=2;h++;if(l>=d.u&&(l=0,k++,k>d.D))break}d.aa=!0;ng.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(p){g=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");na(e,null,!0,function(f,h,g){if(g||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+g+")");else{if(f=d[3])if(g=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=g[0],k,n=/( [a-z]+=)(['"])(.*?)\2/g;k=n.exec(f);)l=0>l.indexOf(k[1])?l.replace(">",k[0]+">"):l.replace(new RegExp(k[1]+"(['\"])(.*?)\\1"),k[0]);g[0]!=l&&(h=h.replace(g[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],h);Kf(a,b,c)}})}else c(a,null)} +function Lf(a,b,c,d){function e(a){if(void 0===g){var b=h&&D(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ga(a))}function f(a){e("Error: "+a);l&&(--uf||Pa(!0));l=!1}var h,g,l=!0;uf++;Xa[a]={};try{if(h=document.getElementById(a)){var k;if("object"==typeof resources&&(k=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],p=document.createElement("style");p.type="text/css";p.styleSheet?p.styleSheet.cssText=k:p.appendChild(document.createTextNode(k));n.appendChild(p)}c|| +(c="/versions/pc8080/1.22.0/components.xsl");k=function(d,g){g?vf(c,null,null,!1,e,function(d,l){if(l)if(Ya(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var k=g.transformNode(l);k?(h.outerHTML=k,--uf||Pa(!0)):f("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(k=new XSLTProcessor,k.importStylesheet(l),(k=k.transformToFragment(g,document))?h.parentNode?(h.parentNode.replaceChild(k,h),--uf||Pa(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?vf(b,a,d,!0,e,k):Jf(b,null,a,d,!1,e,k)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPC8080=function(a,b,c,d){Pa(!1);return Lf(a,b,c,d)};window.enableEvents=Pa;window.sendEvent=Qa; +function Mf(a,b,c,d){if(!c&&b){d.push(b);a=Xa[d[0]];b=null;for(var e in a)if(ea(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?na(b,null,!0,function(a,b){Nf(b,d)}):Nf(null,d)}else t("Error ("+c+") requesting "+a)} +function Nf(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=Xa[f],l={},k;for(k in g){var n=g[k],p=da(k);if("xml"==p){for(p=/[ \t]*]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=p.exec(g[k]);){var w=d[2];w&&(g[w]||(n=n.replace(d[0],"")))}d=k=ca(k)}else"xsl"==p&&(e=k=ca(k));l[k]=n}a&&(l[k="css"]=a);b[2]&&(l[k="parms"]=b[2]);b[3]&&(l[k="state"]=b[3]);d&&e?(k=JSON.stringify(l),h+=".js",c=c[1]+"var resources="+k+";"+c[2]+c[3],c=c.replace(/\u00A9/g, "©"),k=h,g=null,l="data:application/javascript,",l=Ba("Firefox")?l+encodeURIComponent(c):l+encodeURI(c),k&&(g=document.createElement("a"),"string"!=typeof g.download&&(g=null)),g?(g.href=l,g.download=k,document.body.appendChild(g),g.click(),document.body.removeChild(g),c="Check your Downloads folder for "+k+"."):(window.open(l),c="Check your browser for a new window/tab containing the requested data"+(k?" ("+k+")":"")+"."),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+='