diff --git a/apps/pdp11/tapes/DEC-11-AJPB-PB.json b/apps/pdp11/tapes/DEC-11-AJPB-PB.json index ccc0dd96f..2024937e2 100644 --- a/apps/pdp11/tapes/DEC-11-AJPB-PB.json +++ b/apps/pdp11/tapes/DEC-11-AJPB-PB.json @@ -636,4 +636,4 @@ 0x2442 /*022102*/,0x2418 /*022030*/,0x8142 /*100502*/,0x0000 /*000000*/,0xCC00 /*146000*/,0x0000 /*000000*/,0x0000 /*000000*/,0x0000 /*000000*/, 0x0000 /*000000*/,0x0000 /*000000*/,0x0000 /*000000*/,0x0000 /*000000*/,0x0000 /*000000*/,0x0000 /*000000*/,0x0000 /*000000*/,0x0000 /*000000*/, 0x0000 /*000000*/,0xFF00 /*177400*/] -} \ No newline at end of file +} diff --git a/apps/pdp11/tapes/demo.xml b/apps/pdp11/tapes/demo.xml index cba22c818..9e54a95d8 100644 --- a/apps/pdp11/tapes/demo.xml +++ b/apps/pdp11/tapes/demo.xml @@ -1,5 +1,5 @@ - + diff --git a/docs/pcx86/examples/components.xsl b/docs/pcx86/examples/components.xsl index 605bcdb84..5c69d9f5a 100644 --- a/docs/pcx86/examples/components.xsl +++ b/docs/pcx86/examples/components.xsl @@ -738,21 +738,32 @@ - + + + + + + + + + + + + device - ,type:'' + ,type:'',autoMount:'' @@ -878,10 +889,11 @@ - + - + + @@ -893,7 +905,7 @@ fdc - ,autoMount:'',sortBy:'' + ,autoMount:'',sortBy:'' diff --git a/modules/pcx86/lib/disk.js b/modules/pcx86/lib/disk.js index 68962c127..dc801b5cc 100644 --- a/modules/pcx86/lib/disk.js +++ b/modules/pcx86/lib/disk.js @@ -1094,7 +1094,6 @@ Disk.prototype.load = function(sDiskName, sDiskPath, file, fnNotify, controller) }; /** - * * build(buffer, fModified) * * Builds a disk image from an ArrayBuffer (eg, from a FileReader object), rather than from JSON-encoded data. @@ -1217,24 +1216,6 @@ Disk.prototype.doneLoad = function(sURL, sDiskData, nErrorCode) } /* * The most likely source of any exception will be here, where we're parsing the disk data. - * - * TODO: IE9 is rather unfriendly and restrictive with regard to how much data it's willing to - * eval(). In particular, the 10Mb disk image we use for the Windows 1.01 demo config fails in - * IE9 with an "Out of memory" exception. One work-around would be to chop the data into chunks - * (perhaps one track per chunk, using regular expressions) and then manually re-assemble it. - * - * However, it turns out that using JSON.parse(sDiskData) instead of eval("(" + sDiskData + ")") - * is a much easier fix. The only drawback is that we must first quote any unquoted property names - * and remove any comments, because while eval() was cool with them, JSON.parse() is more particular; - * the following RegExp replacements take care of those requirements. - * - * The use of hex values is something else that eval() was OK with, but JSON.parse() is not, and - * while I've stopped using hex values in DumpAPI responses (at least when "format=json" is specified), - * I can't guarantee they won't show up in "legacy" images, and there's no simple RegExp replacement - * for transforming hex values into decimal values, so I cop out and fall back to eval() if I detect - * any hex prefixes ("0x") in the sequence. Ditto for error messages, which appear like so: - * - * ["unrecognized disk path: test.img"] */ var aDiskData; if (sDiskData.substr(0, 1) == "<") { // if the "data" begins with a "<"... @@ -1249,6 +1230,25 @@ Disk.prototype.doneLoad = function(sURL, sDiskData, nErrorCode) */ aDiskData = ["Missing disk image: " + this.sDiskName]; } else { + /* + * TODO: IE9 is rather unfriendly and restrictive with regard to how much data it's willing to + * eval(). In particular, the 10Mb disk image we use for the Windows 1.01 demo config fails in + * IE9 with an "Out of memory" exception. One work-around would be to chop the data into chunks + * (perhaps one track per chunk, using regular expressions) and then manually re-assemble it. + * + * However, it turns out that using JSON.parse(sDiskData) instead of eval("(" + sDiskData + ")") + * is a much easier fix. The only drawback is that we must first quote any unquoted property names + * and remove any comments, because while eval() was cool with them, JSON.parse() is more particular; + * the following RegExp replacements take care of those requirements. + * + * The use of hex values is something else that eval() was OK with, but JSON.parse() is not, and + * while I've stopped using hex values in DumpAPI responses (at least when "format=json" is specified), + * I can't guarantee they won't show up in "legacy" images, and there's no simple RegExp replacement + * for transforming hex values into decimal values, so I cop out and fall back to eval() if I detect + * any hex prefixes ("0x") in the sequence. Ditto for error messages, which appear like so: + * + * ["unrecognized disk path: test.img"] + */ if (sDiskData.indexOf("0x") < 0 && sDiskData.substr(0, 2) != "[\"") { aDiskData = JSON.parse(sDiskData.replace(/([a-z]+):/gm, "\"$1\":").replace(/\/\/[^\n]*/gm, "")); } else { diff --git a/modules/pcx86/lib/fdc.js b/modules/pcx86/lib/fdc.js index 48697e9eb..45c966009 100644 --- a/modules/pcx86/lib/fdc.js +++ b/modules/pcx86/lib/fdc.js @@ -659,10 +659,7 @@ FDC.prototype.initBus = function(cmp, bus, cpu, dbg) bus.addPortOutputTable(this, FDC.aPortOutput); this.addDiskette("None", "", true); - - if (this.fLocalDisks) { - this.addDiskette("Local Disk", "?"); - } + if (this.fLocalDisks) this.addDiskette("Local Disk", "?"); this.addDiskette("Remote Disk", "??"); if (!this.autoMount()) this.setReady(); @@ -1535,6 +1532,7 @@ FDC.prototype.doneLoadDiskette = function onFDCLoadNotify(drive, disk, sDiskette /** * addDiskette(sName, sPath, fTop) * + * @this {FDC} * @param {string} sName * @param {string} sPath * @param {boolean} [fTop] (default is bottom) @@ -1563,6 +1561,7 @@ FDC.prototype.addDiskette = function(sName, sPath, fTop) * This is used to deal with mount requests (eg, autoMount) that supply a path without a name; * if we can find the path in the "listDisks" control, then we return the associated disk name. * + * @this {FDC} * @param {string} sPath * @return {string|null} */ diff --git a/modules/pdp11/lib/pc11.js b/modules/pdp11/lib/pc11.js index b8f886396..d356ceec8 100644 --- a/modules/pdp11/lib/pc11.js +++ b/modules/pdp11/lib/pc11.js @@ -31,6 +31,7 @@ if (NODE) { var str = require("../../shared/lib/strlib"); var web = require("../../shared/lib/weblib"); + var DumpAPI = require("../../shared/lib/dumpapi"); var Component = require("../../shared/lib/component"); var State = require("../../shared/lib/state"); var PDP11 = require("./defines"); @@ -48,14 +49,30 @@ function PC11(parms) { Component.call(this, "PC11", parms, PC11); + /* + * We record any 'autoMount' object now, but we no longer parse it until initBus(), because the Computer's + * getMachineParm() service may have an override for us. + */ + this.configMount = parms['autoMount'] || null; + /* * TODO: Technically, the PC11 should have a timer that "clocks" data from the abReader buffer into the * PRB register at the appropriate rate (300 CPS for the high-speed version, 10 CPS for the low-speed version). */ - this.prs = 0; // PRS register - this.prb = 0; // PRB register - this.iReader = 0; // buffer index - this.abReader = []; // buffer for the PRB register + this.prs = 0; // PRS register + this.prb = 0; // PRB register + this.iReader = 0; // buffer index + this.abReader = []; // buffer for the PRB register + + this.flags.local = false; + this.sTapeName = this.sTapePath = this.sTapeFile = ""; + + /* + * Support for local tape images is currently limited to desktop browsers with FileReader support; + * when this flag is set, setBinding() allows local tape bindings and informs initBus() to update the + * "listTapes" binding accordingly. + */ + this.fLocalTapes = (!web.isMobile() && window && 'FileReader' in window); } Component.subclass(PC11); @@ -64,14 +81,103 @@ Component.subclass(PC11); * setBinding(sType, sBinding, control, sValue) * * @this {PC11} - * @param {string|null} sType is the type of the HTML control (eg, "button", "textarea", "register", "flag", "rled", etc) - * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "buffer") + * @param {string|null} sType is the type of the HTML control (eg, "button", "list", "text", etc) + * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "listTapes") * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) * @param {string} [sValue] optional data value * @return {boolean} true if binding was successful, false if unrecognized binding request */ PC11.prototype.setBinding = function(sType, sBinding, control, sValue) { + var pc11 = this; + + switch (sBinding) { + + case "listTapes": + this.bindings[sBinding] = control; + + control.onchange = function onChangeListTapes(event) { + var controlDesc = pc11.bindings["descTape"]; + var controlOption = control.options[control.selectedIndex]; + if (controlDesc && controlOption) { + var dataValue = {}; + var sValue = controlOption.getAttribute("data-value"); + if (sValue) { + try { + dataValue = eval("(" + sValue + ")"); + } catch (e) { + Component.error("PC11 option error: " + e.message); + } + } + var sHTML = dataValue['desc']; + if (sHTML === undefined) sHTML = ""; + var sHRef = dataValue['href']; + if (sHRef !== undefined) sHTML = "" + sHTML + ""; + controlDesc.innerHTML = sHTML; + } + }; + return true; + + case "descTape": + this.bindings[sBinding] = control; + return true; + + case "loadTape": + this.bindings[sBinding] = control; + + control.onclick = function onClickLoadTape(event) { + var controlTapes = pc11.bindings["listTapes"]; + if (controlTapes) { + var sTapeName = controlTapes.options[controlTapes.selectedIndex].text; + var sTapePath = controlTapes.value; + pc11.loadSelectedTape(sTapeName, sTapePath); + } + }; + return true; + + case "mountTape": + if (!this.fLocalTapes) { + if (DEBUG) this.log("Local tape support not available"); + /* + * We could also simply hide the control; eg: + * + * control.style.display = "none"; + * + * but removing the control altogether seems better. + */ + control.parentNode.removeChild(/** @type {Node} */ (control)); + return false; + } + + this.bindings[sBinding] = control; + + /* + * Enable "Mount" button only if a file is actually selected + */ + control.addEventListener('change', function() { + var fieldset = control.children[0]; + var files = fieldset.children[0].files; + var submit = fieldset.children[1]; + submit.disabled = !files.length; + }); + + control.onsubmit = function(event) { + var file = event.currentTarget[1].files[0]; + if (file) { + var sTapePath = file.name; + var sTapeName = str.getBaseName(sTapePath, true); + pc11.loadSelectedTape(sTapeName, sTapePath, file); + } + /* + * Prevent reloading of web page after form submission + */ + return false; + }; + return true; + + default: + break; + } return false; }; @@ -91,9 +197,30 @@ PC11.prototype.initBus = function(cmp, bus, cpu, dbg) this.cpu = cpu; this.dbg = dbg; + this.configMount = this.cmp.getMachineParm('autoMount') || this.configMount; + + if (this.configMount) { + if (typeof this.configMount == "string") { + try { + /* + * The most likely source of any exception will be right here, where we're parsing + * this JSON-encoded data. + */ + this.configMount = eval("(" + this.configMount + ")"); + } catch (e) { + Component.error("PC11 auto-mount error: " + e.message + " (" + this.configMount + ")"); + this.configMount = null; + } + } + } + bus.addIOTable(this, PC11.UNIBUS_IOTABLE); - this.setReady(); + this.addTape("None", "", true); + if (this.fLocalTapes) this.addTape("Local Tape", "?"); + this.addTape("Remote Tape", "??"); + + if (!this.autoMount()) this.setReady(); }; /** @@ -142,6 +269,318 @@ PC11.prototype.reset = function() this.abReader = []; }; +/** + * autoMount(fRemount) + * + * @this {PC11} + * @param {boolean} [fRemount] is true if we're remounting all auto-mounted tapes + * @return {boolean} true if one or more tape images are being auto-mounted, false if none + */ +PC11.prototype.autoMount = function(fRemount) +{ + if (!fRemount) this.cAutoMount = 0; + if (this.configMount) { + var sTapePath = this.configMount['path']; + var sTapeName = this.configMount['name'] || this.findTape(sTapePath); + if (sTapePath && sTapeName) { + if (!this.loadTape(sTapeName, sTapePath, true) && fRemount) { + this.setReady(false); + } + } else { + this.notice("Incorrect auto-mount settings for PC11 (" + JSON.stringify(this.configMount) + ")"); + } + } + return !!this.cAutoMount; +}; + +/** + * loadSelectedTape(sTapeName, sTapePath, file) + * + * @this {PC11} + * @param {string} sTapeName + * @param {string} sTapePath + * @param {File} [file] is set if there's an associated File object + */ +PC11.prototype.loadSelectedTape = function(sTapeName, sTapePath, file) +{ + if (!sTapePath) { + this.unloadTape(); + return; + } + + if (sTapePath == "?") { + this.notice('Use "Choose File" and "Mount" to select and load a local tape.'); + return; + } + + /* + * If the special path of "??" is selected, then we want to prompt the user for a URL. Oh, and + * make sure we pass an empty string as the 2nd parameter to prompt(), so that IE won't display + * "undefined" -- because after all, undefined and "undefined" are EXACTLY the same thing, right? + * + * TODO: This is literally all I've done to support remote tape images. There's probably more + * I should do, like dynamically updating "listTapes" to include new entries, and adding new entries + * to the save/restore data. + */ + if (sTapePath == "??") { + sTapePath = window.prompt("Enter the URL of a remote tape image.", "") || ""; + if (!sTapePath) return; + sTapeName = str.getBaseName(sTapePath); + if (DEBUG) this.println("Attempting to load " + sTapePath + " as \"" + sTapeName + "\""); + } + + this.loadTape(sTapeName, sTapePath, false, file); +}; + +/** + * loadTape(sTapeName, sTapePath, fAutoMount, file) + * + * NOTE: If sTapePath is already loaded, nothing needs to be done. + * + * @this {PC11} + * @param {string} sTapeName + * @param {string} sTapePath + * @param {boolean} [fAutoMount] + * @param {File} [file] is set if there's an associated File object + * @return {number} 1 if tape loaded, 0 if queued up (or busy), -1 if already loaded + */ +PC11.prototype.loadTape = function(sTapeName, sTapePath, fAutoMount, file) +{ + if (sTapePath) { + if (this.sTapePath.toLowerCase() != sTapePath.toLowerCase()) { + + this.unloadTape(fAutoMount, true); + + if (this.flags.busy) { + this.notice("PC11 busy"); + return 0; + } + + // if (DEBUG) this.println("tape queued: " + sTapeName); + + this.flags.busy = true; + if (fAutoMount) { + this.fAutoMount = true; + this.cAutoMount++; + if (this.messageEnabled()) this.printMessage("auto-loading tape: " + sTapeName); + } + + this.flags.local = !!file; + if (!this.load(sTapeName, sTapePath, file)) { + return 0; + } + return 1; + } + if (DEBUG) this.println("tape loaded"); + } + return -1; +}; + +/** + * load(sTapeName, sTapePath, file) + * + * @this {PC11} + * @param {string} sTapeName + * @param {string} sTapePath + * @param {File} [file] is set if there's an associated File object + * @return {boolean} true if load completed (successfully or not), false if queued + */ +PC11.prototype.load = function(sTapeName, sTapePath, file) +{ + var sTapeURL = sTapePath; + + if (DEBUG) { + var sMessage = 'load("' + sTapeName + '","' + sTapePath + '")'; + this.printMessage(sMessage); + } + + var sTapeFile = str.getBaseName(sTapePath); + + var pc11 = this; + + if (file) { + var reader = new FileReader(); + reader.onload = function() { + pc11.build(reader.result); + }; + reader.readAsArrayBuffer(file); + return true; + } + + /* + * If there's an occurrence of API_ENDPOINT anywhere in the path, we assume we can use it as-is; + * ie, that the user has already formed a URL of the type we use ourselves for unconverted tape images. + */ + if (sTapePath.indexOf(DumpAPI.ENDPOINT) < 0) { + /* + * If the selected tape image has a "json" extension, then we assume it's a pre-converted + * JSON-encoded tape image, so we load it as-is; otherwise, we ask our server-side tape image + * converter to return the corresponding JSON-encoded data. + */ + var sTapeExt = str.getExtension(sTapePath); + if (sTapeExt == DumpAPI.FORMAT.JSON || sTapeExt == DumpAPI.FORMAT.JSON_GZ) { + sTapeURL = encodeURI(sTapePath); + } else { + var sTapeParm = DumpAPI.QUERY.PATH; + sTapeURL = web.getHost() + DumpAPI.ENDPOINT + '?' + sTapeParm + '=' + encodeURIComponent(sTapePath) + "&" + DumpAPI.QUERY.FORMAT + "=" + DumpAPI.FORMAT.JSON; + } + } + + return !!web.getResource(sTapeURL, null, true, function(sURL, sResponse, nErrorCode) { + pc11.doneLoad(sURL, sTapeName, sTapePath, sResponse, nErrorCode); + }); +}; + +/** + * build(buffer) + * + * Builds a disk image from an ArrayBuffer (eg, from a FileReader object), rather than from JSON-encoded data. + * + * @this {PC11} + * @param {?} buffer (we KNOW this is an ArrayBuffer, but we can't seem to convince the Closure Compiler) + */ +PC11.prototype.build = function(buffer) +{ + if (buffer) { + this.aTapeData = new Uint8Array(buffer, 0, buffer.byteLength); + } +}; + +/** + * doneLoad(sURL, sTapeName, sTapePath, sTapeData, nErrorCode) + * + * @this {PC11} + * @param {string} sURL + * @param {string} sTapeName + * @param {string} sTapePath + * @param {string} sTapeData + * @param {number} nErrorCode (response from server if anything other than 200) + */ +PC11.prototype.doneLoad = function(sURL, sTapeName, sTapePath, sTapeData, nErrorCode) +{ + this.flags.busy = false; + + var fPrintOnly = (nErrorCode < 0 && this.cmp && !this.cmp.flags.powered); + + if (nErrorCode) { + /* + * This can happen for innocuous reasons, such as the user switching away too quickly, forcing + * the request to be cancelled. And unfortunately, the browser cancels XMLHttpRequest requests + * BEFORE it notifies any page event handlers, so if the Computer's being powered down, we won't know + * that yet. For now, we rely on the lack of a specific error (nErrorCode < 0), and suppress the + * notify() alert if there's no specific error AND the computer is not powered up yet. + */ + this.notice("Unable to load tape \"" + sTapeName + "\" (error " + nErrorCode + ": " + sURL + ")", fPrintOnly); + } + else { + if (DEBUG && this.messageEnabled()) { + this.printMessage('doneLoad("' + sTapePath + '")'); + } + + Component.addMachineResource(this.idMachine, sURL, sTapeData); + + var resource = web.parseMemoryResource(sURL, sTapeData); + if (resource) { + this.sTapeName = sTapeName; + this.sTapePath = sTapePath; + this.aTapeData = resource.aBytes; + if (DEBUG) this.println("tape loaded: " + sTapeName); + } + } + + if (this.fAutoMount) { + this.fAutoMount = false; + if (!--this.cAutoMount) this.setReady(); + } + + this.displayTape(); +}; + +/** + * addTape(sName, sPath, fTop) + * + * @this {PC11} + * @param {string} sName + * @param {string} sPath + * @param {boolean} [fTop] (default is bottom) + */ +PC11.prototype.addTape = function(sName, sPath, fTop) +{ + var controlTapes = this.bindings["listTapes"]; + if (controlTapes && controlTapes.options) { + for (var i = 0; i < controlTapes.options.length; i++) { + if (controlTapes.options[i].value == sPath) return; + } + var controlOption = document.createElement("option"); + controlOption.text = sName; + controlOption.value = sPath; + if (fTop && controlTapes.childNodes[0]) { + controlTapes.insertBefore(controlOption, controlTapes.childNodes[0]); + } else { + controlTapes.appendChild(controlOption); + } + } +}; + +/** + * findTape(sPath) + * + * This is used to deal with mount requests (eg, autoMount) that supply a path without a name; + * if we can find the path in the "listTapes" control, then we return the associated tape name. + * + * @this {PC11} + * @param {string} sPath + * @return {string|null} + */ +PC11.prototype.findTape = function(sPath) +{ + var controlTapes = this.bindings["listTapes"]; + if (controlTapes && controlTapes.options) { + for (var i = 0; i < controlTapes.options.length; i++) { + var control = controlTapes.options[i]; + if (control.value == sPath) return control.text; + } + } + return str.getBaseName(sPath, true); +}; + +/** + * displayTape() + * + * @this {PC11} + */ +PC11.prototype.displayTape = function() +{ + var controlTapes = this.bindings["listTapes"]; + + if (controlTapes && controlTapes.options) { + var sTargetPath = (this.flags.local? "?" : this.sTapePath); + for (var i = 0; i < controlTapes.options.length; i++) { + if (controlTapes.options[i].value == sTargetPath) { + if (controlTapes.selectedIndex != i) { + controlTapes.selectedIndex = i; + } + break; + } + } + if (i == controlTapes.options.length) controlTapes.selectedIndex = 0; + } +}; + +/** + * unloadTape(fAutoUnload, fQuiet) + * + * @this {PC11} + * @param {boolean} [fAutoUnload] is true if this unload is being forced as part of an automount and/or restored mount + * @param {boolean} [fQuiet] + */ +PC11.prototype.unloadTape = function(fAutoUnload, fQuiet) +{ + this.sTapeName = ""; + this.sTapePath = ""; + this.flags.local = false; +}; + /** * save() * diff --git a/modules/shared/lib/weblib.js b/modules/shared/lib/weblib.js index 412a2a757..6bf99876f 100644 --- a/modules/shared/lib/weblib.js +++ b/modules/shared/lib/weblib.js @@ -298,10 +298,45 @@ web.parseMemoryResource = function(sURL, sData) nLoad: null, nExec: null }; + if (sData.charAt(0) == "[" || sData.charAt(0) == "{") { try { - var a, ib; - var data = eval("(" + sData + ")"); + var a, ib, data; + + if (sData.substr(0, 1) == "<") { // if the "data" begins with a "<"... + /* + * Early server configs reported an error (via the nErrorCode parameter) if a tape URL was invalid, + * but more recent server configs now display a somewhat friendlier HTML error page. The downside, + * however, is that the original error has been buried, and we've received "data" that isn't actually + * tape data. So if the data we've received appears to be "HTML-like", we treat it as an error message. + */ + throw new Error(sData); + } + + /* + * TODO: IE9 is rather unfriendly and restrictive with regard to how much data it's willing to + * eval(). In particular, the 10Mb disk image we use for the Windows 1.01 demo config fails in + * IE9 with an "Out of memory" exception. One work-around would be to chop the data into chunks + * (perhaps one track per chunk, using regular expressions) and then manually re-assemble it. + * + * However, it turns out that using JSON.parse(sDiskData) instead of eval("(" + sDiskData + ")") + * is a much easier fix. The only drawback is that we must first quote any unquoted property names + * and remove any comments, because while eval() was cool with them, JSON.parse() is more particular; + * the following RegExp replacements take care of those requirements. + * + * The use of hex values is something else that eval() was OK with, but JSON.parse() is not, and + * while I've stopped using hex values in DumpAPI responses (at least when "format=json" is specified), + * I can't guarantee they won't show up in "legacy" images, and there's no simple RegExp replacement + * for transforming hex values into decimal values, so I cop out and fall back to eval() if I detect + * any hex prefixes ("0x") in the sequence. Ditto for error messages, which appear like so: + * + * ["unrecognized disk path: test.img"] + */ + if (sData.indexOf("0x") < 0 && sData.substr(0, 2) != "[\"") { + data = JSON.parse(sData.replace(/([a-z]+):/gm, "\"$1\":").replace(/\/\/[^\n]*/gm, "")); + } else { + data = eval("(" + sData + ")"); + } resource.nLoad = data['load']; resource.nExec = data['exec']; @@ -347,22 +382,26 @@ web.parseMemoryResource = function(sURL, sData) resource = null; } } catch (e) { - Component.error("Resource data error: " + e.message); + Component.error("Resource data error (" + sURL + "): " + e.message); resource = null; } } else { /* - * Parse the data manually; we'll assume it's in "simplified" hex form - * (a series of hex byte-values separated by whitespace). + * Parse the data manually; we assume it's a series of hex byte-values separated by whitespace. */ + var ab = []; var sHexData = sData.replace(/\n/gm, " ").replace(/ +$/, ""); var asHexData = sHexData.split(" "); - resource.aBytes = new Array(asHexData.length); for (i = 0; i < asHexData.length; i++) { - resource.aBytes[i] = parseInt(asHexData[i], 16); - Component.assert(!isNaN(resource.aBytes[i])); + var n = parseInt(asHexData[i], 16); + if (isNaN(n)) { + Component.error("Resource data error (" + sURL + "): invalid hex byte (" + asHexData[i] + ")"); + break; + } + ab.push(n & 0xff); } + if (i == asHexData.length) resource.aBytes = ab; } return resource; }; diff --git a/modules/shared/templates/components.xsl b/modules/shared/templates/components.xsl index b9baf7f0f..d2f1b07c8 100644 --- a/modules/shared/templates/components.xsl +++ b/modules/shared/templates/components.xsl @@ -740,21 +740,32 @@ - + + + + + + + + + + + + device - ,type:'' + ,type:'',autoMount:'' @@ -880,10 +891,11 @@ - + - + + @@ -895,7 +907,7 @@ fdc - ,autoMount:'',sortBy:'' + ,autoMount:'',sortBy:'' diff --git a/versions/pc8080/1.30.1/components.xsl b/versions/pc8080/1.30.1/components.xsl index 68c052cfa..5afadcb97 100644 --- a/versions/pc8080/1.30.1/components.xsl +++ b/versions/pc8080/1.30.1/components.xsl @@ -738,21 +738,32 @@ - + + + + + + + + + + + + device - ,type:'' + ,type:'',autoMount:'' @@ -878,10 +889,11 @@ - + - + + @@ -893,7 +905,7 @@ fdc - ,autoMount:'',sortBy:'' + ,autoMount:'',sortBy:'' diff --git a/versions/pc8080/1.30.1/pc8080-dbg.js b/versions/pc8080/1.30.1/pc8080-dbg.js index 0346bc1e9..344d26855 100644 --- a/versions/pc8080/1.30.1/pc8080-dbg.js +++ b/versions/pc8080/1.30.1/pc8080-dbg.js @@ -39,8 +39,9 @@ function pa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a function sa(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>8&255;else if(e=g.data)for(d.za=Array(4*e.length),f=c=0;c>8&255,d.za[f++]=e[c]>>16&255,d.za[f++]=e[c]>>24&255;else d.za=g;d.Ea=g.symbols;d.za.length?1==d.za.length&&(w(d.za[0]),d=null): -(w("Empty resource: "+a),d=null)}catch(h){w("Resource data error: "+h.message),d=null}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),d.za=Array(a.length),c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Rb=g.load;d.Qb=g.exec;if(e=g.bytes)d.Aa=e;else if(e=g.words)for(d.Aa=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.Aa=Array(4*e.length),f=c=0;c>8&255,d.Aa[f++]=e[c]>>16&255,d.Aa[f++]=e[c]>>24&255;else d.Aa=g;d.Ea=g.symbols;d.Aa.length?1==d.Aa.length&&(w(d.Aa[0]),d=null):(w("Empty resource: "+a),d=null)}catch(h){w("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c>1]},ha:function(a,b){this.u[a]=b;this.Pa=!0},eb:function(a,b){this.u[a]=b;this.Pa=!0},la:function(a,b){this.C.setUint16(a,b,!0);this.Pa=!0},na:function(a,b){a&1?(this.u[a]=b,this.u[a+1]=b>>8):this.K[a>>1]=b;this.Pa=!0}}; function xb(a,b,c){a.I=b;a.A=a.j=0;c&&((a.A=c.A)&&ic(a,hc,!1),(a.j=c.j)&&gc(a,hc,!1))}function kc(a,b){b?--a.j||(a.nb=a.N?a.w:a.Bb,a.Fc=a.N?a.G:a.Wb):--a.A||(a.lb=a.yb,a.Dc=a.Sb)}function gc(a,b,c){c&&a.j||(a.nb=!a.N&&b[1]||a.w,a.Fc=!a.N&&b[3]||a.G);if(c||void 0===c)a.Bb=b[1]||a.w,a.Wb=b[3]||a.G}function ic(a,b,c){c&&a.A||(a.lb=b[0]||a.J,a.Dc=b[2]||a.L);if(c||void 0===c)a.yb=b[0]||a.J,a.Sb=b[2]||a.L}function cc(a,b){b||(b=lc);ic(a,b,void 0);gc(a,b,void 0)} var lc=[],fc=[G.prototype.Y,G.prototype.fb,G.prototype.fa,G.prototype.wa],hc=[G.prototype.O,G.prototype.ja,G.prototype.ca,G.prototype.ma];if(qb)var ec=[G.prototype.M,G.prototype.ha,G.prototype.ba,G.prototype.la],dc=[G.prototype.P,G.prototype.eb,G.prototype.ea,G.prototype.na]; -function mc(a,b){z.call(this,"CPU",a,mc,1);var c=a.multiplier||1;this.Y=a.cycles||b;this.Sa=c;this.ha=Math.round(this.Y/1E4)/100;this.bb=this.ha*this.Sa;this.D.Aa=!1;this.D.Vb=!1;this.D.tb=a.autoStart;this.D.yc=!1;this.D.hb=!1;this.vb=this.O=0;this.wb=a.csStart;this.jb=a.csInterval;this.kb=a.csStop;this.w=[];this.Ha=this.cb.bind(this);F(this)}A(mc);var nc=["power","reset"];l=mc.prototype; +function mc(a,b){z.call(this,"CPU",a,mc,1);var c=a.multiplier||1;this.Y=a.cycles||b;this.Sa=c;this.ha=Math.round(this.Y/1E4)/100;this.bb=this.ha*this.Sa;this.D.za=!1;this.D.Vb=!1;this.D.tb=a.autoStart;this.D.yc=!1;this.D.hb=!1;this.vb=this.O=0;this.wb=a.csStart;this.jb=a.csInterval;this.kb=a.csStop;this.w=[];this.Ha=this.cb.bind(this);F(this)}A(mc);var nc=["power","reset"];l=mc.prototype; l.Ra=function(a,b,c,d){this.A=a;this.u=b;this.I=d;for(b=0;b=a.O&&(a.O+=a.jb,c=!0);0<=a.kb&&a.kb<=Gc(a)&&(a.jb=a.kb=-1,Cc(a),a.ra(),c=!0);c&&a.g(Gc(a)+" cycles: checksum="+t(a.vb))}} -l.qa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.N[b]=c;a=!0;break;case "run":this.N[b]=c;c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.D.xa)a=!0;else{var b=null,c,h=db(a.id);for(c=0;ca.K/a.bb?b=1:d=!0;a.Sa=b;b=a.ha*a.Sa;if(a.bb!=b){a.bb=b;b=a.bb.toFixed(2)+"Mhz";var e=a.N.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.A&&a.A.zb()}Ic(a,a.G);a.G=0;a.C=qa();a.J=0;Jc(a);return d}function Kc(a,b){var c=a.w.length;a.w.push([-1,b]);return c}function Lc(a,b,c){0<=b&&ba.w[b][0]&&(c*=a.Y*a.Sa/1E3,a.w[b][0]=c+Mc(a))}function Mc(a,b){var c=a.L-=a.b;a.b=0;b&&(a.L=0);return c} -l.cb=function(a){if(kb(this,!0)){if(!this.D.Aa){Hc(this);this.A&&this.A.start(this.C,Gc(this));this.D.Aa=!0;this.D.Vb=!0;this.F&&this.F.start();var b=this.N.run;b&&(b.textContent="Halt");this.A&&(this.A.La(!0),a&&this.A.zb(!0))}this.ja>=this.Y&&Jc(this,!0);this.ba=0;this.ea=qa();this.J&&(a=this.ea-this.J,a>this.wa&&(this.C+=a,this.C>this.ea&&(this.C=this.ea)));try{do{for(var c,d=this.D.hb?1:this.fa,e=this.w.length-1;0<=e;e--){var f=this.w[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.mb(c);c=Mc(this,!0);this.ba+= -c;this.G+=c;Fc(this,c);a=c;for(var g=this.w.length-1;0<=g;g--){var h=this.w[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.P-=c;if(0>=this.P){this.P+=this.fa;15<=++this.Ba&&(this.A&&this.A.La(),this.Ba=0);break}}while(this.D.Aa)}catch(k){this.ra();Ec(this);this.A&&this.A.stop(qa(),Gc(this));kb(this,!1);nb(this,k.stack||k.message);return}c=setTimeout;d=this.Ha;this.J=qa();e=this.wa;this.ba&&(e=Math.round(e*this.ba/this.fa));e-=this.J-this.ea;if(f=this.J-this.C)this.K=Math.round(this.G/(10*f))/ -100,864E5<=f&&(this.M=0,Hc(this));if(0>e||this.Ke&&(this.C-=e),e=0;this.ja+=this.ba;this.J+=e;c(d,e)}else Ec(this),this.A&&this.A.stop(qa(),Gc(this))};l.mb=function(){return 0};l.ra=function(a){lb(this,!0);Mc(this);Ic(this,this.G);this.G=0;if(this.D.Aa){this.D.Aa=!1;this.F&&this.F.stop();var b=this.N.run;b&&(b.textContent="Run")}this.D.complete=a};function Ec(a,b){if(a.A){for(var c=a.A,d=0;d=this.Y&&Jc(this,!0);this.ba=0;this.ea=qa();this.J&&(a=this.ea-this.J,a>this.wa&&(this.C+=a,this.C>this.ea&&(this.C=this.ea)));try{do{for(var c,d=this.D.hb?1:this.fa,e=this.w.length-1;0<=e;e--){var f=this.w[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.mb(c);c=Mc(this,!0);this.ba+= +c;this.G+=c;Fc(this,c);a=c;for(var g=this.w.length-1;0<=g;g--){var h=this.w[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.P-=c;if(0>=this.P){this.P+=this.fa;15<=++this.Ba&&(this.A&&this.A.La(),this.Ba=0);break}}while(this.D.za)}catch(k){this.ra();Ec(this);this.A&&this.A.stop(qa(),Gc(this));kb(this,!1);nb(this,k.stack||k.message);return}c=setTimeout;d=this.Ha;this.J=qa();e=this.wa;this.ba&&(e=Math.round(e*this.ba/this.fa));e-=this.J-this.ea;if(f=this.J-this.C)this.K=Math.round(this.G/(10*f))/ +100,864E5<=f&&(this.M=0,Hc(this));if(0>e||this.Ke&&(this.C-=e),e=0;this.ja+=this.ba;this.J+=e;c(d,e)}else Ec(this),this.A&&this.A.stop(qa(),Gc(this))};l.mb=function(){return 0};l.ra=function(a){lb(this,!0);Mc(this);Ic(this,this.G);this.G=0;if(this.D.za){this.D.za=!1;this.F&&this.F.stop();var b=this.N.run;b&&(b.textContent="Run")}this.D.complete=a};function Ec(a,b){if(a.A){for(var c=a.A,d=0;d>8&255;a.T=b&255}function Xc(a){return a.U<<8|a.V}function Yc(a,b){a.U=b>>8&255;a.V=b&255}function K(a){return a.W<<8|a.Z} function Zc(a,b){a.W=b>>8&255;a.Z=b&255}function I(a,b){a.R=b&65535}function $c(a){return a.da&256?1:0}function ad(a,b){a.da=a.da&255|b}function bd(a){return rb[a.ga&255]?4:0}function cd(a){return(a.ga^a.ya)&16?16:0}function dd(a){return a.da&255?0:64}function ed(a){return a.ga&128?128:0}function Uc(a){return a.ua&-214|ed(a)|dd(a)|cd(a)|bd(a)|$c(a)}function Sc(a,b){a.da=a.ga=a.ya=0;b&1&&(a.da|=256);b&4||(a.ga|=1);b&16&&(a.ya|=16);b&64||(a.da|=255);b&128&&(a.ga^=192);a.ua=a.ua&-726|b&512|2} function fd(a,b){a.ya=a.i^b;return a.ga=(a.da=a.i+b)&255}function gd(a,b){a.ya=a.i^b;return a.ga=(a.da=a.i+b+(a.da&256?1:0))&255}function hd(a,b){a.da=a.ga=a.ya=a.i&b;(a.i|b)&8&&(a.ya^=16);return a.da}function id(a,b){a.ya=b^255;b=a.ga=b+255&255;a.da=a.da&-256|b;return b}function jd(a,b){a.ya=b;b=a.ga=b+1&255;a.da=a.da&-256|b;return b}function Ed(a,b){return a.ga=a.da=a.ya=a.i|b}function L(a,b){b^=255;a.ya=a.i^b;return a.ga=(a.da=a.i+b+1^256)&255} function Fd(a,b){b^=255;a.ya=a.i^b;return a.ga=(a.da=a.i+b+(a.da&256?0:1)^256)&255}function Gd(a,b){return a.ga=a.da=a.ya=a.i^b}l.aa=function(a){return this.u.aa(a)};l.va=function(a,b){this.u.va(a,b)};function M(a){var b=a.aa(a.R);I(a,a.R+1);return b}function O(a){var b=a.u.ab(a.R);I(a,a.R+2);return b}function P(a){var b=a.u.ab(a.pa);a.pa=a.pa+2&65535;return b}function Q(a,b){a.pa=a.pa-2&65535;a.u.Jb(a.pa,b)} -function Hd(a){if(a.b&&a.j&255&&a.ua&512){for(var b=0;8>b&&!(a.j&1<b?255:1<b&&!(a.j&1<b?255:1<>8;ad(this,a&256);this.b-=4},Ld,function(){var a;Zc(this,a=K(this)+Vc(this));ad(this,a>>8&256);this.b-=10},function(){this.i=this.aa(Vc(this));this.b-=7},function(){Wc(this,Vc(this)-1);this.b-= 5},function(){this.T=jd(this,this.T);this.b-=5},function(){this.T=id(this,this.T);this.b-=5},function(){this.T=M(this);this.b-=7},function(){var a=this.i<<8&256;this.i=(a|this.i)>>1;ad(this,a);this.b-=4},Ld,function(){Yc(this,O(this));this.b-=10},function(){this.va(Xc(this),this.i);this.b-=7},function(){Yc(this,Xc(this)+1);this.b-=5},function(){this.U=jd(this,this.U);this.b-=5},function(){this.U=id(this,this.U);this.b-=5},function(){this.U=M(this);this.b-=7},function(){var a=this.i<<1;this.i=a&255| @@ -139,7 +140,7 @@ function Vd(a,b,c,d){if(d)a.ka("Unable to load system ROM (error "+d+": "+b+")") " ").replace(/ +$/,"").split(" "),a.A=Array(b.length),e=0;e>>f.ia;0>>= f.ia;0>>d.ia],!1)}a.O=["br"];if(a.C)for(b=1;b>>d.ia],!0);a.C=["bw"];a.Xa=0}l.$a=function(a,b,c){var d=!0;c||Ef(this,a,b,!1,!0);if(a!=this.F){var e=Se(b);if(-1===e)this.g("invalid address: "+Z(b.H)),d=!1;else{var f=this.u;f.X[e>>>f.ia].$a(e&f.u,a==this.C)}}d&&(a.push(b),c?b.Qa=!0:(Ff(this,a,a.length-1,"set"),Le(this)));return d}; function Ef(a,b,c,d,e){var f=!1;c=Se(c);for(var g=1;g>>d.ia],b==a.C));h.Qa||Le(a);break}}return f}function Gf(a,b){for(var c=1;c>24,4);break;case 3:y=t(v.ab(y,2),4);break;default:v="imm("+u(r)+")";break a}8086==v.style&&r&64?y="["+y+"]":r&16||(y=(v.style==Je?"$":"0x")+y);v=y}else r&16? (v=(q&3840)>>8,r=Qe[v],8086==a.style&&q&64&&(6==v&&(r="HL"),r="["+r+"]"),v=r):r&128&&(v=(f>>3&7).toString());if(!v||!v.length){h="INVALID";break}0b[0]?1:a[0]=Ga.length&&(ua=0);a.gb=ia;bf++;Ib--}}bf||(a.g("no "+af+"history available"),a.gb=void 0)}else{var oc=Te(a,X);if(oc){var pc=0;ta&&("l"==ta.charAt(0)&&(ta=ta.substr(1)||Eb),pc=Ee(a,ta)>>>0,65536>4||1;mg--&&0tc?String.fromCharCode(tc):".";rc--}Kb&&(Kb+="\n");Kb+=X+" "+od+(Lb?"":" "+ef)}Kb&&a.g(Kb);a.Va=oc}}}}break;case "e":if("else"==f[0])break;var uc=1,ff=255,gf=a.aa,hf=a.va;"ew"==f[0]&&(uc=2,ff=65535,gf=a.ab,hf=a.Jb);var jf=uc<<1,kf=f[1];if(null==kf)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a"); else{var vc=Te(a,kf);if(vc)for(var wc=2;wcvd;){for(var Za=null,sg=256;65536>Ob.H>>>0;){mf.H=a.ab(Ob,2);if(null==Ob.H||!sg--)break;for(var tg=a,yc=mf,nf= null,Pb=yc.H,of=Pb,wd=1;6>=wd&&Pb;wd++){if(2a?"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 la(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function ma(a,b){var c,d={Y:null,wa:null,jb:null,ib:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g=eval("("+b+")");d.jb=g.load;d.ib=g.exec;if(e=g.bytes)d.Y=e;else if(e=g.words)for(d.Y=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.Y=Array(4*e.length),f=c=0;c>8&255,d.Y[f++]=e[c]>>16&255,d.Y[f++]=e[c]>>24&255;else d.Y=g;d.wa=g.symbols;d.Y.length?1==d.Y.length&&(q(d.Y[0]),d=null):(q("Empty resource: "+ -a),d=null)}catch(h){q("Resource data error: "+h.message),d=null}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),d.Y=Array(a.length),c=0;cb?this.Va=this.id:(this.ya=this.id.substr(0,b),this.Va=this.id.substr(b+1));this[a]=c;this.l={ready:!1,Ya:!1,gb:!1,Z:!1,error:!1};this.ab=null;this.l.error=!1;this.A={};this.O=null;v.push(this)}var Ea=void 0,Fa={}; +function ma(a,b){var c,d={aa:null,wa:null,jb:null,ib:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.jb=g.load;d.ib=g.exec;if(e=g.bytes)d.aa=e;else if(e=g.words)for(d.aa=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.aa=Array(4*e.length),f=c=0;c>8&255,d.aa[f++]=e[c]>>16&255,d.aa[f++]=e[c]>>24&255;else d.aa=g;d.wa=g.symbols;d.aa.length?1==d.aa.length&&(q(d.aa[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Va=this.id:(this.ya=this.id.substr(0,b),this.Va=this.id.substr(b+1));this[a]=c;this.l={ready:!1,Ya:!1,gb:!1,Y:!1,error:!1};this.ab=null;this.l.error=!1;this.A={};this.O=null;v.push(this)}var Ea=void 0,Fa={}; if(window){Ea||(Ea=window.location.search.substr(1));for(var Ga,Ha=/\+/g,Ia=/([^&=]+)=?([^&]*)/g;Ga=Ia.exec(Ea);)Fa[decodeURIComponent(Ga[1].replace(Ha," "))]=decodeURIComponent(Ga[2].replace(Ha," "))}function Ja(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function w(a,b){b||(b=r);a.prototype=Ja(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ka=window.PCjs.Machines||(window.PCjs.Machines={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else Ka={},v=[];function La(a,b,c){Ka[a]&&b&&(Ka[a][b]=c)}function Ba(a,b,c){b||q((c?c+": ":"")+a)} function Ma(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.j&&(this.j=10);15>2;this.f=this.c-1;this.i=this.u/this.c|0;this.o=this.i-1;this.m=[];this.v=[];this.B=[];this.C=[];a=new C;Za(a,this.O);this.b=Array(this.i);for(b=0;b>>a.j;0f&&(n=f);if(h&&h.size){if(h.type==d){if(e+f<=h.Pa)return h.fb+=h.Pa-e,h.Pa=e,!0;if(e>=h.Pa+h.fb){n=h.size-(e-l);n>f&&(n=f);h.fb=e-h.Pa+n;e=l+a.c;f-=n;g++;continue}}return ab(1,e,f)}e=new C(e,n,a.c,d);Za(e,a.O,h);a.b[g++]=e;e=l+a.c;f-=n}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+bb[d]+" at "+p(b,4,!0)),!0):ab(2,b,c)}Ya.prototype.J=function(a){return this.b[(a&this.g)>>>this.j].Sa(a&this.f,a)}; function cb(a,b){return a.b[(b&a.g)>>>a.j].eb(b&a.f,b)}function db(a,b){var c=b&a.f,d=(b&a.g)>>>a.j;return c!=a.f?a.b[d].od(c,b):a.b[d++].Sa(c,b)|a.b[d&a.o].Sa(0,b+1)<<8}Ya.prototype.ba=function(a,b){this.b[(a&this.g)>>>this.j].Ta(a&this.f,b&255,a)};function eb(a,b,c){a.b[(b&a.g)>>>a.j].Lb(b&a.f,c&255,b)}function gb(a,b,c){var d=b&a.f,e=(b&a.g)>>>a.j;d!=a.f?a.b[e].pd(d,c&65535,b):(a.b[e++].Ta(d,c&255,b),a.b[e&a.o].Ta(0,c>>8&255,b+1))} @@ -63,17 +63,17 @@ function hb(a){for(var b=0,c=[],d=0;d>1),this.a=new Int32Array(this.j,0,c>>2),qb(this,mb?rb:sb);else{this.a=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},C:function(a){return this.a[a>> -2]>>>((a&3)<<3)&255},I:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},S:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.oa=!0},w:function(a,b){return this.eb(a,b)},H:function(a,b){return this.Ib(a,b)},N:function(a,b,c){this.c||this.Lb(a,b,c)},W:function(a, +2]>>>((a&3)<<3)&255},I:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},S:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.oa=!0},w:function(a,b){return this.eb(a,b)},H:function(a,b){return this.Ib(a,b)},N:function(a,b,c){this.c||this.Lb(a,b,c)},W:function(a, b,c){this.c||this.X(a,b,c)},u:function(a){return this.b[a]},B:function(a){return this.b[a]},G:function(a){return this.A.getUint16(a,!0)},M:function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.i[a>>1]},L:function(a,b){this.b[a]=b;this.oa=!0},R:function(a,b){this.b[a]=b;this.oa=!0},U:function(a,b){this.A.setUint16(a,b,!0);this.oa=!0},ya:function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.i[a>>1]=b;this.oa=!0}};function Za(a,b,c){a.O=b;a.f=a.g=0;c&&((a.f=c.f)&&ub(a,vb,!1),(a.g=c.g)&&wb(a,vb,!1))} -function wb(a,b,c){c&&a.g||(a.Ta=!a.c&&b[1]||a.o,a.pd=!a.c&&b[3]||a.s);if(c||void 0===c)a.Lb=b[1]||a.o,a.X=b[3]||a.s}function ub(a,b,c){c&&a.f||(a.Sa=b[0]||a.m,a.od=b[2]||a.v);if(c||void 0===c)a.eb=b[0]||a.m,a.Ib=b[2]||a.v}function qb(a,b){b||(b=xb);ub(a,b,void 0);wb(a,b,void 0)}var xb=[],tb=[C.prototype.C,C.prototype.S,C.prototype.I,C.prototype.aa],vb=[C.prototype.w,C.prototype.N,C.prototype.H,C.prototype.W]; -if(Ta)var sb=[C.prototype.u,C.prototype.L,C.prototype.G,C.prototype.U],rb=[C.prototype.B,C.prototype.R,C.prototype.M,C.prototype.ya];function yb(a,b){r.call(this,"CPU",a,yb);var c=a.multiplier||1;this.ma=a.cycles||b;this.L=c;this.Fa=Math.round(this.ma/1E4)/100;this.U=this.Fa*this.L;this.l.pa=!1;this.l.Jb=!1;this.l.Qa=a.autoStart;this.l.Cb=!1;this.l.Za=!1;this.ua=this.X=0;this.va=a.csStart;this.aa=a.csInterval;this.ja=a.csStop;this.G=[];this.Xa=this.lb.bind(this);B(this)}w(yb);var zb=["power","reset"]; +function wb(a,b,c){c&&a.g||(a.Ta=!a.c&&b[1]||a.o,a.pd=!a.c&&b[3]||a.s);if(c||void 0===c)a.Lb=b[1]||a.o,a.X=b[3]||a.s}function ub(a,b,c){c&&a.f||(a.Sa=b[0]||a.m,a.od=b[2]||a.v);if(c||void 0===c)a.eb=b[0]||a.m,a.Ib=b[2]||a.v}function qb(a,b){b||(b=xb);ub(a,b,void 0);wb(a,b,void 0)}var xb=[],tb=[C.prototype.C,C.prototype.S,C.prototype.I,C.prototype.Z],vb=[C.prototype.w,C.prototype.N,C.prototype.H,C.prototype.W]; +if(Ta)var sb=[C.prototype.u,C.prototype.L,C.prototype.G,C.prototype.U],rb=[C.prototype.B,C.prototype.R,C.prototype.M,C.prototype.ya];function yb(a,b){r.call(this,"CPU",a,yb);var c=a.multiplier||1;this.ma=a.cycles||b;this.L=c;this.Fa=Math.round(this.ma/1E4)/100;this.U=this.Fa*this.L;this.l.pa=!1;this.l.Jb=!1;this.l.Qa=a.autoStart;this.l.Cb=!1;this.l.Za=!1;this.ua=this.X=0;this.va=a.csStart;this.Z=a.csInterval;this.ja=a.csStop;this.G=[];this.Xa=this.lb.bind(this);B(this)}w(yb);var zb=["power","reset"]; k=yb.prototype;k.ra=function(a,b,c,d){this.v=a;this.j=b;this.O=d;for(b=0;ba.R/a.U&&(b=1);a.L=b;b=a.Fa*a.L;if(a.U!=b){a.U=b;b=a.U.toFixed(2)+"Mhz";var d=a.A.setSpeed;d&&(d.textContent=b);a.ea("target speed: "+b)}c&&a.v&&Ib(a.v)}a.H+=a.N;a.N=0;a.I=ja();a.S=0;Gb(a)}function Jb(a,b){var c=a.G.length;a.G.push([-1,b]);return c}function Kb(a,b,c){0<=b&&ba.G[b][0]&&(c*=a.ma*a.L/1E3,a.G[b][0]=c+Mb(a))}function Mb(a,b){var c=a.W-=a.a;a.a=0;b&&(a.W=0);return c} k.lb=function(a){if(Ra(this,!0)){if(!this.l.pa){Fb(this);this.v&&this.v.start(this.I,Hb(this));this.l.pa=!0;this.l.Jb=!0;this.M&&this.M.start();var b=this.A.run;b&&(b.textContent="Halt");this.v&&(this.v.Da(!0),a&&Ib(this.v,!0))}this.Ga>=this.ma&&Gb(this,!0);this.qa=0;this.ta=ja();this.S&&(a=this.ta-this.S,a>this.Na&&(this.I+=a,this.I>this.ta&&(this.I=this.ta)));try{do{for(var c,d=this.l.Za?1:this.Aa,e=this.G.length-1;0<=e;e--){var f=this.G[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.Kb(c);c=Mb(this,!0); -this.qa+=c;this.N+=c;a=c;this.l.Za&&(b=!1,this.ua=this.ua+this.Fb()|0,this.X-=a,0>=this.X&&(this.X+=this.aa,b=!0),0<=this.ja&&this.ja<=Hb(this)&&(this.aa=this.ja=-1,Cb(this),Eb(this),b=!0),b&&this.ea(Hb(this)+" cycles: checksum="+p(this.ua)));a=c;for(var g=this.G.length-1;0<=g;g--){var h=this.G[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.la-=c;if(0>=this.la){this.la+=this.Aa;15<=++this.Oa&&(this.v&&this.v.Da(),this.Oa=0);break}}while(this.l.pa)}catch(l){Eb(this);Db(this);this.v&&this.v.stop(ja(), +this.qa+=c;this.N+=c;a=c;this.l.Za&&(b=!1,this.ua=this.ua+this.Fb()|0,this.X-=a,0>=this.X&&(this.X+=this.Z,b=!0),0<=this.ja&&this.ja<=Hb(this)&&(this.Z=this.ja=-1,Cb(this),Eb(this),b=!0),b&&this.ea(Hb(this)+" cycles: checksum="+p(this.ua)));a=c;for(var g=this.G.length-1;0<=g;g--){var h=this.G[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.la-=c;if(0>=this.la){this.la+=this.Aa;15<=++this.Oa&&(this.v&&this.v.Da(),this.Oa=0);break}}while(this.l.pa)}catch(l){Eb(this);Db(this);this.v&&this.v.stop(ja(), Hb(this));Ra(this,!1);c=l.stack||l.message;this.l.error=!0;this.K(c);return}c=setTimeout;d=this.Xa;this.S=ja();e=this.Na;this.qa&&(e=Math.round(e*this.qa/this.Aa));e-=this.S-this.ta;if(f=this.S-this.I)this.R=Math.round(this.N/(10*f))/100,864E5<=f&&(this.H=0,Fb(this));if(0>e||this.Re&&(this.I-=e),e=0;this.Ga+=this.qa;this.S+=e;c(d,e)}else Db(this),this.v&&this.v.stop(ja(),Hb(this))};k.Kb=function(){return 0}; function Eb(a){a.l.Ya&&(a.l.gb=!0);Mb(a);a.H+=a.N;a.N=0;if(a.l.pa){a.l.pa=!1;a.M&&a.M.stop();var b=a.A.run;b&&(b.textContent="Run")}a.l.complete=void 0}function Db(a){if(a.v){for(var b=a.v,c=0;cb&&!(a.B&1<b?255:1<>8;K(this,a&256);this.a-=4},ic,function(){var a;I(this,a=G(this)+Vb(this));K(this,a>>8&256);this.a-=10},function(){this.b=this.J(Vb(this));this.a-=7},function(){Wb(this,Vb(this)-1);this.a-=5}, function(){this.D=cc(this,this.D);this.a-=5},function(){this.D=bc(this,this.D);this.a-=5},function(){this.D=N(this);this.a-=7},function(){var a=this.b<<8&256;this.b=(a|this.b)>>1;K(this,a);this.a-=4},ic,function(){Yb(this,O(this));this.a-=10},function(){this.ba(Xb(this),this.b);this.a-=7},function(){Yb(this,Xb(this)+1);this.a-=5},function(){this.f=cc(this,this.f);this.a-=5},function(){this.f=bc(this,this.f);this.a-=5},function(){this.f=N(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|J(this); @@ -111,25 +111,25 @@ O(this);Zb(this)&&(R(this,this.o),E(this,a),this.a-=6);this.a-=11},lc,function() Ub(this)&255|this.b<<8);this.a-=11},function(){this.b=dc(this,N(this));this.a-=7},function(){R(this,this.o);E(this,48);this.a-=11},function(){this.s&128&&(E(this,P(this)),this.a-=6);this.a-=5},function(){this.u=G(this)&65535;this.a-=5},function(){var a=O(this);this.s&128&&E(this,a);this.a-=10},function(){this.C|=512;this.a-=4;gc(this)},function(){var a=O(this);this.s&128&&(R(this,this.o),E(this,a),this.a-=6);this.a-=11},lc,function(){M(this,N(this));this.a-=7},function(){R(this,this.o);E(this,56); this.a-=11}];function T(a){r.call(this,"ChipSet",a,T);var b=a.model;b&&!mc[b]&&Ba("Unrecognized ChipSet model: "+b);this.c=mc[b]||{};a.sound&&(this.I=null,window&&(this.I=window.AudioContext||window.webkitAudioContext),this.I&&new this.I);B(this)}w(T); var V={ca:1978.1,Dc:{da:0,xd:1,Bd:16,Id:32,Rd:64,Qd:128,Ia:14},Ca:{da:1,Tb:1,wc:2,sc:4,tc:16,uc:32,vc:64,Ia:8},Ec:{da:2,wd:3,$d:4,yd:8,Md:16,Nd:32,Od:64,zd:128,Ia:0},Vd:{da:3},Td:{da:2,Jd:7},Xd:{da:3,ae:1,Wd:2,Pd:4,Gd:8,Ad:16,qd:32},Ud:{da:4},Yd:{da:5,Cd:1,Dd:2,Ed:4,Fd:8,be:16}},W={ca:100,ka:{da:66,zb:1,oc:2,pc:4,Ld:8,Kd:16,wb:32,vb:64,rb:128},Rb:{da:66,INIT:0},za:{da:194,sd:0,pb:16,yc:32,xb:48,ac:0,bc:32},Ua:{da:162,Sd:0,dc:0,$b:0,cc:0,Zb:0},na:{Hd:{da:98},Ea:{Ob:0,Nb:1,Bc:2,Jc:4,Ub:5,zc:6,Zd:7}, -Wa:16383}},mc={SI1978:V,VT100:W};T.prototype.V=function(){return!1};T.prototype.ra=function(a,b,c,d){this.j=b;this.a=c;this.O=d;this.v=a;this.m=Wa(a,"Keyboard");this.aa=Wa(a,"SerialPort");this.video=Wa(a,"Video");ib(b,this,this.c.bb);jb(b,this,this.c.cb)};T.prototype.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};T.prototype.ia=function(a){return a?this.save():!0};V.INIT=[[V.Dc.Ia,V.Ca.Ia,V.Ec.Ia,0,0,0,0]]; +Wa:16383}},mc={SI1978:V,VT100:W};T.prototype.V=function(){return!1};T.prototype.ra=function(a,b,c,d){this.j=b;this.a=c;this.O=d;this.v=a;this.m=Wa(a,"Keyboard");this.Z=Wa(a,"SerialPort");this.video=Wa(a,"Video");ib(b,this,this.c.bb);jb(b,this,this.c.cb)};T.prototype.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};T.prototype.ia=function(a){return a?this.save():!0};V.INIT=[[V.Dc.Ia,V.Ca.Ia,V.Ec.Ia,0,0,0,0]]; W.INIT=[[W.Rb.INIT,W.ka.oc|W.ka.pc],[W.za.ac,W.za.bc],[W.Ua.dc,W.Ua.$b,W.Ua.cc,W.Ua.Zb],[0,0,0,0,[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11776,11984,11888,11776,11808,11776,12E3,12E3,11901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11808,11984,11856,11776,11808,11776,12E3,12E3,11881,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]];k=T.prototype;k.reset=function(){this.c.INIT&&!this.restore(this.c.INIT)&&this.K("reset error")}; k.save=function(){var a=new F(this);switch(this.c.ca){case V.ca:a.set(0,[this.W,this.g,this.X,this.C,this.M,this.S,this.U]);break;case W.ca:a.set(0,[this.L,this.u]),a.set(1,[this.o,this.s]),a.set(2,[this.f,this.G,this.R,this.N]),a.set(3,[this.B,this.b,this.w,this.H,this.i])}return a.data()}; k.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.c.ca){case V.ca:return this.W=b[0],this.g=b[1],this.X=b[2],this.C=b[3],this.M=b[4],this.S=b[5],this.U=b[6],!0;case W.ca:return this.L=b[0],this.u=b[1],b=a[1],this.o=b[0],this.s=b[1],b=a[2],this.f=b[0],this.G=b[1],this.R=b[2],this.N=b[3],b=a[3],this.B=b[0],this.b=b[1],this.w=b[2],this.H=b[3],this.i=b[4],!0}return!1};k.start=function(){};k.stop=function(){};k.Wc=function(){return this.W};k.Xc=function(){return this.g};k.Yc=function(){return this.X}; k.Vc=function(){return this.C>>8-this.M&255};k.dd=function(a,b){this.M=b};k.fd=function(a,b){this.S=b};k.ed=function(a,b){this.C=b<<8|this.C>>8};k.gd=function(a,b){this.U=b};k.hd=function(){};function nc(a){var b=0,c=0,d=~a.B;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} k.Zc=function(){var a=this.u,a=a&~W.ka.vb;if((Hb(this.a)&64)<<1&&(a|=W.ka.vb,a!=this.u)){var b,c;b=this.w&1;switch(this.w>>1&7){case W.na.Ea.Nb:this.B=this.B<<1|b;break;case W.na.Ea.Ub:b=nc(this);this.i[b]=W.na.Wa;break;case W.na.Ea.Ob:this.b=this.b<<1|b;break;case W.na.Ea.Jc:b=nc(this);c=this.b&W.na.Wa;this.i[b]=c;break;case W.na.Ea.zc:b=nc(this);c=this.i[b];null==c&&(c=W.na.Wa);this.b=c;break;case W.na.Ea.Bc:this.b<<=1,this.H=this.b&W.na.Wa+1}}a&=~W.ka.wb;this.H&&(a|=W.ka.wb);a&=~W.ka.rb;if(b=this.m){b= -this.m;if(c=b.f)c=b.a,c=Hb(b.a)>=b.m+c.ma*c.L/1E3*1.2731488;c&&(b.f=!1);b=!b.f}b&&(a|=W.ka.rb);a&=~W.ka.zb;this.aa&&this.aa.fa&1&&(a|=W.ka.zb);return this.u=a};k.jd=function(a,b){this.L=b};k.md=function(a,b){this.w=b};k.ld=function(a,b){a=b&3;switch(b>>2&3){case 0:this.f=this.f&-4|a;break;case 1:this.f=this.f&-13|a<<2;this.video&&(b=this.video,a=this.f,b.qa!==a&&((b.qa=a)?Nb(b,!0):b.ta=!0));break;case 2:switch(a){case 0:this.G=~this.G;break;case 2:case 3:this.R=3-a}break;case 3:this.N=a}}; +this.m;if(c=b.f)c=b.a,c=Hb(b.a)>=b.m+c.ma*c.L/1E3*1.2731488;c&&(b.f=!1);b=!b.f}b&&(a|=W.ka.rb);a&=~W.ka.zb;this.Z&&this.Z.fa&1&&(a|=W.ka.zb);return this.u=a};k.jd=function(a,b){this.L=b};k.md=function(a,b){this.w=b};k.ld=function(a,b){a=b&3;switch(b>>2&3){case 0:this.f=this.f&-4|a;break;case 1:this.f=this.f&-13|a<<2;this.video&&(b=this.video,a=this.f,b.qa!==a&&((b.qa=a)?Nb(b,!0):b.ta=!0));break;case 2:switch(a){case 0:this.G=~this.G;break;case 2:case 3:this.R=3-a}break;case 3:this.N=a}}; k.kd=function(a,b){b&W.za.yc?(b&=W.za.xb,this.s!=b&&(this.s=b,this.video&&(this.video.Hb=this.s==W.za.xb?50:60))):(b&=W.za.pb,this.o!=b&&(this.o=b,this.video&&(a=this.video,b=this.o==W.za.pb?132:80,a.H=b,a.T=a.Aa,80>8&255,a.b[d++]=g[c]>>16&255,a.b[d++]=g[c]>>24&255;else a.b=e;a.wa=e.symbols;if(!a.b.length){q("Empty ROM: "+b);return}if(1==a.b.length){q(a.b[0]);return}}catch(h){a.K("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm, " ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e>>f.j;0>>=f.j;0>>=f.j;0d?a.j.push({mb:b,hb:Date.now(),$a:!1}):(a.j[d].hb=Date.now(),a.j[d].$a=!1);else if(0<=d){if(!a.j[d].$a){var e=a.j[d].hb;if(e&&100>Date.now()-e)return a.j[d].$a=!0,Ec(a),!0}a.j.splice(d,1)}if(a.M){d=0;switch(b){case "1p":d=V.Ca.sc;break;case "2p":d=V.Ca.wc;break;case "coin":d=V.Ca.Tb;break;case "left":d=V.Ca.uc;break;case "right":d=V.Ca.vc;break;case "fire":d=V.Ca.tc}d&&(a=a.M,b=d,a.g&=~b,c&&(a.g|=b))}return!0} function Ec(a){for(var b=0,c=-1;bc||c>e)c=e}else{Cc(a,d,!1);b=0;continue}}b++}0<=c&&setTimeout(function(){Ec(a)},c)}k.$c=function(){var a=this.g;0<=this.c&&(this.c>3)*a.G,!$a(a.j,a.ja,a.B,3)))return!1;a.B?(a.Ma=a.f.createImageData(b,c),a.Oa=16/a.la|0,Kc(a,a.B>>1)):Kc(a,(a.H+1)*a.W);a.s=document.createElement("canvas");a.s.width=b;a.s.height=c;a.sa=a.s.getContext("2d");a.I={};a.S=1<>3)*a.G,!$a(a.j,a.ja,a.B,3)))return!1;a.B?(a.Ma=a.f.createImageData(b,c),a.Oa=16/a.la|0,Kc(a,a.B>>1)):Kc(a,(a.H+1)*a.W);a.s=document.createElement("canvas");a.s.width=b;a.s.height=c;a.sa=a.s.getContext("2d");a.I={};a.S=1<=a.Aa?8:16,f=8>(7=a.Aa?8:16,f=8>(7>4)*c)}return l}Fc.prototype.ga=function(){return!0};Fc.prototype.V=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.va[b]=c,!0;switch(b){case "fullScreen":return this.A[b]=c,this.b&&this.b.Ha?c.onclick=function(){d.Ha()}:c.parentNode.removeChild(c),!0}return!1}; Fc.prototype.Ha=function(){var a=!1;if(this.b){if(this.b.Ha){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.C/this.w;b>c&&(a=Math.round(c/b*100)+"%")}this.La?(this.u.style.width=a,this.u.style.width=a,this.u.style.display="block",this.u.style.margin="auto"):(this.b.style.width=a,this.b.style.height="auto");this.b.style.backgroundColor="black";this.b.Ha();a=!0}this.R&&this.R.focus()}return a}; function Ic(a,b){!b&&a.b&&(a.La?a.u.style.width=a.u.style.height="":a.b.style.width=a.b.style.height="")}function Kc(a,b){a.Na=b;a.N=!1;if(void 0===a.i||a.i.length!=a.Na)a.i=Array(a.Na)}function Mc(a,b,c,d,e){d=a.c?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.U&&(208<=c&&236>c?e=a.S+0:28<=c&&72>c&&(e=a.S+1));a=a.L[e];d*=a.length;b.data[d]=a[0];b.data[d+1]=a[1];b.data[d+2]=a[2];b.data[d+3]=a[3]} -function Nb(a,b){var c=!0;if(!b){a.ma&&(120==a.ma?a.Xa&1?(hc(a.a,2),c=!1):hc(a.a,1):hc(a.a,4));if(c&&a.N&&a.B){for(var d=a.j,e=a.B,f=!0,g=a.ja>>>d.j;0>=1);;){var x=cb(a.j,u++);if(127==(x&127)){var t=cb(a.j,u++),d=t&96,c=(t&15)<<8|cb(a.j,u),c=c+(t&16? -8192:16384);break}if(n>4)*x.P,Z,sa,Pa,fb,zc=x.T,Lb=x.P;D?(Z=H*t.T,sa=e*t.P,Pa=t.T,fb=t.P):(Z=H*t.Fa,sa=e*t.Ga,Pa=t.Fa,fb=t.Ga);x.T>t.T&&(Z*=2,Pa*=2);x.P>t.P&&(y||(Q+=t.P),Lb=t.P);D?D.drawImage(x.canvas,U,Q,zc,Lb,Z,sa,Pa,fb):(Z+=0,sa+=0,t.f.drawImage(x.canvas,U,Q,zc,Lb, -Z,sa,Pa,fb))}h++}g++}e++}}a.N=!0;!b&&a.ta&&1==h&&(a.i[l]=-1,h=0);a.ta=!1;(h||b)&&a.sa&&a.f.drawImage(a.s,0,a.qa,a.o,a.G-a.P,0,0,a.Nc,a.Mb)}else{e=a.ja;f=e+a.B;l=h=g=0;b=a.o;n=0;c=a.G;y=d=0;u=a.la;H=(1<>>t.j;t=x!=t.f?t.b[U].Ib(x,D):t.b[U++].eb(x,D)|t.b[U&t.o].eb(0,D+1)<<8;if(a.N&&t===a.i[g])h+=a.Oa;else{a.i[g]=t;(D=y)&&(t=t>>8|(t&255)<<8);h>D&H,Mc(a,a.Ma,h++,l,U),D+=u;h>n&&(n=h);l=d&&(d=l+1)}e+= +function Nb(a,b){var c=!0;if(!b){a.ma&&(120==a.ma?a.Xa&1?(hc(a.a,2),c=!1):hc(a.a,1):hc(a.a,4));if(c&&a.N&&a.B){for(var d=a.j,e=a.B,f=!0,g=a.ja>>>d.j;0>=1);;){var x=cb(a.j,u++);if(127==(x&127)){var t=cb(a.j,u++),d=t&96,c=(t&15)<<8|cb(a.j,u),c=c+(t&16? +8192:16384);break}if(n>4)*x.P,Z,sa,Pa,fb,zc=x.T,Lb=x.P;D?(Z=H*t.T,sa=e*t.P,Pa=t.T,fb=t.P):(Z=H*t.Fa,sa=e*t.Ga,Pa=t.Fa,fb=t.Ga);x.T>t.T&&(Z*=2,Pa*=2);x.P>t.P&&(z||(Q+=t.P),Lb=t.P);D?D.drawImage(x.canvas,U,Q,zc,Lb,Z,sa,Pa,fb):(Z+=0,sa+=0,t.f.drawImage(x.canvas,U,Q,zc,Lb,Z, +sa,Pa,fb))}h++}g++}e++}}a.N=!0;!b&&a.ta&&1==h&&(a.i[l]=-1,h=0);a.ta=!1;(h||b)&&a.sa&&a.f.drawImage(a.s,0,a.qa,a.o,a.G-a.P,0,0,a.Nc,a.Mb)}else{e=a.ja;f=e+a.B;l=h=g=0;b=a.o;n=0;c=a.G;z=d=0;u=a.la;H=(1<>>t.j;t=x!=t.f?t.b[U].Ib(x,D):t.b[U++].eb(x,D)|t.b[U&t.o].eb(0,D+1)<<8;if(a.N&&t===a.i[g])h+=a.Oa;else{a.i[g]=t;(D=z)&&(t=t>>8|(t&255)<<8);h>D&H,Mc(a,a.Ma,h++,l,U),D+=u;h>n&&(n=h);l=d&&(d=l+1)}e+= 2;g++;if(h>=a.o&&(h=0,l++,l>a.G))break}a.N=!0;bMissing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height= +za(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<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height= (a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Fa.aspect);f&&.3<=f&&3.33>=f&&(ya("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");ta("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new Fc(d,e,g,f,c);Qa(d,c)}}); function Nc(a){this.I=+a.adapter;switch(this.I){case 0:this.L=0;this.R=2;break;default:q("Unrecognized serial adapter #"+this.I);return}this.b=this.c=null;this.N=a.tabSize;this.H=a.charBOL;this.f=0;this.C=!1;r.call(this,"SerialPort",a,Nc);var b=a.binding;if("console"==b)this.c="";else{var c;a=Oc;b&&(void 0===c&&(c="Panel"),(c=Oa(c,this.id))&&(b=c.A[b])&&this.V(null,a,b))}this.g="";this.i=this.s=null;this.exports={connect:this.Gb,receiveData:this.kb}}w(Nc); var Pc=[50,75,110,134.5,150,200,300,600,1200,1800,2E3,2400,3600,4800,9600,19200],Qc=[!1,0,0,133,142,39,238],Oc="buffer";k=Nc.prototype; @@ -167,28 +167,28 @@ k.Gb=function(){if(!this.i){var a=Ab(this.v,"connection");if(a){var b=a.split("- k.ia=function(a){return a?this.save():!0};k.reset=function(){Uc(this)};k.save=function(){var a=new F(this),b=0,c=[];c[b++]=this.o;c[b++]=this.B;c[b++]=this.G;c[b++]=this.fa;c[b++]=this.m;c[b++]=this.w;c[b]=this.u;a.set(0,c);return a.data()};k.restore=function(a){return Uc(this,a[0])};function Uc(a,b){var c=0;b||(b=Qc);a.o=b[c++];a.B=b[c++];a.G=b[c++];a.fa=b[c++];a.m=b[c++];a.w=b[c++];a.u=b[c];return!0} function Vc(a,b){var c=a.u&b;b&15||(c>>=4);b=Pc[c];c=((a.m&12)>>2)+6;a.m&16&&c++;c+=((a.m&192)>>6)+1>>1;return 1E3/Math.round(b/c)}function Rc(a,b){return a.C||a.fa&2?!1:(a.B=b,a.fa|=2,hc(a.a,a.R),!0)}k.kb=function(a){null!=a&&(this.g="number"!=typeof a?a:this.g+String.fromCharCode(a));this.g&&(Rc(this,this.g.charCodeAt(0))&&(this.g=this.g.substr(1)),this.g&&this.a&&Kb(this.a,this.S,Vc(this,15)));return!0};k.Uc=function(){var a=this.B;this.fa&=-3;return a};k.Tc=function(){return this.fa}; k.cd=function(a,b){this.G=b;this.fa&=-6;if(19==b)this.C=!0;else if(17==b)this.C=!1;else if(this.s&&this.s.call(this.i,b),this.b)if(8==b)this.b.value=this.b.value.slice(0,-1),0":String.fromCharCode(b);var c=a.length;9==b?(b=this.N||8,c=b-this.f%b,this.N&&(a=" ".slice(0,c))):13==b&&(this.f=c=0,a="\n");this.H&&!this.f&&c&&(a=String.fromCharCode(this.H)+a);this.b.value+=a;this.b.scrollTop=this.b.scrollHeight;this.f+=c}else if(null!= -this.c){if(10==b||1024<=this.c.length)this.ea(this.c),this.c="";10!=b&&(this.c+=String.fromCharCode(b))}this.a&&Kb(this.a,this.U,Vc(this,240))};k.bd=function(a,b){this.o?(this.w=b,this.w&64&&(this.o=!1)):(this.m=b,this.o=!0)};k.ad=function(a,b){this.u=b};var Sc={0:Nc.prototype.Uc,1:Nc.prototype.Tc},Tc={0:Nc.prototype.cd,1:Nc.prototype.bd,2:Nc.prototype.ad};za(function(){for(var a=A(document,"pc8080","serial"),b=0;b\nLicense: GPL version 3 or later ");for(b=0;bYc){if($c(d,this.s)){this.i=new F(this,"1.30.1","failsafe");$c(this.i)&&(ed(this,d),a=2,fd(this.i));this.i.set("timestamp",ka());gd(this.i);var e=this.b&&!this.v;if(1==a||na("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=dd(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?$c(d,g):("error"== f&&"no machine state"!=g?(this.K("Error: "+g),"unable to verify user"==g&&(ra("user",""),this.c=null)):this.ea(f+": "+g),fd(d),$c(d)?(c=dd(d),e=!0):c=!1))}e&&cd(this,c?d:null)}else 2==a&&d.clear()}else cd(this);delete this.s;delete this.u}e=Ma(this.id);for(f=0;fa[1];a=a[2];this.L=!0;this.l.Z=!0;var d=this.A.power;d&&(d.textContent="Shutdown");this.a&&(hd(this,this.a,b,c,a),this.a.Qa());this.C&&(ed(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.f=0}; +function hd(a,b,c,d,e){if(!b.l.Y){b.l.Y=!0;if(b.ga){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ga(f,d)&&f&&(q("Unable to restore state for "+b.type),a.B&&!a.G?(c.clear(),a.b=Yc,window&&window.location.reload()):a.C=!0,b.ga(null),e=!1)}if(!d&&b.yb)for(a=b.yb.split("|"),c=0;ca[1];a=a[2];this.L=!0;this.l.Y=!0;var d=this.A.power;d&&(d.textContent="Shutdown");this.a&&(hd(this,this.a,b,c,a),this.a.Qa());this.C&&(ed(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.f=0}; function ed(a,b){if(na("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.c||"";b=b.toString();var d={app:"PC8080",ver:"1.30.1"};d.url=a.I;d.user=c;d.type="bug";d.data=b;la("http://www.pcjs.org/api/v1/report",d,!0)}} -function id(a,b,c){var d,e="none";if(a.f)return null;a.f--;var f=new F(a,"1.30.1"),g=new F(a,"1.30.1","validate"),h=ka();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ia&&(c&&Eb(a.a),d=a.a.ia(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.l.Z=!1,!1===d&&(e=null)));for(var h=Ma(a.id),l=0;l).*?(<\/xsl:variable>)/,"$1pc8080$2" null)} function pd(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");la(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],n,u=/( [a-z]+=)(['"])(.*?)\2/g;n=u.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,""); a=a.replace(d[0],g);pd(a,b,c)}})}else c(a,null)} -function qd(a,b,c,d){function e(a){if(void 0===h){var b=g&&A(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ga(a))}function f(a){e("Error: "+a);l&&(--md||Ca(!0));l=!1}var g,h,l=!0;md++;Ka[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var u=document.head||document.getElementsByTagName("head")[0],y=document.createElement("style");y.type="text/css";y.styleSheet?y.styleSheet.cssText=n:y.appendChild(document.createTextNode(n));u.appendChild(y)}c|| +function qd(a,b,c,d){function e(a){if(void 0===h){var b=g&&A(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ga(a))}function f(a){e("Error: "+a);l&&(--md||Ca(!0));l=!1}var g,h,l=!0;md++;Ka[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var u=document.head||document.getElementsByTagName("head")[0],z=document.createElement("style");z.type="text/css";z.styleSheet?z.styleSheet.cssText=n:z.appendChild(document.createTextNode(n));u.appendChild(z)}c|| (c="/versions/pc8080/1.30.1/components.xsl");n=function(d,h){h?nd(c,null,null,!1,e,function(d,l){l?(La(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--md||Ca(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--md||Ca(!0)):f("invalid machine element: "+ a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?nd(b,a,d,!0,e,n):od(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(H){f(H.message)}return l}window.embedPC8080=function(a,b,c,d){Ca(!1);return qd(a,b,c,d)};window.enableEvents=Ca;window.sendEvent=Da;})(); diff --git a/versions/pcx86/1.30.1/components.xsl b/versions/pcx86/1.30.1/components.xsl index a0fe1e298..2636d6e68 100644 --- a/versions/pcx86/1.30.1/components.xsl +++ b/versions/pcx86/1.30.1/components.xsl @@ -738,21 +738,32 @@ - + + + + + + + + + + + + device - ,type:'' + ,type:'',autoMount:'' @@ -878,10 +889,11 @@ - + - + + @@ -893,7 +905,7 @@ fdc - ,autoMount:'',sortBy:'' + ,autoMount:'',sortBy:'' diff --git a/versions/pdpjs/1.30.1/components.xsl b/versions/pdpjs/1.30.1/components.xsl index 8f4c9c2d9..0e4f5a23c 100644 --- a/versions/pdpjs/1.30.1/components.xsl +++ b/versions/pdpjs/1.30.1/components.xsl @@ -738,21 +738,32 @@ - + + + + + + + + + + + + device - ,type:'' + ,type:'',autoMount:'' @@ -878,10 +889,11 @@ - + - + + @@ -893,7 +905,7 @@ fdc - ,autoMount:'',sortBy:'' + ,autoMount:'',sortBy:'' diff --git a/versions/pdpjs/1.30.1/pdp11-dbg.js b/versions/pdpjs/1.30.1/pdp11-dbg.js index 4986bdf8b..33b1fcc70 100644 --- a/versions/pdpjs/1.30.1/pdp11-dbg.js +++ b/versions/pdpjs/1.30.1/pdp11-dbg.js @@ -28,234 +28,241 @@ http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ -for(var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea>=3;return(c?"0o":"")+d}function k(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} -function oa(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ta(a){return a.replace(/[&<>"']/g,function(a){return sa[a]})}function ua(a,b){return(a+" ").slice(0,b)} -function va(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var wa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; -function ya(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,l;l=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function Ba(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"== -typeof b){var m="",p;for(p in b)b.hasOwnProperty(p)&&(m&&(m+="&"),m+=p+"="+encodeURIComponent(b[p]));m=m.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(m)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function Fa(a,b){var c,d={ga:null,ja:null,Lb:null,Kb:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g=eval("("+b+")");d.Lb=g.load;d.Kb=g.exec;if(e=g.bytes)d.ga=e;else if(e=g.words)for(d.ga=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ga=Array(4*e.length),f=c=0;c>8&255,d.ga[f++]=e[c]>>16&255,d.ga[f++]=e[c]>>24&255;else d.ga=g;d.ja=g.symbols;d.ga.length?1==d.ga.length&&(n(d.ga[0]),d=null): -(n("Empty resource: "+a),d=null)}catch(l){n("Resource data error: "+l.message),d=null}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),d.ga=Array(a.length),c=0;c>=3;return(c?"0o":"")+d}function l(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} +function oa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function ta(a){return a.replace(/[&<>"']/g,function(a){return sa[a]})} +function ua(a,b){return(a+" ").slice(0,b)}function va(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var wa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function ya(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function Ba(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"== +typeof b){var m="",p;for(p in b)b.hasOwnProperty(p)&&(m&&(m+="&"),m+=p+"="+encodeURIComponent(b[p]));m=m.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(m)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} +function Ca(a,b){var c,d={ja:null,ka:null,Lb:null,Kb:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Lb=g.load;d.Kb=g.exec;if(e=g.bytes)d.ja=e;else if(e=g.words)for(d.ja=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ja=Array(4*e.length),f=c=0;c>8&255,d.ja[f++]=e[c]>>16&255,d.ja[f++]=e[c]>>24&255;else d.ja=g;d.ka=g.symbols;d.ja.length?1==d.ja.length&&(n(d.ja[0]),d=null):(n("Empty resource: "+a),d=null)}catch(k){n("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Ua=this.id:(this.Va=this.id.substr(0,b),this.Ua=this.id.substr(b+1));this[a]=c;this.v={ready:!1,mb:!1,Ib:!1,ia:!1,error:!1};this.zb=null;this.v.error=!1;this.J={};this.i=null;this.ka=d||0;t.push(this)}var cb=void 0,db={}; +function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Yb=b.comment;this.tc=b;b=this.id.indexOf(".");0>b?this.Wa=this.id:(this.Ra=this.id.substr(0,b),this.Wa=this.id.substr(b+1));this[a]=c;this.v={ready:!1,Ia:!1,Ib:!1,ha:!1,error:!1};this.zb=null;this.v.error=!1;this.I={};this.i=null;this.la=d||0;t.push(this)}var cb=void 0,db={}; if(window){cb||(cb=window.location.search.substr(1));for(var eb,fb=/\+/g,gb=/([^&=]+)=?([^&]*)/g;eb=gb.exec(cb);)db[decodeURIComponent(eb[1].replace(fb," "))]=decodeURIComponent(eb[2].replace(fb," "))}function hb(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function u(a,b){b||(b=r);a.prototype=hb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var ib=window.PCjs.Machines||(window.PCjs.Machines={}),t=window.PCjs.Components||(window.PCjs.Components=[])}else ib={},t=[];function jb(a,b,c){ib[a]&&b&&(ib[a][b]=c)}function kb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>2;this.w=this.ua-1;this.D=this.H/this.ua|0;this.Ha=[];this.C=0;this.B=[];this.mc=[Ob,Pb,Qb,Rb];a=new I(this);Sb(a,this.i);this.W=Array(this.D);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ha[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&G(this.i,64)&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!0);this.i&&G(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} -function Pb(a,b,c){var d=!1,e=this.controller,f=e.Ha[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ha[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d?this.i&&G(this.i,64)&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!0,b),this.i&&G(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} -function Qb(a,b){var c=-1,d=this.controller;(a=d.Ha[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&G(this.i,64)&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!1);this.i&&G(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} -function Rb(a,b,c){var d=!1,e=this.controller;if(a=e.Ha[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.i&&G(this.i,64)&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!1,b),this.i&&G(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} -function Vb(a,b){if(b!=a.g){var c;a.g&&(c=(1<>>a.ha;0g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.A)return m.vb+=m.A-f,m.A=f,!0;if(f>=m.A+m.vb){q=m.size-(f-p);q>g&&(q=g);m.vb=f-m.A+q;f=p+a.ua;g-=q;l++;continue}}return ac(1,f,g)}f=new I(a,f,q,a.ua,d,e);Sb(f,a.i,m);a.W[l++]=f;f=p+a.ua;g-=q}if(0>=g){c/=1024;var v;e="";v?10>>=a.ha;0>>=a.ha;0>>this.ha].Eb(a&this.w,a)};h.Bb=function(a){this.C++;a=this.W[(a&this.f)>>>this.ha].Mb(a&this.w,a);this.C--;return a};h.ma=function(a){return this.W[(a&this.f)>>>this.ha].ta(a&this.w,a)}; -h.pb=function(a){var b=a&this.w,c=(a&this.f)>>>this.ha;this.C++;a=this.W[c].Nb(b,a);this.C--;return a};h.Fb=function(a,b){this.W[(a&this.f)>>>this.ha].Hb(a&this.w,b&255,a)};h.gb=function(a,b){this.C++;this.W[(a&this.f)>>>this.ha].Sb(a&this.w,b&255,a);this.C--};h.Ta=function(a,b){this.W[(a&this.f)>>>this.ha].wb(a&this.w,b&65535,a)};h.Gb=function(a,b){var c=a&this.w,d=(a&this.f)>>>this.ha;this.C++;this.W[d].Tb(c,b&65535,a);this.C--}; -function cc(a){for(var b=0,c=[],d=0;da.b.$a)){var g=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));lc(a,e,e,g,l,m,p,f[4])}}}function nc(a,b){a.B.push(b)} -function oc(a,b){a.C||(a.i&&G(a.i,536870912)&&E(a.i,"memory fault on address "+J(a.i,b),!0,!0),a.b.ea(4,b))}function ac(a,b,c){n("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function K(a){r.call(this,"Device",a,K,256);this.g={data:0,Sd:0,Db:20,gd:0};this.f={Td:0,Rb:-1}}u(K);h=K.prototype; -h.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;var e=this;this.f.Rb=pc(c,function(){e.f.Ja|=128;e.f.Ja&64&&(qc(e.b,e.f.hd),rc(e.b,e.f.Rb,1E3/60))});this.f.hd=sc(64,6);mc(b,this,L);nc(b,this.reset.bind(this));H(this)};h.reset=function(){this.g.Db=this.g.Db&-120|20;this.f.Ja=0};h.Dc=function(){var a=this.f.Ja;this.f.Ja&=-129;return a};h.rd=function(a){this.f.Ja=a;a&64&&rc(this.b,this.f.Rb,1E3/60);this.f.Ja=a&-129};h.wc=function(a){return(a?this.g.gd:this.g.data)&65535}; -h.kd=function(a){this.g.data=a};h.Fc=function(){var a=this.b;return a.G&62337|a.wa<<5|a.xa<<1};h.td=function(a){var b=this.b;a&=62337;if(b.G!=a){b.G=a;b.wa=a>>5&3;b.xa=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ka!=c&&(b.Ka=c,tc(b))}uc(this)};h.Gc=function(){var a=this.b.Ma;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Hc=function(){return this.b.tb};h.Ic=function(){return this.b.Na}; -h.ud=function(a){var b=this.b;1170>b.$a&&(a&=-49);b.Na!=a&&(b.Na=a,a&16?(b.Ya=4194303,b.ya=3915776):(b.Ya=262143,b.ya=253952),tc(b));uc(this)};function uc(a){a.g.Db=a.g.Db&-8|(a.b.Ka?a.b.Na&16?1:2:4)}h.Wc=function(a){return this.b.P[1][a>>1&7]};h.Id=function(a,b){this.b.P[1][b>>1&7]=a&65295};h.Uc=function(a){return this.b.P[1][(a>>1&7)+8]};h.Gd=function(a,b){this.b.P[1][(b>>1&7)+8]=a&65295};h.Vc=function(a){return this.b.sa[1][a>>1&7]}; +var sb="undefined"!==typeof ArrayBuffer,tb={cpu:1,trap:16,bus:64,memory:128,device:256,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function ub(a){r.call(this,"Panel",a,ub);this.f=0;this.v.Wb=!0}u(ub);h=ub.prototype; +h.qa=function(a,b,c,d){if(this.C&&this.C.qa(a,b,c,d)||this.b&&this.b.qa(a,b,c,d)||this.i&&this.i.qa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.I[b]=c,this.f++,!0;default:return"rled"==a?(this.I[b]=c,this.f++,!0):this.parent.qa.call(this,a,b,c,d)}};h.Ca=function(a,b,c,d){this.C=a;this.w=b;this.b=c;this.i=d};h.Aa=function(a,b){b||Ib();return!0};h.za=function(){return!0}; +function Jb(a,b,c,d){if(a.I[b]){void 0===c&&(rb(a,"Value for "+b+" is invalid"),a.b.da());var e=a.i&&a.i.ma||8;c=!a.b.v.ca||a.v.Wb?8==e?na(c,d):l(c,d):"--------".substr(0,d||4);a.I[b].textContent!=c&&(a.I[b].textContent=c)}}function Kb(a,b,c,d){for(var e=0;e>2;this.w=this.ua-1;this.D=this.H/this.ua|0;this.Ha=[];this.A=0;this.C=[];this.mc=[Ob,Pb,Qb,Rb];a=new I(this);Sb(a,this.i);this.W=Array(this.D);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ha[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&D(this.i,64)&&C(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!0);this.i&&D(this.i,64)&&C(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} +function Pb(a,b,c){var d=!1,e=this.controller,f=e.Ha[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ha[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d?this.i&&D(this.i,64)&&C(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!0,b),this.i&&D(this.i,64)&&C(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} +function Qb(a,b){var c=-1,d=this.controller;(a=d.Ha[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&D(this.i,64)&&C(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!1);this.i&&D(this.i,64)&&C(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} +function Rb(a,b,c){var d=!1,e=this.controller;if(a=e.Ha[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.i&&D(this.i,64)&&C(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!1,b),this.i&&D(this.i,64)&&C(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} +function Vb(a,b){if(b!=a.g){var c;a.g&&(c=(1<>>a.ia;0g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.B)return m.vb+=m.B-f,m.B=f,!0;if(f>=m.B+m.vb){q=m.size-(f-p);q>g&&(q=g);m.vb=f-m.B+q;f=p+a.ua;g-=q;k++;continue}}return ac(1,f,g)}f=new I(a,f,q,a.ua,d,e);Sb(f,a.i,m);a.W[k++]=f;f=p+a.ua;g-=q}if(0>=g){c/=1024;var v;e="";v?10>>=a.ia;0>>=a.ia;0>>this.ia].Eb(a&this.w,a)};h.Bb=function(a){this.A++;a=this.W[(a&this.f)>>>this.ia].Mb(a&this.w,a);this.A--;return a};h.na=function(a){return this.W[(a&this.f)>>>this.ia].ta(a&this.w,a)}; +h.pb=function(a){var b=a&this.w,c=(a&this.f)>>>this.ia;this.A++;a=this.W[c].Nb(b,a);this.A--;return a};h.Fb=function(a,b){this.W[(a&this.f)>>>this.ia].Hb(a&this.w,b&255,a)};h.hb=function(a,b){this.A++;this.W[(a&this.f)>>>this.ia].Sb(a&this.w,b&255,a);this.A--};h.Va=function(a,b){this.W[(a&this.f)>>>this.ia].wb(a&this.w,b&65535,a)};h.Gb=function(a,b){var c=a&this.w,d=(a&this.f)>>>this.ia;this.A++;this.W[d].Tb(c,b&65535,a);this.A--}; +function cc(a){for(var b=0,c=[],d=0;da.b.ab)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!k&&p&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));dc(a,e,e,g,k,m,p,f[4])}}}function nc(a,b){a.C.push(b)} +function oc(a,b){a.A||(a.i&&D(a.i,536870912)&&C(a.i,"memory fault on address "+J(a.i,b),!0,!0),a.b.ea(4,b))}function ac(a,b,c){n("Memory block error ("+a+": "+l(b)+","+l(c)+")");return!1}function K(a){r.call(this,"Device",a,K,256);this.g={data:0,Sd:0,Db:20,gd:0};this.f={Td:0,Rb:-1}}u(K);h=K.prototype; +h.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;var e=this;this.f.Rb=pc(c,function(){e.f.Ka|=128;e.f.Ka&64&&(qc(e.b,e.f.hd),rc(e.b,e.f.Rb,1E3/60))});this.f.hd=sc(64,6);mc(b,this,L);nc(b,this.reset.bind(this));H(this)};h.reset=function(){this.g.Db=this.g.Db&-120|20;this.f.Ka=0};h.Dc=function(){var a=this.f.Ka;this.f.Ka&=-129;return a};h.rd=function(a){this.f.Ka=a;a&64&&rc(this.b,this.f.Rb,1E3/60);this.f.Ka=a&-129};h.wc=function(a){return(a?this.g.gd:this.g.data)&65535}; +h.kd=function(a){this.g.data=a};h.Fc=function(){var a=this.b;return a.G&62337|a.wa<<5|a.xa<<1};h.td=function(a){var b=this.b;a&=62337;if(b.G!=a){b.G=a;b.wa=a>>5&3;b.xa=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.La!=c&&(b.La=c,tc(b))}uc(this)};h.Gc=function(){var a=this.b.Na;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Hc=function(){return this.b.tb};h.Ic=function(){return this.b.Oa}; +h.ud=function(a){var b=this.b;1170>b.ab&&(a&=-49);b.Oa!=a&&(b.Oa=a,a&16?(b.Za=4194303,b.ya=3915776):(b.Za=262143,b.ya=253952),tc(b));uc(this)};function uc(a){a.g.Db=a.g.Db&-8|(a.b.La?a.b.Oa&16?1:2:4)}h.Wc=function(a){return this.b.P[1][a>>1&7]};h.Id=function(a,b){this.b.P[1][b>>1&7]=a&65295};h.Uc=function(a){return this.b.P[1][(a>>1&7)+8]};h.Gd=function(a,b){this.b.P[1][(b>>1&7)+8]=a&65295};h.Vc=function(a){return this.b.sa[1][a>>1&7]}; h.Hd=function(a,b){b=b>>1&7;this.b.sa[1][b]=a;this.b.P[1][b]&=65295};h.Tc=function(a){return this.b.sa[1][(a>>1&7)+8]};h.Fd=function(a,b){b=(b>>1&7)+8;this.b.sa[1][b]=a;this.b.P[1][b]&=65295};h.Cc=function(a){return this.b.P[0][a>>1&7]};h.qd=function(a,b){this.b.P[0][b>>1&7]=a&65295};h.Ac=function(a){return this.b.P[0][(a>>1&7)+8]};h.od=function(a,b){this.b.P[0][(b>>1&7)+8]=a&65295};h.Bc=function(a){return this.b.sa[0][a>>1&7]};h.pd=function(a,b){b=b>>1&7;this.b.sa[0][b]=a;this.b.P[0][b]&=65295}; h.zc=function(a){return this.b.sa[0][(a>>1&7)+8]};h.nd=function(a,b){b=(b>>1&7)+8;this.b.sa[0][b]=a;this.b.P[0][b]&=65295};h.bd=function(a){return this.b.P[3][a>>1&7]};h.Od=function(a,b){this.b.P[3][b>>1&7]=a&65295};h.$c=function(a){return this.b.P[3][(a>>1&7)+8]};h.Md=function(a,b){this.b.P[3][(b>>1&7)+8]=a&65295};h.ad=function(a){return this.b.sa[3][a>>1&7]};h.Nd=function(a,b){b=b>>1&7;this.b.sa[3][b]=a;this.b.P[3][b]&=65295};h.Zc=function(a){return this.b.sa[3][(a>>1&7)+8]}; -h.Ld=function(a,b){b=(b>>1&7)+8;this.b.sa[3][b]=a;this.b.P[3][b]&=65295};h.eb=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]};h.jb=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a};h.Nc=function(){return this.b.L&49152?this.b.va[0]:this.b.u[6]};h.zd=function(a){this.b.L&49152?this.b.va[0]=a:this.b.u[6]=a};h.Qc=function(){return this.b.u[7]};h.Cd=function(a){this.b.u[7]=a};h.fb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]}; -h.kb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ea[b]=a};h.Oc=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[1]};h.Ad=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[1]=a};h.Pc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[3]};h.Bd=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[3]=a};h.yc=function(a){return this.b.gc[a-65504>>1]};h.md=function(a,b){this.b.gc[b-65504>>1]=a};h.dc=function(a){return 65520==a?61183:0};h.jc=function(){}; -h.Yc=function(){return 1};h.Kd=function(){};h.xc=function(){return this.b.Z};h.ld=function(){this.b.Z=0};h.Ec=function(){return this.b.fc};h.sd=function(a,b){b&1||(a&=255);this.b.fc=a};h.Jc=function(a){return a?this.b.Pb:0};h.vd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Pb=a;b.F|=2};h.Xc=function(a){return a?this.b.Oa&65280:0};h.Jd=function(a){this.b.Oa=a|255};h.Mc=function(){return Lb(this.b)};h.yd=function(a){vc(this.b,a&-1809|Lb(this.b)&1808);this.b.F|=128}; -h.ic=function(a,b){G(this)&&E(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; +h.Ld=function(a,b){b=(b>>1&7)+8;this.b.sa[3][b]=a;this.b.P[3][b]&=65295};h.fb=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]};h.kb=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a};h.Nc=function(){return this.b.L&49152?this.b.va[0]:this.b.u[6]};h.zd=function(a){this.b.L&49152?this.b.va[0]=a:this.b.u[6]=a};h.Qc=function(){return this.b.u[7]};h.Cd=function(a){this.b.u[7]=a};h.gb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]}; +h.lb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ea[b]=a};h.Oc=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[1]};h.Ad=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[1]=a};h.Pc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[3]};h.Bd=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[3]=a};h.yc=function(a){return this.b.gc[a-65504>>1]};h.md=function(a,b){this.b.gc[b-65504>>1]=a};h.dc=function(a){return 65520==a?61183:0};h.jc=function(){}; +h.Yc=function(){return 1};h.Kd=function(){};h.xc=function(){return this.b.Z};h.ld=function(){this.b.Z=0};h.Ec=function(){return this.b.fc};h.sd=function(a,b){b&1||(a&=255);this.b.fc=a};h.Jc=function(a){return a?this.b.Pb:0};h.vd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Pb=a;b.F|=2};h.Xc=function(a){return a?this.b.Pa&65280:0};h.Jd=function(a){this.b.Pa=a|255};h.Mc=function(){return Lb(this.b)};h.yd=function(a){vc(this.b,a&-1809|Lb(this.b)&1808);this.b.F|=128}; +h.ic=function(a,b){D(this)&&C(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; var M={},L=(M[62592]=[null,null,K.prototype.Wc,K.prototype.Id,"SISDR",1145],M[62608]=[null,null,K.prototype.Uc,K.prototype.Gd,"SDSDR",1145],M[62624]=[null,null,K.prototype.Vc,K.prototype.Hd,"SISAR",1145],M[62640]=[null,null,K.prototype.Tc,K.prototype.Fd,"SDSAR",1145],M[62656]=[null,null,K.prototype.Cc,K.prototype.qd,"KISDR",1145],M[62672]=[null,null,K.prototype.Ac,K.prototype.od,"KDSDR",1145],M[62688]=[null,null,K.prototype.Bc,K.prototype.pd,"KISAR",1145],M[62704]=[null,null,K.prototype.zc,K.prototype.nd, "KDSAR",1145],M[62798]=[null,null,K.prototype.Ic,K.prototype.ud,"MMR3",1145],M[65382]=[null,null,K.prototype.Dc,K.prototype.rd,"LKS"],M[65400]=[null,null,K.prototype.wc,K.prototype.kd,"CNSL"],M[65402]=[null,null,K.prototype.Fc,K.prototype.td,"MMR0",1145],M[65404]=[null,null,K.prototype.Gc,K.prototype.ic,"MMR1",1145],M[65406]=[null,null,K.prototype.Hc,K.prototype.ic,"MMR2",1145],M[65408]=[null,null,K.prototype.bd,K.prototype.Od,"UISDR",1145],M[65424]=[null,null,K.prototype.$c,K.prototype.Md,"UDSDR", -1145],M[65440]=[null,null,K.prototype.ad,K.prototype.Nd,"UISAR",1145],M[65456]=[null,null,K.prototype.Zc,K.prototype.Ld,"UDSAR",1145],M[65472]=[null,null,K.prototype.eb,K.prototype.jb,"R0SET0"],M[65473]=[null,null,K.prototype.eb,K.prototype.jb,"R1SET0"],M[65474]=[null,null,K.prototype.eb,K.prototype.jb,"R2SET0"],M[65475]=[null,null,K.prototype.eb,K.prototype.jb,"R3SET0"],M[65476]=[null,null,K.prototype.eb,K.prototype.jb,"R4SET0"],M[65477]=[null,null,K.prototype.eb,K.prototype.jb,"R5SET0"],M[65478]= -[null,null,K.prototype.Nc,K.prototype.zd,"R6KERNEL"],M[65479]=[null,null,K.prototype.Qc,K.prototype.Cd,"R7KERNEL"],M[65480]=[null,null,K.prototype.fb,K.prototype.kb,"R0SET1",1145],M[65481]=[null,null,K.prototype.fb,K.prototype.kb,"R1SET1",1145],M[65482]=[null,null,K.prototype.fb,K.prototype.kb,"R2SET1",1145],M[65483]=[null,null,K.prototype.fb,K.prototype.kb,"R3SET1",1145],M[65484]=[null,null,K.prototype.fb,K.prototype.kb,"R4SET1",1145],M[65485]=[null,null,K.prototype.fb,K.prototype.kb,"R5SET1",1145], +1145],M[65440]=[null,null,K.prototype.ad,K.prototype.Nd,"UISAR",1145],M[65456]=[null,null,K.prototype.Zc,K.prototype.Ld,"UDSAR",1145],M[65472]=[null,null,K.prototype.fb,K.prototype.kb,"R0SET0"],M[65473]=[null,null,K.prototype.fb,K.prototype.kb,"R1SET0"],M[65474]=[null,null,K.prototype.fb,K.prototype.kb,"R2SET0"],M[65475]=[null,null,K.prototype.fb,K.prototype.kb,"R3SET0"],M[65476]=[null,null,K.prototype.fb,K.prototype.kb,"R4SET0"],M[65477]=[null,null,K.prototype.fb,K.prototype.kb,"R5SET0"],M[65478]= +[null,null,K.prototype.Nc,K.prototype.zd,"R6KERNEL"],M[65479]=[null,null,K.prototype.Qc,K.prototype.Cd,"R7KERNEL"],M[65480]=[null,null,K.prototype.gb,K.prototype.lb,"R0SET1",1145],M[65481]=[null,null,K.prototype.gb,K.prototype.lb,"R1SET1",1145],M[65482]=[null,null,K.prototype.gb,K.prototype.lb,"R2SET1",1145],M[65483]=[null,null,K.prototype.gb,K.prototype.lb,"R3SET1",1145],M[65484]=[null,null,K.prototype.gb,K.prototype.lb,"R4SET1",1145],M[65485]=[null,null,K.prototype.gb,K.prototype.lb,"R5SET1",1145], M[65486]=[null,null,K.prototype.Oc,K.prototype.Ad,"R6SUPER",1145],M[65487]=[null,null,K.prototype.Pc,K.prototype.Bd,"R6USER",1145],M[65504]=[null,null,K.prototype.yc,K.prototype.md,"CTRL",1170],M[65520]=[null,null,K.prototype.dc,K.prototype.jc,"LSIZE",1170],M[65522]=[null,null,K.prototype.dc,K.prototype.jc,"HSIZE",1170],M[65524]=[null,null,K.prototype.Yc,K.prototype.Kd,"SYSID",1170],M[65526]=[null,null,K.prototype.xc,K.prototype.ld,"CPUERR",1170],M[65528]=[null,null,K.prototype.Ec,K.prototype.sd, "MB",1170],M[65530]=[null,null,K.prototype.Jc,K.prototype.vd,"PIR"],M[65532]=[null,null,K.prototype.Xc,K.prototype.Jd,"SL"],M[65534]=[null,null,K.prototype.Mc,K.prototype.yd,"PSW"],M);L[62594]=L[62592];L[62596]=L[62592];L[62598]=L[62592];L[62600]=L[62592];L[62602]=L[62592];L[62604]=L[62592];L[62606]=L[62592];L[62610]=L[62608];L[62612]=L[62608];L[62614]=L[62608];L[62616]=L[62608];L[62618]=L[62608];L[62620]=L[62608];L[62622]=L[62608];L[62626]=L[62624];L[62628]=L[62624];L[62630]=L[62624];L[62632]=L[62624]; L[62634]=L[62624];L[62636]=L[62624];L[62638]=L[62624];L[62642]=L[62640];L[62644]=L[62640];L[62646]=L[62640];L[62648]=L[62640];L[62650]=L[62640];L[62652]=L[62640];L[62654]=L[62640];L[62658]=L[62656];L[62660]=L[62656];L[62662]=L[62656];L[62664]=L[62656];L[62666]=L[62656];L[62668]=L[62656];L[62670]=L[62656];L[62674]=L[62672];L[62676]=L[62672];L[62678]=L[62672];L[62680]=L[62672];L[62682]=L[62672];L[62684]=L[62672];L[62686]=L[62672];L[62690]=L[62688];L[62692]=L[62688];L[62694]=L[62688];L[62696]=L[62688]; L[62698]=L[62688];L[62700]=L[62688];L[62702]=L[62688];L[62706]=L[62704];L[62708]=L[62704];L[62710]=L[62704];L[62712]=L[62704];L[62714]=L[62704];L[62716]=L[62704];L[62718]=L[62704];L[65410]=L[65408];L[65412]=L[65408];L[65414]=L[65408];L[65416]=L[65408];L[65418]=L[65408];L[65420]=L[65408];L[65422]=L[65408];L[65426]=L[65424];L[65428]=L[65424];L[65430]=L[65424];L[65432]=L[65424];L[65434]=L[65424];L[65436]=L[65424];L[65438]=L[65424];L[65442]=L[65440];L[65444]=L[65440];L[65446]=L[65440];L[65448]=L[65440]; L[65450]=L[65440];L[65452]=L[65440];L[65454]=L[65440];L[65458]=L[65456];L[65460]=L[65456];L[65462]=L[65456];L[65464]=L[65456];L[65466]=L[65456];L[65468]=L[65456];L[65470]=L[65456];L[65506]=L[65504];L[65508]=L[65504];L[65510]=L[65504];L[65512]=L[65504];L[65514]=L[65504];L[65516]=L[65504];L[65518]=L[65504];Ta(function(){for(var a=B(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.C,0,d>>2),Dc(this,zc?Ec:Fc);else{this.b=Array(d>>2);for(a=0;a>1),this.b=new Int32Array(this.A,0,d>>2),Dc(this,zc?Ec:Fc);else{this.b=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},la:function(a,b){a&1&&oc(this.w,b);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},wa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]= -this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Ia=!0},T:function(a,b){if(this.i&&null!=this.A){var c=this.i;Kc(c,this.A+a,1,c.M)&&c.da(!0)}return this.Mb(a,b)},ba:function(a,b){if(this.i&&null!=this.A){var c=this.i;Kc(c,this.A+a,2,c.M)&&c.da(!0)}return this.Nb(a,b)},oa:function(a,b,c){if(this.i&&null!=this.A){var d=this.i;Kc(d,this.A+a, -1,d.D)&&d.da(!0)}this.f?this.J(a,b,c):this.Sb(a,b,c)},ya:function(a,b,c){if(this.i&&null!=this.A){var d=this.i;Kc(d,this.A+a,2,d.D)&&d.da(!0)}this.f?this.J(a,b,c):this.Tb(a,b,c)},R:function(a){return this.D[a]},U:function(a,b){a=this.D[a];this.i&&G(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},aa:function(a,b){a&1&&oc(this.w,b);return this.G.getUint16(a,!0)},fa:function(a,b){a&1&&oc(this.w,b);a=this.I[a>>1];this.i&&G(this.i,128)&&E(this.i,"Memory.readWord("+ -J(this.i,b)+"): "+J(this.i,a),!0);return a},na:function(a,b){this.D[a]=b;this.Ia=!0},ra:function(a,b,c){this.D[a]=b;this.Ia=!0;this.i&&G(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},xa:function(a,b,c){a&1&&oc(this.w,c);this.G.setUint16(a,b,!0);this.Ia=!0},Ua:function(a,b,c){a&1&&oc(this.w,c);this.I[a>>1]=b;this.Ia=!0;this.i&&G(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0)}}; -function Sb(a,b,c){a.i=b;a.g=a.B=0;c&&((a.g=c.g)&&Jc(a,Ic,!1),(a.B=c.B)&&Hc(a,Ic,!1))}function Lc(a,b){b?--a.B||(a.Hb=a.f?a.J:a.Sb,a.wb=a.f?a.H:a.Tb):--a.g||(a.Eb=a.Mb,a.ta=a.Nb)}function Hc(a,b,c){c&&a.B||(a.Hb=!a.f&&b[1]||a.J,a.wb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Sb=b[1]||a.J,a.Tb=b[3]||a.H}function Jc(a,b,c){c&&a.g||(a.Eb=b[0]||a.K,a.ta=b[2]||a.M);if(c||void 0===c)a.Mb=b[0]||a.K,a.Nb=b[2]||a.M}function Dc(a,b){b||(b=Mc);Jc(a,b,void 0);Hc(a,b,void 0)} -var Mc=[],Gc=[I.prototype.V,I.prototype.wa,I.prototype.la,I.prototype.Va],Ic=[I.prototype.T,I.prototype.oa,I.prototype.ba,I.prototype.ya];if(sb)var Fc=[I.prototype.R,I.prototype.na,I.prototype.aa,I.prototype.xa],Ec=[I.prototype.U,I.prototype.ra,I.prototype.fa,I.prototype.Ua]; -function Nc(a,b){r.call(this,"CPU",a,Nc,1);var c=a.multiplier||1;this.Ga=a.cycles||b;this.La=c;this.Xa=Math.round(this.Ga/1E4)/100;this.Sa=this.Xa*this.La;this.v.ca=!1;this.v.Qb=!1;this.v.lb=a.autoStart;this.v.Za=!1;this.qb=this.la=0;this.rb=a.csStart;this.ab=a.csInterval;this.bb=a.csStop;this.K=[];this.bc=this.fd.bind(this);H(this)}u(Nc);var Oc=["power","reset"];h=Nc.prototype; -h.Ca=function(a,b,c,d){this.B=a;this.w=b;this.i=d;for(b=0;b=a.la&&(a.la+=a.ab,c=!0);0<=a.bb&&a.bb<=Uc(a)&&(a.ab=a.bb=-1,Rc(a),a.da(),c=!0);c&&a.j(Uc(a)+" cycles: checksum="+k(a.qb))}} -h.qa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.J[b]=c,!0;case "run":return this.J[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.v.ia)a=!0;else{var b=null,c,l=kb(a.id);for(c=0;ca.V/a.Sa?b=1:d=!0;a.La=b;b=a.Xa*a.La;if(a.Sa!=b){a.Sa=b;b=a.Sa.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.B&&a.B.ub()}Wc(a,a.T);a.T=0;a.R=za();a.aa=0;Xc(a);return d}function pc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function rc(a,b,c){0<=b&&ba.K[b][0]&&(c=a.Ga*a.La/1E3*c|0,a.K[b][0]=c+Yc(a))} +I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(sb)for(a=Array(this.size>>2),b=0;b>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ma:function(a,b){a&1&&oc(this.w,b);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},ra:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]= +this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Ja=!0},T:function(a,b){if(this.i&&null!=this.B){var c=this.i;Kc(c,this.B+a,1,c.M)&&c.da(!0)}return this.Mb(a,b)},ba:function(a,b){if(this.i&&null!=this.B){var c=this.i;Kc(c,this.B+a,2,c.M)&&c.da(!0)}return this.Nb(a,b)},pa:function(a,b,c){if(this.i&&null!=this.B){var d=this.i;Kc(d,this.B+a, +1,d.D)&&d.da(!0)}this.f?this.C(a,b,c):this.Sb(a,b,c)},xa:function(a,b,c){if(this.i&&null!=this.B){var d=this.i;Kc(d,this.B+a,2,d.D)&&d.da(!0)}this.f?this.C(a,b,c):this.Tb(a,b,c)},R:function(a){return this.D[a]},U:function(a,b){a=this.D[a];this.i&&D(this.i,128)&&C(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},aa:function(a,b){a&1&&oc(this.w,b);return this.G.getUint16(a,!0)},fa:function(a,b){a&1&&oc(this.w,b);a=this.J[a>>1];this.i&&D(this.i,128)&&C(this.i,"Memory.readWord("+ +J(this.i,b)+"): "+J(this.i,a),!0);return a},oa:function(a,b){this.D[a]=b;this.Ja=!0},Ra:function(a,b,c){this.D[a]=b;this.Ja=!0;this.i&&D(this.i,128)&&C(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},wa:function(a,b,c){a&1&&oc(this.w,c);this.G.setUint16(a,b,!0);this.Ja=!0},ya:function(a,b,c){a&1&&oc(this.w,c);this.J[a>>1]=b;this.Ja=!0;this.i&&D(this.i,128)&&C(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0)}}; +function Sb(a,b,c){a.i=b;a.g=a.I=0;c&&((a.g=c.g)&&Jc(a,Ic,!1),(a.I=c.I)&&Hc(a,Ic,!1))}function Lc(a,b){b?--a.I||(a.Hb=a.f?a.C:a.Sb,a.wb=a.f?a.H:a.Tb):--a.g||(a.Eb=a.Mb,a.ta=a.Nb)}function Hc(a,b,c){c&&a.I||(a.Hb=!a.f&&b[1]||a.C,a.wb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Sb=b[1]||a.C,a.Tb=b[3]||a.H}function Jc(a,b,c){c&&a.g||(a.Eb=b[0]||a.K,a.ta=b[2]||a.M);if(c||void 0===c)a.Mb=b[0]||a.K,a.Nb=b[2]||a.M}function Dc(a,b){b||(b=Mc);Jc(a,b,void 0);Hc(a,b,void 0)} +var Mc=[],Gc=[I.prototype.V,I.prototype.ra,I.prototype.ma,I.prototype.Wa],Ic=[I.prototype.T,I.prototype.pa,I.prototype.ba,I.prototype.xa];if(sb)var Fc=[I.prototype.R,I.prototype.oa,I.prototype.aa,I.prototype.wa],Ec=[I.prototype.U,I.prototype.Ra,I.prototype.fa,I.prototype.ya]; +function Nc(a,b){r.call(this,"CPU",a,Nc,1);var c=a.multiplier||1;this.Ga=a.cycles||b;this.Ma=c;this.Ya=Math.round(this.Ga/1E4)/100;this.Ua=this.Ya*this.Ma;this.v.ca=!1;this.v.Qb=!1;this.v.mb=a.autoStart;this.v.$a=!1;this.qb=this.ma=0;this.rb=a.csStart;this.bb=a.csInterval;this.cb=a.csStop;this.K=[];this.bc=this.fd.bind(this);H(this)}u(Nc);var Oc=["power","reset"];h=Nc.prototype; +h.Ca=function(a,b,c,d){this.C=a;this.w=b;this.i=d;for(b=0;b=a.ma&&(a.ma+=a.bb,c=!0);0<=a.cb&&a.cb<=Uc(a)&&(a.bb=a.cb=-1,Rc(a),a.da(),c=!0);c&&a.j(Uc(a)+" cycles: checksum="+l(a.qb))}} +h.qa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.I[b]=c,!0;case "run":return this.I[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.v.ha)a=!0;else{var b=null,c,k=kb(a.id);for(c=0;ca.V/a.Ua?b=1:d=!0;a.Ma=b;b=a.Ya*a.Ma;if(a.Ua!=b){a.Ua=b;b=a.Ua.toFixed(2)+"Mhz";var e=a.I.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.ub()}Wc(a,a.T);a.T=0;a.R=za();a.aa=0;Xc(a);return d}function pc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function rc(a,b,c){0<=b&&ba.K[b][0]&&(c=a.Ga*a.Ma/1E3*c|0,a.K[b][0]=c+Yc(a))} function Zc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function $c(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Yc(a,b){var c=a.ba-=a.b;a.b=0;b&&(a.ba=0);return c} -h.fd=function(){if(this.v.ca){this.nb>=this.Ga&&Xc(this,!0);this.ra=0;this.Fa=za();if(this.aa){var a=this.Fa-this.aa;a>this.Ab&&(this.R+=a,this.R>this.Fa&&(this.R=this.Fa))}try{do{var b=Zc(this,this.v.Za?1:this.Pa);try{this.ib(b)}catch(e){if("number"!=typeof e)throw e;}b=Yc(this,!0);this.ra+=b;this.T+=b;Tc(this,b);$c(this,b);this.na-=b;if(0>=this.na){this.na+=this.Pa;15<=++this.Cb&&(this.B&&this.B.$(),this.Cb=0);break}}while(this.v.ca)}catch(e){this.da();this.B&&this.B.stop(za(),Uc(this));rb(this, -e.stack||e.message);return}if(this.v.ca){a=setTimeout;b=this.bc;this.aa=za();var c=this.Ab;this.ra&&(c=Math.round(c*this.ra/this.Pa));var c=c-(this.aa-this.Fa),d=this.aa-this.R;d&&(this.V=Math.round(this.T/(10*d))/100,864E5<=d&&(this.fa=0,Vc(this)));if(0>c||this.Vc&&(this.R-=c),c=0;this.nb+=this.ra;this.aa+=c;a(b,c)}}}; -h.hb=function(a){if(qb(this))return!1;if(this.v.ca)return this.j(this.toString()+" busy"),!1;Vc(this);this.v.ca=!0;this.v.Qb=!0;var b=this.J.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.ub(!0),this.B.start(this.R,Uc(this)));setTimeout(this.bc,0);return!0};h.ib=function(){return 0};h.da=function(a){if(this.v.ca){Yc(this);Wc(this,this.T);this.T=0;this.v.ca=!1;var b=this.J.run;b&&(b.textContent="Run");this.B&&this.B.stop(za(),Uc(this))}this.v.complete=a}; -function ad(a){this.$a=+a.model||1170;this.xb=a.addrReset||0;Nc.call(this,a,6666667);this.decode=1120==this.$a?ud.bind(this):vd.bind(this);wd(this);this.C=0;this.U=null;this.v.complete=this.v.oc=!1}u(ad,Nc);h=ad.prototype;h.reset=function(){this.status("model "+this.$a);this.v.ca&&this.da();wd(this);Qc(this);this.v.error=!1;this.parent.reset.call(this)}; -function wd(a){a.N=65536;a.O=32768;a.X=65535;a.S=32768;a.L=15;a.u=[0,0,0,0,0,0,0,a.xb];a.Ea=[0,0,0,0,0,0];a.va=[0,0,0,0];a.D=0;a.xa=0;a.sc=[4,2,0,1];a.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.sa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.uc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.gc=[0,0,0,0,0,0,0,0];a.fc=0;a.F=0;a.H=a.I=0;a.g=a.f=a.Wa=0;a.oa=-1;xd(a)}function xd(a){a.Oa=255;a.Z=0;a.Pb=0;a.G=0;a.Ma=0;a.tb=0;a.Na=0;a.Ka=0;a.wa=0;a.Ya=262143;a.ya=253952;a.F|=2;a.w&&tc(a)}function tc(a){a.Ka?(a.M=65536,a.Y=a.rc,a.ta=a.cd,a.wb=a.Pd,Vb(a.w,a.Na&16?22:18)):(a.M=0,a.Y=a.qc,a.ta=a.ec,a.wb=a.kc,Vb(a.w,16))}h.Zb=function(){return 0}; -h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.fa,this.La]);a.set(2,cc(this.w));return a.data()};h.restore=function(a){var b=a[1];this.fa=b[1];Vc(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c=this.Ga&&Xc(this,!0);this.ra=0;this.Fa=za();if(this.aa){var a=this.Fa-this.aa;a>this.Ab&&(this.R+=a,this.R>this.Fa&&(this.R=this.Fa))}try{do{var b=Zc(this,this.v.$a?1:this.Qa);try{this.jb(b)}catch(e){if("number"!=typeof e)throw e;}b=Yc(this,!0);this.ra+=b;this.T+=b;Tc(this,b);$c(this,b);this.oa-=b;if(0>=this.oa){this.oa+=this.Qa;15<=++this.Cb&&(this.C&&this.C.$(),this.Cb=0);break}}while(this.v.ca)}catch(e){this.da();this.C&&this.C.stop(za(),Uc(this));rb(this, +e.stack||e.message);return}if(this.v.ca){a=setTimeout;b=this.bc;this.aa=za();var c=this.Ab;this.ra&&(c=Math.round(c*this.ra/this.Qa));var c=c-(this.aa-this.Fa),d=this.aa-this.R;d&&(this.V=Math.round(this.T/(10*d))/100,864E5<=d&&(this.fa=0,Vc(this)));if(0>c||this.Vc&&(this.R-=c),c=0;this.nb+=this.ra;this.aa+=c;a(b,c)}}}; +h.ib=function(a){if(qb(this))return!1;if(this.v.ca)return this.j(this.toString()+" busy"),!1;Vc(this);this.v.ca=!0;this.v.Qb=!0;var b=this.I.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.ub(!0),this.C.start(this.R,Uc(this)));setTimeout(this.bc,0);return!0};h.jb=function(){return 0};h.da=function(a){if(this.v.ca){Yc(this);Wc(this,this.T);this.T=0;this.v.ca=!1;var b=this.I.run;b&&(b.textContent="Run");this.C&&this.C.stop(za(),Uc(this))}this.v.complete=a}; +function ad(a){this.ab=+a.model||1170;this.xb=a.addrReset||0;Nc.call(this,a,6666667);this.decode=1120==this.ab?bd.bind(this):cd.bind(this);dd(this);this.A=0;this.U=null;this.v.complete=this.v.oc=!1}u(ad,Nc);h=ad.prototype;h.reset=function(){this.status("model "+this.ab);this.v.ca&&this.da();dd(this);Qc(this);this.v.error=!1;this.parent.reset.call(this)}; +function dd(a){a.N=65536;a.O=32768;a.X=65535;a.S=32768;a.L=15;a.u=[0,0,0,0,0,0,0,a.xb];a.Ea=[0,0,0,0,0,0];a.va=[0,0,0,0];a.D=0;a.xa=0;a.sc=[4,2,0,1];a.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.sa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.uc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.gc=[0,0,0,0,0,0,0,0];a.fc=0;a.F=0;a.H=a.J=0;a.g=a.f=a.Xa=0;a.pa=-1;ed(a)}function ed(a){a.Pa=255;a.Z=0;a.Pb=0;a.G=0;a.Na=0;a.tb=0;a.Oa=0;a.La=0;a.wa=0;a.Za=262143;a.ya=253952;a.F|=2;a.w&&tc(a)}function tc(a){a.La?(a.M=65536,a.Y=a.rc,a.ta=a.cd,a.wb=a.Pd,Vb(a.w,a.Oa&16?22:18)):(a.M=0,a.Y=a.qc,a.ta=a.ec,a.wb=a.kc,Vb(a.w,16))}h.Zb=function(){return 0}; +h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.fa,this.Ma]);a.set(2,cc(this.w));return a.data()};h.restore=function(a){var b=a[1];this.fa=b[1];Vc(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.L>>14&3;a.D!=c&&(a.va[c]=a.u[6],a.u[6]=a.va[a.D]);a.L=b;a.F|=2}function P(a,b){a.F&128||(a.S=a.X=b,a.O=0)}function Cd(a,b,c){a.F&128||(a.S=a.X=a.N=b,a.O=c||0)}function Dd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^b)&(d^b))}function Ed(a,b){a.F&128||(a.S=a.X=a.N=b,a.O=a.S^a.N>>1)}function Fd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^d)&(d^b))} -h.ea=function(a,b){if(!this.C){var c=!1;0>this.oa?this.oa=Lb(this):this.D||(a=4,c=!0);this.G&57344||(this.Ma=63222,this.tb=a);this.D=0;var d=this.ta(a|this.M),e=this.ta(a+2&65535|this.M);vc(this,e&-12289|this.oa>>2&12288);c&&(this.Z|=4,this.u[6]=4);Gd(this,this.oa);Gd(this,this.u[7]);O(this,d);this.F&=-113;this.oa=-1;if(26!=b)throw a;}};function Hd(a){var b=Id(a),c=Id(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);O(a,b);vc(a,c);a.F&=-17} -function Jd(a,b,c){var d,e,f,g=0;d=b>>13;a.Na&a.sc[a.D]||(d&=7);e=a.P[a.D][d];f=(a.sa[a.D][d]<<6)+(b&8191)&a.Ya;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.Na&32&&(f=a.uc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.ya&&4186112>f&&(a.Z|=32,a.ea(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4? -192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.P[a.D][d]=e;if(4194170!==f||a.D)a.wa=a.D,a.xa=d;g&&(g&57344&&(0<=a.oa&&(g|=128),a.G&57344||(a.G=a.G|g|a.wa<<5|a.xa<<1),a.ea(168,16)),a.G&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.ta(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.ta(e)|g; -a.b-=8;break;case 6:return e=Bd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=Bd(a),e=e+a.u[c]&65535,e=a.ta(e|a.M)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.Ma=a.Ma<<8|f<<3&248|c);6==c&&!a.D&&d&4&&0>=f&&(a.u[6]<=a.Oa||65534<=a.u[6])&&(a.u[6]<=a.Oa-32?(a.Z|=4,a.u[6]=4,a.ea(4,24)):(a.Z|=8,a.F|=64));return e}h.Bb=function(a){if(!this.Ka)return this.w.Bb(a);this.C++;a=Kd(this,Jd(this,a,3));this.C--;return a}; -h.pb=function(a){if(!this.Ka)return this.w.pb(a);this.C++;a=this.ec(Jd(this,a,2));this.C--;return a};h.gb=function(a,b){this.Ka?(this.C++,Ld(this,Jd(this,a,5),b),this.C--):this.w.gb(a,b)};h.Gb=function(a,b){this.Ka?(this.C++,this.kc(Jd(this,a,4),b),this.C--):this.w.Gb(a,b)};h.qc=function(a,b,c){return Md(this,a,b,c)};h.rc=function(a,b,c){return Jd(this,Md(this,a,b,c),c)};h.ec=function(a){return this.w.ma(a)};h.cd=function(a){return this.w.ma(Jd(this,a,2))};h.kc=function(a,b){this.w.Ta(a,b&65535)}; -h.Pd=function(a,b){this.w.Ta(Jd(this,a,4),b)};function Nd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Md(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.D=a.L>>12&3,c=a.ta(d|c&a.M),a.D=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.va[a.L>>12&3];return c}function Od(a,b,c,d){a.G&57344||(a.Ma=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Md(a,b,e,4),c&65536||(e&=65535),a.D=a.L>>12&3,e=Jd(a,e|c&65536,4),a.D=a.L>>14&3,a.w.Ta(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.va[a.L>>12&3]=d} -function Pd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?Kd(a,a.Y(b,c,3)):a.u[c]&255}function Qd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?a.w.ma(a.Y(b,c,2)):a.u[c]}function Rd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Md(a,b,c,8)}function Sd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Kd(a,a.Y(b,c,3)):a.u[c]&255}function Td(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.ma(a.Y(b,c,2)):a.u[c]} -function Q(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Wa=a.Y(b,e,7),Ld(a,e,d.call(a,c,Kd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Y(b,e,6),a.w.Ta(e,d.call(a,c,a.w.ma(e)))):a.u[e]=d.call(a,c,a.u[e])}function Ud(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Ld(a,a.Y(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Vd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.Ta(a.Y(b,d,4),c):a.u[d]=c&65535;return c} +h.ea=function(a,b){if(!this.A){var c=!1;0>this.pa?this.pa=Lb(this):this.D||(a=4,c=!0);this.G&57344||(this.Na=63222,this.tb=a);this.D=0;var d=this.ta(a|this.M),e=this.ta(a+2&65535|this.M);vc(this,e&-12289|this.pa>>2&12288);c&&(this.Z|=4,this.u[6]=4);Gd(this,this.pa);Gd(this,this.u[7]);O(this,d);this.F&=-113;this.pa=-1;if(26!=b)throw a;}};function Hd(a){var b=Id(a),c=Id(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);O(a,b);vc(a,c);a.F&=-17} +function Jd(a,b,c){var d,e,f,g=0;d=b>>13;a.Oa&a.sc[a.D]||(d&=7);e=a.P[a.D][d];f=(a.sa[a.D][d]<<6)+(b&8191)&a.Za;if(ff){if(3932160<=f){f&=262143;var k=f>>13&31;31>k?a.Oa&32&&(f=a.uc[k]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.ya&&4186112>f&&(a.Z|=32,a.ea(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4? +192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.P[a.D][d]=e;if(4194170!==f||a.D)a.wa=a.D,a.xa=d;g&&(g&57344&&(0<=a.pa&&(g|=128),a.G&57344||(a.G=a.G|g|a.wa<<5|a.xa<<1),a.ea(168,16)),a.G&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.ta(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.ta(e)|g; +a.b-=8;break;case 6:return e=Bd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=Bd(a),e=e+a.u[c]&65535,e=a.ta(e|a.M)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.Na=a.Na<<8|f<<3&248|c);6==c&&!a.D&&d&4&&0>=f&&(a.u[6]<=a.Pa||65534<=a.u[6])&&(a.u[6]<=a.Pa-32?(a.Z|=4,a.u[6]=4,a.ea(4,24)):(a.Z|=8,a.F|=64));return e}h.Bb=function(a){if(!this.La)return this.w.Bb(a);this.A++;a=Kd(this,Jd(this,a,3));this.A--;return a}; +h.pb=function(a){if(!this.La)return this.w.pb(a);this.A++;a=this.ec(Jd(this,a,2));this.A--;return a};h.hb=function(a,b){this.La?(this.A++,Ld(this,Jd(this,a,5),b),this.A--):this.w.hb(a,b)};h.Gb=function(a,b){this.La?(this.A++,this.kc(Jd(this,a,4),b),this.A--):this.w.Gb(a,b)};h.qc=function(a,b,c){return Md(this,a,b,c)};h.rc=function(a,b,c){return Jd(this,Md(this,a,b,c),c)};h.ec=function(a){return this.w.na(a)};h.cd=function(a){return this.w.na(Jd(this,a,2))};h.kc=function(a,b){this.w.Va(a,b&65535)}; +h.Pd=function(a,b){this.w.Va(Jd(this,a,4),b)};function Nd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Md(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.D=a.L>>12&3,c=a.ta(d|c&a.M),a.D=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.va[a.L>>12&3];return c}function Od(a,b,c,d){a.G&57344||(a.Na=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Md(a,b,e,4),c&65536||(e&=65535),a.D=a.L>>12&3,e=Jd(a,e|c&65536,4),a.D=a.L>>14&3,a.w.Va(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.va[a.L>>12&3]=d} +function Pd(a,b){b>>=6;var c=a.J=b&7;return(b=a.H=(b&56)>>3)?Kd(a,a.Y(b,c,3)):a.u[c]&255}function Qd(a,b){b>>=6;var c=a.J=b&7;return(b=a.H=(b&56)>>3)?a.w.na(a.Y(b,c,2)):a.u[c]}function Rd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Md(a,b,c,8)}function Sd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Kd(a,a.Y(b,c,3)):a.u[c]&255}function Td(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.na(a.Y(b,c,2)):a.u[c]} +function Q(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Xa=a.Y(b,e,7),Ld(a,e,d.call(a,c,Kd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Y(b,e,6),a.w.Va(e,d.call(a,c,a.w.na(e)))):a.u[e]=d.call(a,c,a.u[e])}function Ud(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Ld(a,a.Y(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Vd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.Va(a.Y(b,d,4),c):a.u[d]=c&65535;return c} function S(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -h.ib=function(a){this.v.complete=!0;var b=this.v.oc=this.i&&Wd(this.i),c=a?this.v.Qb?0:1:-1;this.v.Qb=!1;this.ba=this.b=a;do{if(b){if(Xd(this.i,this.u[7],c)){this.da();break}c=1}if(this.F&&(this.F&112&&(this.F&32?this.ea(168,28):this.F&64?this.ea(4,30):this.F&16&&this.ea(12,32),this.F&=-113),this.F&7))if(this.F&2){this.F&=-3;var d=160,e=(this.Pb&224)>>5;if(a=this.U&&this.U.cb>e?this.U:null)d=a.jd,e=a.cb;e>(this.L&224)>>5?(this.F&4&&(this.u[7]=this.u[7]+2&65535,this.F&=-5),this.ea(d,26),e=!0):e=!1; -if(e&&a)if(e=this.U,e==a)this.U=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.F&1&&this.F++;this.G&57344||(this.Ma=0,this.tb=this.u[7]);this.F=this.F&7|this.L&16;this.decode(Bd(this))}while(0>5;if(a=this.U&&this.U.eb>e?this.U:null)d=a.jd,e=a.eb;e>(this.L&224)>>5?(this.F&4&&(this.u[7]=this.u[7]+2&65535,this.F&=-5),this.ea(d,26),e=!0):e=!1; +if(e&&a)if(e=this.U,e==a)this.U=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.F&1&&this.F++;this.G&57344||(this.Na=0,this.tb=this.u[7]);this.F=this.F&7|this.L&16;this.decode(Bd(this))}while(0>1|b<<16;Ed(this,a);return a&65535}function ce(a,b){a=b&2048|b>>1|b<<8;Ed(this,a<<8);return a&255}function de(a,b){a=b&~a;P(this,a);return a}function ee(a,b){a=b&~a;P(this,a<<8);return a}function fe(a,b){a|=b;P(this,a);return a}function ge(a,b){a|=b;P(this,a<<8);return a} function he(a,b){a=~b|65536;Cd(this,a);return a&65535}function ie(a,b){a=~b|256;Cd(this,a<<8);return a&255}function je(a,b){a=b-a;this.F&128||(this.S=this.X=a,this.O=b&(b^a));return a&65535}function ke(a,b){a=b-a;var c=a<<8;b<<=8;this.F&128||(this.S=this.X=c,this.O=b&(b^c));return a&255}function le(a,b){a=b+a;this.F&128||(this.S=this.X=a,this.O=a&(b^a));return a&65535}function me(a,b){a=b+a;var c=a<<8;this.F&128||(this.S=this.X=c,this.O=c&(b<<8^c));return a&255} function ne(a,b){a=-b;Cd(this,a,a&b&32768);return a&65535}function oe(a,b){a=-b;Cd(this,a<<8,(a&b&128)<<8);return a&255}function pe(a,b){a=b<<1|this.N>>16&1;Ed(this,a);return a&65535}function qe(a,b){a=b<<1|this.N>>16&1;Ed(this,a<<8);return a&255}function re(a,b){a=(this.N&65536|b)>>1|b<<16;Ed(this,a);return a&65535}function se(a,b){a=((this.N&65536)>>8|b)>>1|b<<8;Ed(this,a<<8);return a&255}function te(a,b){var c=b-a;Fd(this,c,a,b);return c&65535} -function ue(a,b){var c=b-a;Fd(this,c<<8,a<<8,b<<8);return c&255}function ve(a,b){this.F&128||(this.S=this.X=b&65280,this.O=this.N=0);return(b<<8|b>>8)&65535}function we(a,b){a^=b;P(this,a);return a&65535}function xe(a){R(this,a,Qd(this,a),Yd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} +function ue(a,b){var c=b-a;Fd(this,c<<8,a<<8,b<<8);return c&255}function ve(a,b){this.F&128||(this.S=this.X=b&65280,this.O=this.N=0);return(b<<8|b>>8)&65535}function we(a,b){a^=b;P(this,a);return a&65535}function xe(a){R(this,a,Qd(this,a),Yd);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} function ye(a){var b=Td(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.N=this.O=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.O=32768)}this.u[a]=c&65535;this.S=this.X=c;this.b-=(this.g?6:7)+b} -function ze(a){var b=Td(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&=63;if(b&32){b=64-b;32>b-1;this.N=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.S=d>>16;this.X=d>>16|d;this.b-=(this.g?6:7)+b}function Ae(a){S(this,a,!yd(this))}function Be(a){S(this,a,yd(this))} -function Ce(a){R(this,a,Qd(this,a),de);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function De(a){Q(this,a,Pd(this,a),ee);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Ee(a){R(this,a,Qd(this,a),fe);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Fe(a){Q(this,a,Pd(this,a),ge);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} -function Ge(a){P(this,Qd(this,a)&Td(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function He(a){P(this,(Pd(this,a)&Sd(this,a))<<8);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Ie(a){S(this,a,Ad(this))}function Je(a){S(this,a,!this.Da()==!zd(this))}function Ke(a){S(this,a,!Ad(this)&&!this.Da()==!zd(this))}function Le(a){S(this,a,!yd(this)&&!Ad(this))}function Me(a){S(this,a,Ad(this)||!this.Da()!=!zd(this))} -function Ne(a){S(this,a,yd(this)||Ad(this))}function Oe(a){S(this,a,!this.Da()!=!zd(this))}function Pe(a){S(this,a,this.Da())}function Qe(a){S(this,a,!Ad(this))}function Re(a){S(this,a,!this.Da())}function Se(){this.ea(12,1);this.b-=5}function Te(a){S(this,a,!0)}function Ue(a){S(this,a,!zd(this))}function Ve(a){S(this,a,zd(this))}function T(a){a&1&&(this.N=0);a&2&&(this.O=0);a&4&&(this.X=1);a&8&&(this.S=0);this.b-=5} -function We(a){var b=Qd(this,a);a=Td(this,a);Fd(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Xe(a){var b=Pd(this,a)<<8;a=Sd(this,a)<<8;Fd(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)} +function ze(a){var b=Td(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&=63;if(b&32){b=64-b;32>b-1;this.N=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.S=d>>16;this.X=d>>16|d;this.b-=(this.g?6:7)+b}function Ae(a){S(this,a,!fd(this))}function Be(a){S(this,a,fd(this))} +function Ce(a){R(this,a,Qd(this,a),de);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function De(a){Q(this,a,Pd(this,a),ee);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Ee(a){R(this,a,Qd(this,a),fe);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Fe(a){Q(this,a,Pd(this,a),ge);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} +function Ge(a){P(this,Qd(this,a)&Td(this,a));this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function He(a){P(this,(Pd(this,a)&Sd(this,a))<<8);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Ie(a){S(this,a,Ad(this))}function Je(a){S(this,a,!this.Da()==!zd(this))}function Ke(a){S(this,a,!Ad(this)&&!this.Da()==!zd(this))}function Le(a){S(this,a,!fd(this)&&!Ad(this))}function Me(a){S(this,a,Ad(this)||!this.Da()!=!zd(this))} +function Ne(a){S(this,a,fd(this)||Ad(this))}function Oe(a){S(this,a,!this.Da()!=!zd(this))}function Pe(a){S(this,a,this.Da())}function Qe(a){S(this,a,!Ad(this))}function Re(a){S(this,a,!this.Da())}function Se(){this.ea(12,1);this.b-=5}function Te(a){S(this,a,!0)}function Ue(a){S(this,a,!zd(this))}function Ve(a){S(this,a,zd(this))}function T(a){a&1&&(this.N=0);a&2&&(this.O=0);a&4&&(this.X=1);a&8&&(this.S=0);this.b-=5} +function We(a){var b=Qd(this,a);a=Td(this,a);Fd(this,b-a,a,b);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Xe(a){var b=Pd(this,a)<<8;a=Sd(this,a)<<8;Fd(this,b-a,a,b);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)} function Ye(a){var b=Td(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.X=d>>16|d,this.S=d>>16):(this.O=32768,this.X=d>>15|d,this.S=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.X=this.S=0,this.O=32768,this.N=65536,this.b-=7}function Ze(){this.ea(24,2);this.b-=25}function $e(){this.L&49152?(this.Z|=128,this.ea(4,3)):this.da();this.b-=7} function af(){this.ea(16,4);this.b-=25}var bf=[0,7,7,10,7,11,9,13];function cf(a){var b=this.b;O(this,Rd(this,a));this.b=b-bf[this.g]}var df=[0,14,14,17,14,18,16,20];function ef(a){var b=this.b,c=Rd(this,a);a=a>>6&7;Gd(this,this.u[a]);this.u[a]=this.u[7];O(this,c);this.b=b-df[this.g]}var ff=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function gf(a){var b=Qd(this,a),c=this.b;P(this,Vd(this,a,b));this.b=c-ff[(this.H?8:0)+this.g]+(7!=this.f||this.g?0:2)} -function hf(a){var b=Pd(this,a);P(this,Ud(this,a,b,1)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}var jf=[7,13,13,17,14,18,17,21];function kf(a){var b=Td(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.F&128||(this.S=b>>16,this.X=this.S|b,this.O=0,this.N=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function qf(a){R(this,a,Qd(this,a),te);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} -function rf(a){R(this,a,0,ve);this.b-=this.g?9:3+(7==this.f?2:0)}function sf(){this.ea(28,5);this.b-=5}function tf(){this.F&4||this.B.$();this.F|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3}function uf(a){R(this,a,Qd(this,a),we);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,E(b,"undefined opcode "+J(b,a),!0,!0),b=$b(b);b||this.ea(8,6)}function ud(a){vf[a>>12].call(this,a)}function wf(a){xf[a>>6&3].call(this,a)}function yf(a){zf[a>>6&3].call(this,a)} -function Af(a){Bf[a>>6&3].call(this,a)}function Cf(a){Df[a&15].call(this,a)}function Ef(a){Ff[a&15].call(this,a)}function Gf(a){$f[a>>6&3].call(this,a)}function ag(a){bg[a>>6&3].call(this,a)}function cg(a){dg[a>>6&3].call(this,a)} +function hf(a){var b=Pd(this,a);P(this,Ud(this,a,b,1)<<8);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}var jf=[7,13,13,17,14,18,17,21];function kf(a){var b=Td(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.F&128||(this.S=b>>16,this.X=this.S|b,this.O=0,this.N=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function qf(a){R(this,a,Qd(this,a),te);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} +function rf(a){R(this,a,0,ve);this.b-=this.g?9:3+(7==this.f?2:0)}function sf(){this.ea(28,5);this.b-=5}function tf(){this.F&4||this.C.$();this.F|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3}function uf(a){R(this,a,Qd(this,a),we);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,C(b,"undefined opcode "+J(b,a),!0,!0),b=$b(b);b||this.ea(8,6)}function bd(a){vf[a>>12].call(this,a)}function wf(a){xf[a>>6&3].call(this,a)}function yf(a){zf[a>>6&3].call(this,a)} +function Af(a){Bf[a>>6&3].call(this,a)}function Cf(a){Df[a&15].call(this,a)}function Ef(a){Ff[a&15].call(this,a)}function Gf(a){Hf[a>>6&3].call(this,a)}function If(a){Jf[a>>6&3].call(this,a)}function cg(a){dg[a>>6&3].call(this,a)} var vf=[function(a){eg[a>>8&15].call(this,a)},gf,We,Ge,Ce,Ee,xe,V,function(a){fg[a>>8&15].call(this,a)},hf,Xe,He,De,Fe,qf,V],eg=[function(a){gg[a>>4&15].call(this,a)},Te,Qe,Ie,Je,Oe,Ke,Me,ef,ef,wf,yf,Af,V,V,V],xf=[function(a){Cd(this,Vd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,he);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,je);this.b-=this.g?9:3+(7==this.f?2:0)}],zf=[function(a){R(this,a,0, -ne);this.b-=this.g?11:6},function(a){R(this,a,yd(this)?1:0,Yd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,yd(this)?1:0,te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Td(this,a);Cd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Bf=[function(a){R(this,a,0,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,$d);this.b-=this.g?9:3+(7==this.f?2:0)}], -gg=[function(a){hg[a&15].call(this,a)},V,V,V,cf,cf,cf,cf,of,V,Cf,Ef,rf,rf,rf,rf],hg=[$e,tf,nf,Se,af,mf,V,V,V,V,V,V,V,V,V,V],Df=[lf,function(){this.N=0;this.b-=5},function(){this.O=0;this.b-=5},T,function(){this.X=1;this.b-=5},T,T,T,function(){this.S=0;this.b-=5},T,T,T,T,T,T,T],Ff=[lf,function(){this.N=65536;this.b-=5},function(){this.O=32768;this.b-=5},W,function(){this.X=0;this.b-=5},W,W,W,function(){this.S=32768;this.b-=5},W,W,W,W,W,W,W],fg=[Re,Pe,Le,Ne,Ue,Ve,Ae,Be,Ze,sf,Gf,ag,cg,V,V,V],$f=[function(a){Cd(this, -Ud(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,ke);this.b-=this.g?9:3+(7==this.f?2:0)}],bg=[function(a){Q(this,a,0,oe);this.b-=this.g?11:6},function(a){Q(this,a,yd(this)?1:0,Zd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,yd(this)?1:0,ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Sd(this,a);Cd(this,a<<8);this.b-=this.g?4:3+(7== -this.f?2:0)}],dg=[function(a){Q(this,a,0,se);this.b-=this.g?9+(this.Wa&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ce);this.b-=this.g?9+(this.Wa&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,ae);this.b-=this.g?9:3+(7==this.f?2:0)}];function vd(a){ig[a>>12].call(this,a)} +ne);this.b-=this.g?11:6},function(a){R(this,a,fd(this)?1:0,Yd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,fd(this)?1:0,te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Td(this,a);Cd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Bf=[function(a){R(this,a,0,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,$d);this.b-=this.g?9:3+(7==this.f?2:0)}], +gg=[function(a){hg[a&15].call(this,a)},V,V,V,cf,cf,cf,cf,of,V,Cf,Ef,rf,rf,rf,rf],hg=[$e,tf,nf,Se,af,mf,V,V,V,V,V,V,V,V,V,V],Df=[lf,function(){this.N=0;this.b-=5},function(){this.O=0;this.b-=5},T,function(){this.X=1;this.b-=5},T,T,T,function(){this.S=0;this.b-=5},T,T,T,T,T,T,T],Ff=[lf,function(){this.N=65536;this.b-=5},function(){this.O=32768;this.b-=5},W,function(){this.X=0;this.b-=5},W,W,W,function(){this.S=32768;this.b-=5},W,W,W,W,W,W,W],fg=[Re,Pe,Le,Ne,Ue,Ve,Ae,Be,Ze,sf,Gf,If,cg,V,V,V],Hf=[function(a){Cd(this, +Ud(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,ke);this.b-=this.g?9:3+(7==this.f?2:0)}],Jf=[function(a){Q(this,a,0,oe);this.b-=this.g?11:6},function(a){Q(this,a,fd(this)?1:0,Zd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,fd(this)?1:0,ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Sd(this,a);Cd(this,a<<8);this.b-=this.g?4:3+(7== +this.f?2:0)}],dg=[function(a){Q(this,a,0,se);this.b-=this.g?9+(this.Xa&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ce);this.b-=this.g?9+(this.Xa&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,ae);this.b-=this.g?9:3+(7==this.f?2:0)}];function cd(a){ig[a>>12].call(this,a)} var ig=[function(a){jg[a>>8&15].call(this,a)},gf,We,Ge,Ce,Ee,xe,function(a){kg[a>>8&15].call(this,a)},function(a){lg[a>>8&15].call(this,a)},hf,Xe,He,De,Fe,qf,V],jg=[function(a){mg[a>>4&15].call(this,a)},Te,Qe,Ie,Je,Oe,Ke,Me,ef,ef,wf,yf,Af,function(a){ng[a>>6&3].call(this,a)},V,V],ng=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ta(a|this.M);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Nd(this,a,0);Gd(this,a);P(this,a);this.b-=11},function(a){var b=Id(this),c= -this.b;Od(this,a,0,b);P(this,b);this.b=c-jf[this.g]},function(a){P(this,Vd(this,a,this.Da?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],mg=[function(a){og[a&15].call(this,a)},V,V,V,cf,cf,cf,cf,of,function(a){a&8?(this.L&49152||(this.L=this.L&-2017|(a&7)<<5,this.F|=1),this.b-=5):V.call(this,a)},Cf,Ef,rf,rf,rf,rf],og=[$e,tf,nf,Se,af,mf,function(){Hd(this);this.b-=13},V,V,V,V,V,V,V,V,V],kg=[kf,kf,Ye,Ye,ye,ye,ze,ze,uf,uf,V,V,V,V,pf,pf],lg=[Re,Pe,Le,Ne,Ue,Ve,Ae,Be,Ze,sf,Gf,ag,cg,function(a){pg[a>>6&3].call(this, +this.b;Od(this,a,0,b);P(this,b);this.b=c-jf[this.g]},function(a){P(this,Vd(this,a,this.Da?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],mg=[function(a){og[a&15].call(this,a)},V,V,V,cf,cf,cf,cf,of,function(a){a&8?(this.L&49152||(this.L=this.L&-2017|(a&7)<<5,this.F|=1),this.b-=5):V.call(this,a)},Cf,Ef,rf,rf,rf,rf],og=[$e,tf,nf,Se,af,mf,function(){Hd(this);this.b-=13},V,V,V,V,V,V,V,V,V],kg=[kf,kf,Ye,Ye,ye,ye,ze,ze,uf,uf,V,V,V,V,pf,pf],lg=[Re,Pe,Le,Ne,Ue,Ve,Ae,Be,Ze,sf,Gf,If,cg,function(a){pg[a>>6&3].call(this, a)},V,V],pg=[V,function(a){a=Nd(this,a,65536);Gd(this,a);P(this,a);this.b-=11},function(a){var b=Id(this),c=this.b;Od(this,a,65536,b);P(this,b);this.b=c-jf[this.g]},V]; -function qg(a){r.call(this,"ROM",a,qg);this.ja=this.f=null;this.D=a.addr;this.g=a.size;this.C=a.alias;this.B=a.file;this.G=oa(this.B);if(this.B){a=this.B;var b=pa(this.G);"json"!=b&&"hex"!=b&&(a=ra()+"/api/v1/dump?file="+this.B+"&format=bytes&decimal=true");var c=this;Ba(a,null,!0,function(a,b,f){f?c.pa("Unable to load ROM resource (error "+f+": "+a+")"):(jb(c.Va,a,b),(a=Fa(a,b))?(c.f=a.ga,c.ja=a.ja):c.B=null,rg(c))})}}u(qg);qg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;rg(this)}; -qg.prototype.Aa=function(){if(this.ja){if(this.i){var a=this.i,b=this.id,c=this.D,d=this.g,e=this.ja,f=[],g;for(g in e){var l=e[g];"number"==typeof l&&(e[g]=l={o:l});var m=l.o,p=l.a;if(void 0!==m){var q=f,m=[m>>>0,g],v=ya(q,m,a.Vb);0>v&&q.splice(-(v+1),0,m)}p&&(l.a=p.replace(/''/g,'"'))}a.G.push({Ud:b,A:c,vc:d,ja:e,Ub:f})}delete this.ja}return!0};qg.prototype.za=function(){return!0}; -function rg(a){if(!pb(a)){if(a.B){if(!a.f||!a.w)return;a.g||(a.g=a.f.length);if(a.f.length!=a.g)rb(a,"ROM size ("+k(a.f.length,8,!0)+") does not match specified size ("+k(a.g,8,!0)+")");else{var b;b=a.D;if(Yb(a.w,b,a.g,Cc)){var c;for(c=0;c>>0,g],v=ya(q,m,a.Vb);0>v&&q.splice(-(v+1),0,m)}p&&(k.a=p.replace(/''/g,'"'))}a.G.push({Ud:b,B:c,vc:d,ka:e,Ub:f})}delete this.ka}return!0};qg.prototype.za=function(){return!0}; +function rg(a){if(!pb(a)){if(a.C){if(!a.f||!a.w)return;a.g||(a.g=a.f.length);if(a.f.length!=a.g)rb(a,"ROM size ("+l(a.f.length,8,!0)+") does not match specified size ("+l(a.g,8,!0)+")");else{var b;b=a.D;if(Yb(a.w,b,a.g,Cc)){var c;for(c=0;c=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=va(b[0]);if(c!=this.Ua)return;b=va(b[1]);if(this.I=lb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.K=d.receiveData){this.status(this.Va+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.Aa=function(a,b){if(!b)if(this.cc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +function sg(a){r.call(this,"RAM",a,sg);this.ka=this.g=null;this.G=a.addr;this.H=a.size;this.A=a.load;this.C=a.exec;this.D=!1;this.f=a.file;this.J=oa(this.f);if(this.f){a=this.f;var b=pa(this.J);"json"!=b&&"hex"!=b&&(a=ra()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Ba(a,null,!0,function(a,b,f){f?c.ga("Unable to load RAM resource (error "+f+": "+a+")"):(jb(c.Ra,a,b),(a=Ca(a,b))?(c.g=a.ja,c.ka=a.ka,null==c.A&&null!=a.Lb&&(c.A=a.Lb),null==c.C&&null!=a.Kb&&(c.C=a.Kb)):c.f=null, +tg(c))})}}u(sg);sg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;tg(this)};sg.prototype.Aa=function(){return!0};sg.prototype.za=function(){return!0};function tg(a){!a.D&&a.H&&Yb(a.w,a.G,a.H,1)&&(a.D=!0);if(!pb(a)){if(!a.D)n("No RAM allocated");else if(a.f){if(!a.g||!a.w)return;var b=a.G;null!==a.A&&(b=a.A);for(var c=0;c=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=va(b[0]);if(c!=this.Wa)return;b=va(b[1]);if(this.J=lb(b)){var d=this.J.exports;if(d){var e=d.connect;e&&e.call(this.J);if(this.K=d.receiveData){this.status(this.Ra+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.Aa=function(a,b){if(!b)if(this.cc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; h.za=function(a){return a?this.save():!0};h.reset=function(){xg(this)};h.save=function(){var a=new N(this);a.set(0,[]);return a.data()};h.restore=function(){return xg(this)};function xg(a){a.R=0;a.f=0;a.g=128;a.D=[];return!0}h.Ob=function(a){if("number"==typeof a)this.D.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.H%a,this.T&&(b=ua("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.C.value+=b;this.C.scrollTop=this.C.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.j(this.G), +h.Qd=function(a){if(a&=255){C(this,"transmitByte("+l(a,2,!0)+")");this.K&&this.K.call(this.J,a);if(this.A)if(13==a)this.H=0;else if(8==a)this.A.value=this.A.value.slice(0,-1),0":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.H%a,this.T&&(b=ua("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.A.value+=b;this.A.scrollTop=this.A.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.j(this.G), this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.g&=-129;rc(this.b,this.V,1)}};var yg={},wg=(yg[65392]=[null,null,X.prototype.Sc,X.prototype.Ed,"RCSR"],yg[65394]=[null,null,X.prototype.Rc,X.prototype.Dd,"RBUF"],yg[65396]=[null,null,X.prototype.ed,X.prototype.Rd,"XCSR"],yg[65398]=[null,null,X.prototype.dd,X.prototype.Qd,"XBUF"],yg);Ta(function(){for(var a=B(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Bg.prototype.$b=function(){return-1};Bg.prototype.ac=function(){}; -function Dg(a,b,c,d){if(c)if(b){0>a.C&&a.g.length&&(a.C=0);if(0>a.C||b!=a.g[a.C])a.g.splice(0,0,b),a.C=0;a.C--}else a.U?b="end":b=a.g[a.C+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(va(b.substring(c,f))),c=f+1}}return a} -function Eg(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +function wc(a){r.call(this,"PC11",a,wc);this.f=a.autoMount||null;this.J=this.g=0;this.v.local=!1;this.A="";this.H=!La("Mobi")&&window&&"FileReader"in window}u(wc);h=wc.prototype; +h.qa=function(a,b,c){var d=this;switch(b){case "listTapes":return this.I[b]=c,c.onchange=function(){var a=d.I.descTape,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){n("PC11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descTape":return this.I[b]=c,!0;case "loadTape":return this.I[b]=c,c.onclick=function(){var a=d.I.listTapes;a&&zg(d, +a.options[a.selectedIndex].text,a.value)},!0;case "mountTape":if(this.H)return this.I[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;zg(d,oa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.Ca=function(a,b,c,d){this.C=a;this.w=b;this.b=c;this.i=d;if((this.f=Pc(this.C,"autoMount")||this.f)&&"string"==typeof this.f)try{this.f=eval("("+this.f+")")}catch(e){n("PC11 auto-mount error: "+e.message+" ("+this.f+")"),this.f=null}mc(b,this,Ag);Bg(this,"None","",!0);this.H&&Bg(this,"Local Tape","?");Bg(this,"Remote Tape","??");Cg(this)||H(this)};h.Aa=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.za=function(a){return a?this.save():!0}; +h.reset=function(){this.g&=-2241;this.J=0};function Cg(a){a.D=0;if(a.f){var b=a.f.path,c;if(!(c=a.f.name))a:{if((c=a.I.listTapes)&&c.options)for(var d=0;dc.indexOf("/api/v1/dump")&&(d=pa(c),e="json"==d||"gz"==d?encodeURI(c):ra()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ba(e,null,!0,function(d,e,f){a.v.Ia=!1;var g=0>f&&a.C&&!a.C.v.ha;f?a.ga('Unable to load tape "'+b+'" (error '+f+": "+d+")",g):(jb(a.Ra,d,e),Ca(d,e)&&(a.A=c));a.G&&(a.G=!1,--a.D||H(a));if((d=a.I.listTapes)&& +d.options){e=a.v.local?"?":a.A;for(f=0;f=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Gg.prototype.$b=function(){return-1};Gg.prototype.ac=function(){}; +function Ig(a,b,c,d){if(c)if(b){0>a.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.U?b="end":b=a.g[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(va(b.substring(c,f))),c=f+1}}return a} +function Jg(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 Fg(a,b,c){var d;if(b){b=Gg(a,b);for(var e=0,f=!1,g=b,l=[],m=[],p=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=q+g;d>>=8}d=k(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Jg(a,b){if(b)return Ig(a,b,a.aa[b]);var c=0;for(b in a.aa)Ig(a,b,a.aa[b]),c++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=q+g;d>>=8}d=l(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Og(a,b){if(b)return Ng(a,b,a.aa[b]);var c=0;for(b in a.aa)Ng(a,b,a.aa[b]),c++;return 0this.b.$a?Sg:[];Tg(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,m=b.length;if(c){a=d.Y(Ug(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ha;m=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.j("..."):(c=q.type,p=bc[c],q&&d.j(k(q.id,8)+" %"+k(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}h.ac=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ea[a-8]:20>a?b=this.b.va[a-16]:20==a&&(b=Lb(this.b)));return b}; -h.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.tb).A));this.ka&1073741824?this.wa.push(a):this.ra&&a==this.ra||(this.ra=a,this.ka&-2147483648&&(this.da(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,Yc(a),a.na=0,a.B.$()))}; -function Mg(a){var b;if(Wd(a)){if(!a.I||!a.I.length){a.I=Array(1E3);for(b=0;b>>d.ha],!1)}a.M=["br"];if(a.D)for(b=1;b>>d.ha],!0);a.D=["bw"];a.Wa=0} -h.Qa=function(a,b,c){var d=!0;c||dh(this,a,b,!1,!0);if(a!=this.f){var e=this.Y(b);if(-1===e)this.j("invalid address: "+J(this,b.A)),d=!1;else{var f=this.w;f.W[e>>>f.ha].Qa(e&f.w,a==this.D)}}d&&(a.push(b),c?b.Ba=!0:(eh(this,a,a.length-1,"set"),Mg(this)));return d};function dh(a,b,c,d,e){var f=!1;c=a.Y(c);for(var g=1;g>>d.ha],b==a.D));l.Ba||Mg(a);break}}return f} -function fh(a,b){for(var c=1;c>23)&65535,y=J(x,w);else if(8192==D)w=w.A-((f&63)<<1)&65535,y=J(x,w);else if(12288==D)y=J(x,f&7,1);else if(24576==D)y=J(x,f&63,1);else if(D=f&C,C&4032&&(D>>=6,C>>=6),C&63)switch(C=D&7,D&56){case 0:y= -Zg(C);break;case 8:y="@"+Zg(C);break;case 16:7>C?y="("+Zg(C)+")+":(D=x.ma(w,2),y="#"+J(x,D,0,!0));break;case 24:7>C?y="@("+Zg(C)+")+":(D=x.ma(w,2),y="@#"+J(x,D,0,!0));break;case 32:y="-("+Zg(C)+")";break;case 40:y="@-("+Zg(C)+")";break;case 48:D=x.ma(w,2);y=J(x,D,0,!0)+"("+Zg(C)+")";7==C&&(y=[y,J(x,D+w.A&65535)]);break;case 56:D=x.ma(w,2),y="@"+J(x,D)+"("+Zg(C)+")",7==C&&(y=[y,J(x,D+w.A&65535)])}x=y;if(!x||!x.length){l="INVALID";break}"string"!=typeof x&&(p=x[1],x=x[0]);0b?(c=Zg(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ea[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.va[b-16]):20==b&&(c="PS="+J(a,Lb(d)));c&&(c+=" ");return c}function kh(a){var b,c="";for(b=0;6>b;b++)c+=jh(a,b);c=c+"\n"+(jh(a,6)+jh(a,7)+jh(a,20));return c+=ih(a,"T")+ih(a,"N")+ih(a,"Z")+ih(a,"V")+ih(a,"C")}h.Vb=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,l=f.vc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.B.$();a.j("updated registers:")}a.j(kh(a));c&&(a.K=Z(d.u[7]),bh(a,J(a,a.K.A)))}}function ph(a,b){b=va(b);var c=b.match(/^(['"])(.*?)\1$/);c?1l[0].indexOf("+"))){var p=l[0]+":";l[2]&&(p+=" "+l[2]);a.j(p)}l[3]&&(g=l[3],f=null);f=hh(a,b,g,f);a.j(f);a.K=b;e-=b.A-m;c++}}} -function gh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.U&&(a.j("ended assemble at "+J(a,a.T.A)),a.K=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ra=null;if(pb(a)&&0q||"z"ia.length&&(a.j("note: only "+ia.length+" available"),Y=ia.length);ca-=Y;0>ca&&(null==ia[ia.length-1].A?(Y=ca+Y,ca=0):ca+=ia.length);var ed=[];"call"==Mf&&(tb=1E5,ed=["CALL"]);for(void 0!==Lf&&a.j(Y+" instructions earlier:");0=ia.length&&(ca=0);a.Xa=Y;Of++;tb--}}Of||(a.j("no "+Nf+"history available"),a.Xa=void 0)}else{var vb=Ug(a,ha);if(vb){var dc=0;Da&&("l"==Da.charAt(0)&&(Da=Da.substr(1)||Jh),dc=Hg(a,Da)>>>0,65536>4||1;Lh--&&0gc?String.fromCharCode(gc):".";ec--}wb&&(wb+="\n");wb+=ha+" "+fd+(0==yb?" "+Rf:"")}wb&&a.j(wb);a.Pa=vb}}}}break;case "e":if("else"==g[0])break;var bb,hd,id,jd,kd=g[0],ld=g[1];"eb"==kd?(bb=1,hd=255,id=a.ob,jd=a.Fb):"e"==kd||"ew"==kd?(bb=2,hd=65535,id=a.ma,jd=a.Ta):ld=null;if(null==ld)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var hc=Ug(a,ld);if(hc)for(var ic=2;ic< -g.length;ic++){var zb=Fg(a,g[ic]);if(void 0===zb){a.j("unrecognized value: "+g[ic]);break}zb&~hd&&a.j("warning: "+k(zb)+" exceeds "+bb+"-byte value");var Mh=id.call(a,hc);a.j("changing "+J(a,hc.A)+" from "+J(a,Mh,bb)+" to "+J(a,zb,bb));jd.call(a,hc,zb,bb)}}break;case "g":a:{var Sf=g[1],Nh=b;if(void 0!==Sf){var md=Ug(a,Sf,!0);if(!md)break a;Yg(a,md,Nh);a.Qa(a.f,md,!0)}a.hb(!0,c)}break;case "h":a.v.ca?(c||a.j("halting"),a.da()):ob(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var nd; -var Ab=b.substr(2),Ab=va(Ab);Fg(a,Ab)?(c||a.j("true: "+Ab),nd=!0):(c||a.j("false: "+Ab),nd=!1);nd||(d=!1);break}f=!0;break;case "k":var Oh=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var od=0,pd=Z(),Bb=Z(a.b.u[6]);for(a.j("stack trace for "+J(a,Bb.A));10>od;){for(var Ea=null,Ph=256;65536>Bb.A>>>0;){pd.A=a.ma(Bb,2);if(null==Bb.A||!Ph--)break;if(!(pd.A&1)){for(var Qh=a,jc=pd,Tf=null,Cb=jc.A,Uf=Cb,qd=1;6>=qd&&Cb;qd++){if(2< -qd){jc.A=Cb;var kc=hh(Qh,jc);if(0<=kc.indexOf("JSR")){var Vf=kc.indexOf(" ");if(Cb+(kc.indexOf(" ",Vf+1)-Vf-1)/2==Uf){Tf=kc;break}}}Cb-=2}jc.A=Uf;if(Ea=Tf)break}}if(!Ea||null==Ea)break;var Wf=null;if("ks"==Oh){var Xf=Ea.match(/[0-9A-F]+$/);Xf&&(Wf=oh(a,Xf[0]))}Ea=ua(Ea,50)+" ;"+(Wf||"stack="+J(a,Bb.A));a.j(Ea);od++}od||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){oh(a,g[1],!0);break}f=!0;break;case "m":a:{var ja,ka=null,F=g[1];"?"==F&&(F=void 0);if(void 0!==F){var xa=0;if("all"== -F)xa=1878917119,F=null;else if("on"==F)ka=!0,F=null;else if("off"==F)ka=!1,F=null;else{"keys"==F&&(F="key");"kbd"==F&&(F="keyboard");for(ja in Gb)if(F==ja){xa=Gb[ja];ka=!!(a.ka&xa);break}if(!xa){a.j("unknown message category: "+F);break a}}if(xa)if("on"==g[2])a.ka|=xa,ka=!0;else if("off"==g[2]&&(a.ka&=~xa,ka=!1,1073741824==xa)){for(var rd=0;rd\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;buh){if(wh(d,this.I)){this.D=new N(this,"1.30.1","failsafe");wh(this.D)&&(Bh(this,d),a=2,Ch(this.D));this.D.set("timestamp",Aa());Dh(this.D);var e=this.f&&!this.G;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ah(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?wh(d,g):("error"== -f&&"no machine state"!=g?(this.pa("Error: "+g),"unable to verify user"==g&&(Ka("user",""),this.g=null)):this.j(f+": "+g),Ch(d),wh(d)?(c=Ah(d),e=!0):c=!1))}e&&zh(this,c?d:null)}else 2==a&&d.clear()}else zh(this);delete this.I;delete this.K}e=kb(this.id);for(f=0;fa[1];a=a[2];this.fa=!0;this.v.ia=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.b&&(Eh(this,this.b,b,c,a),this.b.lb());this.T&&(Bh(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.B=0}; -function Bh(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Ba("http://www.pcjs.org/api/v1/report",d,!0)}} -function rh(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),l=Aa();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.za&&(c&&a.b.da(),d=a.b.za(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ia=!1,!1===d&&(e=null)));for(var l=kb(a.id),m=0;mthis.b.ab?Xg:[];Yg(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,m=b.length;if(c){a=d.Y(Zg(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ia;m=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.j("..."):(c=q.type,p=bc[c],q&&d.j(l(q.id,8)+" %"+l(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}h.ac=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ea[a-8]:20>a?b=this.b.va[a-16]:20==a&&(b=Lb(this.b)));return b}; +h.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.tb).B));this.la&1073741824?this.wa.push(a):this.ra&&a==this.ra||(this.ra=a,this.la&-2147483648&&(this.da(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,Yc(a),a.oa=0,a.C.$()))}; +function Rg(a){var b;if(Wd(a)){if(!a.J||!a.J.length){a.J=Array(1E3);for(b=0;b>>d.ia],!1)}a.M=["br"];if(a.D)for(b=1;b>>d.ia],!0);a.D=["bw"];a.Xa=0} +h.Sa=function(a,b,c){var d=!0;c||ih(this,a,b,!1,!0);if(a!=this.f){var e=this.Y(b);if(-1===e)this.j("invalid address: "+J(this,b.B)),d=!1;else{var f=this.w;f.W[e>>>f.ia].Sa(e&f.w,a==this.D)}}d&&(a.push(b),c?b.Ba=!0:(jh(this,a,a.length-1,"set"),Rg(this)));return d};function ih(a,b,c,d,e){var f=!1;c=a.Y(c);for(var g=1;g>>d.ia],b==a.D));k.Ba||Rg(a);break}}return f} +function kh(a,b){for(var c=1;c>23)&65535,y=J(x,w);else if(8192==F)w=w.B-((f&63)<<1)&65535,y=J(x,w);else if(12288==F)y=J(x,f&7,1);else if(24576==F)y=J(x,f&63,1);else if(F=f&E,E&4032&&(F>>=6,E>>=6),E&63)switch(E=F&7,F&56){case 0:y= +dh(E);break;case 8:y="@"+dh(E);break;case 16:7>E?y="("+dh(E)+")+":(F=x.na(w,2),y="#"+J(x,F,0,!0));break;case 24:7>E?y="@("+dh(E)+")+":(F=x.na(w,2),y="@#"+J(x,F,0,!0));break;case 32:y="-("+dh(E)+")";break;case 40:y="@-("+dh(E)+")";break;case 48:F=x.na(w,2);y=J(x,F,0,!0)+"("+dh(E)+")";7==E&&(y=[y,J(x,F+w.B&65535)]);break;case 56:F=x.na(w,2),y="@"+J(x,F)+"("+dh(E)+")",7==E&&(y=[y,J(x,F+w.B&65535)])}x=y;if(!x||!x.length){k="INVALID";break}"string"!=typeof x&&(p=x[1],x=x[0]);0b?(c=dh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ea[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.va[b-16]):20==b&&(c="PS="+J(a,Lb(d)));c&&(c+=" ");return c}function ph(a){var b,c="";for(b=0;6>b;b++)c+=oh(a,b);c=c+"\n"+(oh(a,6)+oh(a,7)+oh(a,20));return c+=nh(a,"T")+nh(a,"N")+nh(a,"Z")+nh(a,"V")+nh(a,"C")}h.Vb=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,k=f.vc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.C.$();a.j("updated registers:")}a.j(ph(a));c&&(a.K=Z(d.u[7]),gh(a,J(a,a.K.B)))}}function uh(a,b){b=va(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var p=k[0]+":";k[2]&&(p+=" "+k[2]);a.j(p)}k[3]&&(g=k[3],f=null);f=mh(a,b,g,f);a.j(f);a.K=b;e-=b.B-m;c++}}} +function lh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.U&&(a.j("ended assemble at "+J(a,a.T.B)),a.K=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ra=null;if(pb(a)&&0q||"z"ja.length&&(a.j("note: only "+ja.length+" available"),Y=ja.length);ca-=Y;0>ca&&(null==ja[ja.length-1].B?(Y=ca+Y,ca=0):ca+=ja.length);var jd=[];"call"==Pf&&(vb=1E5,jd=["CALL"]);for(void 0!==Of&&a.j(Y+" instructions earlier:");0=ja.length&&(ca=0);a.Ya=Y;Rf++;vb--}}Rf||(a.j("no "+Qf+"history available"),a.Ya=void 0)}else{var xb=Zg(a,ia);if(xb){var ec=0;Fa&&("l"==Fa.charAt(0)&&(Fa=Fa.substr(1)||Oh),ec=Mg(a,Fa)>>>0,65536>4||1;Qh--&&0hc?String.fromCharCode(hc):".";fc--}yb&&(yb+="\n");yb+=ia+" "+kd+(0==Ab?" "+Uf:"")}yb&&a.j(yb);a.Qa=xb}}}}break;case "e":if("else"==g[0])break;var bb,md,nd,od,pd=g[0],qd=g[1];"eb"==pd?(bb=1,md=255,nd=a.ob,od=a.Fb):"e"==pd||"ew"==pd?(bb=2,md=65535,nd=a.na,od=a.Va):qd=null;if(null==qd)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var ic=Zg(a,qd);if(ic)for(var jc=2;jc< +g.length;jc++){var Bb=Kg(a,g[jc]);if(void 0===Bb){a.j("unrecognized value: "+g[jc]);break}Bb&~md&&a.j("warning: "+l(Bb)+" exceeds "+bb+"-byte value");var Rh=nd.call(a,ic);a.j("changing "+J(a,ic.B)+" from "+J(a,Rh,bb)+" to "+J(a,Bb,bb));od.call(a,ic,Bb,bb)}}break;case "g":a:{var Vf=g[1],Sh=b;if(void 0!==Vf){var rd=Zg(a,Vf,!0);if(!rd)break a;ch(a,rd,Sh);a.Sa(a.f,rd,!0)}a.ib(!0,c)}break;case "h":a.v.ca?(c||a.j("halting"),a.da()):ob(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var sd; +var Cb=b.substr(2),Cb=va(Cb);Kg(a,Cb)?(c||a.j("true: "+Cb),sd=!0):(c||a.j("false: "+Cb),sd=!1);sd||(d=!1);break}f=!0;break;case "k":var Th=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var td=0,ud=Z(),Db=Z(a.b.u[6]);for(a.j("stack trace for "+J(a,Db.B));10>td;){for(var Ga=null,Uh=256;65536>Db.B>>>0;){ud.B=a.na(Db,2);if(null==Db.B||!Uh--)break;if(!(ud.B&1)){for(var Vh=a,kc=ud,Wf=null,Eb=kc.B,Xf=Eb,vd=1;6>=vd&&Eb;vd++){if(2< +vd){kc.B=Eb;var lc=mh(Vh,kc);if(0<=lc.indexOf("JSR")){var Yf=lc.indexOf(" ");if(Eb+(lc.indexOf(" ",Yf+1)-Yf-1)/2==Xf){Wf=lc;break}}}Eb-=2}kc.B=Xf;if(Ga=Wf)break}}if(!Ga||null==Ga)break;var Zf=null;if("ks"==Th){var $f=Ga.match(/[0-9A-F]+$/);$f&&(Zf=th(a,$f[0]))}Ga=ua(Ga,50)+" ;"+(Zf||"stack="+J(a,Db.B));a.j(Ga);td++}td||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){th(a,g[1],!0);break}f=!0;break;case "m":a:{var ka,la=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var xa=0;if("all"== +G)xa=1878917119,G=null;else if("on"==G)la=!0,G=null;else if("off"==G)la=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(ka in tb)if(G==ka){xa=tb[ka];la=!!(a.la&xa);break}if(!xa){a.j("unknown message category: "+G);break a}}if(xa)if("on"==g[2])a.la|=xa,la=!0;else if("off"==g[2]&&(a.la&=~xa,la=!1,1073741824==xa)){for(var wd=0;wd\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bzh){if(Bh(d,this.J)){this.D=new N(this,"1.30.1","failsafe");Bh(this.D)&&(Gh(this,d),a=2,Hh(this.D));this.D.set("timestamp",Aa());Ih(this.D);var e=this.f&&!this.G;if(1==a||Da("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Fh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Bh(d,g):("error"== +f&&"no machine state"!=g?(this.ga("Error: "+g),"unable to verify user"==g&&(Ka("user",""),this.g=null)):this.j(f+": "+g),Hh(d),Bh(d)?(c=Fh(d),e=!0):c=!1))}e&&Eh(this,c?d:null)}else 2==a&&d.clear()}else Eh(this);delete this.J;delete this.K}e=kb(this.id);for(f=0;fa[1];a=a[2];this.fa=!0;this.v.ha=!0;var d=this.I.power;d&&(d.textContent="Shutdown");this.b&&(Jh(this,this.b,b,c,a),this.b.mb());this.T&&(Gh(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.C=0}; +function Gh(a,b){if(Da("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Ba("http://www.pcjs.org/api/v1/report",d,!0)}} +function wh(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),k=Aa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.za&&(c&&a.b.da(),d=a.b.za(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ha=!1,!1===d&&(e=null)));for(var k=kb(a.id),m=0;mf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){f=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ba(e,null,!0,function(f,g,l){if(l||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=l[0],p,q=/( [a-z]+=)(['"])(.*?)\2/g;p=q.exec(f);)m=0>m.indexOf(p[1])?m.replace(">",p[0]+">"):m.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);l[0]!=m&&(g=g.replace(l[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Wh(a,b,c)}})}else c(a,null)} -function Xh(a,b,c,d){function e(a){if(void 0===l){var b=g&&B(g,"machine-warning");l=b&&b[0]||g}l&&(l.innerHTML=ta(a))}function f(a){e("Error: "+a);m&&(--Ih||Va(!0));m=!1}var g,l,m=!0;Ih++;ib[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=p:v.appendChild(document.createTextNode(p));q.appendChild(v)}c|| -(c="/versions/pdpjs/1.30.1/components.xsl");p=function(d,l){l?Uh(c,null,null,!1,e,function(d,m){m?(jb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=l.transformNode(m))?(g.outerHTML=m,--Ih||Va(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(l,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--Ih||Va(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Uh(b,a,d,!0,e,p):Vh(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(w){f(w.message)}return m}window.embedPDP11=function(a,b,c,d){Va(!1);return Xh(a,b,c,d)};window.enableEvents=Va;window.sendEvent=Wa;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11-dbg.map +h.qa=function(a,b,c){var d=this;switch(b){case "power":return this.I[b]=c,c.onclick=function(){d.C||(d.v.ha?wh(d,!1,!0):Dh(d,d.sb))},!0;case "reset":return this.I[b]=c,c.onclick=function(){if(d.v.ha&&!d.C)if(d.f&&!d.H){var a=Da("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");wh(d,a,!0);!a&&d.R?window&&window.location.reload():d.sb(zh)}else d.reset(),d.b&&d.b.mb()},!0;case "save":if(qa())c.parentNode.removeChild(c);else return this.I[b]= +c,c.onclick=function(){var a=Ah(d,!0);if(a){var b=!!(d.f&&!d.H||d.R),c=wh(d,b);b?Kh(d,a,c):d.ga("Resume disabled, machine state not saved")}},!0}return!1}; +function Ah(a,b){var c=a.g;c||((c=Ja("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Lh(a,c))||a.ga("The user ID is invalid.")):b&&a.ga("Browser local storage is not available"));return c} +function Lh(a,b){a.g=null;b=Ba(ra()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ka("user",b.data),a.g=b.data)}catch(d){n(d.message+" ("+c+")")}return a.g}function Ch(a){var b=null;a.g&&(b=ra()+"/api/v1/user?req=load&user="+a.g+"&state="+Mh(a,"1.30.1"));return b} +function Kh(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Mh(a,"1.30.1");d.data=c;b=Ba(ra()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){f=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ba(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=k[0],p,q=/( [a-z]+=)(['"])(.*?)\2/g;p=q.exec(f);)m=0>m.indexOf(p[1])?m.replace(">",p[0]+">"):m.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);k[0]!=m&&(g=g.replace(k[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);ai(a,b,c)}})}else c(a,null)} +function bi(a,b,c,d){function e(a){if(void 0===k){var b=g&&B(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=ta(a))}function f(a){e("Error: "+a);m&&(--Nh||Va(!0));m=!1}var g,k,m=!0;Nh++;ib[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=p:v.appendChild(document.createTextNode(p));q.appendChild(v)}c|| +(c="/versions/pdpjs/1.30.1/components.xsl");p=function(d,k){k?Zh(c,null,null,!1,e,function(d,m){m?(jb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=k.transformNode(m))?(g.outerHTML=m,--Nh||Va(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--Nh||Va(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Zh(b,a,d,!0,e,p):$h(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(w){f(w.message)}return m}window.embedPDP11=function(a,b,c,d){Va(!1);return bi(a,b,c,d)};window.enableEvents=Va;window.sendEvent=Wa;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11-dbg.map diff --git a/versions/pdpjs/1.30.1/pdp11.js b/versions/pdpjs/1.30.1/pdp11.js index f0fa902d5..b5739031e 100644 --- a/versions/pdpjs/1.30.1/pdp11.js +++ b/versions/pdpjs/1.30.1/pdp11.js @@ -30,157 +30,164 @@ */ for(var g,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da>=3;return""+c}function ja(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} -function ka(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function pa(a){return a.replace(/[&<>"']/g,function(a){return oa[a]})}function qa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} -var ra={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},sa=Date.now||function(){return+new Date}; +function ka(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function pa(a){return a.replace(/[&<>"']/g,function(a){return oa[a]})} +function qa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var ra={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},sa=Date.now||function(){return+new Date}; function ta(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function h(a,b,c,d){var e=0,f=null,k=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),k;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var n="",r;for(r in b)b.hasOwnProperty(r)&&(n&&(n+="&"),n+=r+"="+encodeURIComponent(b[r]));n=n.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(n)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),k=[f,e]);return k} -function ua(a,b){var c,d={K:null,Y:null,bb:null,ab:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,k=eval("("+b+")");d.bb=k.load;d.ab=k.exec;if(e=k.bytes)d.K=e;else if(e=k.words)for(d.K=Array(2*e.length),f=c=0;c>8&255;else if(e=k.data)for(d.K=Array(4*e.length),f=c=0;c>8&255,d.K[f++]=e[c]>>16&255,d.K[f++]=e[c]>>24&255;else d.K=k;d.Y=k.symbols;d.K.length?1==d.K.length&&(m(d.K[0]),d=null):(m("Empty resource: "+ -a),d=null)}catch(l){m("Resource data error: "+l.message),d=null}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),d.K=Array(a.length),c=0;cb?this.Ga=this.id:(this.Ha=this.id.substr(0,b),this.Ga=this.id.substr(b+1));this[a]=c;this.i={ready:!1,fd:!1,gd:!1,M:!1,error:!1};this.Ra=null;this.i.error=!1;this.v={};this.G=null;v.push(this)}var Ia=void 0,Ja={}; +function ua(a,b){var c,d={M:null,Y:null,cb:null,bb:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,k;if("<"==b.substr(0,1))throw Error(b);k=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.cb=k.load;d.bb=k.exec;if(e=k.bytes)d.M=e;else if(e=k.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=k.data)for(d.M=Array(4*e.length),f=c=0;c>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=k;d.Y=k.symbols;d.M.length?1==d.M.length&&(m(d.M[0]),d=null):(m("Empty resource: "+a),d=null)}catch(l){m("Resource data error ("+a+"): "+l.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Ha=this.id:(this.ra=this.id.substr(0,b),this.Ha=this.id.substr(b+1));this[a]=c;this.h={ready:!1,Wa:!1,gd:!1,L:!1,error:!1};this.Ra=null;this.h.error=!1;this.s={};this.G=null;v.push(this)}var Ia=void 0,Ja={}; if(window){Ia||(Ia=window.location.search.substr(1));for(var Ka,La=/\+/g,Ma=/([^&=]+)=?([^&]*)/g;Ka=Ma.exec(Ia);)Ja[decodeURIComponent(Ka[1].replace(La," "))]=decodeURIComponent(Ka[2].replace(La," "))}function Na(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function w(a,b){b||(b=u);a.prototype=Na(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Oa=window.PCjs.Machines||(window.PCjs.Machines={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else Oa={},v=[];function Pa(a,b,c){Oa[a]&&b&&(Oa[a][b]=c)}function x(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>2;this.g=this.c-1;this.w=this.A/this.c|0;this.ka=[];this.S=0;this.o=[];this.Ab=[ab,bb,cb,db];a=new E(this);eb(a,this.G);this.b=Array(this.w);for(b=0;b>2;this.g=this.c-1;this.v=this.A/this.c|0;this.ka=[];this.S=0;this.o=[];this.Bb=[ab,bb,cb,db];a=new E(this);eb(a,this.G);this.b=Array(this.v);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.ka[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=gb(d,b)}function bb(a,b,c){var d=!1,e=this.controller,f=e.ka[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ka[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||gb(e,c)} -function cb(a,b){var c=-1,d=this.controller;(a=d.ka[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=gb(d,b)}function db(a,b,c){var d=!1,e=this.controller;if(a=e.ka[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||gb(e,c)}function hb(a,b){if(b!=a.j){var c;a.j&&(c=(1<>8,c+1),d=!0);d||gb(e,c)}function hb(a,b){if(b!=a.j){var c;a.j&&(c=(1<>>a.m;0k&&(t=k);if(!e&&n&&n.size){if(n.type==d){if(f+k<=n.Ba)return n.Ua+=n.Ba-f,n.Ba=f,!0;if(f>=n.Ba+n.Ua){t=n.size-(f-r);t>k&&(t=k);n.Ua=f-n.Ba+t;f=r+a.c;k-=t;l++;continue}}return mb(1,f,k)}f=new E(a,f,t,a.c,d,e);eb(f,a.G,n);a.b[l++]=f;f=r+a.c;k-=t}if(0>=k){c/=1024;var C;e="";C?10>>=a.m;0>>=a.m;0>>a.m].cb(b&a.g,b)}function pb(a,b){return a.b[(b&a.h)>>>a.m].T(b&a.g,b)}$a.prototype.Ta=function(a,b){this.S++;this.b[(a&this.h)>>>this.m].xb(a&this.g,b&255,a);this.S--}; -function qb(a,b,c){a.b[(b&a.h)>>>a.m].Va(b&a.g,c&65535,b)}function rb(a){for(var b=0,c=[],d=0;da.a.Fa)){var k=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,r=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&r&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(r)));sb(a,e,e,k,l,n,r,f[4])}}}function ub(a,b){a.o.push(b)}function vb(a,b){a.S||F(a.a,4,b)} -function mb(a,b,c){m("Memory block error ("+a+": "+ja(b)+","+ja(c)+")");return!1}function G(a){u.call(this,"Device",a,G);this.c={data:0,ed:0,Sa:20,tc:0};this.b={hd:0,hb:-1}}w(G);g=G.prototype;g.ea=function(a,b,c,d){this.m=b;this.a=c;this.G=d;var e=this;this.b.hb=wb(c,function(){e.b.na|=128;e.b.na&64&&(xb(e.a,e.b.uc),yb(e.a,e.b.hb,1E3/60))});this.b.uc=zb(64,6);tb(b,this,H);ub(b,this.reset.bind(this));B(this)};g.reset=function(){this.c.Sa=this.c.Sa&-120|20;this.b.na=0}; -g.Pb=function(){var a=this.b.na;this.b.na&=-129;return a};g.Dc=function(a){this.b.na=a;a&64&&yb(this.a,this.b.hb,1E3/60);this.b.na=a&-129};g.Ib=function(a){return(a?this.c.tc:this.c.data)&65535};g.wc=function(a){this.c.data=a};g.Rb=function(){var a=this.a;return a.A&62337|a.Ia<<5|a.Ja<<1};g.Fc=function(a){var b=this.a;a&=62337;if(b.A!=a){b.A=a;b.Ia=a>>5&3;b.Ja=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Da!=c&&(b.Da=c,Ab(b))}Bb(this)}; -g.Sb=function(){var a=this.a.oa;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Tb=function(){return this.a.fb};g.Ub=function(){return this.a.pa};g.Gc=function(a){var b=this.a;1170>b.Fa&&(a&=-49);b.pa!=a&&(b.pa=a,a&16?(b.Za=4194303,b.Ka=3915776):(b.Za=262143,b.Ka=253952),Ab(b));Bb(this)};function Bb(a){a.c.Sa=a.c.Sa&-8|(a.a.Da?a.a.pa&16?1:2:4)}g.hc=function(a){return this.a.C[1][a>>1&7]};g.Uc=function(a,b){this.a.C[1][b>>1&7]=a&65295};g.fc=function(a){return this.a.C[1][(a>>1&7)+8]}; -g.Sc=function(a,b){this.a.C[1][(b>>1&7)+8]=a&65295};g.gc=function(a){return this.a.R[1][a>>1&7]};g.Tc=function(a,b){b=b>>1&7;this.a.R[1][b]=a;this.a.C[1][b]&=65295};g.ec=function(a){return this.a.R[1][(a>>1&7)+8]};g.Rc=function(a,b){b=(b>>1&7)+8;this.a.R[1][b]=a;this.a.C[1][b]&=65295};g.Ob=function(a){return this.a.C[0][a>>1&7]};g.Cc=function(a,b){this.a.C[0][b>>1&7]=a&65295};g.Mb=function(a){return this.a.C[0][(a>>1&7)+8]};g.Ac=function(a,b){this.a.C[0][(b>>1&7)+8]=a&65295}; -g.Nb=function(a){return this.a.R[0][a>>1&7]};g.Bc=function(a,b){b=b>>1&7;this.a.R[0][b]=a;this.a.C[0][b]&=65295};g.Lb=function(a){return this.a.R[0][(a>>1&7)+8]};g.zc=function(a,b){b=(b>>1&7)+8;this.a.R[0][b]=a;this.a.C[0][b]&=65295};g.nc=function(a){return this.a.C[3][a>>1&7]};g.$c=function(a,b){this.a.C[3][b>>1&7]=a&65295};g.lc=function(a){return this.a.C[3][(a>>1&7)+8]};g.Yc=function(a,b){this.a.C[3][(b>>1&7)+8]=a&65295};g.mc=function(a){return this.a.R[3][a>>1&7]}; -g.Zc=function(a,b){b=b>>1&7;this.a.R[3][b]=a;this.a.C[3][b]&=65295};g.kc=function(a){return this.a.R[3][(a>>1&7)+8]};g.Xc=function(a,b){b=(b>>1&7)+8;this.a.R[3][b]=a;this.a.C[3][b]&=65295};g.wa=function(a){a&=7;return this.a.u&2048?this.a.ua[a]:this.a.f[a]};g.ya=function(a,b){b&=7;this.a.u&2048?this.a.ua[b]=a:this.a.f[b]=a};g.Zb=function(){return this.a.u&49152?this.a.aa[0]:this.a.f[6]};g.Lc=function(a){this.a.u&49152?this.a.aa[0]=a:this.a.f[6]=a};g.bc=function(){return this.a.f[7]}; -g.Oc=function(a){this.a.f[7]=a};g.xa=function(a){a&=7;return this.a.u&2048?this.a.f[a]:this.a.ua[a]};g.za=function(a,b){b&=7;this.a.u&2048?this.a.f[b]=a:this.a.ua[b]=a};g.$b=function(){return 1==(this.a.u&49152)>>14?this.a.f[6]:this.a.aa[1]};g.Mc=function(a){1==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.aa[1]=a};g.ac=function(){return 3==(this.a.u&49152)>>14?this.a.f[6]:this.a.aa[3]};g.Nc=function(a){3==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.aa[3]=a};g.Kb=function(a){return this.a.ub[a-65504>>1]}; -g.yc=function(a,b){this.a.ub[b-65504>>1]=a};g.sb=function(a){return 65520==a?61183:0};g.zb=function(){};g.jc=function(){return 1};g.Wc=function(){};g.Jb=function(){return this.a.F};g.xc=function(){this.a.F=0};g.Qb=function(){return this.a.tb};g.Ec=function(a,b){b&1||(a&=255);this.a.tb=a};g.Vb=function(a){return a?this.a.gb:0};g.Hc=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.gb=a;b.l|=2};g.ic=function(a){return a?this.a.qa&65280:0};g.Vc=function(a){this.a.qa=a|255}; -g.Yb=function(){return Za(this.a)};g.Kc=function(a){Cb(this.a,a&-1809|Za(this.a)&1808);this.a.l|=128};g.yb=function(){}; -var I={},H=(I[62592]=[null,null,G.prototype.hc,G.prototype.Uc,"SISDR",1145],I[62608]=[null,null,G.prototype.fc,G.prototype.Sc,"SDSDR",1145],I[62624]=[null,null,G.prototype.gc,G.prototype.Tc,"SISAR",1145],I[62640]=[null,null,G.prototype.ec,G.prototype.Rc,"SDSAR",1145],I[62656]=[null,null,G.prototype.Ob,G.prototype.Cc,"KISDR",1145],I[62672]=[null,null,G.prototype.Mb,G.prototype.Ac,"KDSDR",1145],I[62688]=[null,null,G.prototype.Nb,G.prototype.Bc,"KISAR",1145],I[62704]=[null,null,G.prototype.Lb,G.prototype.zc, -"KDSAR",1145],I[62798]=[null,null,G.prototype.Ub,G.prototype.Gc,"MMR3",1145],I[65382]=[null,null,G.prototype.Pb,G.prototype.Dc,"LKS"],I[65400]=[null,null,G.prototype.Ib,G.prototype.wc,"CNSL"],I[65402]=[null,null,G.prototype.Rb,G.prototype.Fc,"MMR0",1145],I[65404]=[null,null,G.prototype.Sb,G.prototype.yb,"MMR1",1145],I[65406]=[null,null,G.prototype.Tb,G.prototype.yb,"MMR2",1145],I[65408]=[null,null,G.prototype.nc,G.prototype.$c,"UISDR",1145],I[65424]=[null,null,G.prototype.lc,G.prototype.Yc,"UDSDR", -1145],I[65440]=[null,null,G.prototype.mc,G.prototype.Zc,"UISAR",1145],I[65456]=[null,null,G.prototype.kc,G.prototype.Xc,"UDSAR",1145],I[65472]=[null,null,G.prototype.wa,G.prototype.ya,"R0SET0"],I[65473]=[null,null,G.prototype.wa,G.prototype.ya,"R1SET0"],I[65474]=[null,null,G.prototype.wa,G.prototype.ya,"R2SET0"],I[65475]=[null,null,G.prototype.wa,G.prototype.ya,"R3SET0"],I[65476]=[null,null,G.prototype.wa,G.prototype.ya,"R4SET0"],I[65477]=[null,null,G.prototype.wa,G.prototype.ya,"R5SET0"],I[65478]= -[null,null,G.prototype.Zb,G.prototype.Lc,"R6KERNEL"],I[65479]=[null,null,G.prototype.bc,G.prototype.Oc,"R7KERNEL"],I[65480]=[null,null,G.prototype.xa,G.prototype.za,"R0SET1",1145],I[65481]=[null,null,G.prototype.xa,G.prototype.za,"R1SET1",1145],I[65482]=[null,null,G.prototype.xa,G.prototype.za,"R2SET1",1145],I[65483]=[null,null,G.prototype.xa,G.prototype.za,"R3SET1",1145],I[65484]=[null,null,G.prototype.xa,G.prototype.za,"R4SET1",1145],I[65485]=[null,null,G.prototype.xa,G.prototype.za,"R5SET1",1145], -I[65486]=[null,null,G.prototype.$b,G.prototype.Mc,"R6SUPER",1145],I[65487]=[null,null,G.prototype.ac,G.prototype.Nc,"R6USER",1145],I[65504]=[null,null,G.prototype.Kb,G.prototype.yc,"CTRL",1170],I[65520]=[null,null,G.prototype.sb,G.prototype.zb,"LSIZE",1170],I[65522]=[null,null,G.prototype.sb,G.prototype.zb,"HSIZE",1170],I[65524]=[null,null,G.prototype.jc,G.prototype.Wc,"SYSID",1170],I[65526]=[null,null,G.prototype.Jb,G.prototype.xc,"CPUERR",1170],I[65528]=[null,null,G.prototype.Qb,G.prototype.Ec, -"MB",1170],I[65530]=[null,null,G.prototype.Vb,G.prototype.Hc,"PIR"],I[65532]=[null,null,G.prototype.ic,G.prototype.Vc,"SL"],I[65534]=[null,null,G.prototype.Yb,G.prototype.Kc,"PSW"],I);H[62594]=H[62592];H[62596]=H[62592];H[62598]=H[62592];H[62600]=H[62592];H[62602]=H[62592];H[62604]=H[62592];H[62606]=H[62592];H[62610]=H[62608];H[62612]=H[62608];H[62614]=H[62608];H[62616]=H[62608];H[62618]=H[62608];H[62620]=H[62608];H[62622]=H[62608];H[62626]=H[62624];H[62628]=H[62624];H[62630]=H[62624];H[62632]=H[62624]; +function kb(a,b,c,d,e){for(var f=b,k=c,l=f>>>a.m;0k&&(t=k);if(!e&&n&&n.size){if(n.type==d){if(f+k<=n.Ca)return n.Ua+=n.Ca-f,n.Ca=f,!0;if(f>=n.Ca+n.Ua){t=n.size-(f-r);t>k&&(t=k);n.Ua=f-n.Ca+t;f=r+a.c;k-=t;l++;continue}}return mb(1,f,k)}f=new E(a,f,t,a.c,d,e);eb(f,a.G,n);a.b[l++]=f;f=r+a.c;k-=t}if(0>=k){c/=1024;var D;e="";D?10>>=a.m;0>>=a.m;0>>a.m].eb(b&a.g,b)}function pb(a,b){return a.b[(b&a.i)>>>a.m].T(b&a.g,b)}$a.prototype.Ta=function(a,b){this.S++;this.b[(a&this.i)>>>this.m].yb(a&this.g,b&255,a);this.S--}; +function qb(a,b,c){a.b[(b&a.i)>>>a.m].Va(b&a.g,c&65535,b)}function rb(a){for(var b=0,c=[],d=0;da.a.Ga)){var k=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,r=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&r&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(r)));sb(a,e,e,k,l,n,r,f[4])}}}function ub(a,b){a.o.push(b)}function vb(a,b){a.S||F(a.a,4,b)} +function mb(a,b,c){m("Memory block error ("+a+": "+ja(b)+","+ja(c)+")");return!1}function G(a){u.call(this,"Device",a,G);this.c={data:0,fd:0,Sa:20,uc:0};this.b={hd:0,ib:-1}}w(G);g=G.prototype;g.ea=function(a,b,c,d){this.m=b;this.a=c;this.G=d;var e=this;this.b.ib=wb(c,function(){e.b.na|=128;e.b.na&64&&(xb(e.a,e.b.vc),yb(e.a,e.b.ib,1E3/60))});this.b.vc=zb(64,6);tb(b,this,H);ub(b,this.reset.bind(this));B(this)};g.reset=function(){this.c.Sa=this.c.Sa&-120|20;this.b.na=0}; +g.Qb=function(){var a=this.b.na;this.b.na&=-129;return a};g.Ec=function(a){this.b.na=a;a&64&&yb(this.a,this.b.ib,1E3/60);this.b.na=a&-129};g.Jb=function(a){return(a?this.c.uc:this.c.data)&65535};g.xc=function(a){this.c.data=a};g.Sb=function(){var a=this.a;return a.A&62337|a.Ia<<5|a.Ja<<1};g.Gc=function(a){var b=this.a;a&=62337;if(b.A!=a){b.A=a;b.Ia=a>>5&3;b.Ja=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ea!=c&&(b.Ea=c,Ab(b))}Bb(this)}; +g.Tb=function(){var a=this.a.oa;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Ub=function(){return this.a.gb};g.Vb=function(){return this.a.pa};g.Hc=function(a){var b=this.a;1170>b.Ga&&(a&=-49);b.pa!=a&&(b.pa=a,a&16?(b.$a=4194303,b.Ka=3915776):(b.$a=262143,b.Ka=253952),Ab(b));Bb(this)};function Bb(a){a.c.Sa=a.c.Sa&-8|(a.a.Ea?a.a.pa&16?1:2:4)}g.ic=function(a){return this.a.C[1][a>>1&7]};g.Vc=function(a,b){this.a.C[1][b>>1&7]=a&65295};g.gc=function(a){return this.a.C[1][(a>>1&7)+8]}; +g.Tc=function(a,b){this.a.C[1][(b>>1&7)+8]=a&65295};g.hc=function(a){return this.a.R[1][a>>1&7]};g.Uc=function(a,b){b=b>>1&7;this.a.R[1][b]=a;this.a.C[1][b]&=65295};g.fc=function(a){return this.a.R[1][(a>>1&7)+8]};g.Sc=function(a,b){b=(b>>1&7)+8;this.a.R[1][b]=a;this.a.C[1][b]&=65295};g.Pb=function(a){return this.a.C[0][a>>1&7]};g.Dc=function(a,b){this.a.C[0][b>>1&7]=a&65295};g.Nb=function(a){return this.a.C[0][(a>>1&7)+8]};g.Bc=function(a,b){this.a.C[0][(b>>1&7)+8]=a&65295}; +g.Ob=function(a){return this.a.R[0][a>>1&7]};g.Cc=function(a,b){b=b>>1&7;this.a.R[0][b]=a;this.a.C[0][b]&=65295};g.Mb=function(a){return this.a.R[0][(a>>1&7)+8]};g.Ac=function(a,b){b=(b>>1&7)+8;this.a.R[0][b]=a;this.a.C[0][b]&=65295};g.oc=function(a){return this.a.C[3][a>>1&7]};g.ad=function(a,b){this.a.C[3][b>>1&7]=a&65295};g.mc=function(a){return this.a.C[3][(a>>1&7)+8]};g.Zc=function(a,b){this.a.C[3][(b>>1&7)+8]=a&65295};g.nc=function(a){return this.a.R[3][a>>1&7]}; +g.$c=function(a,b){b=b>>1&7;this.a.R[3][b]=a;this.a.C[3][b]&=65295};g.lc=function(a){return this.a.R[3][(a>>1&7)+8]};g.Yc=function(a,b){b=(b>>1&7)+8;this.a.R[3][b]=a;this.a.C[3][b]&=65295};g.wa=function(a){a&=7;return this.a.w&2048?this.a.ua[a]:this.a.f[a]};g.ya=function(a,b){b&=7;this.a.w&2048?this.a.ua[b]=a:this.a.f[b]=a};g.$b=function(){return this.a.w&49152?this.a.aa[0]:this.a.f[6]};g.Mc=function(a){this.a.w&49152?this.a.aa[0]=a:this.a.f[6]=a};g.cc=function(){return this.a.f[7]}; +g.Pc=function(a){this.a.f[7]=a};g.xa=function(a){a&=7;return this.a.w&2048?this.a.f[a]:this.a.ua[a]};g.za=function(a,b){b&=7;this.a.w&2048?this.a.f[b]=a:this.a.ua[b]=a};g.ac=function(){return 1==(this.a.w&49152)>>14?this.a.f[6]:this.a.aa[1]};g.Nc=function(a){1==(this.a.w&49152)>>14?this.a.f[6]=a:this.a.aa[1]=a};g.bc=function(){return 3==(this.a.w&49152)>>14?this.a.f[6]:this.a.aa[3]};g.Oc=function(a){3==(this.a.w&49152)>>14?this.a.f[6]=a:this.a.aa[3]=a};g.Lb=function(a){return this.a.vb[a-65504>>1]}; +g.zc=function(a,b){this.a.vb[b-65504>>1]=a};g.tb=function(a){return 65520==a?61183:0};g.Ab=function(){};g.kc=function(){return 1};g.Xc=function(){};g.Kb=function(){return this.a.F};g.yc=function(){this.a.F=0};g.Rb=function(){return this.a.ub};g.Fc=function(a,b){b&1||(a&=255);this.a.ub=a};g.Wb=function(a){return a?this.a.hb:0};g.Ic=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.hb=a;b.l|=2};g.jc=function(a){return a?this.a.qa&65280:0};g.Wc=function(a){this.a.qa=a|255}; +g.Zb=function(){return Za(this.a)};g.Lc=function(a){Cb(this.a,a&-1809|Za(this.a)&1808);this.a.l|=128};g.zb=function(){}; +var I={},H=(I[62592]=[null,null,G.prototype.ic,G.prototype.Vc,"SISDR",1145],I[62608]=[null,null,G.prototype.gc,G.prototype.Tc,"SDSDR",1145],I[62624]=[null,null,G.prototype.hc,G.prototype.Uc,"SISAR",1145],I[62640]=[null,null,G.prototype.fc,G.prototype.Sc,"SDSAR",1145],I[62656]=[null,null,G.prototype.Pb,G.prototype.Dc,"KISDR",1145],I[62672]=[null,null,G.prototype.Nb,G.prototype.Bc,"KDSDR",1145],I[62688]=[null,null,G.prototype.Ob,G.prototype.Cc,"KISAR",1145],I[62704]=[null,null,G.prototype.Mb,G.prototype.Ac, +"KDSAR",1145],I[62798]=[null,null,G.prototype.Vb,G.prototype.Hc,"MMR3",1145],I[65382]=[null,null,G.prototype.Qb,G.prototype.Ec,"LKS"],I[65400]=[null,null,G.prototype.Jb,G.prototype.xc,"CNSL"],I[65402]=[null,null,G.prototype.Sb,G.prototype.Gc,"MMR0",1145],I[65404]=[null,null,G.prototype.Tb,G.prototype.zb,"MMR1",1145],I[65406]=[null,null,G.prototype.Ub,G.prototype.zb,"MMR2",1145],I[65408]=[null,null,G.prototype.oc,G.prototype.ad,"UISDR",1145],I[65424]=[null,null,G.prototype.mc,G.prototype.Zc,"UDSDR", +1145],I[65440]=[null,null,G.prototype.nc,G.prototype.$c,"UISAR",1145],I[65456]=[null,null,G.prototype.lc,G.prototype.Yc,"UDSAR",1145],I[65472]=[null,null,G.prototype.wa,G.prototype.ya,"R0SET0"],I[65473]=[null,null,G.prototype.wa,G.prototype.ya,"R1SET0"],I[65474]=[null,null,G.prototype.wa,G.prototype.ya,"R2SET0"],I[65475]=[null,null,G.prototype.wa,G.prototype.ya,"R3SET0"],I[65476]=[null,null,G.prototype.wa,G.prototype.ya,"R4SET0"],I[65477]=[null,null,G.prototype.wa,G.prototype.ya,"R5SET0"],I[65478]= +[null,null,G.prototype.$b,G.prototype.Mc,"R6KERNEL"],I[65479]=[null,null,G.prototype.cc,G.prototype.Pc,"R7KERNEL"],I[65480]=[null,null,G.prototype.xa,G.prototype.za,"R0SET1",1145],I[65481]=[null,null,G.prototype.xa,G.prototype.za,"R1SET1",1145],I[65482]=[null,null,G.prototype.xa,G.prototype.za,"R2SET1",1145],I[65483]=[null,null,G.prototype.xa,G.prototype.za,"R3SET1",1145],I[65484]=[null,null,G.prototype.xa,G.prototype.za,"R4SET1",1145],I[65485]=[null,null,G.prototype.xa,G.prototype.za,"R5SET1",1145], +I[65486]=[null,null,G.prototype.ac,G.prototype.Nc,"R6SUPER",1145],I[65487]=[null,null,G.prototype.bc,G.prototype.Oc,"R6USER",1145],I[65504]=[null,null,G.prototype.Lb,G.prototype.zc,"CTRL",1170],I[65520]=[null,null,G.prototype.tb,G.prototype.Ab,"LSIZE",1170],I[65522]=[null,null,G.prototype.tb,G.prototype.Ab,"HSIZE",1170],I[65524]=[null,null,G.prototype.kc,G.prototype.Xc,"SYSID",1170],I[65526]=[null,null,G.prototype.Kb,G.prototype.yc,"CPUERR",1170],I[65528]=[null,null,G.prototype.Rb,G.prototype.Fc, +"MB",1170],I[65530]=[null,null,G.prototype.Wb,G.prototype.Ic,"PIR"],I[65532]=[null,null,G.prototype.jc,G.prototype.Wc,"SL"],I[65534]=[null,null,G.prototype.Zb,G.prototype.Lc,"PSW"],I);H[62594]=H[62592];H[62596]=H[62592];H[62598]=H[62592];H[62600]=H[62592];H[62602]=H[62592];H[62604]=H[62592];H[62606]=H[62592];H[62610]=H[62608];H[62612]=H[62608];H[62614]=H[62608];H[62616]=H[62608];H[62618]=H[62608];H[62620]=H[62608];H[62622]=H[62608];H[62626]=H[62624];H[62628]=H[62624];H[62630]=H[62624];H[62632]=H[62624]; H[62634]=H[62624];H[62636]=H[62624];H[62638]=H[62624];H[62642]=H[62640];H[62644]=H[62640];H[62646]=H[62640];H[62648]=H[62640];H[62650]=H[62640];H[62652]=H[62640];H[62654]=H[62640];H[62658]=H[62656];H[62660]=H[62656];H[62662]=H[62656];H[62664]=H[62656];H[62666]=H[62656];H[62668]=H[62656];H[62670]=H[62656];H[62674]=H[62672];H[62676]=H[62672];H[62678]=H[62672];H[62680]=H[62672];H[62682]=H[62672];H[62684]=H[62672];H[62686]=H[62672];H[62690]=H[62688];H[62692]=H[62688];H[62694]=H[62688];H[62696]=H[62688]; H[62698]=H[62688];H[62700]=H[62688];H[62702]=H[62688];H[62706]=H[62704];H[62708]=H[62704];H[62710]=H[62704];H[62712]=H[62704];H[62714]=H[62704];H[62716]=H[62704];H[62718]=H[62704];H[65410]=H[65408];H[65412]=H[65408];H[65414]=H[65408];H[65416]=H[65408];H[65418]=H[65408];H[65420]=H[65408];H[65422]=H[65408];H[65426]=H[65424];H[65428]=H[65424];H[65430]=H[65424];H[65432]=H[65424];H[65434]=H[65424];H[65436]=H[65424];H[65438]=H[65424];H[65442]=H[65440];H[65444]=H[65440];H[65446]=H[65440];H[65448]=H[65440]; H[65450]=H[65440];H[65452]=H[65440];H[65454]=H[65440];H[65458]=H[65456];H[65460]=H[65456];H[65462]=H[65456];H[65464]=H[65456];H[65466]=H[65456];H[65468]=H[65456];H[65470]=H[65456];H[65506]=H[65504];H[65508]=H[65504];H[65510]=H[65504];H[65512]=H[65504];H[65514]=H[65504];H[65516]=H[65504];H[65518]=H[65504];q(function(){for(var a=A(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,d>>2),Jb(this,Fb?Kb:Lb);else{this.a=Array(d>>2);for(a=0;a>1),this.a=new Int32Array(this.b,0,d>>2),Jb(this,Fb?Kb:Lb);else{this.a=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ba:function(a,b){a&1&&vb(this.m,b);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ha:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.la=!0},H:function(a,b){return this.I(a,b)}, -S:function(a,b){return this.W(a,b)},da:function(a,b,c){this.v||this.xb(a,b,c)},ja:function(a,b,c){this.v||this.ra(a,b,c)},D:function(a){return this.c[a]},J:function(a){return this.c[a]},O:function(a,b){a&1&&vb(this.m,b);return this.g.getUint16(a,!0)},X:function(a,b){a&1&&vb(this.m,b);return this.o[a>>1]},ca:function(a,b){this.c[a]=b;this.la=!0},ga:function(a,b){this.c[a]=b;this.la=!0},ia:function(a,b,c){a&1&&vb(this.m,c);this.g.setUint16(a,b,!0);this.la=!0},sa:function(a,b,c){a&1&&vb(this.m,c);this.o[a>> -1]=b;this.la=!0}};function eb(a,b,c){a.G=b;a.h=a.j=0;c&&((a.h=c.h)&&Nb(a,Ob,!1),(a.j=c.j)&&Pb(a,Ob,!1))}function Pb(a,b,c){c&&a.j||(a.ib=!a.v&&b[1]||a.A,a.Va=!a.v&&b[3]||a.B);if(c||void 0===c)a.xb=b[1]||a.A,a.ra=b[3]||a.B}function Nb(a,b,c){c&&a.h||(a.cb=b[0]||a.w,a.T=b[2]||a.s);if(c||void 0===c)a.I=b[0]||a.w,a.W=b[2]||a.s}function Jb(a,b){b||(b=Qb);Nb(a,b,void 0);Pb(a,b,void 0)} -var Qb=[],Mb=[E.prototype.N,E.prototype.ha,E.prototype.ba,E.prototype.ta],Ob=[E.prototype.H,E.prototype.da,E.prototype.S,E.prototype.ja];if(Ta)var Lb=[E.prototype.D,E.prototype.ca,E.prototype.O,E.prototype.ia],Kb=[E.prototype.J,E.prototype.ga,E.prototype.X,E.prototype.sa]; -function Rb(a,b){u.call(this,"CPU",a,Rb);var c=a.multiplier||1;this.Pa=a.cycles||b;this.da=c;this.Ya=Math.round(this.Pa/1E4)/100;this.ga=this.Ya*this.da;this.i.U=!1;this.i.vb=!1;this.i.Ca=a.autoStart;this.i.Oa=!1;this.Ma=this.ia=0;this.Na=a.csStart;this.ra=a.csInterval;this.sa=a.csStop;this.H=[];this.rb=this.sc.bind(this);B(this)}w(Rb);var Sb=["power","reset"];g=Rb.prototype; -g.ea=function(a,b,c,d){this.w=a;this.m=b;this.G=d;for(b=0;ba.ba/a.ga&&(b=1),a.da=b,b=a.Ya*a.da,a.ga!=b)){a.ga=b;b=a.ga.toFixed(2)+"Mhz";var c=a.v.setSpeed;c&&(c.textContent=b);a.P("target speed: "+b)}a.J+=a.W;a.W=0;a.O=sa();a.ca=0;Yb(a)}function wb(a,b){var c=a.H.length;a.H.push([-1,b]);return c}function yb(a,b,c){0<=b&&ba.H[b][0]&&(c=a.Pa*a.da/1E3*c|0,a.H[b][0]=c+$b(a))}function $b(a,b){var c=a.ha-=a.a;a.a=0;b&&(a.ha=0);return c} -g.sc=function(){if(this.i.U){this.$a>=this.Pa&&Yb(this,!0);this.Aa=0;this.La=sa();if(this.ca){var a=this.La-this.ca;a>this.pb&&(this.O+=a,this.O>this.La&&(this.O=this.La))}try{do{for(var b,c=this.i.Oa?1:this.Qa,d=this.H.length-1;0<=d;d--){var e=this.H[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.wb(b)}catch(n){if("number"!=typeof n)throw n;}b=$b(this,!0);this.Aa+=b;this.W+=b;a=b;if(this.i.Oa){var f=!1;this.Ma=this.Ma+this.lb()|0;this.ia-=a;0>=this.ia&&(this.ia+=this.ra,f=!0);0<=this.sa&&this.sa<=Zb(this)&& -(this.ra=this.sa=-1,Vb(this),Xa(this),f=!0);f&&this.P(Zb(this)+" cycles: checksum="+ja(this.Ma))}for(var a=b,k=this.H.length-1;0<=k;k--){var l=this.H[k];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.ta-=b;if(0>=this.ta){this.ta+=this.Qa;15<=++this.qb&&(this.w&&this.w.fa(),this.qb=0);break}}while(this.i.U)}catch(n){Xa(this);this.w&&this.w.stop(sa(),Zb(this));b=n.stack||n.message;this.i.error=!0;this.L(b);return}if(this.i.U){b=setTimeout;c=this.rb;this.ca=sa();d=this.pb;this.Aa&&(d=Math.round(d* -this.Aa/this.Qa));d-=this.ca-this.La;if(e=this.ca-this.O)this.ba=Math.round(this.W/(10*e))/100,864E5<=e&&(this.J=0,Xb(this));if(0>d||this.bad&&(this.O-=d),d=0;this.$a+=this.Aa;this.ca+=d;b(c,d)}}};function Wb(a){var b;a.i.error?(a.P(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.i.U)a.P(a.toString()+" busy");else{Xb(a);a.i.U=!0;a.i.vb=!0;if(b=a.v.run)b.textContent="Halt";a.w&&a.w.start(a.O,Zb(a));setTimeout(a.rb,0)}}g.wb=function(){return 0}; -function Xa(a){if(a.i.U){$b(a);a.J+=a.W;a.W=0;a.i.U=!1;var b=a.v.run;b&&(b.textContent="Run");a.w&&a.w.stop(sa(),Zb(a))}a.i.complete=void 0}function ac(a){this.Fa=+a.model||1170;this.nb=a.addrReset||0;Rb.call(this,a,6666667);this.decode=1120==this.Fa?bc.bind(this):cc.bind(this);dc(this);this.S=0;this.X=null;this.i.complete=this.i.Bb=!1}w(ac,Rb);g=ac.prototype;g.reset=function(){this.status("model "+this.Fa);this.i.U&&Xa(this);dc(this);Ub(this);this.i.error=!1;this.parent.reset.call(this)}; -function dc(a){a.j=65536;a.g=32768;a.h=65535;a.o=32768;a.u=15;a.f=[0,0,0,0,0,0,0,a.nb];a.ua=[0,0,0,0,0,0];a.aa=[0,0,0,0];a.s=0;a.Ja=0;a.Fb=[4,2,0,1];a.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.R=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Hb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.ub=[0,0,0,0,0,0,0,0];a.tb=0;a.l=0;a.B=a.D=0;a.c=a.b=a.Xa=0;a.ja=-1;ec(a)}function ec(a){a.qa=255;a.F=0;a.gb=0;a.A=0;a.oa=0;a.fb=0;a.pa=0;a.Da=0;a.Ia=0;a.Za=262143;a.Ka=253952;a.l|=2;a.m&&Ab(a)}function Ab(a){a.Da?(a.N=65536,a.I=a.Eb,a.T=a.pc,a.Va=a.bd,hb(a.m,a.pa&16?22:18)):(a.N=0,a.I=a.Db,a.T=a.oc,a.Va=a.ad,hb(a.m,16))}g.lb=function(){return 0}; -g.save=function(){var a=new K(this);a.set(0,[]);a.set(1,[this.J,this.da]);a.set(2,rb(this.m));return a.data()};g.restore=function(a){var b=a[1];this.J=b[1];Xb(this,b[3]);a:{b=this.m;a=a[2];var c;for(c=0;c>14&3;c=a.u>>14&3;a.s!=c&&(a.aa[c]=a.f[6],a.f[6]=a.aa[a.s]);a.u=b;a.l|=2}function N(a,b){a.l&128||(a.o=a.h=b,a.g=0)}function O(a,b,c){a.l&128||(a.o=a.h=a.j=b,a.g=c||0)}function gc(a,b,c,d){a.l&128||(a.o=a.h=a.j=b,a.g=(c^b)&(d^b))}function P(a,b){a.l&128||(a.o=a.h=a.j=b,a.g=a.o^a.j>>1)}function hc(a,b,c,d){a.l&128||(a.o=a.h=a.j=b,a.g=(c^d)&(d^b))} -function F(a,b,c){if(!a.S){var d=!1;0>a.ja?a.ja=Za(a):a.s||(b=4,d=!0);a.A&57344||(a.oa=63222,a.fb=b);a.s=0;var e=a.T(b|a.N),f=a.T(b+2&65535|a.N);Cb(a,f&-12289|a.ja>>2&12288);d&&(a.F|=4,a.f[6]=4);ic(a,a.ja);ic(a,a.f[7]);M(a,e);a.l&=-113;a.ja=-1;if(26!=c)throw b;}}function jc(a){var b=kc(a),c=kc(a)&-1793;a.u&49152&&(c=c&-225|a.u&63712);M(a,b);Cb(a,c);a.l&=-17} -function lc(a,b,c){var d,e,f,k=0;d=b>>13;a.pa&a.Fb[a.s]||(d&=7);e=a.C[a.s][d];f=(a.R[a.s][d]<<6)+(b&8191)&a.Za;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.pa&32&&(f=a.Hb[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ka&&4186112>f&&(a.F|=32,F(a,4,12))}switch(e&7){case 1:k=4096;case 2:e|=128;c&4&&(k=8192);break;case 4:k=4096;case 5:c&4&&(k=4096);case 6:e|=c&4?192: -128;break;default:k=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(k|=16384):(b&8128)>(e>>2&8128)&&(k|=16384));a.C[a.s][d]=e;if(4194170!==f||a.s)a.Ia=a.s,a.Ja=d;k&&(k&57344&&(0<=a.ja&&(k|=128),a.A&57344||(a.A=a.A|k|a.Ia<<5|a.Ja<<1),F(a,168,16)),a.A&61440||!(4191360>f||4194239>>a.m].ib(b&a.g,c&255,b)}function kc(a){var b=a.T(a.f[6]|a.N);a.f[6]=a.f[6]+2&65535;return b} -function ic(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A&57344||(a.oa=a.oa<<8|246);!a.s&&c<=a.qa&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=k);e=a.T(e);e|=k;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=k);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=k);e=a.T(e)|k;a.a-= -8;break;case 6:return e=fc(a),e=e+a.f[c]&65535|k,a.a-=6,e;case 7:return e=fc(a),e=e+a.f[c]&65535,e=a.T(e|a.N)|k,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!k||a.A&57344||(a.oa=a.oa<<8|f<<3&248|c);6==c&&!a.s&&d&4&&0>=f&&(a.f[6]<=a.qa||65534<=a.f[6])&&(a.f[6]<=a.qa-32?(a.F|=4,a.f[6]=4,F(a,4,24)):(a.F|=8,a.l|=64));return e}g.Ta=function(a,b){this.Da?(this.S++,mc(this,lc(this,a,5),b),this.S--):this.m.Ta(a,b)};g.Db=function(a,b,c){return nc(this,a,b,c)};g.Eb=function(a,b,c){return lc(this,nc(this,a,b,c),c)}; -g.oc=function(a){return pb(this.m,a)};g.pc=function(a){return pb(this.m,lc(this,a,2))};g.ad=function(a,b){qb(this.m,a,b&65535)};g.bd=function(a,b){qb(this.m,lc(this,a,4),b)};function oc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=nc(a,b,d,2),c&65536||61440!==(a.u&61440)&&(d&=65535),a.s=a.u>>12&3,c=a.T(d|c&a.N),a.s=a.u>>14&3):c=6!=d||(a.u>>2&12288)===(a.u&12288)?a.f[d]:a.aa[a.u>>12&3];return c} -function pc(a,b,c,d){a.A&57344||(a.oa=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=nc(a,b,e,4),c&65536||(e&=65535),a.s=a.u>>12&3,e=lc(a,e|c&65536,4),a.s=a.u>>14&3,qb(a.m,e,d)):6!=e||(a.u>>2&12288)===(a.u&12288)?a.f[e]=d:a.aa[a.u>>12&3]=d}function qc(a,b){b>>=6;var c=a.D=b&7;(b=a.B=(b&56)>>3)?(c=a.I(b,c,3),a=ob(a.m,c)):a=a.f[c]&255;return a}function Q(a,b){b>>=6;var c=a.D=b&7;return(b=a.B=(b&56)>>3)?pb(a.m,a.I(b,c,2)):a.f[c]}function rc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return nc(a,b,c,8)} -function sc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.I(b,c,3),a=ob(a.m,c)):a=a.f[c]&255;return a}function tc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?pb(a.m,a.I(b,c,2)):a.f[c]}function R(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Xa=a.I(b,e,7),mc(a,e,d.call(a,c,ob(a.m,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.I(b,e,6),qb(a.m,e,d.call(a,c,pb(a.m,e)))):a.f[e]=d.call(a,c,a.f[e])} -function uc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?mc(a,a.I(b,e,5),c):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function vc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?qb(a.m,a.I(b,d,4),c):a.f[d]=c&65535;return c}function T(a,b,c){c&&(M(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3} -g.wb=function(a){this.i.complete=!0;this.i.Bb=!1;this.i.vb=!1;this.ha=this.a=a;do{if(this.l&&(this.l&112&&(this.l&32?F(this,168,28):this.l&64?F(this,4,30):this.l&16&&F(this,12,32),this.l&=-113),this.l&7))if(this.l&2){this.l&=-3;var b=160,c=(this.gb&224)>>5;if(a=this.X&&this.X.va>c?this.X:null)b=a.vc,c=a.va;c>(this.u&224)>>5?(this.l&4&&(this.f[7]=this.f[7]+2&65535,this.l&=-5),F(this,b,26),c=!0):c=!1;if(c&&a)if(c=this.X,c==a)this.X=a.next;else for(;c;){b=c.next;if(b==a){c.next=b.next;break}c=b}}else this.l& -1&&this.l++;this.A&57344||(this.oa=0,this.fb=this.f[7]);this.l=this.l&7|this.u&16;this.decode(fc(this))}while(0>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ba:function(a,b){a&1&&vb(this.m,b);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ha:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.la=!0},I:function(a,b){return this.J(a,b)}, +S:function(a,b){return this.W(a,b)},da:function(a,b,c){this.g||this.yb(a,b,c)},ja:function(a,b,c){this.g||this.ra(a,b,c)},D:function(a){return this.c[a]},K:function(a){return this.c[a]},O:function(a,b){a&1&&vb(this.m,b);return this.s.getUint16(a,!0)},X:function(a,b){a&1&&vb(this.m,b);return this.o[a>>1]},ca:function(a,b){this.c[a]=b;this.la=!0},ga:function(a,b){this.c[a]=b;this.la=!0},ia:function(a,b,c){a&1&&vb(this.m,c);this.s.setUint16(a,b,!0);this.la=!0},sa:function(a,b,c){a&1&&vb(this.m,c);this.o[a>> +1]=b;this.la=!0}};function eb(a,b,c){a.G=b;a.i=a.j=0;c&&((a.i=c.i)&&Nb(a,Ob,!1),(a.j=c.j)&&Pb(a,Ob,!1))}function Pb(a,b,c){c&&a.j||(a.jb=!a.g&&b[1]||a.A,a.Va=!a.g&&b[3]||a.B);if(c||void 0===c)a.yb=b[1]||a.A,a.ra=b[3]||a.B}function Nb(a,b,c){c&&a.i||(a.eb=b[0]||a.v,a.T=b[2]||a.u);if(c||void 0===c)a.J=b[0]||a.v,a.W=b[2]||a.u}function Jb(a,b){b||(b=Qb);Nb(a,b,void 0);Pb(a,b,void 0)} +var Qb=[],Mb=[E.prototype.N,E.prototype.ha,E.prototype.ba,E.prototype.ta],Ob=[E.prototype.I,E.prototype.da,E.prototype.S,E.prototype.ja];if(Ta)var Lb=[E.prototype.D,E.prototype.ca,E.prototype.O,E.prototype.ia],Kb=[E.prototype.K,E.prototype.ga,E.prototype.X,E.prototype.sa]; +function Rb(a,b){u.call(this,"CPU",a,Rb);var c=a.multiplier||1;this.Pa=a.cycles||b;this.da=c;this.Za=Math.round(this.Pa/1E4)/100;this.ga=this.Za*this.da;this.h.U=!1;this.h.wb=!1;this.h.Da=a.autoStart;this.h.Oa=!1;this.Ma=this.ia=0;this.Na=a.csStart;this.sa=a.csInterval;this.ta=a.csStop;this.I=[];this.sb=this.tc.bind(this);B(this)}w(Rb);var Sb=["power","reset"];g=Rb.prototype; +g.ea=function(a,b,c,d){this.v=a;this.m=b;this.G=d;for(b=0;ba.ba/a.ga&&(b=1),a.da=b,b=a.Za*a.da,a.ga!=b)){a.ga=b;b=a.ga.toFixed(2)+"Mhz";var c=a.s.setSpeed;c&&(c.textContent=b);a.P("target speed: "+b)}a.K+=a.W;a.W=0;a.O=sa();a.ca=0;Yb(a)}function wb(a,b){var c=a.I.length;a.I.push([-1,b]);return c}function yb(a,b,c){0<=b&&ba.I[b][0]&&(c=a.Pa*a.da/1E3*c|0,a.I[b][0]=c+$b(a))}function $b(a,b){var c=a.ha-=a.a;a.a=0;b&&(a.ha=0);return c} +g.tc=function(){if(this.h.U){this.ab>=this.Pa&&Yb(this,!0);this.Ba=0;this.La=sa();if(this.ca){var a=this.La-this.ca;a>this.qb&&(this.O+=a,this.O>this.La&&(this.O=this.La))}try{do{for(var b,c=this.h.Oa?1:this.Qa,d=this.I.length-1;0<=d;d--){var e=this.I[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.xb(b)}catch(n){if("number"!=typeof n)throw n;}b=$b(this,!0);this.Ba+=b;this.W+=b;a=b;if(this.h.Oa){var f=!1;this.Ma=this.Ma+this.mb()|0;this.ia-=a;0>=this.ia&&(this.ia+=this.sa,f=!0);0<=this.ta&&this.ta<=Zb(this)&& +(this.sa=this.ta=-1,Vb(this),Xa(this),f=!0);f&&this.P(Zb(this)+" cycles: checksum="+ja(this.Ma))}for(var a=b,k=this.I.length-1;0<=k;k--){var l=this.I[k];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.Aa-=b;if(0>=this.Aa){this.Aa+=this.Qa;15<=++this.rb&&(this.v&&this.v.fa(),this.rb=0);break}}while(this.h.U)}catch(n){Xa(this);this.v&&this.v.stop(sa(),Zb(this));b=n.stack||n.message;this.h.error=!0;this.H(b);return}if(this.h.U){b=setTimeout;c=this.sb;this.ca=sa();d=this.qb;this.Ba&&(d=Math.round(d* +this.Ba/this.Qa));d-=this.ca-this.La;if(e=this.ca-this.O)this.ba=Math.round(this.W/(10*e))/100,864E5<=e&&(this.K=0,Xb(this));if(0>d||this.bad&&(this.O-=d),d=0;this.ab+=this.Ba;this.ca+=d;b(c,d)}}};function Wb(a){var b;a.h.error?(a.P(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.h.U)a.P(a.toString()+" busy");else{Xb(a);a.h.U=!0;a.h.wb=!0;if(b=a.s.run)b.textContent="Halt";a.v&&a.v.start(a.O,Zb(a));setTimeout(a.sb,0)}}g.xb=function(){return 0}; +function Xa(a){if(a.h.U){$b(a);a.K+=a.W;a.W=0;a.h.U=!1;var b=a.s.run;b&&(b.textContent="Run");a.v&&a.v.stop(sa(),Zb(a))}a.h.complete=void 0}function ac(a){this.Ga=+a.model||1170;this.ob=a.addrReset||0;Rb.call(this,a,6666667);this.decode=1120==this.Ga?bc.bind(this):cc.bind(this);dc(this);this.S=0;this.X=null;this.h.complete=this.h.Cb=!1}w(ac,Rb);g=ac.prototype;g.reset=function(){this.status("model "+this.Ga);this.h.U&&Xa(this);dc(this);Ub(this);this.h.error=!1;this.parent.reset.call(this)}; +function dc(a){a.j=65536;a.g=32768;a.i=65535;a.o=32768;a.w=15;a.f=[0,0,0,0,0,0,0,a.ob];a.ua=[0,0,0,0,0,0];a.aa=[0,0,0,0];a.u=0;a.Ja=0;a.Gb=[4,2,0,1];a.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.R=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Ib=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.vb=[0,0,0,0,0,0,0,0];a.ub=0;a.l=0;a.B=a.D=0;a.c=a.b=a.Ya=0;a.ja=-1;ec(a)}function ec(a){a.qa=255;a.F=0;a.hb=0;a.A=0;a.oa=0;a.gb=0;a.pa=0;a.Ea=0;a.Ia=0;a.$a=262143;a.Ka=253952;a.l|=2;a.m&&Ab(a)}function Ab(a){a.Ea?(a.N=65536,a.J=a.Fb,a.T=a.qc,a.Va=a.cd,hb(a.m,a.pa&16?22:18)):(a.N=0,a.J=a.Eb,a.T=a.pc,a.Va=a.bd,hb(a.m,16))}g.mb=function(){return 0}; +g.save=function(){var a=new K(this);a.set(0,[]);a.set(1,[this.K,this.da]);a.set(2,rb(this.m));return a.data()};g.restore=function(a){var b=a[1];this.K=b[1];Xb(this,b[3]);a:{b=this.m;a=a[2];var c;for(c=0;c>14&3;c=a.w>>14&3;a.u!=c&&(a.aa[c]=a.f[6],a.f[6]=a.aa[a.u]);a.w=b;a.l|=2}function N(a,b){a.l&128||(a.o=a.i=b,a.g=0)}function O(a,b,c){a.l&128||(a.o=a.i=a.j=b,a.g=c||0)}function gc(a,b,c,d){a.l&128||(a.o=a.i=a.j=b,a.g=(c^b)&(d^b))}function P(a,b){a.l&128||(a.o=a.i=a.j=b,a.g=a.o^a.j>>1)}function hc(a,b,c,d){a.l&128||(a.o=a.i=a.j=b,a.g=(c^d)&(d^b))} +function F(a,b,c){if(!a.S){var d=!1;0>a.ja?a.ja=Za(a):a.u||(b=4,d=!0);a.A&57344||(a.oa=63222,a.gb=b);a.u=0;var e=a.T(b|a.N),f=a.T(b+2&65535|a.N);Cb(a,f&-12289|a.ja>>2&12288);d&&(a.F|=4,a.f[6]=4);ic(a,a.ja);ic(a,a.f[7]);M(a,e);a.l&=-113;a.ja=-1;if(26!=c)throw b;}}function jc(a){var b=kc(a),c=kc(a)&-1793;a.w&49152&&(c=c&-225|a.w&63712);M(a,b);Cb(a,c);a.l&=-17} +function lc(a,b,c){var d,e,f,k=0;d=b>>13;a.pa&a.Gb[a.u]||(d&=7);e=a.C[a.u][d];f=(a.R[a.u][d]<<6)+(b&8191)&a.$a;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.pa&32&&(f=a.Ib[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ka&&4186112>f&&(a.F|=32,F(a,4,12))}switch(e&7){case 1:k=4096;case 2:e|=128;c&4&&(k=8192);break;case 4:k=4096;case 5:c&4&&(k=4096);case 6:e|=c&4?192: +128;break;default:k=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(k|=16384):(b&8128)>(e>>2&8128)&&(k|=16384));a.C[a.u][d]=e;if(4194170!==f||a.u)a.Ia=a.u,a.Ja=d;k&&(k&57344&&(0<=a.ja&&(k|=128),a.A&57344||(a.A=a.A|k|a.Ia<<5|a.Ja<<1),F(a,168,16)),a.A&61440||!(4191360>f||4194239>>a.m].jb(b&a.g,c&255,b)}function kc(a){var b=a.T(a.f[6]|a.N);a.f[6]=a.f[6]+2&65535;return b} +function ic(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A&57344||(a.oa=a.oa<<8|246);!a.u&&c<=a.qa&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=k);e=a.T(e);e|=k;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=k);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=k);e=a.T(e)|k;a.a-= +8;break;case 6:return e=fc(a),e=e+a.f[c]&65535|k,a.a-=6,e;case 7:return e=fc(a),e=e+a.f[c]&65535,e=a.T(e|a.N)|k,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!k||a.A&57344||(a.oa=a.oa<<8|f<<3&248|c);6==c&&!a.u&&d&4&&0>=f&&(a.f[6]<=a.qa||65534<=a.f[6])&&(a.f[6]<=a.qa-32?(a.F|=4,a.f[6]=4,F(a,4,24)):(a.F|=8,a.l|=64));return e}g.Ta=function(a,b){this.Ea?(this.S++,mc(this,lc(this,a,5),b),this.S--):this.m.Ta(a,b)};g.Eb=function(a,b,c){return nc(this,a,b,c)};g.Fb=function(a,b,c){return lc(this,nc(this,a,b,c),c)}; +g.pc=function(a){return pb(this.m,a)};g.qc=function(a){return pb(this.m,lc(this,a,2))};g.bd=function(a,b){qb(this.m,a,b&65535)};g.cd=function(a,b){qb(this.m,lc(this,a,4),b)};function oc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=nc(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.u=a.w>>12&3,c=a.T(d|c&a.N),a.u=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.f[d]:a.aa[a.w>>12&3];return c} +function pc(a,b,c,d){a.A&57344||(a.oa=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=nc(a,b,e,4),c&65536||(e&=65535),a.u=a.w>>12&3,e=lc(a,e|c&65536,4),a.u=a.w>>14&3,qb(a.m,e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.f[e]=d:a.aa[a.w>>12&3]=d}function qc(a,b){b>>=6;var c=a.D=b&7;(b=a.B=(b&56)>>3)?(c=a.J(b,c,3),a=ob(a.m,c)):a=a.f[c]&255;return a}function Q(a,b){b>>=6;var c=a.D=b&7;return(b=a.B=(b&56)>>3)?pb(a.m,a.J(b,c,2)):a.f[c]}function rc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return nc(a,b,c,8)} +function sc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.J(b,c,3),a=ob(a.m,c)):a=a.f[c]&255;return a}function tc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?pb(a.m,a.J(b,c,2)):a.f[c]}function R(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Ya=a.J(b,e,7),mc(a,e,d.call(a,c,ob(a.m,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.J(b,e,6),qb(a.m,e,d.call(a,c,pb(a.m,e)))):a.f[e]=d.call(a,c,a.f[e])} +function uc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?mc(a,a.J(b,e,5),c):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function vc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?qb(a.m,a.J(b,d,4),c):a.f[d]=c&65535;return c}function T(a,b,c){c&&(M(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3} +g.xb=function(a){this.h.complete=!0;this.h.Cb=!1;this.h.wb=!1;this.ha=this.a=a;do{if(this.l&&(this.l&112&&(this.l&32?F(this,168,28):this.l&64?F(this,4,30):this.l&16&&F(this,12,32),this.l&=-113),this.l&7))if(this.l&2){this.l&=-3;var b=160,c=(this.hb&224)>>5;if(a=this.X&&this.X.va>c?this.X:null)b=a.wc,c=a.va;c>(this.w&224)>>5?(this.l&4&&(this.f[7]=this.f[7]+2&65535,this.l&=-5),F(this,b,26),c=!0):c=!1;if(c&&a)if(c=this.X,c==a)this.X=a.next;else for(;c;){b=c.next;if(b==a){c.next=b.next;break}c=b}}else this.l& +1&&this.l++;this.A&57344||(this.oa=0,this.gb=this.f[7]);this.l=this.l&7|this.w&16;this.decode(fc(this))}while(0>1|b<<16;P(this,a);return a&65535}function Bc(a,b){a=b&2048|b>>1|b<<8;P(this,a<<8);return a&255}function Cc(a,b){a=b&~a;N(this,a);return a}function Dc(a,b){a=b&~a;N(this,a<<8);return a}function Ec(a,b){a|=b;N(this,a);return a}function Fc(a,b){a|=b;N(this,a<<8);return a}function Gc(a,b){a=~b|65536;O(this,a);return a&65535}function Hc(a,b){a=~b|256;O(this,a<<8);return a&255} -function Ic(a,b){a=b-a;this.l&128||(this.o=this.h=a,this.g=b&(b^a));return a&65535}function Jc(a,b){a=b-a;var c=a<<8;b<<=8;this.l&128||(this.o=this.h=c,this.g=b&(b^c));return a&255}function Kc(a,b){a=b+a;this.l&128||(this.o=this.h=a,this.g=a&(b^a));return a&65535}function Lc(a,b){a=b+a;var c=a<<8;this.l&128||(this.o=this.h=c,this.g=c&(b<<8^c));return a&255}function Mc(a,b){a=-b;O(this,a,a&b&32768);return a&65535}function Nc(a,b){a=-b;O(this,a<<8,(a&b&128)<<8);return a&255} -function Oc(a,b){a=b<<1|this.j>>16&1;P(this,a);return a&65535}function Pc(a,b){a=b<<1|this.j>>16&1;P(this,a<<8);return a&255}function Qc(a,b){a=(this.j&65536|b)>>1|b<<16;P(this,a);return a&65535}function Rc(a,b){a=((this.j&65536)>>8|b)>>1|b<<8;P(this,a<<8);return a&255}function Sc(a,b){var c=b-a;hc(this,c,a,b);return c&65535}function Tc(a,b){var c=b-a;hc(this,c<<8,a<<8,b<<8);return c&255}function Uc(a,b){this.l&128||(this.o=this.h=b&65280,this.g=this.j=0);return(b<<8|b>>8)&65535} -function Vc(a,b){a^=b;N(this,a);return a&65535}function Wc(a){S(this,a,Q(this,a),wc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Xc(a){var b=tc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.j=this.g=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.o=this.h=c;this.a-=(this.c?6:7)+b} -function Yc(a){var b=tc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.j=this.g=0;b&=63;if(b&32){b=64-b;32>b-1;this.j=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.f[a|1]=d&65535;this.o=d>>16;this.h=d>>16|d;this.a-=(this.c?6:7)+b}function Zc(a){T(this,a,!L(this))}function $c(a){T(this,a,L(this))} +function Ic(a,b){a=b-a;this.l&128||(this.o=this.i=a,this.g=b&(b^a));return a&65535}function Jc(a,b){a=b-a;var c=a<<8;b<<=8;this.l&128||(this.o=this.i=c,this.g=b&(b^c));return a&255}function Kc(a,b){a=b+a;this.l&128||(this.o=this.i=a,this.g=a&(b^a));return a&65535}function Lc(a,b){a=b+a;var c=a<<8;this.l&128||(this.o=this.i=c,this.g=c&(b<<8^c));return a&255}function Mc(a,b){a=-b;O(this,a,a&b&32768);return a&65535}function Nc(a,b){a=-b;O(this,a<<8,(a&b&128)<<8);return a&255} +function Oc(a,b){a=b<<1|this.j>>16&1;P(this,a);return a&65535}function Pc(a,b){a=b<<1|this.j>>16&1;P(this,a<<8);return a&255}function Qc(a,b){a=(this.j&65536|b)>>1|b<<16;P(this,a);return a&65535}function Rc(a,b){a=((this.j&65536)>>8|b)>>1|b<<8;P(this,a<<8);return a&255}function Sc(a,b){var c=b-a;hc(this,c,a,b);return c&65535}function Tc(a,b){var c=b-a;hc(this,c<<8,a<<8,b<<8);return c&255}function Uc(a,b){this.l&128||(this.o=this.i=b&65280,this.g=this.j=0);return(b<<8|b>>8)&65535} +function Vc(a,b){a^=b;N(this,a);return a&65535}function Wc(a){S(this,a,Q(this,a),wc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Xc(a){var b=tc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.j=this.g=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.o=this.i=c;this.a-=(this.c?6:7)+b} +function Yc(a){var b=tc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.j=this.g=0;b&=63;if(b&32){b=64-b;32>b-1;this.j=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.f[a|1]=d&65535;this.o=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Zc(a){T(this,a,!L(this))}function $c(a){T(this,a,L(this))} function ad(a){S(this,a,Q(this,a),Cc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function bd(a){R(this,a,qc(this,a),Dc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function cd(a){S(this,a,Q(this,a),Ec);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function dd(a){R(this,a,qc(this,a),Fc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} -function ed(a){N(this,Q(this,a)&tc(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function fd(a){N(this,(qc(this,a)&sc(this,a))<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function gd(a){T(this,a,this.h&65535?0:4)}function hd(a){T(this,a,!this.ma()==!(this.g&32768))}function id(a){T(this,a,!!(this.h&65535)&&!this.ma()==!(this.g&32768))}function jd(a){T(this,a,!L(this)&&!!(this.h&65535))} -function kd(a){T(this,a,(this.h&65535?0:4)||!this.ma()!=!(this.g&32768))}function ld(a){T(this,a,L(this)||(this.h&65535?0:4))}function md(a){T(this,a,!this.ma()!=!(this.g&32768))}function nd(a){T(this,a,this.ma())}function od(a){T(this,a,!!(this.h&65535))}function pd(a){T(this,a,!this.ma())}function qd(){F(this,12,1);this.a-=5}function rd(a){T(this,a,!0)}function sd(a){T(this,a,!(this.g&32768))}function td(a){T(this,a,this.g&32768?2:0)} -function U(a){a&1&&(this.j=0);a&2&&(this.g=0);a&4&&(this.h=1);a&8&&(this.o=0);this.a-=5}function ud(a){var b=Q(this,a);a=tc(this,a);hc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function vd(a){var b=qc(this,a)<<8;a=sc(this,a)<<8;hc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)} -function wd(a){var b=tc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.j=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.h=d>>16|d,this.o=d>>16):(this.g=32768,this.h=d>>15|d,this.o=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.h=this.o=0,this.g=32768,this.j=65536,this.a-=7}function xd(){F(this,24,2);this.a-=25}function yd(){this.u&49152?(this.F|=128,F(this,4,3)):Xa(this);this.a-=7} +function ed(a){N(this,Q(this,a)&tc(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function fd(a){N(this,(qc(this,a)&sc(this,a))<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function gd(a){T(this,a,this.i&65535?0:4)}function hd(a){T(this,a,!this.ma()==!(this.g&32768))}function id(a){T(this,a,!!(this.i&65535)&&!this.ma()==!(this.g&32768))}function jd(a){T(this,a,!L(this)&&!!(this.i&65535))} +function kd(a){T(this,a,(this.i&65535?0:4)||!this.ma()!=!(this.g&32768))}function ld(a){T(this,a,L(this)||(this.i&65535?0:4))}function md(a){T(this,a,!this.ma()!=!(this.g&32768))}function nd(a){T(this,a,this.ma())}function od(a){T(this,a,!!(this.i&65535))}function pd(a){T(this,a,!this.ma())}function qd(){F(this,12,1);this.a-=5}function rd(a){T(this,a,!0)}function sd(a){T(this,a,!(this.g&32768))}function td(a){T(this,a,this.g&32768?2:0)} +function U(a){a&1&&(this.j=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.o=0);this.a-=5}function ud(a){var b=Q(this,a);a=tc(this,a);hc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function vd(a){var b=qc(this,a)<<8;a=sc(this,a)<<8;hc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)} +function wd(a){var b=tc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.j=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.o=d>>16):(this.g=32768,this.i=d>>15|d,this.o=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.o=0,this.g=32768,this.j=65536,this.a-=7}function xd(){F(this,24,2);this.a-=25}function yd(){this.w&49152?(this.F|=128,F(this,4,3)):Xa(this);this.a-=7} function zd(){F(this,16,4);this.a-=25}var Ad=[0,7,7,10,7,11,9,13];function V(a){var b=this.a;M(this,rc(this,a));this.a=b-Ad[this.c]}var Bd=[0,14,14,17,14,18,16,20];function Cd(a){var b=this.a,c=rc(this,a);a=a>>6&7;ic(this,this.f[a]);this.f[a]=this.f[7];M(this,c);this.a=b-Bd[this.c]}var Dd=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ed(a){var b=Q(this,a),c=this.a;N(this,vc(this,a,b));this.a=c-Dd[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)} -function Fd(a){var b=qc(this,a);N(this,uc(this,a,b,1)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var Gd=[7,13,13,17,14,18,17,21];function Hd(a){var b=tc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.l&128||(this.o=b>>16,this.h=this.o|b,this.g=0,this.j=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)M(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Nd(a){S(this,a,Q(this,a),Sc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} -function X(a){S(this,a,0,Uc);this.a-=this.c?9:3+(7==this.b?2:0)}function Od(){F(this,28,5);this.a-=5}function Qd(){this.l&4||this.w.fa();this.l|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3}function Rd(a){S(this,a,Q(this,a),Vc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){F(this,8,6)}function bc(a){Sd[a>>12].call(this,a)}function Td(a){Ud[a>>6&3].call(this,a)}function Vd(a){Wd[a>>6&3].call(this,a)}function Xd(a){Yd[a>>6&3].call(this,a)}function Zd(a){$d[a&15].call(this,a)} +function Fd(a){var b=qc(this,a);N(this,uc(this,a,b,1)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var Gd=[7,13,13,17,14,18,17,21];function Hd(a){var b=tc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.l&128||(this.o=b>>16,this.i=this.o|b,this.g=0,this.j=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)M(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Nd(a){S(this,a,Q(this,a),Sc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} +function X(a){S(this,a,0,Uc);this.a-=this.c?9:3+(7==this.b?2:0)}function Od(){F(this,28,5);this.a-=5}function Pd(){this.l&4||this.v.fa();this.l|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3}function Qd(a){S(this,a,Q(this,a),Vc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){F(this,8,6)}function bc(a){Rd[a>>12].call(this,a)}function Td(a){Ud[a>>6&3].call(this,a)}function Vd(a){Wd[a>>6&3].call(this,a)}function Xd(a){Yd[a>>6&3].call(this,a)}function Zd(a){$d[a&15].call(this,a)} function ae(a){be[a&15].call(this,a)}function ce(a){de[a>>6&3].call(this,a)}function ee(a){fe[a>>6&3].call(this,a)}function ge(a){he[a>>6&3].call(this,a)} -var Sd=[function(a){ie[a>>8&15].call(this,a)},Ed,ud,ed,ad,cd,Wc,Y,function(a){je[a>>8&15].call(this,a)},Fd,vd,fd,bd,dd,Nd,Y],ie=[function(a){ke[a>>4&15].call(this,a)},rd,od,gd,hd,md,id,kd,Cd,Cd,Td,Vd,Xd,Y,Y,Y],Ud=[function(a){O(this,vc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Gc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Kc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Ic);this.a-=this.c?9:3+(7==this.b?2:0)}],Wd=[function(a){S(this,a,0,Mc); +var Rd=[function(a){ie[a>>8&15].call(this,a)},Ed,ud,ed,ad,cd,Wc,Y,function(a){je[a>>8&15].call(this,a)},Fd,vd,fd,bd,dd,Nd,Y],ie=[function(a){ke[a>>4&15].call(this,a)},rd,od,gd,hd,md,id,kd,Cd,Cd,Td,Vd,Xd,Y,Y,Y],Ud=[function(a){O(this,vc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Gc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Kc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Ic);this.a-=this.c?9:3+(7==this.b?2:0)}],Wd=[function(a){S(this,a,0,Mc); this.a-=this.c?11:6},function(a){S(this,a,L(this)?1:0,wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,L(this)?1:0,Sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=tc(this,a);O(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Yd=[function(a){S(this,a,0,Qc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Oc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Ac);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,yc);this.a-=this.c?9:3+(7==this.b?2:0)}],ke=[function(a){le[a& -15].call(this,a)},Y,Y,Y,V,V,V,V,Ld,Y,Zd,ae,X,X,X,X],le=[yd,Qd,Kd,qd,zd,Jd,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],$d=[Id,function(){this.j=0;this.a-=5},function(){this.g=0;this.a-=5},U,function(){this.h=1;this.a-=5},U,U,U,function(){this.o=0;this.a-=5},U,U,U,U,U,U,U],be=[Id,function(){this.j=65536;this.a-=5},function(){this.g=32768;this.a-=5},W,function(){this.h=0;this.a-=5},W,W,W,function(){this.o=32768;this.a-=5},W,W,W,W,W,W,W],je=[pd,nd,jd,ld,sd,td,Zc,$c,xd,Od,ce,ee,ge,Y,Y,Y],de=[function(a){O(this,uc(this,a,0)); +15].call(this,a)},Y,Y,Y,V,V,V,V,Ld,Y,Zd,ae,X,X,X,X],le=[yd,Pd,Kd,qd,zd,Jd,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],$d=[Id,function(){this.j=0;this.a-=5},function(){this.g=0;this.a-=5},U,function(){this.i=1;this.a-=5},U,U,U,function(){this.o=0;this.a-=5},U,U,U,U,U,U,U],be=[Id,function(){this.j=65536;this.a-=5},function(){this.g=32768;this.a-=5},W,function(){this.i=0;this.a-=5},W,W,W,function(){this.o=32768;this.a-=5},W,W,W,W,W,W,W],je=[pd,nd,jd,ld,sd,td,Zc,$c,xd,Od,ce,ee,ge,Y,Y,Y],de=[function(a){O(this,uc(this,a,0)); this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,Hc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,1,Lc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,1,Jc);this.a-=this.c?9:3+(7==this.b?2:0)}],fe=[function(a){R(this,a,0,Nc);this.a-=this.c?11:6},function(a){R(this,a,L(this)?1:0,xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,L(this)?1:0,Tc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=sc(this,a);O(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],he= -[function(a){R(this,a,0,Rc);this.a-=this.c?9+(this.Xa&1):3+(7==this.b?2:0)},function(a){R(this,a,0,Pc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,Bc);this.a-=this.c?9+(this.Xa&1):3+(7==this.b?2:0)},function(a){R(this,a,0,zc);this.a-=this.c?9:3+(7==this.b?2:0)}];function cc(a){me[a>>12].call(this,a)} +[function(a){R(this,a,0,Rc);this.a-=this.c?9+(this.Ya&1):3+(7==this.b?2:0)},function(a){R(this,a,0,Pc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,Bc);this.a-=this.c?9+(this.Ya&1):3+(7==this.b?2:0)},function(a){R(this,a,0,zc);this.a-=this.c?9:3+(7==this.b?2:0)}];function cc(a){me[a>>12].call(this,a)} var me=[function(a){ne[a>>8&15].call(this,a)},Ed,ud,ed,ad,cd,Wc,function(a){oe[a>>8&15].call(this,a)},function(a){pe[a>>8&15].call(this,a)},Fd,vd,fd,bd,dd,Nd,Y],ne=[function(a){qe[a>>4&15].call(this,a)},rd,od,gd,hd,md,id,kd,Cd,Cd,Td,Vd,Xd,function(a){re[a>>6&3].call(this,a)},Y,Y],re=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.T(a|this.N);M(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=oc(this,a,0);ic(this,a);N(this,a);this.a-=11},function(a){var b=kc(this),c=this.a; -pc(this,a,0,b);N(this,b);this.a=c-Gd[this.c]},function(a){N(this,vc(this,a,this.ma?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],qe=[function(a){se[a&15].call(this,a)},Y,Y,Y,V,V,V,V,Ld,function(a){a&8?(this.u&49152||(this.u=this.u&-2017|(a&7)<<5,this.l|=1),this.a-=5):F(this,8,6)},Zd,ae,X,X,X,X],se=[yd,Qd,Kd,qd,zd,Jd,function(){jc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],oe=[Hd,Hd,wd,wd,Xc,Xc,Yc,Yc,Rd,Rd,Y,Y,Y,Y,Md,Md],pe=[pd,nd,jd,ld,sd,td,Zc,$c,xd,Od,ce,ee,ge,function(a){te[a>>6&3].call(this,a)},Y, +pc(this,a,0,b);N(this,b);this.a=c-Gd[this.c]},function(a){N(this,vc(this,a,this.ma?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],qe=[function(a){se[a&15].call(this,a)},Y,Y,Y,V,V,V,V,Ld,function(a){a&8?(this.w&49152||(this.w=this.w&-2017|(a&7)<<5,this.l|=1),this.a-=5):F(this,8,6)},Zd,ae,X,X,X,X],se=[yd,Pd,Kd,qd,zd,Jd,function(){jc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],oe=[Hd,Hd,wd,wd,Xc,Xc,Yc,Yc,Qd,Qd,Y,Y,Y,Y,Md,Md],pe=[pd,nd,jd,ld,sd,td,Zc,$c,xd,Od,ce,ee,ge,function(a){te[a>>6&3].call(this,a)},Y, Y],te=[Y,function(a){a=oc(this,a,65536);ic(this,a);N(this,a);this.a-=11},function(a){var b=kc(this),c=this.a;pc(this,a,65536,b);N(this,b);this.a=c-Gd[this.c]},Y]; -function ue(a){u.call(this,"ROM",a,ue);this.Y=this.b=null;this.j=a.addr;this.c=a.size;this.h=a.alias;this.g=a.file;this.o=ka(this.g);if(this.g){a=this.g;var b=la(this.o);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;h(a,null,!0,function(a,b,f){f?c.L("Unable to load ROM resource (error "+f+": "+a+")"):(Pa(c.Ha,a,b),(a=ua(a,b))?(c.b=a.K,c.Y=a.Y):c.g=null,ve(c))})}}w(ue);ue.prototype.ea=function(a,b,c,d){this.m=b;this.a=c;this.G=d;ve(this)}; +function ue(a){u.call(this,"ROM",a,ue);this.Y=this.b=null;this.j=a.addr;this.c=a.size;this.i=a.alias;this.g=a.file;this.o=ka(this.g);if(this.g){a=this.g;var b=la(this.o);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;h(a,null,!0,function(a,b,f){f?c.H("Unable to load ROM resource (error "+f+": "+a+")"):(Pa(c.ra,a,b),(a=ua(a,b))?(c.b=a.M,c.Y=a.Y):c.g=null,ve(c))})}}w(ue);ue.prototype.ea=function(a,b,c,d){this.m=b;this.a=c;this.G=d;ve(this)}; ue.prototype.$=function(){this.Y&&(this.G&&this.G.a(this.id,this.j,this.c,this.Y),delete this.Y);return!0};ue.prototype.Z=function(){return!0}; -function ve(a){if(!Sa(a)){if(a.g){if(!a.b||!a.m)return;a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+ja(a.b.length,8,!0)+") does not match specified size ("+ja(a.c,8,!0)+")";a.i.error=!0;a.L(b)}else{b=a.j;if(kb(a.m,b,a.c,Ib)){var c;for(c=0;c=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=qa(b[0]);if(c!=this.Ga)return;b=qa(b[1]);if(this.s=Qa(b)){var d=this.s.exports;if(d){var e=d.connect;e&&e.call(this.s);if(this.A=d.receiveData){this.status(this.Ha+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.$=function(a,b){if(!b)if(this.mb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -g.Z=function(a){return a?this.save():!0};g.reset=function(){Be(this)};g.save=function(){var a=new K(this);a.set(0,[]);return a.data()};g.restore=function(){return Be(this)};function Be(a){a.D=0;a.b=0;a.c=128;a.h=[];return!0}g.eb=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.H||8,c=a-this.o%a,this.H&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.j){if(10==a||1024<=this.j.length)this.P(this.j), -this.j="";10!=a&&(this.j+=String.fromCharCode(a))}this.c&=-129;yb(this.a,this.J,1)}};var Ce={},Ae=(Ce[65392]=[null,null,Z.prototype.dc,Z.prototype.Qc,"RCSR"],Ce[65394]=[null,null,Z.prototype.cc,Z.prototype.Pc,"RBUF"],Ce[65396]=[null,null,Z.prototype.rc,Z.prototype.dd,"XCSR"],Ce[65398]=[null,null,Z.prototype.qc,Z.prototype.cd,"XBUF"],Ce);q(function(){for(var a=A(document,"pdp11","serial"),b=0;b\nLicense: GPL version 3 or later ");this.P("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bHe){if(Je(d,this.s)){this.j=new K(this,"1.30.1","failsafe");Je(this.j)&&(Oe(this,d),a=2,Pe(this.j));this.j.set("timestamp",ta());Qe(this.j);var e=this.b&&!this.o;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ne(d)){var f=d.get("code"),k=d.get("data");f&&("ok"==f?Je(d,k):("error"== -f&&"no machine state"!=k?(this.L("Error: "+k),"unable to verify user"==k&&(za("user",""),this.c=null)):this.P(f+": "+k),Pe(d),Je(d)?(c=Ne(d),e=!0):c=!1))}e&&Me(this,c?d:null)}else 2==a&&d.clear()}else Me(this);delete this.s;delete this.A}e=x(this.id);for(f=0;fa[1];a=a[2];this.S=!0;this.i.M=!0;var d=this.v.power;d&&(d.textContent="Shutdown");this.a&&(Re(this,this.a,b,c,a),this.a.Ca());this.H&&(Oe(this,b),b.clear());!c&&this.j&&(this.j.clear(),delete this.j);this.g=0}; -function Oe(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.O;d.user=c;d.type="bug";d.data=b;h("http://www.pcjs.org/api/v1/report",d,!0)}} -function Se(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new K(a,"1.30.1"),k=new K(a,"1.30.1","validate"),l=ta();k.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.Z&&(c&&Xa(a.a),d=a.a.Z(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.i.M=!1,!1===d&&(e=null)));for(var l=x(a.id),n=0;n=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=qa(b[0]);if(c!=this.Ha)return;b=qa(b[1]);if(this.u=Qa(b)){var d=this.u.exports;if(d){var e=d.connect;e&&e.call(this.u);if(this.A=d.receiveData){this.status(this.ra+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.$=function(a,b){if(!b)if(this.nb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +g.Z=function(a){return a?this.save():!0};g.reset=function(){Be(this)};g.save=function(){var a=new K(this);a.set(0,[]);return a.data()};g.restore=function(){return Be(this)};function Be(a){a.D=0;a.b=0;a.c=128;a.i=[];return!0}g.fb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.I||8,c=a-this.o%a,this.I&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.j){if(10==a||1024<=this.j.length)this.P(this.j), +this.j="";10!=a&&(this.j+=String.fromCharCode(a))}this.c&=-129;yb(this.a,this.K,1)}};var Ce={},Ae=(Ce[65392]=[null,null,Z.prototype.ec,Z.prototype.Rc,"RCSR"],Ce[65394]=[null,null,Z.prototype.dc,Z.prototype.Qc,"RBUF"],Ce[65396]=[null,null,Z.prototype.sc,Z.prototype.ed,"XCSR"],Ce[65398]=[null,null,Z.prototype.rc,Z.prototype.dd,"XBUF"],Ce);q(function(){for(var a=A(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.s[b]=c,!0;case "loadTape":return this.s[b]=c,c.onclick=function(){var a=d.s.listTapes;a&&De(d, +a.options[a.selectedIndex].text,a.value)},!0;case "mountTape":if(this.o)return this.s[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;De(d,ka(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +g.ea=function(a,b,c,d){this.v=a;this.m=b;this.a=c;this.G=d;if((this.b=Tb(this.v,"autoMount")||this.b)&&"string"==typeof this.b)try{this.b=eval("("+this.b+")")}catch(e){m("PC11 auto-mount error: "+e.message+" ("+this.b+")"),this.b=null}tb(b,this,Ee);Fe(this,"None","",!0);this.o&&Fe(this,"Local Tape","?");Fe(this,"Remote Tape","??");Ge(this)||B(this)};g.$=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};g.Z=function(a){return a?this.save():!0}; +g.reset=function(){this.c&=-2241;this.u=0};function Ge(a){a.i=0;if(a.b){var b=a.b.path,c;if(!(c=a.b.name))a:{if((c=a.s.listTapes)&&c.options)for(var d=0;dc.indexOf("/api/v1/dump")&&(d=la(c),e="json"==d||"gz"==d?encodeURI(c):na()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!h(e,null,!0,function(d,e,f){a.h.Wa=!1;var k=0>f&&a.v&&!a.v.h.L;f?a.H('Unable to load tape "'+b+'" (error '+f+": "+d+")",k):(Pa(a.ra,d,e),ua(d,e)&&(a.g=c));a.j&&(a.j=!1,--a.i||B(a));if((d=a.s.listTapes)&& +d.options){e=a.h.local?"?":a.g;for(f=0;f\nLicense: GPL version 3 or later ");this.P("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bMe){if(Oe(d,this.u)){this.j=new K(this,"1.30.1","failsafe");Oe(this.j)&&(Te(this,d),a=2,Ue(this.j));this.j.set("timestamp",ta());Ve(this.j);var e=this.b&&!this.o;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Se(d)){var f=d.get("code"),k=d.get("data");f&&("ok"==f?Oe(d,k):("error"== +f&&"no machine state"!=k?(this.H("Error: "+k),"unable to verify user"==k&&(za("user",""),this.c=null)):this.P(f+": "+k),Ue(d),Oe(d)?(c=Se(d),e=!0):c=!1))}e&&Re(this,c?d:null)}else 2==a&&d.clear()}else Re(this);delete this.u;delete this.A}e=x(this.id);for(f=0;fa[1];a=a[2];this.S=!0;this.h.L=!0;var d=this.s.power;d&&(d.textContent="Shutdown");this.a&&(We(this,this.a,b,c,a),this.a.Da());this.I&&(Te(this,b),b.clear());!c&&this.j&&(this.j.clear(),delete this.j);this.g=0}; +function Te(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.O;d.user=c;d.type="bug";d.data=b;h("http://www.pcjs.org/api/v1/report",d,!0)}} +function Xe(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new K(a,"1.30.1"),k=new K(a,"1.30.1","validate"),l=ta();k.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.Z&&(c&&Xa(a.a),d=a.a.Z(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.h.L=!1,!1===d&&(e=null)));for(var l=x(a.id),n=0;nf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");h(e,null,!0,function(f,k,l){if(l||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],r,t=/( [a-z]+=)(['"])(.*?)\2/g;r=t.exec(f);)n=0>n.indexOf(r[1])?n.replace(">",r[0]+">"):n.replace(new RegExp(r[1]+"(['\"])(.*?)\\1"),r[0]);l[0]!=n&&(k=k.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],k);Ze(a,b,c)}})}else c(a,null)} -function $e(a,b,c,d){function e(a){if(void 0===l){var b=k&&A(k,"machine-warning");l=b&&b[0]||k}l&&(l.innerHTML=pa(a))}function f(a){e("Error: "+a);n&&(--We||Ga(!0));n=!1}var k,l,n=!0;We++;Oa[a]={};try{if(k=document.getElementById(a)){var r;if("object"==typeof resources&&(r=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],C=document.createElement("style");C.type="text/css";C.styleSheet?C.styleSheet.cssText=r:C.appendChild(document.createTextNode(r));t.appendChild(C)}c|| -(c="/versions/pdpjs/1.30.1/components.xsl");r=function(d,l){l?Xe(c,null,null,!1,e,function(d,n){n?(Pa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(k.outerHTML=n,--We||Ga(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?k.parentNode?(k.parentNode.replaceChild(n,k),--We||Ga(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Xe(b,a,d,!0,e,r):Ye(b,null,a,d,!1,e,r)}else f("missing machine element: "+a)}catch(Pd){f(Pd.message)}return n}window.embedPDP11=function(a,b,c,d){Ga(!1);return $e(a,b,c,d)};window.enableEvents=Ga;window.sendEvent=Ha;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11.map +g.V=function(a,b,c){var d=this;switch(b){case "power":return this.s[b]=c,c.onclick=function(){d.g||(d.h.L?Xe(d,!1,!0):Qe(d,d.Fa))},!0;case "reset":return this.s[b]=c,c.onclick=function(){if(d.h.L&&!d.g)if(d.b&&!d.v){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Xe(d,a,!0);!a&&d.D?window&&window.location.reload():d.Fa(Me)}else d.reset(),d.a&&d.a.Da()},!0;case "save":if(ma())c.parentNode.removeChild(c);else return this.s[b]= +c,c.onclick=function(){var a=Ne(d,!0);if(a){var b=!!(d.b&&!d.v||d.D),c=Xe(d,b);b?Ye(d,a,c):d.H("Resume disabled, machine state not saved")}},!0}return!1}; +function Ne(a,b){var c=a.c;c||((c=ya("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Ze(a,c))||a.H("The user ID is invalid.")):b&&a.H("Browser local storage is not available"));return c} +function Ze(a,b){a.c=null;b=h(na()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(za("user",b.data),a.c=b.data)}catch(d){m(d.message+" ("+c+")")}return a.c}function Pe(a){var b=null;a.c&&(b=na()+"/api/v1/user?req=load&user="+a.c+"&state="+$e(a,"1.30.1"));return b} +function Ye(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=$e(a,"1.30.1");d.data=c;b=h(na()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");h(e,null,!0,function(f,k,l){if(l||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],r,t=/( [a-z]+=)(['"])(.*?)\2/g;r=t.exec(f);)n=0>n.indexOf(r[1])?n.replace(">",r[0]+">"):n.replace(new RegExp(r[1]+"(['\"])(.*?)\\1"),r[0]);l[0]!=n&&(k=k.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],k);df(a,b,c)}})}else c(a,null)} +function ef(a,b,c,d){function e(a){if(void 0===l){var b=k&&A(k,"machine-warning");l=b&&b[0]||k}l&&(l.innerHTML=pa(a))}function f(a){e("Error: "+a);n&&(--af||Ga(!0));n=!1}var k,l,n=!0;af++;Oa[a]={};try{if(k=document.getElementById(a)){var r;if("object"==typeof resources&&(r=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],D=document.createElement("style");D.type="text/css";D.styleSheet?D.styleSheet.cssText=r:D.appendChild(document.createTextNode(r));t.appendChild(D)}c|| +(c="/versions/pdpjs/1.30.1/components.xsl");r=function(d,l){l?bf(c,null,null,!1,e,function(d,n){n?(Pa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(k.outerHTML=n,--af||Ga(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?k.parentNode?(k.parentNode.replaceChild(n,k),--af||Ga(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?bf(b,a,d,!0,e,r):cf(b,null,a,d,!1,e,r)}else f("missing machine element: "+a)}catch(Sd){f(Sd.message)}return n}window.embedPDP11=function(a,b,c,d){Ga(!1);return ef(a,b,c,d)};window.enableEvents=Ga;window.sendEvent=Ha;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11.map