diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 2ef09fad6..e6e6c45a9 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -771,6 +771,7 @@ var PDP11 = { RL11: { // RL11 Disk Controller PRI: 5, VEC: 0o160, + DRIVES: 4, // maximum of 4 drives RLCS: { // 174400: Control Status Register DRDY: 0x0001, // Drive Ready (R/O) FUNC: 0x000E, // Function Code (F2,F1,F0) (R/W) @@ -876,6 +877,7 @@ var PDP11 = { }; PDP11.RK11.RK05 = [203, 2, 12, 512, PDP11.RK11.RKDS.RK05 | PDP11.RK11.RKDS.SOK | PDP11.RK11.RKDS.RRDY]; +PDP11.RL11.RL02K = [512, 2, 40, 256, PDP11.RL11.RLMP.GS_ST.LOCKON | PDP11.RL11.RLMP.GS_BH | PDP11.RL11.RLMP.GS_HO]; PDP11.ACCESS.READ_WORD = PDP11.ACCESS.WORD | PDP11.ACCESS.READ; // formerly READ_MODE (2) PDP11.ACCESS.READ_BYTE = PDP11.ACCESS.BYTE | PDP11.ACCESS.READ; // formerly READ_MODE (2) | BYTE_MODE (1) diff --git a/modules/pdp11/lib/drive.js b/modules/pdp11/lib/drive.js index 8fde0dba6..b34ee3390 100644 --- a/modules/pdp11/lib/drive.js +++ b/modules/pdp11/lib/drive.js @@ -48,6 +48,31 @@ if (NODE) { */ var Config; +/** + * Since the Closure Compiler treats ES6 classes as @struct rather than @dict by default, + * it deters us from defining named properties on our components; eg: + * + * this['exports'] = {...} + * + * results in an error: + * + * Cannot do '[]' access on a struct + * + * So, in order to define 'exports', we must override the @struct assumption by annotating + * the class as @unrestricted (or @dict). Note that this must be done both here and in the + * Component class, because otherwise the Compiler won't allow us to *reference* the named + * property either. + * + * TODO: Consider marking ALL our classes unrestricted, because otherwise it forces us to + * define every single property the class uses in its constructor, which results in a fair + * bit of redundant initialization, since many properties aren't (and don't need to be) fully + * initialized until the appropriate init(), reset(), restore(), etc. function is called. + * + * The upside, however, may be that since the structure of the class is completely defined by + * the constructor, JavaScript engines may be able to optimize and run more efficiently. + * + * @unrestricted + */ class DriveController extends Component { /** * DriveController(type, parms, bitsMessage, configDC) @@ -96,6 +121,10 @@ class DriveController extends Component { this.aDiskHistory = []; this.irq = null; + + this['exports'] = { + 'selectDrive': this.selectDrive + }; } /** @@ -860,15 +889,20 @@ class DriveController extends Component { /** * displayDisk(iDrive, fUpdateDrive) * + * This ensures that the selected disk matches the drive's sDiskPath property, and if fUpdateDrive is set, + * it also ensures that the selected drive matches the specified drive number. + * * @this {DriveController} * @param {number} iDrive (unvalidated) * @param {boolean} [fUpdateDrive] is true to update the drive list to match the specified drive (eg, the auto-mount case) + * @return {boolean} true if successful, false if not */ displayDisk(iDrive, fUpdateDrive) { /* * First things first: validate iDrive. */ + var fSuccess = false; if (iDrive >= 0 && iDrive < this.aDrives.length) { var drive = this.aDrives[iDrive]; var controlDisks = this.bindings["listDisks"]; @@ -878,34 +912,67 @@ class DriveController extends Component { */ if (controlDisks && controlDrives && controlDisks.options && controlDrives.options) { /* - * Next, make sure the drive whose disk we're updating is the currently selected drive. + * Next, update the drive if the caller has requested it. */ var i; + if (fUpdateDrive) { + this.assert(iDrive == drive.iDrive); + for (i = 0; i < controlDrives.options.length; i++) { + if (Str.parseInt(controlDrives.options[i].value, 10) == drive.iDrive) { + if (controlDrives.selectedIndex != i) { + controlDrives.selectedIndex = i; + } + fSuccess = true; + break; + } + } + } + /* + * Next, make sure the drive whose disk we're updating is the currently selected drive. + */ var iDriveSelected = Str.parseInt(controlDrives.value, 10); - var sTargetPath = (drive.fLocal? DriveController.SOURCE.LOCAL : drive.sDiskPath); + var sTargetPath = (drive.fLocal? RL11.SOURCE.LOCAL : drive.sDiskPath); if (!isNaN(iDriveSelected) && iDriveSelected == iDrive) { for (i = 0; i < controlDisks.options.length; i++) { if (controlDisks.options[i].value == sTargetPath) { if (controlDisks.selectedIndex != i) { controlDisks.selectedIndex = i; } + fSuccess = true; break; } } if (i == controlDisks.options.length) controlDisks.selectedIndex = 0; } - if (fUpdateDrive) { - for (i = 0; i < controlDrives.options.length; i++) { - if (Str.parseInt(controlDrives.options[i].value, 10) == drive.iDrive) { - if (controlDrives.selectedIndex != i) { - controlDrives.selectedIndex = i; - } - break; - } + } + } + return fSuccess; + } + + /** + * selectDrive(sDrive) + * + * Used to programmatically select a drive by name. + * + * @this {DriveController} + * @param {number} sDrive + * @return {boolean} true if successful, false if not + */ + selectDrive(sDrive) + { + var controlDrives = this.bindings["listDrives"]; + if (controlDrives && controlDrives.options) { + var nDrives = controlDrives.options.length; + for (var i = 0; i < nDrives; i++) { + if (controlDrives.options[i].innerHTML == sDrive) { + var iDrive = Str.parseInt(controlDrives.options[i].value, 10); + if (iDrive >= 0) { + return this.displayDisk(iDrive, true); } } } } + return false; } /** diff --git a/modules/pdp11/lib/rl11.js b/modules/pdp11/lib/rl11.js index 20d9412d9..fb1134b76 100644 --- a/modules/pdp11/lib/rl11.js +++ b/modules/pdp11/lib/rl11.js @@ -34,41 +34,12 @@ if (NODE) { var Str = require("../../shared/es6/strlib"); - var Web = require("../../shared/es6/weblib"); - var DiskAPI = require("../../shared/es6/diskapi"); - var Component = require("../../shared/es6/component"); - var State = require("../../shared/es6/state"); var PDP11 = require("./defines"); var MessagesPDP11 = require("./messages"); - var DiskPDP11 = require("./disk"); + var DriveController = require("./drive"); } -/** - * Since the Closure Compiler treats ES6 classes as @struct rather than @dict by default, - * it deters us from defining named properties on our components; eg: - * - * this['exports'] = {...} - * - * results in an error: - * - * Cannot do '[]' access on a struct - * - * So, in order to define 'exports', we must override the @struct assumption by annotating - * the class as @unrestricted (or @dict). Note that this must be done both here and in the - * Component class, because otherwise the Compiler won't allow us to *reference* the named - * property either. - * - * TODO: Consider marking ALL our classes unrestricted, because otherwise it forces us to - * define every single property the class uses in its constructor, which results in a fair - * bit of redundant initialization, since many properties aren't (and don't need to be) fully - * initialized until the appropriate init(), reset(), restore(), etc. function is called. - * - * The upside, however, may be that since the structure of the class is completely defined by - * the constructor, JavaScript engines may be able to optimize and run more efficiently. - * - * @unrestricted - */ -class RL11 extends Component { +class RL11 extends DriveController { /** * RL11(parms) * @@ -89,928 +60,62 @@ class RL11 extends Component { */ constructor(parms) { - super("RL11", parms, MessagesPDP11.RL11); + super("RL11", parms, MessagesPDP11.RL11, PDP11.RL11, PDP11.RL11.RL02K, RL11.UNIBUS_IOTABLE); /* - * We preliminarily parse and record any 'autoMount' object now, but we no longer process it - * until initBus(), because the Computer's getMachineParm() service may have an override for us. - */ - this.configMount = this.parseConfig(parms['autoMount']); - this.cAutoMount = 0; - - /* - * The RL11 has two Drive Select bits, representing up to four drives. - */ - this.nDrives = 4; - this.aDrives = new Array(this.nDrives); - this.fLocalDisks = (!Web.isMobile() && window && 'FileReader' in window); - this.sDiskSource = RL11.SOURCE.NONE; - - this.irq = null; - - /* - * Define all the properties to be initialized by initController() + * Define all the registers required for this controller. */ this.regRLCS = this.regRLBA = this.regRLDA = this.tmpRLDA = this.regRLMP = this.regRLBE = 0; - - this['exports'] = { - 'selectDrive': this.selectDrive - }; } /** - * parseConfig(config) + * initController(aRegs, aHistory) * * @this {RL11} - * @param {*} config - * @return {*} + * @param {Array} [aRegs] + * @param {Array} [aHistory] + * @return {boolean} true if successful, false if failure */ - parseConfig(config) + initController(aRegs, aHistory) { - if (config && typeof config == "string") { - try { - /* - * The most likely source of any exception will be right here, where we're parsing - * this JSON-encoded data. - */ - config = eval("(" + config + ")"); - } catch (e) { - Component.error(this.type + " auto-mount error: " + e.message + " (" + config + ")"); - config = null; - } - } - return config || {}; - } - - /** - * setBinding(sType, sBinding, control, sValue) - * - * @this {RL11} - * @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, "listDisks") - * @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 - */ - setBinding(sType, sBinding, control, sValue) - { - var rl11 = this; - - switch (sBinding) { - - case "listDisks": - this.bindings[sBinding] = control; - - control.onchange = function onChangeListDisks(event) { - var controlDesc = rl11.bindings["descDisk"]; - var controlOption = control.options && 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("RL11 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 "descDisk": - case "listDrives": - this.bindings[sBinding] = control; - /* - * I tried going with onclick instead of onchange, so that if you wanted to confirm what's - * loaded in a particular drive, you could click the drive control without having to change it. - * However, that doesn't seem to work for all browsers, so I've reverted to onchange. - */ - control.onchange = function onChangeListDrives(event) { - var iDrive = Str.parseInt(control.value, 10); - if (iDrive != null) rl11.displayDisk(iDrive); - }; - return true; - - case "loadDisk": - this.bindings[sBinding] = control; - - control.onclick = function onClickLoadDrive(event) { - var controlDisks = rl11.bindings["listDisks"]; - if (controlDisks && controlDisks.options) { - var sDiskName = controlDisks.options[controlDisks.selectedIndex].text; - var sDiskPath = controlDisks.value; - rl11.loadSelectedDrive(sDiskName, sDiskPath); - } - }; - return true; - - case "bootDisk": - this.bindings[sBinding] = control; - - control.onclick = function onClickBootDisk(event) { - rl11.bootSelectedDisk(); - }; - return true; - - case "saveDisk": - /* - * Yes, technically, this feature does not require "Local disk support" (which is really a reference - * to FileReader support), but since fLocalDisks is also false for all mobile devices, and since there - * is an "orthogonality" to disabling both features in tandem, let's just let it slide, OK? - */ - if (!this.fLocalDisks) { - if (DEBUG) this.log("Local disk 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; - - control.onclick = function onClickSaveDrive(event) { - var controlDrives = rl11.bindings["listDrives"]; - if (controlDrives && controlDrives.options && rl11.aDrives) { - var iDriveSelected = Str.parseInt(controlDrives.value, 10) || 0; - var drive = rl11.aDrives[iDriveSelected]; - if (drive) { - /* - * Note the similarity (and hence factoring opportunity) between this code and the HDC's "saveHD*" binding. - */ - var disk = drive.disk; - if (disk) { - if (DEBUG) rl11.println("saving disk " + disk.sDiskPath + "..."); - var sAlert = Web.downloadFile(disk.encodeAsBase64(), "octet-stream", true, disk.sDiskFile.replace(".json", ".img")); - Component.alertUser(sAlert); - } else { - rl11.notice("No disk loaded in drive."); - } - } else { - rl11.notice("No disk drive selected."); - } - } - }; - return true; - - case "mountDisk": - if (!this.fLocalDisks) { - if (DEBUG) this.log("Local disk 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 sDiskPath = file.name; - var sDiskName = Str.getBaseName(sDiskPath, true); - rl11.loadSelectedDrive(sDiskName, sDiskPath, file); - } - /* - * Prevent reloading of web page after form submission - */ - return false; - }; - return true; - - default: - break; - } - return false; - } - - /** - * initBus(cmp, bus, cpu, dbg) - * - * @this {RL11} - * @param {ComputerPDP11} cmp - * @param {BusPDP11} bus - * @param {CPUStatePDP11} cpu - * @param {DebuggerPDP11} dbg - */ - initBus(cmp, bus, cpu, dbg) - { - this.cmp = cmp; - this.bus = bus; - this.cpu = cpu; - this.dbg = dbg; - - var configMount = this.parseConfig(this.cmp.getMachineParm('autoMount')); - - /* - * Add only drives from the machine-wide autoMount configuration that match drives managed by this component. - */ - if (configMount) { - for (var sDrive in configMount) { - if (sDrive.substr(0, 2) != this.type.substr(0, 2)) continue; - this.configMount[sDrive] = configMount[sDrive]; - } + if (!aRegs) { + aRegs = [(RL11.RLCS.DRDY | RL11.RLCS.CRDY), 0, 0, 0, 0, 0]; } /* - * If we didn't need auto-mount support, we could defer controller initialization until we received - * a powerUp() notification, at which point reset() would call initController(), or restore() would restore - * the controller; in that case, all we'd need to do here is call setReady(). + * ES6 ALERT: A handy destructuring assignment, which makes it easy to perform the inverse + * of what saveController() does when it collects a bunch of object properties into an array. */ - this.initController(); + [ + this.regRLCS, + this.regRLBA, + this.regRLDA, + this.tmpRLDA, + this.regRLMP, + this.regRLBE + ] = aRegs; - this.irq = this.cpu.addIRQ(RL11.VEC, RL11.PRI, MessagesPDP11.RL11); - - bus.addIOTable(this, RL11.UNIBUS_IOTABLE); - bus.addResetHandler(this.reset.bind(this)); - - this.addDisk("None", RL11.SOURCE.NONE, true); - if (this.fLocalDisks) this.addDisk("Local Disk", RL11.SOURCE.LOCAL); - this.addDisk("Remote Disk", RL11.SOURCE.REMOTE); - - if (!this.autoMount()) this.setReady(); - } - - /** - * getDriveName(iDrive) - * - * @this {RL11} - * @param {number} iDrive - * @return {string} - */ - getDriveName(iDrive) - { - return "RL" + iDrive; - } - - /** - * getDriveNumber(sDrive) - * - * @this {RL11} - * @param {string} sDrive - * @return {number} (0-3, or -1 if error) - */ - getDriveNumber(sDrive) - { - var iDrive = -1; - if (sDrive) { - iDrive = sDrive.charCodeAt(sDrive.length - 1) - 0x30; - if (iDrive < 0 || iDrive > 9) iDrive = -1; - } - return iDrive; - } - - /** - * powerUp(data, fRepower) - * - * @this {RL11} - * @param {Object|null} data - * @param {boolean} [fRepower] - * @return {boolean} true if successful, false if failure - */ - powerUp(data, fRepower) - { - if (!fRepower) { - if (!data) { - this.reset(); - if (this.cmp.fReload) { - /* - * If the computer's fReload flag is set, we're required to toss all currently - * loaded disks and remount all disks specified in the auto-mount configuration. - */ - this.unloadAllDrives(true); - this.autoMount(true); - } - } else { - if (!this.restore(data)) return false; - } - /* - * Populate the HTML controls to match the actual (well, um, specified) number of floppy drives. - */ - var controlDrives; - if ((controlDrives = this.bindings['listDrives'])) { - while (controlDrives.firstChild) { - controlDrives.removeChild(controlDrives.firstChild); - } - controlDrives.value = ""; - for (var iDrive = 0; iDrive < this.nDrives; iDrive++) { - var controlOption = document.createElement("option"); - controlOption.value = iDrive; - controlOption.text = this.getDriveName(iDrive); - controlDrives.appendChild(controlOption); - } - if (this.nDrives > 0) { - controlDrives.value = "0"; - this.displayDisk(0); - } - } - } - return true; - } - - /** - * powerDown(fSave, fShutdown) - * - * @this {RL11} - * @param {boolean} [fSave] - * @param {boolean} [fShutdown] - * @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure - */ - powerDown(fSave, fShutdown) - { - return fSave? this.save() : true; - } - - /** - * reset() - * - * @this {RL11} - */ - reset() - { - this.initController(); - } - - /** - * save() - * - * This implements save support for the RL11 component. - * - * @this {RL11} - * @return {Object} - */ - save() - { - var state = new State(this); - // state.set(0, this.saveController()); - return state.data(); - } - - /** - * restore(data) - * - * This implements restore support for the RL11 component. - * - * @this {RL11} - * @param {Object} data - * @return {boolean} true if successful, false if failure - */ - restore(data) - { - return this.initController(data[0]); + return super.initController(aRegs, aHistory); } /** * saveController() * - * TODO: Implement. + * Basically, the inverse of initController(). * * @this {RL11} * @return {Array} */ saveController() { - return []; - } - - /** - * autoMount(fRemount) - * - * @this {RL11} - * @param {boolean} [fRemount] is true if we're remounting all auto-mounted disks - * @return {boolean} true if one or more disk images are being auto-mounted, false if none - */ - autoMount(fRemount) - { - if (!fRemount) this.cAutoMount = 0; - for (var sDrive in this.configMount) { - var configDrive = this.configMount[sDrive]; - var sDiskPath = configDrive['path'] || ""; - var sDiskName = configDrive['name'] || this.findDisk(sDiskPath); - if (sDiskPath && sDiskName) { - var iDrive = this.getDriveNumber(sDrive); - if (iDrive >= 0 && iDrive < this.aDrives.length) { - if (!this.loadDrive(iDrive, sDiskName, sDiskPath, true) && fRemount) { - this.setReady(false); - } - continue; - } - } - this.notice("Incorrect auto-mount settings for drive " + sDrive + " (" + JSON.stringify(configDrive) + ")"); - } - return !!this.cAutoMount; - } - - /** - * loadSelectedDrive(sDiskName, sDiskPath, file) - * - * @this {RL11} - * @param {string} sDiskName - * @param {string} sDiskPath - * @param {File} [file] is set if there's an associated File object - */ - loadSelectedDrive(sDiskName, sDiskPath, file) - { - var controlDrives = this.bindings["listDrives"]; - var iDrive = controlDrives && Str.parseInt(controlDrives.value, 10); - - if (iDrive === undefined || iDrive < 0 || iDrive >= this.aDrives.length) { - this.notice("Unable to load the selected drive"); - return; - } - - if (!sDiskPath) { - this.unloadDrive(iDrive); - return; - } - - if (sDiskPath == RL11.SOURCE.LOCAL) { - this.notice('Use "Choose File" and "Mount" to select and load a local disk.'); - return; - } - - /* - * If the special RL11.SOURCE.REMOTE path 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 disk images. There's probably more - * I should do, like dynamically updating "listDisks" to include new entries, and adding new entries - * to the save/restore data. - */ - if (sDiskPath == RL11.SOURCE.REMOTE) { - sDiskPath = window.prompt("Enter the URL of a remote disk image.", "") || ""; - if (!sDiskPath) return; - sDiskName = Str.getBaseName(sDiskPath); - this.status("Attempting to load " + sDiskPath + " as \"" + sDiskName + "\""); - this.sDiskSource = RL11.SOURCE.REMOTE; - } - else { - this.sDiskSource = sDiskPath; - } - - this.loadDrive(iDrive, sDiskName, sDiskPath, false, file); - } - - /** - * bootSelectedDisk() - * - * @this {RL11} - */ - bootSelectedDisk() - { - var drive; - var controlDrives = this.bindings["listDrives"]; - var iDrive = controlDrives && Str.parseInt(controlDrives.value, 10); - - if (iDrive == null || iDrive < 0 || iDrive >= this.aDrives.length || !(drive = this.aDrives[iDrive])) { - this.notice("Unable to boot the selected drive"); - return; - } - if (!drive.disk) { - this.notice("Load a disk into the drive first"); - return; - } - /* - * NOTE: We're calling setReset() BEFORE reading the boot code in order to eliminate any side-effects - * of the previous state of either the controller OR the CPU; for example, we don't want any previous MMU - * or UNIBUS Map registers affecting the simulated readData() call. Also, some boot code (eg, RSTS/E) - * expects the controller to be in a READY state; since setReset() triggers a call to our reset() handler, - * a READY state is assured, and the readData() call shouldn't do anything to change that. - */ - this.cpu.setReset(0, true); - var err = this.readData(drive, 0, 0, 0, 512, 0x0000); - if (err) { - this.notice("Unable to read the boot sector (" + err + ")"); - } - } - - /** - * loadDrive(iDrive, sDiskName, sDiskPath, fAutoMount, file) - * - * NOTE: If sDiskPath is already loaded, nothing needs to be done. - * - * @this {RL11} - * @param {number} iDrive - * @param {string} sDiskName - * @param {string} sDiskPath - * @param {boolean} [fAutoMount] - * @param {File} [file] is set if there's an associated File object - * @return {number} 1 if disk loaded, 0 if queued up (or busy), -1 if already loaded - */ - loadDrive(iDrive, sDiskName, sDiskPath, fAutoMount, file) - { - var nResult = -1; - var drive = this.aDrives[iDrive]; - - if (drive.sDiskPath.toLowerCase() != sDiskPath.toLowerCase()) { - - nResult++; - this.unloadDrive(iDrive, true); - - if (drive.fBusy) { - this.notice("RL11 busy"); - } - else { - // this.status("disk queued: " + sDiskName); - drive.fBusy = true; - if (fAutoMount) { - drive.fAutoMount = true; - this.cAutoMount++; - if (this.messageEnabled()) this.printMessage("auto-loading disk: " + sDiskName); - } - drive.fLocal = !!file; - var disk = new DiskPDP11(this, drive, DiskAPI.MODE.PRELOAD); - if (disk.load(sDiskName, sDiskPath, file, this.finishLoadDrive)) { - nResult++; - } - } - } - return nResult; - } - - /** - * finishLoadDrive(drive, disk, sDiskName, sDiskPath, fAutoMount) - * - * The disk parameter is set if the disk was successfully loaded, null if not. - * - * @this {RL11} - * @param {Object} drive - * @param {DiskPDP11} disk - * @param {string} sDiskName - * @param {string} sDiskPath - * @param {boolean} [fAutoMount] - */ - finishLoadDrive(drive, disk, sDiskName, sDiskPath, fAutoMount) - { - drive.fBusy = false; - - if (disk) { - /* - * TODO: While this is a perfectly reasonable thing to do, one wonders if the Disk object shouldn't - * have done this itself, since we passed our Drive object to it (it already knows the drive's limits). - */ - if (disk.nCylinders > drive.nCylinders || disk.nHeads > drive.nHeads /* || disk.nSectors > drive.nSectors */) { - this.notice("Disk \"" + sDiskName + "\" too large for drive " + this.getDriveName(drive.iDrive)); - disk = null; - } - } - - if (disk) { - drive.disk = disk; - drive.sDiskName = sDiskName; - drive.sDiskPath = sDiskPath; - - /* - * Adding local disk image names to the disk list seems like a nice idea, but it's too confusing, - * because then it looks like the "Mount" button should be able to (re)load them, and that can NEVER - * happen, for security reasons; local disk images can ONLY be loaded via the "Mount" button after - * the user has selected them via the "Choose File" button. - * - * this.addDisk(sDiskName, sDiskPath); - * - * So we're going to take a different approach: when displayDisk() is asked to display the name - * of a local disk image, it will map all such disks to "Local Disk", and any attempt to "Mount" such - * a disk, will essentially result in a "Disk not found" error. - */ - // this.addDiskHistory(sDiskName, sDiskPath, disk); - - /* - * For a local disk (ie, one loaded via mountDrive()), the disk.restore() performed by addDiskHistory() - * may have altered the disk geometry, so refresh the disk info. - */ - // aDiskInfo = disk.info(); - - /* - * Clearly, a successful mount implies a disk change, and I suppose that, technically, an *unsuccessful* - * mount should imply the same, but what would the real-world analog be? Inserting a piece of cardboard - * instead of an actual disk? In any case, if we can do the user a favor by pretending (as far as the - * disk change line is concerned) that an unsuccessful mount never happened, let's do it. - * - * Successful unmounts are a different story, however; those *do* trigger a change. See unloadDrive(). - */ - // this.regInput |= FDC.REG_INPUT.DISK_CHANGE; - - /* - * With the addition of notify(), users are now "alerted" whenever a disk has finished loading; - * notify() is selective about its output, using print() if a print window is open, alert() otherwise. - */ - this.notice("Loaded disk \"" + sDiskName + "\" in drive " + this.getDriveName(drive.iDrive), drive.fAutoMount || fAutoMount); - - /* - * Since you usually want the Computer to have focus again after loading a new disk, let's try automatically - * updating the focus after a successful load. - */ - if (this.cmp) this.cmp.setFocus(); - } - else { - drive.fLocal = false; - } - - if (drive.fAutoMount) { - drive.fAutoMount = false; - if (!--this.cAutoMount) this.setReady(); - } - - this.displayDisk(drive.iDrive); - } - - /** - * addDisk(sName, sPath, fTop) - * - * @this {RL11} - * @param {string} sName - * @param {string} sPath - * @param {boolean} [fTop] (default is bottom) - */ - addDisk(sName, sPath, fTop) - { - var controlDisks = this.bindings["listDisks"]; - if (controlDisks && controlDisks.options) { - for (var i = 0; i < controlDisks.options.length; i++) { - if (controlDisks.options[i].value == sPath) return; - } - var controlOption = document.createElement("option"); - controlOption.text = sName; - controlOption.value = sPath; - if (fTop && controlDisks.childNodes[0]) { - controlDisks.insertBefore(controlOption, controlDisks.childNodes[0]); - } else { - controlDisks.appendChild(controlOption); - } - } - } - - /** - * findDisk(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 "listDisks" control, then we return the associated disk name. - * - * @this {RL11} - * @param {string} sPath - * @return {string|null} - */ - findDisk(sPath) - { - var controlDisks = this.bindings["listDisks"]; - if (controlDisks && controlDisks.options) { - for (var i = 0; i < controlDisks.options.length; i++) { - var control = controlDisks.options[i]; - if (control.value == sPath) return control.text; - } - } - return Str.getBaseName(sPath, true); - } - - /** - * displayDisk(iDrive, fUpdateDrive) - * - * This ensures that the selected disk matches the drive's sDiskPath property, and if fUpdateDrive is set, - * it also ensures that the selected drive matches the specified drive number. - * - * @this {RL11} - * @param {number} iDrive - * @param {boolean} [fUpdateDrive] is true to update the drive list to match the specified drive (eg, the auto-mount case) - * @return {boolean} true if successful, false if not - */ - displayDisk(iDrive, fUpdateDrive) - { - /* - * First things first: validate iDrive. - */ - var fSuccess = false; - if (iDrive >= 0 && iDrive < this.aDrives.length) { - var drive = this.aDrives[iDrive]; - var controlDisks = this.bindings["listDisks"]; - var controlDrives = this.bindings["listDrives"]; - /* - * Next, make sure controls for both drives and disks exist. - */ - if (controlDisks && controlDrives && controlDisks.options && controlDrives.options) { - /* - * Next, update the drive if the caller has requested it. - */ - var i; - if (fUpdateDrive) { - this.assert(iDrive == drive.iDrive); - for (i = 0; i < controlDrives.options.length; i++) { - if (Str.parseInt(controlDrives.options[i].value, 10) == drive.iDrive) { - if (controlDrives.selectedIndex != i) { - controlDrives.selectedIndex = i; - } - fSuccess = true; - break; - } - } - } - /* - * Next, make sure the drive whose disk we're updating is the currently selected drive. - */ - var iDriveSelected = Str.parseInt(controlDrives.value, 10); - var sTargetPath = (drive.fLocal? RL11.SOURCE.LOCAL : drive.sDiskPath); - if (!isNaN(iDriveSelected) && iDriveSelected == iDrive) { - for (i = 0; i < controlDisks.options.length; i++) { - if (controlDisks.options[i].value == sTargetPath) { - if (controlDisks.selectedIndex != i) { - controlDisks.selectedIndex = i; - } - fSuccess = true; - break; - } - } - if (i == controlDisks.options.length) controlDisks.selectedIndex = 0; - } - } - } - return fSuccess; - } - - /** - * selectDrive(sDrive) - * - * Used to programmatically select a drive by name. - * - * @this {RL11} - * @param {number} sDrive - * @return {boolean} true if successful, false if not - */ - selectDrive(sDrive) - { - var controlDrives = this.bindings["listDrives"]; - if (controlDrives && controlDrives.options) { - var nDrives = controlDrives.options.length; - for (var i = 0; i < nDrives; i++) { - if (controlDrives.options[i].innerHTML == sDrive) { - var iDrive = Str.parseInt(controlDrives.options[i].value, 10); - if (iDrive >= 0) { - return this.displayDisk(iDrive, true); - } - } - } - } - return false; - } - - /** - * unloadDrive(iDrive, fLoading) - * - * @this {RL11} - * @param {number} iDrive - * @param {boolean} [fLoading] - */ - unloadDrive(iDrive, fLoading) - { - var drive = this.aDrives[iDrive]; - - if (drive.disk || fLoading === false) { - - /* - * Before we toss the disk's information, capture any deltas that may have occurred. - */ - // this.updateDiskHistory(drive.sDiskName, drive.sDiskPath, drive.disk); - - drive.sDiskName = ""; - drive.sDiskPath = ""; - drive.disk = null; - drive.fLocal = false; - - // this.regInput |= FDC.REG_INPUT.DISK_CHANGE; - - if (!fLoading) { - this.notice("Drive " + this.getDriveName(iDrive) + " unloaded", fLoading); - this.sDiskSource = RL11.SOURCE.NONE; - this.displayDisk(iDrive); - } - } - } - - /** - * unloadAllDrives(fDiscard) - * - * @this {RL11} - * @param {boolean} fDiscard to discard all disk history before unloading - */ - unloadAllDrives(fDiscard) - { - // if (fDiscard) this.aDiskHistory = []; - - for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { - this.unloadDrive(iDrive, true); - } - } - - /** - * initController(data) - * - * @this {RL11} - * @param {Array} [data] - * @return {boolean} true if successful, false if failure - */ - initController(data) - { - var i = 0; - if (!data) data = []; - this.regRLCS = data[i++] || (RL11.RLCS.DRDY | RL11.RLCS.CRDY); - this.regRLBA = data[i++] || 0; - this.regRLDA = data[i++] || 0; - this.tmpRLDA = data[i++] || 0; - this.regRLMP = data[i++] || 0; - this.regRLBE = data[i] || 0; - - var fSuccess = true; - for (var iDrive = 0; iDrive < this.aDrives.length; iDrive++) { - var drive = this.aDrives[iDrive]; - if (drive === undefined) { - drive = this.aDrives[iDrive] = {}; - } - if (!this.initDrive(drive, iDrive)) { - fSuccess = false; - } - } - return fSuccess; - } - - /** - * initDrive(drive, iDrive, data) - * - * TODO: Consider a separate Drive class that any drive controller can use, since there's a lot of commonality - * between the drive objects created by disk controllers. This will clean up overall drive management and allow - * us to factor out some common Drive methods. - * - * @this {RL11} - * @param {Object} drive - * @param {number} iDrive - * @param {Array|undefined} [data] - * @return {boolean} true if successful, false if failure - */ - initDrive(drive, iDrive, data) - { - var i = 0; - var fSuccess = true; - - drive.iDrive = iDrive; - drive.name = this.idComponent; - drive.fBusy = drive.fLocal = false; - - /* - * NOTE: We initialize the following drive properties to their MAXIMUMs; disks may have - * these or SMALLER values (subject to the limits of what the controller supports, of course). - */ - drive.nCylinders = 512; - drive.nHeads = 2; - drive.nSectors = 40; - drive.cbSector = 256; - drive.fRemovable = true; - - /* - * The next group of properties are set by various controller command sequences. - */ - drive.bHead = 0; - drive.bCylinder = 0; - drive.bSector = 1; - drive.bSectorEnd = drive.nSectors; // aka EOT - drive.nBytes = drive.cbSector; - - /* - * The next group of properties are managed by worker functions (eg, doRead()) to maintain state across DMA requests. - */ - drive.ibSector = 0; - drive.sector = null; - - if (!drive.disk) drive.sDiskPath = ""; // ensure this is initialized to a default that displayDisk() can deal with - - /* - * Default drive status bits returned via the controller's Get Status command via the RLMP register - */ - drive.status = RL11.RLMP.GS_ST.LOCKON | RL11.RLMP.GS_BH | RL11.RLMP.GS_HO; - - return fSuccess; + return [ + this.regRLCS, + this.regRLBA, + this.regRLDA, + this.tmpRLDA, + this.regRLMP, + this.regRLBE + ]; } /** @@ -1093,7 +198,7 @@ class RL11 extends Component { if (this.messageEnabled()) this.printMessage(this.type + ": " + sFunc + "(" + iCylinder + ":" + iHead + ":" + iSector + ") " + Str.toOct(addr) + "--" + Str.toOct(addr + (nWords << 1)), true, true); - fInterrupt = fnReadWrite.call(this, drive, iCylinder, iHead, iSector, nWords, addr, this.doneReadWrite.bind(this)); + fInterrupt = fnReadWrite.call(this, drive, iCylinder, iHead, iSector, nWords, addr, 2, false, this.doneReadWrite.bind(this)); break; default: @@ -1107,7 +212,7 @@ class RL11 extends Component { } /** - * readData(drive, iCylinder, iHead, iSector, nWords, addr, done) + * readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) * * @this {RL11} * @param {Object} drive @@ -1116,10 +221,12 @@ class RL11 extends Component { * @param {number} iSector * @param {number} nWords * @param {number} addr + * @param {number} inc (normally 2, unless inhibited, in which case it's 0) + * @param {boolean} [fCheck] * @param {function(...)} [done] * @return {boolean|number} true if complete, false if queued (or if no done() is supplied, the error code, if any) */ - readData(drive, iCylinder, iHead, iSector, nWords, addr, done) + readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) { var err = 0; var checksum = 0; @@ -1190,7 +297,7 @@ class RL11 extends Component { } /** - * writeData(drive, iCylinder, iHead, iSector, nWords, addr, done) + * writeData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) * * @this {RL11} * @param {Object} drive @@ -1199,10 +306,12 @@ class RL11 extends Component { * @param {number} iSector * @param {number} nWords * @param {number} addr + * @param {number} inc (normally 2, unless inhibited, in which case it's 0) + * @param {boolean} [fCheck] * @param {function(...)} [done] * @return {boolean|number} true if complete, false if queued (or if no done() is supplied, the error code, if any) */ - writeData(drive, iCylinder, iHead, iSector, nWords, addr, done) + writeData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) { var err = 0; var checksum = 0; @@ -1427,20 +536,9 @@ class RL11 extends Component { } } -/* - * There's nothing super special about these values, except that NONE should be falsey and the others should not. - */ -RL11.SOURCE = { - NONE: "", - LOCAL: "?", - REMOTE: "??" -}; - /* * Alias RL11 definitions as class constants */ -RL11.PRI = PDP11.RL11.PRI; -RL11.VEC = PDP11.RL11.VEC; RL11.RLCS = PDP11.RL11.RLCS; // 174400: Control Status Register RL11.RLBA = PDP11.RL11.RLBA; // 174402: Bus Address Register RL11.RLDA = PDP11.RL11.RLDA; // 174404: Disk Address Register diff --git a/versions/pdpjs/1.32.2/pdp11-dbg.js b/versions/pdpjs/1.32.2/pdp11-dbg.js index 382b11114..d6cf7ed0c 100644 --- a/versions/pdpjs/1.32.2/pdp11-dbg.js +++ b/versions/pdpjs/1.32.2/pdp11-dbg.js @@ -15,6 +15,7 @@ http://pcjs.org/modules/pdp11/lib/keyboard.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/pc11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/rk11.js (C) Jeff Parsons 2012-2017 + http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/es6/state.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/es6/embed.js (C) Jeff Parsons 2012-2017 @@ -29,356 +30,344 @@ http://pcjs.org/modules/pdp11/lib/serial.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/disk.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/drive.js (C) Jeff Parsons 2012-2017 - http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/es6/debugger.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2017 */ 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;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var ea=0;function da(a){return"jscomp_symbol_"+(a||"")+ea++} -function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ga(this)}});fa=function(){}}function ga(a){var b=0;return ia(function(){return b":62,"?":63,"@":64,Zc:65,lh:66,nh:67,Lh:68,E:69,Qh:70,Sh:71,Th:72,Uh:73,Vh:74,Wh:75,Xh:76,Yh:77,Zh:78,$h:79,bi:80,Q:81,di:82,ei:83,ii:84,ki:85,li:86,mi:87,ri:88,si:89,Ae:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,ti:97,ui:98,vi:99,d:100,e:101,wi:102,xi:103,yi:104,zi:105,Ci:106,k:107,Di:108,Ei:109,n:110,Fi:111,p:112,q:113,r:114,Gi:115,t:116,Ii:117,Ji:118,Ki:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Zd:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.pd=b.comment;this.we=b;this.exports={};this.C=this.bindings={};a=this.id.indexOf(".");0>a?this.nb=this.id:(this.ob=this.id.substr(0,a),this.nb=this.id.substr(a+1));this.A={ready:!1,gb:!1,Qc:!1,fa:!1,error:!1};this.rc=null;this.A.error=!1;this.ia=c||0;this.G=this.f=this.D=this.J=this.Pa=null;va.push(this)}function wa(a,b,c){xa[a]&&b&&(xa[a][b]=c)} -function ya(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function za(a){var b=!1;window&&(b=window.confirm(a));return b}function Ba(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b":62,"?":63,"@":64,nd:65,Fh:66,Ih:67,gi:68,E:69,mi:70,oi:71,Bi:72,Di:73,Ei:74,Fi:75,Gi:76,Ji:77,Li:78,Ni:79,Qi:80,Q:81,Si:82,Ui:83,bj:84,dj:85,fj:86,gj:87,kj:88,lj:89,We:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,mj:97,nj:98,qj:99,d:100,e:101,rj:102,sj:103,tj:104,uj:105,yj:106,k:107,zj:108,Aj:109,n:110,Bj:111,p:112,q:113,r:114,Cj:115,t:116,Fj:117,Gj:118,Hj:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,ne:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Cd=b.comment;this.Te=b;this.exports={};this.H=this.bindings={};a=this.id.indexOf(".");0>a?this.Fb=this.id:(this.pb=this.id.substr(0,a),this.Fb=this.id.substr(a+1));this.A={ready:!1,jb:!1,$c:!1,ca:!1,error:!1};this.zc=null;this.A.error=!1;this.fa=c||0;this.F=this.f=this.C=this.K=this.Qa=null;ua.push(this)}function va(a,b,c){xa[a]&&b&&(xa[a][b]=c)} +function ya(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function za(a){var b=!1;window&&(b=window.confirm(a));return b}function Aa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=1,f--;return d}function F(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d} -function Qa(a){var b=2,c="";b?10=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function Ra(a){return H(a,4,!0)} -function Sa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Wa[a]})}function Xa(a,b){return(a+" ").slice(0,b)} -function ab(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Wa={"&":"&","<":"<",">":">",'"':""","'":"'"},bb={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",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 cb(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 eb(a,b,c,d){c=void 0===c?!1:c;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, +function La(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=1,f--;return d}function E(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d} +function Ra(a){var b=2,c="";b?10=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function Sa(a){return F(a,4,!0)} +function Ta(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Xa[a]})}function Ya(a,b){return(a+" ").slice(0,b)} +function Za(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Xa={"&":"&","<":"<",">":">",'"':""","'":"'"},$a={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",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 ab(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 fb(a,b,c,d){c=void 0===c?!1:c;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 l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}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 fb(a,b){var c,d={ca:null,ha:null,Ba:null,Aa: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.Ba=g.load;d.Aa=g.exec;if(e=g.bytes)d.ca=e;else if(e=g.words)for(d.ca=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ca=Array(4*e.length),f=c=0;c>8&255,d.ca[f++]=e[c]>>16&255,d.ca[f++]=e[c]>>24&255;else d.ca=g;d.ha=g.symbols;d.ca.length?1==d.ca.length&&(v(d.ca[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.wa=g.load;d.va=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&&(v(d.aa[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.b["S"+a]=[0,0,!1,!1,this.Te,a];this.G=this.f=this.D=this.J=null;A(this)}p(Wb,q);h=Wb.prototype; -h.reset=function(a){this.stop();a&&Yb(this,this.Sa=0)}; -h.sa=function(a,b,c,d){if(this.J&&this.J.sa(a,b,c,d)||this.f&&this.f.sa(a,b,c,d)||this.G&&this.G.sa(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.C[b]=c,this.u++,!0;default:return"led"==a||"rled"==a?(this.C[b]=c,this.i[b]=d?1:0,this.u++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.C[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, -b){return function(){Zb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){$b(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Zb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){$b(a,b)}}(this,b),!0):q.prototype.sa.call(this,a,b,c,d)}};h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;ac(b,this,bc);cc(b,this.reset.bind(this));dc(this);ec(this)}; -h.ya=function(a,b){if(!b)if(this.M&&fc(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.save=function(){var a=new I(this);a.set(0,[this.ga,this.Sa,this.Ta]);return a.data()};h.restore=function(a){if(a=a[0])gc(this,this.ga=a[0]),Yb(this,this.Sa=a[1]),hc(this,a[2]);return!0};function ic(a,b,c){if(a=a.C[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function dc(a,b){for(var c in a.i)ic(a,c,null!=b?b:a.i[c])} -function jc(a,b,c){if(a=a.C[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function ec(a){for(var b in a.b)jc(a,b,a.b[b][1])}function kc(a,b,c,d){if(a.C[b]){var e=a.G&&a.G.Ca||8;c=c||0;c=8==e?F(c,d):H(c,d);a.C[b].textContent!=c&&(a.C[b].textContent=c)}}function Zb(a,b){var c=a.b[b];jc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=lc&&(a.H=b==mc,a.I=b==nc)} -function $b(a,b){var c=a.b[b];c[2]&&c[3]&&(jc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Re=function(a){a||this.f.A.T||(a=this.f,a.D.reset(),oc(a),this.b[pc]&&this.b[pc][1]&&qc(this.f))};h.Se=function(){};h.Ne=function(a){a||this.f.ba()}; -h.Le=function(a){if(!a&&!this.f.A.T)if(this.b[pc]&&this.b[pc][1])qc(this.f);else{if((a=this.G)&&!Ia(a,!0))Na(a,!0),rc(a,0,null),Na(a,!1);else try{var b=this.f.jc(1);0=a.f.ka?8:16,c=65472<=a.ga&&a.ga<65472+b,b=c?1:2,c=c?15:a.D.I;a.b[lc]&&a.b[lc][1]||(b=-b);gc(a,a.ga&~c|a.ga+b&c)} -function gc(a,b){a.ga=b&a.D.I;if(a.B!==a.ga){a.B=a.ga;b=a.B;for(var c=0;22>c;c++)Lc(a,"A"+c,b&1<c;c++)Lc(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.H=this.M/this.j|0;this.U=this.H-1;this.Ma=[];this.ma=0;this.F=!1;this.N=[];this.Be=[Rc,Sc,Tc,Uc];this.b=this.u=[];this.B=this.L=this.w=this.P=this.R=0;a=new K(this);Vc(a,this.G);this.b=Array(this.H);this.u=Array(this.H);for(b=0;b>>this.g;this.L=0;this.w=this.I;A(this)}p(Pc,q);function Yc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.u[a.R]=a.b[a.P])}}h=Pc.prototype;h.reset=function(){for(var a=0;a>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.K)return l.Kb+=l.K-f,l.K=f,!0;if(f>=l.K+l.Kb){n=l.size-(f-m);n>g&&(n=g);l.Kb=f-l.K+n;f=m+a.j;g-=n;k++;continue}}return $c(ad,f,g)}f=new K(a,f,n,a.j,d,e);Vc(f,a.G,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+bd[d]+" at "+F(b)),!0):$c(cd,b,c)}h.$c=function(a){return this.u[(a&this.w)>>>this.g].xb(a&this.i,a)}; -h.ic=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Lb||b!=this.i?this.u[c].na(b,a):this.u[c++].xb(b,a)|this.u[c&this.U].xb(0,a+1)<<8};h.ad=function(a,b){this.u[(a&this.w)>>>this.g].zb(a&this.i,b,a)};h.Ob=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Lb||c!=this.i?this.u[d].Ab(c,b,a):(this.u[d++].zb(c,b&255,a),this.u[d&this.U].zb(0,b>>8&255,a+1))};function dd(a,b){return a.b[(b&a.I)>>>a.g]} -function Jc(a,b){var c;a.F=!1;a.ma++;var d=b&a.i,e=dd(a,b);Lb||d!=a.i?c=e.B(d,b):c=e.j(d,b)|dd(a,b+1).j(0,b+1)<<8;a.ma--;return c}function ed(a,b,c){a.F=!1;a.ma++;dd(a,b).D(b&a.i,c&255,b);a.ma--}function wc(a,b,c){a.F=!1;a.ma++;var d=b&a.i,e=dd(a,b);Lb||d!=a.i?e.F(d,c&65535,b):(e.D(d,c&255,b),dd(a,b+1).D(0,c>>8&255,b+1));a.ma--} -function Zc(a){for(var b=0,c=[],d=0;da.f.ka)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Ma[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&B(this.f,16|e[5])&&C(this.f,e[4]+".readByte("+M(this.f,b)+"): "+M(this.f,c),!0,!d.ma),c;d.La(b,16,3);c=255;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to byte @"+M(this.f,b)+": "+M(this.f,c),!0,!d.ma);return c} -function Sc(a,b,c){var d=!1,e=this.controller,f=e.Ma[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ma[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&B(this.f,16|f[5])&&C(this.f,f[4]+".writeByte("+M(this.f,c)+","+M(this.f,b)+")",!0,!e.ma):(e.La(c,16,5),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to byte @"+M(this.f,c)+": "+M(this.f, -b),!0,!e.ma))}function Tc(a,b){var c=-1,d=this.controller;a=d.Ma[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".readWord("+M(this.f,b)+"): "+M(this.f,c),!0,!d.ma),c;d.La(b,16,2);c=65535;this.f&&B(this.f,16)&&C(this.f,"warning: unconverted read access to word @"+M(this.f,b)+": "+M(this.f,c),!0,!d.ma);return c} -function Uc(a,b,c){var d=!1,e=this.controller;a=e.Ma[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&B(this.f,16|a[5])&&C(this.f,a[4]+".writeWord("+M(this.f,c)+","+M(this.f,b)+")",!0,!e.ma):(e.La(c,16,4),this.f&&B(this.f,16)&&C(this.f,"warning: unconverted write access to word @"+M(this.f,c)+": "+M(this.f,b),!0,!e.ma))}function N(a){q.call(this,"Device",a,256);this.b={Za:128,Xc:-1}}p(N,q);h=N.prototype; -h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.G=d;var e=this;this.b.Xc=kd(c,function(){e.b.Za|=128;e.b.Za&64&&ld(e.f,e.b.ib);e.J&&J(e.J,1);md(e.f,e.b.Xc,1E3/60)});this.b.ib=nd(c,64,6,524288);ac(b,this,od);cc(b,this.reset.bind(this));d&&pd(d,64,function(a){var b=e.f;rd(e,"KIPDR",b.B[0],0,a[0]);rd(e,"KDPDR",b.B[0],8,a[0]);rd(e,"KIPAR",b.M[0],0,a[0]);rd(e,"KDPAR",b.M[0],8,a[0],!0);rd(e,"SIPDR",b.B[1],0,a[0]);rd(e,"SDPDR",b.B[1],8,a[0]);rd(e,"SIPAR",b.M[1],0,a[0]);rd(e,"SDPAR",b.M[1],8,a[0], -!0);rd(e,"UIPDR",b.B[3],0,a[0]);rd(e,"UDPDR",b.B[3],8,a[0]);rd(e,"UIPAR",b.M[3],0,a[0]);rd(e,"UDPAR",b.M[3],8,a[0],!0);b.V&32&&rd(e,"UNIMAP",b.Fa,-1,a[0])});A(this)};function rd(a,b,c,d,e,f){a=a.G;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Fa[a>>1];return a&1?b>>16:b&65535};h.bh=function(a,b){b=b>>1&63;var c=b>>1;this.f.Fa[c]=b&1?this.f.Fa[c]&65535|(a&63)<<16:this.f.Fa[c]&-65536|a&65534};h.Mf=function(a){return this.f.B[1][a>>1&7]};h.Vg=function(a,b){this.f.B[1][b>>1&7]=a&65295};h.Kf=function(a){return this.f.B[1][(a>>1&7)+8]};h.Tg=function(a,b){this.f.B[1][(b>>1&7)+8]=a&65295};h.Lf=function(a){return this.f.M[1][a>>1&7]}; -h.Ug=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.Jf=function(a){return this.f.M[1][(a>>1&7)+8]};h.Sg=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.df=function(a){return this.f.B[0][a>>1&7]};h.qg=function(a,b){this.f.B[0][b>>1&7]=a&65295};h.bf=function(a){return this.f.B[0][(a>>1&7)+8]};h.og=function(a,b){this.f.B[0][(b>>1&7)+8]=a&65295};h.cf=function(a){return this.f.M[0][a>>1&7]};h.pg=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.B[0][b]&=65295}; -h.af=function(a){return this.f.M[0][(a>>1&7)+8]};h.ng=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.B[0][b]&=65295};h.Sf=function(a){return this.f.B[3][a>>1&7]};h.ah=function(a,b){this.f.B[3][b>>1&7]=a&65295};h.Qf=function(a){return this.f.B[3][(a>>1&7)+8]};h.Zg=function(a,b){this.f.B[3][(b>>1&7)+8]=a&65295};h.Rf=function(a){return this.f.M[3][a>>1&7]};h.$g=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Pf=function(a){return this.f.M[3][(a>>1&7)+8]}; -h.Yg=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Ib=function(a){a&=7;return this.f.w&2048?this.f.pa[a]:this.f.g[a]};h.Mb=function(a,b){b&=7;this.f.w&2048?this.f.pa[b]=a:this.f.g[b]=a};h.qf=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.zg=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.tf=function(){return this.f.g[7]};h.Cg=function(a){this.f.g[7]=a};h.Jb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.pa[a]}; -h.Nb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.pa[b]=a};h.rf=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Ag=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.sf=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Bg=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.$e=function(a){return this.f.fc[a-65504>>1]};h.mg=function(a,b){this.f.fc[b-65504>>1]=a};h.Od=function(a){return 65520==a?(fd(this.D)>>6)-1:0}; -h.Td=function(){};h.Of=function(){return 1};h.Xg=function(){};h.Ze=function(){return this.f.R};h.lg=function(){this.f.R=0};h.ff=function(){return this.f.cc};h.sg=function(a,b){b&1||(a&=255);this.f.cc=a};h.lf=function(a,b){return b?0:this.f.Va};h.vg=function(a){yd(this.f,a)};h.Nf=function(a,b){return b?0:this.f.za&65280};h.Wg=function(a){this.f.za=a|255};h.pf=function(){return zd(this.f)};h.yg=function(a){Ad(this.f,a)};h.Sd=function(a,b){B(this)&&C(this,"writeIgnored("+F(b)+"): "+F(a),!0,!0)}; -var O={},od=(O[61568]=[null,null,N.prototype.Tf,N.prototype.bh,"UNIMAP",64,1170],O[62592]=[null,null,N.prototype.Mf,N.prototype.Vg,"SIPDR",8,1145,64],O[62608]=[null,null,N.prototype.Kf,N.prototype.Tg,"SDPDR",8,1145,64],O[62624]=[null,null,N.prototype.Lf,N.prototype.Ug,"SIPAR",8,1145,64],O[62640]=[null,null,N.prototype.Jf,N.prototype.Sg,"SDPAR",8,1145,64],O[62656]=[null,null,N.prototype.df,N.prototype.qg,"KIPDR",8,1140,64],O[62672]=[null,null,N.prototype.bf,N.prototype.og,"KDPDR",8,1145,64],O[62688]= -[null,null,N.prototype.cf,N.prototype.pg,"KIPAR",8,1140,64],O[62704]=[null,null,N.prototype.af,N.prototype.ng,"KDPAR",8,1145,64],O[62798]=[null,null,N.prototype.kf,N.prototype.ug,"MMR3",1,1145,64],O[65382]=[null,null,N.prototype.ef,N.prototype.rg,"LKS"],O[65402]=[null,null,N.prototype.gf,N.prototype.tg,"MMR0",1,1140,64],O[65404]=[null,null,N.prototype.hf,N.prototype.Sd,"MMR1",1,1145,64],O[65406]=[null,null,N.prototype.jf,N.prototype.Sd,"MMR2",1,1140,64],O[65408]=[null,null,N.prototype.Sf,N.prototype.ah, -"UIPDR",8,1140,64],O[65424]=[null,null,N.prototype.Qf,N.prototype.Zg,"UDPDR",8,1145,64],O[65440]=[null,null,N.prototype.Rf,N.prototype.$g,"UIPAR",8,1140,64],O[65456]=[null,null,N.prototype.Pf,N.prototype.Yg,"UDPAR",8,1145,64],O[65472]=[null,null,N.prototype.Ib,N.prototype.Mb,"R0SET0"],O[65473]=[null,null,N.prototype.Ib,N.prototype.Mb,"R1SET0"],O[65474]=[null,null,N.prototype.Ib,N.prototype.Mb,"R2SET0"],O[65475]=[null,null,N.prototype.Ib,N.prototype.Mb,"R3SET0"],O[65476]=[null,null,N.prototype.Ib, -N.prototype.Mb,"R4SET0"],O[65477]=[null,null,N.prototype.Ib,N.prototype.Mb,"R5SET0"],O[65478]=[null,null,N.prototype.qf,N.prototype.zg,"R6KERNEL"],O[65479]=[null,null,N.prototype.tf,N.prototype.Cg,"R7KERNEL"],O[65480]=[null,null,N.prototype.Jb,N.prototype.Nb,"R0SET1",1,1145],O[65481]=[null,null,N.prototype.Jb,N.prototype.Nb,"R1SET1",1,1145],O[65482]=[null,null,N.prototype.Jb,N.prototype.Nb,"R2SET1",1,1145],O[65483]=[null,null,N.prototype.Jb,N.prototype.Nb,"R3SET1",1,1145],O[65484]=[null,null,N.prototype.Jb, -N.prototype.Nb,"R4SET1",1,1145],O[65485]=[null,null,N.prototype.Jb,N.prototype.Nb,"R5SET1",1,1145],O[65486]=[null,null,N.prototype.rf,N.prototype.Ag,"R6SUPER",1,1145],O[65487]=[null,null,N.prototype.sf,N.prototype.Bg,"R6USER",1,1145],O[65504]=[null,null,N.prototype.$e,N.prototype.mg,"CTRL",8,1170],O[65520]=[null,null,N.prototype.Od,N.prototype.Td,"LSIZE",1,1170],O[65522]=[null,null,N.prototype.Od,N.prototype.Td,"HSIZE",1,1170],O[65524]=[null,null,N.prototype.Of,N.prototype.Xg,"SYSID",1,1170],O[65526]= -[null,null,N.prototype.Ze,N.prototype.lg,"ERR",1,1170],O[65528]=[null,null,N.prototype.ff,N.prototype.sg,"MBR",1,1170],O[65530]=[null,null,N.prototype.lf,N.prototype.vg,"PIR"],O[65532]=[null,null,N.prototype.Nf,N.prototype.Wg,"SLR"],O[65534]=[null,null,N.prototype.pf,N.prototype.yg,"PSW"],O); -yb(function(){for(var a=y(document,x,"device"),b=0;b>1),this.b=new Int32Array(this.u,0,this.size>>2),Gd(this,Hd?Id:Rd);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.Xe=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.Zf=function(a,b){Kb&&a&1&&this.C.La(b,64,2);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}; -h.jg=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.Xa=!0};h.Ve=function(a,b){this.f&&null!=this.K&&Yd(this.f,this.K+a);return this.j(a,b)};h.Vf=function(a,b){this.f&&null!=this.K&&Yd(this.f,this.K+a,2);return this.B(a,b)}; -h.hg=function(a,b,c){this.f&&null!=this.K&&Zd(this.f,this.K+a);this.J?this.Lb(0,b,c):this.D(a,b,c)};h.eh=function(a,b,c){this.f&&null!=this.K&&Zd(this.f,this.K+a,2);this.J?this.Lb(0,b,c):this.F(a,b,c)};h.Ue=function(a){return this.g[a]};h.We=function(a,b){a=this.g[a];this.f&&B(this.f,32)&&C(this.f,"Memory.readByte("+M(this.f,b)+"): "+M(this.f,a),!0);return a};h.Uf=function(a,b){Kb&&a&1&&this.C.La(b,64,2);return this.w.getUint16(a,!0)}; -h.Yf=function(a,b){Kb&&a&1&&this.C.La(b,64,2);a=!Lb&&a&1?this.g[a]|this.g[a+1]<<8:this.H[a>>1];this.f&&B(this.f,32)&&C(this.f,"Memory.readWord("+M(this.f,b)+"): "+M(this.f,a),!0);return a};h.gg=function(a,b){this.g[a]=b;this.Xa=!0};h.ig=function(a,b,c){this.g[a]=b;this.Xa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeByte("+M(this.f,c)+","+M(this.f,b)+")",!0)};h.dh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);this.w.setUint16(a,b,!0);this.Xa=!0}; -h.fh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);!Lb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.H[a>>1]=b;this.Xa=!0;this.f&&B(this.f,32)&&C(this.f,"Memory.writeWord("+M(this.f,c)+","+M(this.f,b)+")",!0)};var Ed=0,gd=1,Fd=2,Xc=4,bd=["NONE","RAM","ROM","VID","H/W"],Dd=0,Td=[],Sd=[K.prototype.Xe,K.prototype.jg,K.prototype.Zf,K.prototype.gh],Wd=[K.prototype.Ve,K.prototype.hg,K.prototype.Vf,K.prototype.eh]; -if(Gb)var Rd=[K.prototype.Ue,K.prototype.gg,K.prototype.Uf,K.prototype.dh],Id=[K.prototype.We,K.prototype.ig,K.prototype.Yf,K.prototype.fh];var $d;if(Gb){var ae=new ArrayBuffer(2);(new DataView(ae)).setUint16(0,256,!0);$d=256===(new Uint16Array(ae))[0]}else $d=!1;var Hd=$d; -function be(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Cc=0;this.zc=b;this.eb=c;this.Kc=Math.round(this.zc/1E4)/100;this.qb=this.Kc*this.eb;this.Lc=this.Zb=this.ub=this.Ac=0;this.A.T=this.A.vc=!1;this.A.va=a.autoStart;"string"==typeof this.A.va&&(this.A.va="true"==this.A.va);this.A.Db=!1;this.Xb=this.Fb=0;this.Yb=+a.csStart;this.Eb=+a.csInterval;this.Gb=+a.csStop;this.ja=[];this.ud=this.cg.bind(this);this.fb=this.Ia=this.cb=this.b=this.la=this.Ha=this.Wb=this.bb=this.Hb= -this.Mc=this.pb=0;this.ua=null;A(this)}p(be,q);h=be.prototype;h.wa=function(a,b,c,d){this.J=a;this.D=b;this.G=d;this.ua=a.i;for(a=0;a=a.Fb&&(a.Fb+=a.Eb,c=!0);0<=a.Gb&&a.Gb<=je(a)&&(a.Eb=a.Gb=-1,fe(a),a.ba(),c=!0);c&&a.v(je(a)+" cycles: checksum="+H(a.Xb))}} -h.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.C[b]=c,!0;case "run":return this.C[b]=c,c.onclick=function(){var a;if(a=d.J)if(a=d.J,a.A.fa)a=!0;else{var b=null,c,k=Ba(a.id);for(c=0;ca.pb/a.qb?b=1:d=!0;a.eb=b;b=a.Kc*a.eb;if(a.qb!=b){a.qb=b;b=a.qb.toFixed(2)+"Mhz";var e=a.C.setSpeed;e&&(e.textContent=b);a.v("target speed: "+b)}c&&a.J&&ne(a.J)}tc(a,a.Ia);a.Ia=0;a.Ha=ya();a.bb=0;le(a);return d}function kd(a,b){var c=a.ja.length;a.ja.push([-1,b]);return c}function md(a,b,c,d){0<=b&&ba.ja[b][0])&&(c=a.zc*a.eb/1E3*c|0,a.A.T&&(c+=oe(a)),a.ja[b][0]=c)} -function pe(a,b){for(var c=a.ja.length-1;0<=c;c--){var d=a.ja[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function qe(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function oe(a,b){var c=a.cb-=a.b;a.b=a.la=0;b&&(a.cb=0);return c} -h.cg=function(){if(this.A.T){this.Ac>=this.zc&&le(this,!0);this.Hb=0;this.Wb=ya();if(this.bb){var a=this.Wb-this.bb;a>this.Lc&&(this.Ha+=a,this.Ha>this.Wb&&(this.Ha=this.Wb))}try{do{var b=pe(this,this.A.Db?1:this.Zb);try{this.jc(b)}catch(e){if("number"!=typeof e)throw e;}b=oe(this,!0);this.Hb+=b;this.Ia+=b;uc(this,b);sc(this,b);this.ub-=b;if(0>=this.ub){this.ub+=this.Zb;++this.Mc>=re&&(this.J&&J(this.J,void 0),this.Mc=0);break}}while(this.A.T)}catch(e){this.ba();this.J&&this.J.stop(ya(),je(this)); -Fa(this,e.stack||e.message);return}if(this.A.T){a=setTimeout;b=this.ud;this.bb=ya();var c=this.Lc;this.Hb&&(c=Math.round(c*this.Hb/this.Zb));var c=c-(this.bb-this.Wb),d=this.bb-this.Ha;d&&(this.pb=Math.round(this.Ia/(10*d))/100,864E5<=d&&(this.fb=0,ke(this)));if(0>c||this.pbc&&(this.Ha-=c),c=0;this.Ac+=this.Hb;this.bb+=c;a(b,c)}}}; -function qc(a,b){if(!Ga(a))if(a.A.T)a.v(a.toString()+" busy");else{ke(a);a.A.T=!0;a.A.vc=!0;var c=a.C.run;c&&(c.textContent="Halt");a.J&&(b&&ne(a.J,!0),a.J.start(a.Ha,je(a)));a.G||a.status("Started");setTimeout(a.ud,0)}}h.jc=function(){return 0};h.ba=function(a){var b=!1;if(this.A.T){oe(this);tc(this,this.Ia);this.Ia=0;this.A.T=!1;if(b=this.C.run)b.textContent="Run";this.J&&this.J.stop(ya(),je(this));b=!0;this.G||this.status("Stopped")}this.A.complete=a;return b};var me=30,re=15,ce=["power","reset"]; -function se(a){var b=+a.model||1170;be.call(this,a,6666667);this.ka=b;this.od=+a.addrReset||0;this.Ua=this.w=this.N=this.F=this.H=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Fa=this.fc=[];this.$a=this.P=this.ld=this.rb=this.lb=this.sb=this.ab=this.R=this.cc=this.Va=this.za=this.U=this.dc=this.ec=this.V=this.i=0;this.qd=[4,2,0,1];this.gc=0;this.rd=255;1120>=this.ka?(this.kd=te.bind(this),this.Cb=this.Fe,this.gc=8,this.rd=-1,this.yd=255,this.xd=0):(this.kd=ue.bind(this),this.Cb=this.Ge, -this.yd=~(1792|(1140>=this.ka?2048:0))&65535,this.xd=1140e.yb&&(e.yb=c,c+=4)}return be.prototype.ya.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.ka);this.A.T&&this.ba();this.F=65536;this.H=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.od,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,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,65535, -65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.fc=[0,0,0,0,0,0,0,0];this.N=0;this.Ua=-1;this.u=this.j=this.yc=this.X=this.Z=this.i=this.cc=0;oc(this);ee(this);this.A.error=!1;be.prototype.reset.call(this)};function oc(a){a.U=0;a.dc=0;a.ec=0;a.V=0;a.R=0;a.Va=0;a.za=255;a.rb=0;a.lb=0;a.sb=0;a.ab=262143;a.$a=a.g[7];a.P=0;a.S=null;a.D&&(ve(a),a.ld=fd(a.D))} -function ve(a){a.Sb=a.Ec;a.Tb=a.Fc;a.wc=a.Gc;a.Ub=a.Jc;a.ac&&(a.Sb=a.Hd,a.Tb=a.Md);a.bc&&(a.wc=a.Qd,a.Ub=a.Rd);a.rb?(a.Ga=65536,a.mb=a.V&16?4186112:253952,a.Ea=a.Ld,a.na=a.ac?a.Xf:a.Vc,a.Ab=a.bc?a.ih:a.Yc,Yc(a.D,a.V&16?22:18)):(a.Ga=0,a.mb=57344,a.Ea=a.Ie,a.na=a.ac?a.Wf:a.Pd,a.Ab=a.bc?a.hh:a.Ud,Yc(a.D,16))}function td(a){var b=a.U;b&57344||(b=b&-3199|a.lb<<5|a.sb<<1);return b} -function ud(a,b){b&=-3073;if(a.U!=b){b&57344&&!(a.U&57344)&&(a.dc=a.P>>16&65535,a.ec=a.P&65535);a.U=b;a.lb=(b&96)>>5;a.sb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.rb!=c&&(a.rb=c,ve(a))}}function vd(a){a.U&57344||(a.dc=a.P>>16&65535);a=a.dc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function wd(a){a.U&57344||(a.ec=a.P&65535);return a.ec}function xd(a,b){1170>a.ka&&(b&=-49);a.V!=b&&(a.V=b,a.ab=b&16?4194303:262143,ve(a))} -function we(a,b,c){a.od=b;xe(a,b);Ad(a,0);a.D.reset();oc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.T||qc(a)}else a.G&&a.A.fa?a.ba()||(ge(a.G),J(a.J,-1)):!1===c&&a.ba();!a.A.T&&a.ua&&a.ua.stop()}h.Id=function(){return 0}; -h.save=function(){var a=new I(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Fa,this.fc,this.R,this.cc,this.Va,this.za,this.lb,this.sb,this.$a,this.i,this.P,this.Ua,this.hc,this.kc]);a.set(1,[zd(this),td(this),vd(this),wd(this),this.V]);a.set(2,[this.fb,this.eb,this.A.va]);a.set(3,ye(this));a.set(4,qe(this));return a.data()}; -h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Fa=b.next().value;this.fc=b.next().value;this.R=b.next().value;this.cc=b.next().value;this.Va=b.next().value;this.za=b.next().value;this.lb=b.next().value;this.sb=b.next().value;this.$a=b.next().value;this.i=b.next().value;this.P=b.next().value;this.Ua=b.next().value;this.hc=b.next().value;this.kc=b.next().value;b=a[1];Ad(this,b[0]);ud(this,b[1]); -this.dc=b[2];this.ec=b[3];xd(this,b[4]);b=a[2];this.fb=b[0];ke(this,b[1]);this.A.va=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function xe(a,b){a.g[7]=b&65535}function nd(a,b,c,d){b={yb:b,jb:c,message:d||0,name:Ob[b],next:null};a.Vb.push(b);return b}function Ee(a,b){var c=a.S;if(c==b)a.S=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.S&&(a.i|=1)} -function ld(a,b){if(b){if(b!=a.S){var c=a.S;if(!c||c.jb<=b.jb)b.next=c,a.S=b;else{do{var d=c.next;if(!d||d.jb<=b.jb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&B(a,b.message|8)&&C(a,"setIRQ(vector="+F(b.yb)+",priority="+b.jb+")",!0,!0)}}function sd(a,b){b&&(Ee(a,b),b.message&&B(a,b.message|8)&&C(a,"clearIRQ(vector="+F(b.yb)+",priority="+b.jb+")",!0,!0))}function ye(a){var b=[];for(a=a.S;a;)b.push(a.yb),a=a.next;return b} -function Fe(a){return a.i&64?(a.ta(168,64,-6),!0):a.i&32?(a.ta(4,32,-5),!0):a.i&16?(a.ta(12,16,-7),!0):!1}function zd(a){return a.w=a.w&63728|Ce(a)|Be(a)|Ae(a)|ze(a)}function Ad(a,b){b&=a.yd;a.I=b<<12;a.L=~b&4;a.H=b<<14;a.F=b<<16;if((b^a.w)&a.xd)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.N=b>>14&3;c=a.w>>14&3;a.N!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.N]);a.w=b;a.i&=-3;a.i|=a.S?2:1}function yd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.Va=b} -h.Da=function(a){this.I=this.L=a;this.H=0};h.kb=function(a,b){this.I=this.L=this.F=a;this.H=b||0};function Ge(a,b){a.I=a.L=a.F=b;a.H=a.I^a.F>>1}function He(a,b,c,d){a.I=a.L=a.F=b;a.H=(c^d)&(d^b)} -h.ta=function(a,b,c){if(!this.oa){0>this.Ua?this.Ua=zd(this):this.N||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.R|=4,this.g[6]=a=4);if(-1!=c){this.P=a|4143316992;this.N=0;var d=this.na(a|this.Ga),e=this.na(a+2&65535|this.Ga);Ad(this,e&-12289|this.Ua>>2&12288);Ie(this,this.Ua);Ie(this,this.g[7]);xe(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Ua=-1;this.hc=c;this.kc=a;-1==c&&this.ba();if(-4<=c)throw a;}}; -function Je(a){var b=Ke(a),c=Ke(a);a.w&49152&&(c=c&-225|a.w&63712);xe(a,b);Ad(a,c);a.i&=-17}function Le(a,b){var c=b>>13&31;31>c&&(b=a.V&32?a.Fa[c]+(b&8191)&4194303:b&-3932161);return b} -function Me(a,b,c){var d=[];if(c){c=Le(a,b);var e=b>>13&31;d.push(c);d.push(e);a.V&32&&(d.push(a.Fa[e]),d.push(b&8191))}else if(a.rb){var e=a.N<<1,f=b>>13;7>13;a.V&a.qd[a.N]||(d&=7);e=a.B[a.N][d];f=(a.M[a.N][d]<<6)+(b&8191)&a.ab;3932160<=f&&(f=Le(a,f));if(a.oa)return f;f>=a.ld&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.B[a.N][d]=e;if(f!=(4194170&a.ab)||a.N)a.lb=a.N,a.sb=d;g&&(g&57344&&(0<=a.Ua&&(g|=128),a.U&57344||(g|=a.U&4096|a.lb<<5|a.sb<<1,ud(a,a.U&-61695|g&61694)),a.ta(168,64,-2)),a.U&61440||!(f<(4191360&a.ab)||f>(4194239&a.ab))||(a.U|=4096,a.U&512&&(a.i|=64)));return f}function Ke(a){var b=a.na(a.g[6]|a.Ga);a.g[6]=a.g[6]+2&65535;return b}function Ie(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.P=a.P&65535|(a.P&-65536)<<8|16121856;a.i&256||a.Cb(4,-2,c);a.Ab(c,b)} -function Ne(a,b,c,d){var e,f,g=d&8?0:a.Ga;switch(b){case 0:return a.ta(4,0,-3),0;case 1:return 6==c&&a.Cb(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Cb(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Cb(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(De(a,2)),e=e+a.g[c]&65535,6==c&&a.Cb(d, -0,e),a.b-=6,e|g;case 7:return e=a.na(De(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ga),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.P=a.P&65535|(a.P&-65536)<<8|(f<<3&248|c)<<16;return e}h.Fe=function(a,b,c){!this.N&&0>=b&&c<=this.za&&(this.i|=32)};h.Ge=function(a,b,c){this.N||(65534<=c&&(c|=-65536),a&4&&c<=this.za&&(c<=this.za-32?this.ta(4,0,-4):(this.R|=8,this.i|=32)))};h.Hd=function(a){this.G&&Yd(this.G,a,1);return this.Ec(a)};h.Md=function(a){this.G&&Yd(this.G,a,2);return this.Fc(a)}; -h.Qd=function(a,b){this.G&&Zd(this.G,a,1);this.Gc(a,b)};h.Rd=function(a,b){this.G&&Zd(this.G,a,2);this.Jc(a,b)};function Kc(a,b){a.oa++;b=a.D.ic(xc(a,b,2));a.oa--;return b}function Oe(a,b){(b?--a.bc:--a.ac)||ve(a)}h.Ie=function(a,b,c){return Ne(this,a,b,c)};h.Ld=function(a,b,c){return xc(this,Ne(this,a,b,c),c)};h.Pd=function(a){return this.D.ic(this.$a=a)};h.Wf=function(a){this.G&&Yd(this.G,a,2);return this.Pd(a)};h.Vc=function(a){return this.D.ic(this.$a=xc(this,a,2))}; -h.Xf=function(a){this.G&&Yd(this.G,a,2);return this.Vc(a)};h.Ud=function(a,b){this.D.Ob(this.$a=a,b)};h.hh=function(a,b){this.G&&Zd(this.G,a,2);this.Ud(a,b)};h.Yc=function(a,b){this.D.Ob(this.$a=xc(this,a,4),b)};h.ih=function(a,b){this.G&&Zd(this.G,a,2);this.Yc(a,b)};function Pe(a,b,c){var d=a.j=b&7;(b=a.u=(b&56)>>3)?(d=Ne(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.N=a.w>>12&3,c=a.na(d|c&a.Ga),a.N=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} -function Qe(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=Ne(a,b,e,4),c&65536||(e&=65535),a.N=a.w>>12&3,e=xc(a,e|c&65536,4),a.N=a.w>>14&3,a.Ub(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Re(a,b){b>>=6;var c=a.Z=b&7;return(b=a.X=(b&56)>>3)?a.Sb(a.Ea(b,c,3)):a.g[c+a.gc]&a.rd}function Se(a,b){var c;b>>=6;var d=a.Z=b&7;(b=a.X=(b&56)>>3)?c=a.Tb(a.Ea(b,d,2)):c=a.g[d+a.gc];return c}function Te(a,b){var c=a.j=b&7;b=a.u=(b&56)>>3;return Ne(a,b,c,8)} -function Ue(a,b){var c=a.j=b&7;return(b=a.u=(b&56)>>3)?a.Sb(a.Ea(b,c,3)):a.g[c]&255}function Ve(a,b){var c,d=a.j=b&7;(b=a.u=(b&56)>>3)?c=a.Tb(a.Ea(b,d,2)):c=a.g[d];return c}function We(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.yc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.wc(e,d.call(a,c,a.Sb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} -function S(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,6),a.Ub(e,d.call(a,0>c?a.g[-c-1]:c,a.Tb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function sf(a,b,c,d,e){var f=a.j=b&7;(b=a.u=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.wc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} -function tf(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Ub(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} -h.jc=function(a){this.A.complete=!0;var b=this.G?uf(this.G)?1:this.A.vc?-1:0:0,c=a?this.A.vc?0:1:-1;this.A.vc=!1;this.cb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(vf(this.G,this.g[7],c)){this.ba();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.Va&224)>>5,f=this.S&&this.S.jb>e?this.S:null;f&&(d=f.yb,e=f.jb);e>(this.w&224)>>5?(this.i&8&&(De(this,2),this.i&=-9),this.ta(d,0,-10),e=!0):e=!1;e&&(f&&Ee(this,f),a=!0);this.S||this.Va||(this.i&=-3)}else this.i& -1&&this.i++;if(a){if(this.i&4&&vf(this.G,this.g[7],c)){this.ba();break}if(0>c)break}if(this.i&112&&Fe(this)){if(this.i&4&&vf(this.G,this.g[7],c)){this.ba();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.kd(f)}while(0>1|b<<16;Ge(this,a);return a&65535}function Bf(a,b){a=b&128|b>>1|b<<8;Ge(this,a<<8);return a&255}function Cf(a,b){a=b&~a;this.Da(a);return a}function Df(a,b){a=b&~a;this.Da(a<<8);return a} -function Ef(a,b){a|=b;this.Da(a);return a}function Ff(a,b){a|=b;this.Da(a<<8);return a}function Gf(a,b){a=~b|65536;this.kb(a);return a&65535}function Hf(a,b){a=~b|256;this.kb(a<<8);return a&255}function If(a,b){this.I=this.L=a=b-a;this.H=b&(b^a);return a&65535}function Jf(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.H=b&(b^c);return a&255}function Kf(a,b){this.I=this.L=a=b+a;this.H=a&(b^a);return a&65535}function Lf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.H=c&(b<<8^c);return a&255} -function Mf(a,b){a=-b;this.kb(a,a&b&32768);return a&65535}function Nf(a,b){a=-b;this.kb(a<<8,(a&b&128)<<8);return a&255}function Of(a,b){a=b<<1|this.F>>16&1;Ge(this,a);return a&65535}function Pf(a,b){a=b<<1|this.F>>16&1;Ge(this,a<<8);return a&255}function Qf(a,b){a=(this.F&65536|b)>>1|b<<16;Ge(this,a);return a&65535}function Rf(a,b){a=((this.F&65536)>>8|b)>>1|b<<8;Ge(this,a<<8);return a&255}function Sf(a,b){var c=b-a;He(this,c,a,b);return c&65535} -function Tf(a,b){var c=b-a;He(this,c<<8,a<<8,b<<8);return c&255}function Uf(a,b){this.I=this.L=b&65280;this.H=this.F=0;return(b<<8|b>>8)&65535}function Vf(a,b){a^=b;this.Da(a);return a&65535}function Wf(a){S(this,a,Se(this,a),wf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} -function Xf(a){var b=Ve(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.F=this.H=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.H=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.u?6:7)+b} -function Yf(a){var b=Ve(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&=63;if(b&32){b=64-b;32>b-1;this.F=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.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.u?6:7)+b}function Zf(a){R(this,a,!ze(this))}function $f(a){R(this,a,ze(this))} -function ag(a){S(this,a,Se(this,a),Cf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function bg(a){We(this,a,Re(this,a),Df);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function cg(a){S(this,a,Se(this,a),Ef);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function dg(a){We(this,a,Re(this,a),Ff);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} -function eg(a){var b=Se(this,a);a=Ve(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function fg(a){var b=Re(this,a);a=Ue(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function gg(a){R(this,a,Be(this))}function hg(a){R(this,a,!Ce(this)==!Ae(this))}function ig(a){R(this,a,!Be(this)&&!Ce(this)==!Ae(this))}function jg(a){R(this,a,!ze(this)&&!Be(this))} -function kg(a){R(this,a,Be(this)||!Ce(this)!=!Ae(this))}function lg(a){R(this,a,ze(this)||Be(this))}function mg(a){R(this,a,!Ce(this)!=!Ae(this))}function ng(a){R(this,a,Ce(this))}function og(a){R(this,a,!Be(this))}function pg(a){R(this,a,!Ce(this))}function qg(){this.ta(12,0,-9)}function rg(a){R(this,a,!0)}function sg(a){R(this,a,!Ae(this))}function tg(a){R(this,a,Ae(this))}function ug(a){a&1&&(this.F=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} -function vg(a){var b=Se(this,a);a=Ve(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;He(this,c,a,b);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function wg(a){var b=Re(this,a);a=Ue(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);He(this,c,a,b);this.b-=this.u?4+(this.Z&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} -function xg(a){var b=Ve(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.F=this.H=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.H=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.H=32768,this.F=65536,this.b-=7}function yg(){this.ta(24,0,-9);this.b-=20} -function zg(){this.w&49152?(this.R|=128,this.ta(4,0,-8)):(this.ua&&1120==this.ka&&this.ua.setData(this.g[0],!0),this.G?Ag(this.G):this.ba());this.b-=7}function Bg(){this.ta(16,0,-9);this.b-=20}var Cg=[0,7,7,10,7,11,9,13];function Dg(a){this.la=this.b;xe(this,Te(this,a));this.b=this.la-Cg[this.u]}var Eg=[0,14,14,17,14,18,16,20];function Fg(a){this.la=this.b;var b=Te(this,a);a=a>>6&7;Ie(this,this.g[a]);this.g[a]=this.g[7];xe(this,b);this.b=this.la-Eg[this.u]} -var Gg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Hg(a){var b=Se(this,a);this.la=this.b;tf(this,a,b,this.Da);this.b=this.la-Gg[(this.X?8:0)+this.u]+(7!=this.j||this.u?0:2)}function Ig(a){var b=Re(this,a);sf(this,a,b,65535,this.Da);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Jg=[7,13,13,17,14,18,17,21]; -function Kg(a){var b=Ve(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.H=0;this.F=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)xe(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Rg(a){S(this,a,Se(this,a),Sf);this.b-=this.u?9+(this.Z&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Sg(a){S(this,a,0,Uf);this.b-=this.u?9:3+(7==this.j?2:0)}function Tg(){this.ta(28,0,-9)} -function Ug(){this.ua&&(this.ua.Wc(this.g[7],!0),this.ua.setData(this.g[0],!0));this.i|=8;De(this,-2);this.b-=3}function Vg(a){S(this,a,this.g[(a>>6&7)+this.gc],Vf);this.b-=this.u?9:3+(7==this.j?2:0)}function T(a){var b;if(b=this.G)b=this.G,B(b,1)?(C(b,"undefined opcode "+M(b,a),!0,!0),b=Ag(b)):b=!1;b||this.ta(8,0,-9)}function te(a){Wg[a>>12].call(this,a)}function Xg(a){Yg[a>>6&3].call(this,a)}function Zg(a){$g[a>>6&3].call(this,a)}function ah(a){bh[a>>6&3].call(this,a)} -function ch(a){dh[a&15].call(this,a)}function eh(a){fh[a&15].call(this,a)}function gh(a){hh[a>>6&3].call(this,a)}function ih(a){jh[a>>6&3].call(this,a)}function kh(a){lh[a>>6&3].call(this,a)} -var Wg=[function(a){mh[a>>8&15].call(this,a)},Hg,vg,eg,ag,cg,Wf,T,function(a){nh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Rg,T],mh=[function(a){oh[a>>4&15].call(this,a)},rg,og,gg,hg,mg,ig,kg,Fg,Fg,Xg,Zg,ah,T,T,T],Yg=[function(a){tf(this,a,0,this.kb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,0,Gf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,1,Kf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,1,If);this.b-=this.u?9:3+(7==this.j?2:0)}],$g=[function(a){S(this,a,0,Mf); -this.b-=this.u?11:6},function(a){S(this,a,ze(this)?1:0,wf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,ze(this)?1:0,Sf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=Ve(this,a);this.kb(a);this.b-=this.u?4:3+(7==this.j?2:0)}],bh=[function(a){S(this,a,0,Qf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,0,Of);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,0,Af);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){S(this,a,0,yf);this.b-=this.u?9:3+(7==this.j?2:0)}],oh= -[function(a){ph[a&15].call(this,a)},T,T,T,Dg,Dg,Dg,Dg,Ng,T,ch,eh,Sg,Sg,Sg,Sg],ph=[zg,Ug,Og,qg,Bg,Mg,T,T,T,T,T,T,T,T,T,T],dh=[Lg,function(){this.F=0;this.b-=5},function(){this.H=0;this.b-=5},ug,function(){this.L=1;this.b-=5},ug,ug,ug,function(){this.I=0;this.b-=5},ug,ug,ug,ug,ug,ug,ug],fh=[Lg,function(){this.F=65536;this.b-=5},function(){this.H=32768;this.b-=5},Pg,function(){this.L=0;this.b-=5},Pg,Pg,Pg,function(){this.I=32768;this.b-=5},Pg,Pg,Pg,Pg,Pg,Pg,Pg],nh=[pg,ng,jg,lg,sg,tg,Zf,$f,yg,Tg,gh,ih, -kh,T,T,T],hh=[function(a){sf(this,a,0,255,this.kb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,0,Hf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,1,Lf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,1,Jf);this.b-=this.u?9:3+(7==this.j?2:0)}],jh=[function(a){We(this,a,0,Nf);this.b-=this.u?11:6},function(a){We(this,a,ze(this)?1:0,xf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,ze(this)?1:0,Tf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=Ue(this, -a);this.kb(a<<8);this.b-=this.u?4:3+(7==this.j?2:0)}],lh=[function(a){We(this,a,0,Rf);this.b-=this.u?9+(this.yc&1):3+(7==this.j?2:0)},function(a){We(this,a,0,Pf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){We(this,a,0,Bf);this.b-=this.u?9+(this.yc&1):3+(7==this.j?2:0)},function(a){We(this,a,0,zf);this.b-=this.u?9:3+(7==this.j?2:0)}];function ue(a){qh[a>>12].call(this,a)} -var qh=[function(a){rh[a>>8&15].call(this,a)},Hg,vg,eg,ag,cg,Wf,function(a){sh[a>>8&15].call(this,a)},function(a){th[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Rg,T],rh=[function(a){uh[a>>4&15].call(this,a)},rg,og,gg,hg,mg,ig,kg,Fg,Fg,Xg,Zg,ah,function(a){vh[a>>6&3].call(this,a)},T,T],vh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.na(a|this.Ga);xe(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Pe(this,a,0);this.Da(a);Ie(this,a);this.b-=11},function(a){var b=Ke(this); -this.la=this.b;this.Da(b);Qe(this,a,0,b);this.b=this.la-Jg[this.u]},function(a){tf(this,a,Ce(this)?65535:0,this.Da);this.b-=this.u?9:3+(7==this.j?2:0)}],uh=[function(a){wh[a&15].call(this,a)},T,T,T,Dg,Dg,Dg,Dg,Ng,function(a){!(a&8)||1145>this.ka?T.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},ch,eh,Sg,Sg,Sg,Sg],wh=[zg,Ug,function(){Je(this);this.i|=this.w&16;this.b-=13},qg,Bg,Mg,Og,function(a){T.call(this,a)},T,T,T,T,T,T,T,T],sh=[Kg,Kg,xg,xg,Xf,Xf,Yf,Yf, -Vg,Vg,T,T,T,T,Qg,Qg],th=[pg,ng,jg,lg,sg,tg,Zf,$f,yg,Tg,gh,ih,kh,function(a){1145>this.ka?T.call(this,a):xh[a>>6&3].call(this,a)},T,T],xh=[function(a){T.call(this,a)},function(a){a=Pe(this,a,65536);this.Da(a);Ie(this,a);this.b-=11},function(a){var b=Ke(this);this.la=this.b;this.Da(b);Qe(this,a,65536,b);this.b=this.la-Jg[this.u]},function(a){T.call(this,a)}]; -function yh(a){q.call(this,"ROM",a,128);this.ha=this.g=null;this.u=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Sa(this.j);if(this.j){a=this.j;var b=Ta(this.B);"json"!=b&&"hex"!=b&&(a=gb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;eb(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(wa(c.ob,a,b),(a=fb(a,b))?(c.g=a.ca,c.ha=a.ha):c.j=null);zh(c)})}}p(yh,q); -h=yh.prototype;h.wa=function(a,b,c,d){this.D=b;this.f=c;this.G=d;zh(this)};h.ya=function(){this.ha&&(this.G&&Ah(this.G,this.id,this.u,this.b,this.ha),delete this.ha);return!0};h.xa=function(){return!0}; -function zh(a){if(!Ha(a)){if(a.j){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Fa(a,"ROM size ("+H(a.g.length,8,!0)+") does not match specified size ("+H(a.b,8,!0)+")");else{var b;a:{b=a.u;if(57344<=b&&b<57344+Qc){var c={},c=(c[b]=[yh.prototype.If,yh.prototype.Rg,null,null,null,a.b>>1],c);if(ac(a.D,a,c)){a.status("Added "+a.b+"-byte ROM at "+F(b));b=a.w=!0;break a}}else if(Wc(a.D,b,a.b,Fd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){C(a,"invalid block at offset "+Ra(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,E=r-=6;0=b.length){C(a,"insufficient data for block at offset "+Ra(n),4096); -break}m+=b[l++]&255;if(m&255){C(a,"invalid checksum ("+H(m,2,!0)+") for block at offset "+Ra(n),4096);break}if(E)for(C(a,"loading "+Ra(E)+" bytes at "+Ra(u)+"-"+Ra(u+E),4096);E--;)ed(a.D,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&C(a,"starting address: "+Ra(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=ta.Zc&&c<=ta.Ae&&(b=c-(ta.Zc-ta.Wd));b&&(a.preventDefault&&a.preventDefault(),d.sc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ta.Yd&&(b=ta.Xd);d.sc(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); -a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.sc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;var e=this;this.R=nd(this.f,this.M?-1:48,4,262144);this.S=kd(this.f,function(){var a;a=-1;e.i.length&&(a=e.i.shift()&255,C(e,"receiveByte("+H(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),md(e.f,e.S,1E3/Math.round(e.U/10)));0<=a&&(e.F=a,e.b&128?e.F|=49152:e.b|=128,e.b&64&&ld(c,e.R))});this.N=nd(this.f,this.M?-1:52,4,262144);this.X=kd(this.f,function(){e.g|=128;e.g&64&&ld(c,e.N)});ac(b,this,Hh,this.M?64832+8*(this.M-1)-65392:0);cc(b,this.reset.bind(this)); -A(this)};h.Nd=function(a){if(!this.j){var b=de(this.J,"connection");if(b){var c=b.split("->");if(2==c.length){var d=ab(c[0]);if(d!=this.nb)return;c=ab(c[1]);if(this.j=Ca(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.H=e.receiveData){this.I=a;this.P=e.receiveStatus;this.status("Connected "+this.ob+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -h.ya=function(a,b){if(!b)if(this.Nd(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){Ih(this)};h.save=function(){var a=new I(this);a.set(0,[this.F,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Ih(this,a[0])};function Ih(a,b){b||(b=[0,8192,128,a.i]);b=ja(b);a.F=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0} -h.sc=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Xa("",c)));this.V&&!this.B&&c&&(b=String.fromCharCode(this.V)+b);this.u.value+=b;this.u.scrollTop=this.u.scrollHeight;this.B+=c}}else if(null!=this.w){if(10== -a||1024<=this.w.length)this.v(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}md(this.f,this.X,1E3/Math.round(this.Z/10));this.g&=-129};var Gh="buffer",Jh={},Hh=(Jh[65392]=[null,null,Fh.prototype.vf,Fh.prototype.Eg,"RCSR"],Jh[65394]=[null,null,Fh.prototype.uf,Fh.prototype.Dg,"RBUF"],Jh[65396]=[null,null,Fh.prototype.ag,Fh.prototype.kh,"XCSR"],Jh[65398]=[null,null,Fh.prototype.$f,Fh.prototype.jh,"XBUF"],Jh); -yb(function(){for(var a=y(document,x,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.C[b]=c,!0;case "readTape":e=Nh;case "loadTape":return e||(e=Oh),this.C[b]=c,c.onclick= -function(){var a=d.C.listTapes;a&&Ph(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.N){c.parentNode.removeChild(c);break}this.C[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;Ph(d,Sa(b,!0),b,Oh,a)}return!1};return!0;case Qh:return this.C[b]=c,!0}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;this.I=Rh(a);var e=this;if(a=Kh(this,de(this.J,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.H=nd(this.f,56,4,4096);this.R=kd(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=Ta(c),f="json"==e||"gz"==e?encodeURI(c):gb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!eb(f,null,!0,function(e,f,g){var k=0>g&&!!a.J&&!a.J.A.fa;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(wa(a.ob,e,f),(e=fb(e,f))&&bi(a,b,c,d,e.ca,e.Ba, -e.Aa));a.A.gb=!1;a.g&&(a.g--,a.g||A(a));Zh(a)})}function Uh(a,b,c,d){if((a=a.C.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.Y);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ua(c,"/")&&(d="dir"),f=gb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.qc?"":e)+"&format=json"));return!!eb(f, -null,!0,function(b,c,d){ji(a,b,c,d)})} -function ji(a,b,c,d){var e=null,f=0>d&&!!a.J&&!a.J.A.fa;a.j=!1;if(d)a.controller.O('Unable to load disk "'+a.Na+'" (error '+d+": "+b+")",f);else{wa(a.controller.ob,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)v(k[0]);else{a.Y=k.length;a.ea=k[0].length;a.aa=k[0][0].length;var l=k[0][0][0];a.qa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;E>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ja?f=a.Ra+a.Ja&&(a.Ja+=f-(a.Ra+a.Ja)+1):(a.Ra=f,a.Ja=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Na+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=li(this,a++);)oi(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function oi(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var fi=0;function pi(a,b,c,d,e,f){q.call(this,a,b,c);this.L=qi(this,b.autoMount);this.F=0;this.P=d;this.R=e;this.S=f;this.N=d.ce;this.i=Array(this.N);this.M=!mb("Mobi")&&window&&"FileReader"in window;this.u=[];this.ib=null}p(pi,q); -function qi(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=pi.prototype; -h.sa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.C[b]=c,c.onchange=function(){var a=d.C.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v(d.type+" option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.C[b]=c,c.onchange=function(){var a=Oa(c.value,10);null!=a&& -ri(d,a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&si(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&Oa(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.O("Unable to boot the selected drive"):a.da?(we(d.f,0,!0),(a=d.Dc(a,0,0,0,512,0,2))&&d.O("Unable to read the boot sector ("+a+")")):d.O("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c); -break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.i&&((a=d.i[Oa(a.value,10)||0])?(a=a.da)?(a=ub(ni(a),a.uc.replace(".json",".img")),v(a)):d.O("No disk loaded in drive."):d.O("No disk drive selected."))};return!0;case "mountDisk":if(this.M)return this.C[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;si(d,Sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=qi(this,de(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.L[e]=a[e]);this.Rb();this.ib=nd(this.f,this.P.xe,this.P.he,this.ia);ac(b,this,this.S);cc(b,this.reset.bind(this));Mi(this,"None",Oi,!0);this.M&&Mi(this,"Local Disk",Pi);Mi(this,"Remote Disk",Qi);Ri(this)||A(this)}; -h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){this.u=[];for(a=0;ag||9e||e>=a.i.length)a.O("Unable to load the selected drive");else if(c)if(c==Pi)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Qi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Vi(a,e,b,c,!1,d)}else Si(a,e)} -function Vi(a,b,c,d,e,f){var g=-1,k=a.i[b];k.ra.toLowerCase()!=d.toLowerCase()&&(g++,Si(a,b,!0),k.wb?a.O(a.type+" busy"):(k.wb=!0,e&&(k.vb=!0,a.F++,B(a)&&C(a,"auto-loading disk: "+c)),k.Ya=!!f,ii(new ei(a,k,"preload"),c,d,f,a.ee)&&g++));return g} -h.ee=function(a,b,c,d,e){a.wb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.O('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.hb)),b=null);if(b){a.da=b;a.Na=c;a.ra=d;a:{var f;for(f=0;f=a.Y){m=V.mc;break}n=a.seek(b,c,d+1);if(!n){m=V.vd;break}r=0;++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=V.nc;break}if(!k&&(wc(this.D,Le(this.f,f),u|t<<8),jd(this.D))){m=V.nd;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.fd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var n=null,r;a||(m=V.md,e=0);for(;e;){var u=Jc(this.D,Le(this.f,f));if(jd(this.D)){m=V.nd;break}if(!n){if(b>=a.Y){m=V.mc;break}n=a.seek(b,c,d+1,!0);if(!n){m=V.vd;break}r=0;++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=V.nc;break}if(u!=(t|E<<8)){m=V.ye;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=V.nc;break}r>=a.qa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.ke=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&~U.Bb|f>>16-U.Wa.Bb&U.Bb;this.B=65536-e&65535;this.j=this.j&~Yi.Nc|d&Yi.Nc;this.g|=a;Zi(this);return!0};function Zi(a){a.b&=~U.gd;a.g&&(a.g|=V.ae,a.b|=U.gd,a.g&V.Hc&&(a.b|=U.Hc),B(a)&&C(a,a.type+": ERROR: "+F(a.g)))}h.Af=function(){return this.I};h.Jg=function(){};h.Bf=function(){return this.g};h.Kg=function(){};h.xf=function(){return this.b&U.re}; -h.Gg=function(a){this.b=this.b&~U.Ad|a&U.Ad;if(this.b&U.hd){a=!0;var b,c,d="",e=(this.j&Yi.Bc)>>Yi.Wa.Bc,f=this.i[e],g,k,l,m,n,r;this.b&=~(U.Qb|U.Oc);this.g&=~V.te;switch(c=this.b&U.lc){case $i.Vd:B(this)&&C(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=U.Qb;break;case $i.ie:d="RCHK";case $i.je:d||(d="READ"),b=this.Dc;case $i.zd:d||(d="WCHK");case $i.ze:d||(d="WRITE");b||(b=this.fd);g=(this.j&Yi.Pb)>>Yi.Wa.Pb;k=(this.j&Yi.Ic)>>Yi.Wa.Ic;l=this.j&Yi.Nc;m=65536-this.B&65535;n=(this.b&U.Bb)<< -16-U.Wa.Bb|this.w;r=this.b&U.fe?0:2;B(this)&&C(this,this.type+": "+d+"("+g+":"+k+":"+l+") "+F(n)+"--"+F(n+(m<<1)),!0,!0);if(g>=f.Y){this.g|=V.mc;break}if(l>=f.aa){this.g|=V.nc;break}a=b.call(this,f,g,k,l,m,n,r,c>=$i.zd,this.ke.bind(this));break;case $i.ue:g=(this.j&Yi.Pb)>>Yi.Wa.Pb;B(this)&&C(this,this.type+": SEEK("+g+")",!0);g'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.C[b]=c,c.onchange=function(){var a=Oa(c.value,10);null!=a&&cj(d, -a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&dj(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&Oa(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.O("Unable to boot the selected drive"):a.da?(we(d.f,0,!0),(a=d.sd(a,0,0,0,512,0))&&d.O("Unable to read the boot sector ("+a+")")):d.O("Load a disk into the drive first")},!0;case "saveDisk":if(!this.I){c.parentNode.removeChild(c); -break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.g&&((a=d.g[Oa(a.value,10)||0])?(a=a.da)?(a=ub(ni(a),a.uc.replace(".json",".img")),v(a)):d.O("No disk loaded in drive."):d.O("No disk drive selected."))};return!0;case "mountDisk":if(this.I)return this.C[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;dj(d,Sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.wa=function(a,b,c,d){this.J=a;this.D=b;this.f=c;this.G=d;if(a=bj(this,de(this.J,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.H[e]=a[e]);ej(this);this.ib=nd(this.f,112,5,131072);ac(b,this,fj);cc(b,this.reset.bind(this));gj(this,"None",hj,!0);this.I&&gj(this,"Local Disk",ij);gj(this,"Remote Disk",jj);kj(this)||A(this)}; -h.ya=function(a,b){if(!b){if(!a){if(this.reset(),this.J.B){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";cj(this,0)}}return!0};h.xa=function(a){return a?this.save():!0};h.reset=function(){ej(this)};h.save=function(){return(new I(this)).data()}; -h.restore=function(a){return ej(this,a[0])};function kj(a,b){b||(a.F=0);for(var c in a.H){var d=a.H[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.C.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.O("Unable to load the selected drive");else if(c)if(c==ij)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==jj){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}mj(a,e,b,c,!1,d)}else lj(a,e)} -function mj(a,b,c,d,e,f){var g=-1,k=a.g[b];k.ra.toLowerCase()!=d.toLowerCase()&&(g++,lj(a,b,!0),k.wb?a.O("RL11 busy"):(k.wb=!0,e&&(k.vb=!0,a.F++,B(a)&&C(a,"auto-loading disk: "+c)),k.Ya=!!f,ii(new ei(a,k,"preload"),c,d,f,a.pe)&&g++));return g} -h.pe=function(a,b,c,d,e){a.wb=!1;b&&(b.Y>a.Y||b.ea>a.ea)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.hb)),b=null);b?(a.da=b,a.Na=c,a.ra=d,this.O('Loaded disk "'+c+'" in drive '+("RL"+a.hb),a.vb||e),this.J&&ne(this.J)):a.Ya=!1;a.vb&&(a.vb=!1,--this.F||A(this));cj(this,a.hb)}; -function gj(a,b,c,d){if((a=a.C.listDisks)&&a.options){for(var e=0;e(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}wc(this.D,Le(this.f,f),n|r<<8);if(jd(this.D)){k=8192;break}f+=2;e--;if(m>=a.qa&&(l=null,++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.qe=function(a,b,c,d,e,f,g){var k=0;a=a.da;var l=null,m;a||(k=5120,e=0);for(;e;){var n=Jc(this.D,Le(this.f,f));if(jd(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.qa&&(l=null,++d>=a.aa&&(d=0,++c>=a.ea&&(c=0,++b>=a.Y)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.oe=function(a,b,c,d,e,f){this.B=f&65535;this.b=this.b&-49|f>>12&48;this.u=f>>16&63;this.j=this.i=b<<7|(c?64:0)|d&63;this.w=65536-e&65535;a&&(this.b=this.b|a|32768);return!0};h.Ff=function(){return this.b&65535}; -h.Og=function(a){this.b=this.b&-1023|a&1022;this.u=this.u&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c="",d=this.g[(this.b&768)>>8],e=d.da,f,g,k;this.b&=-2;switch(this.b&14){case 4:this.w&8&&(this.b&=63);this.w=d.status|this.j&64|(e&&512==e.Y?128:0);break;case 6:1==(this.i&3)&&(b=this.i&65408,c=(this.i&16)<<2,this.j=this.i&4?this.j+b:this.j-b,this.i=this.j=this.j&65408|c);break;case 8:this.w=this.j;break;case 12:c="READ",b=this.sd;case 10:c||(c="WRITE"),b||(b=this.qe),f=this.i>>7,g=this.i&64?1:0,k= -this.i&63,!e||f>=e.Y||k>=e.aa?this.b|=37888:(a=65536-this.w&65535,e=(this.u&63)<<16|this.B,B(this)&&C(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+F(e)+"--"+F(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.oe.bind(this)))}a&&(this.b|=129,this.b&64&&ld(this.f,this.ib))}};h.Df=function(){return this.B};h.Mg=function(a){this.B=a&65534};h.Gf=function(){return this.i};h.Pg=function(a){this.i=a};h.Hf=function(){return this.w};h.Qg=function(a){this.w=a};h.Ef=function(){return this.u}; -h.Ng=function(a){this.u=a&63;this.b=this.b&-49|(this.u&3)<<4};var hj="",ij="?",jj="??",nj={},fj=(nj[63744]=[null,null,Cd.prototype.Ff,Cd.prototype.Og,"RLCS"],nj[63746]=[null,null,Cd.prototype.Df,Cd.prototype.Mg,"RLBA"],nj[63748]=[null,null,Cd.prototype.Gf,Cd.prototype.Pg,"RLDA"],nj[63750]=[null,null,Cd.prototype.Hf,Cd.prototype.Qg,"RLMP"],nj[63752]=[null,null,Cd.prototype.Ef,Cd.prototype.Ng,"RLBE"],nj); -function oj(a){q.call(this,"Debugger",a);this.Ca=+a.base||16;this.ja=!1;this.w=0;this.P=!1;this.u=-1;this.j=[];this.U={}}p(oj,q);oj.prototype.Jd=function(){return-1};oj.prototype.Kd=function(){}; -function pj(a,b,c,d){if(c)if(b){0>a.u&&a.j.length&&(a.u=0);if(0>a.u||b!=a.j[a.u])a.j.splice(0,0,b),a.u=0;a.u--}else a.P?b="end":b=a.j[a.u+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(ab(b.substring(c,f))),c=f+1}}return a} -function qj(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 Ab(a){if(Bb)try{for(var b=0;ba;a++)this.b["S"+a]=[0,0,!1,!1,this.pf,a];this.F=this.f=this.C=this.K=null;y(this)}p(Rb,q);h=Rb.prototype; +h.reset=function(a){this.stop();a&&Zb(this,this.Ta=0)}; +h.ta=function(a,b,c,d){if(this.K&&this.K.ta(a,b,c,d)||this.f&&this.f.ta(a,b,c,d)||this.F&&this.F.ta(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.H[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.H[b]=c,this.i[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.H[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, +b){return function(){$b(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){ac(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){$b(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){ac(a,b)}}(this,b),!0):q.prototype.ta.call(this,a,b,c,d)}};h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;bc(b,this,cc);dc(b,this.reset.bind(this));ec(this);fc(this)}; +h.Ca=function(a,b){if(!b)if(this.M&&gc(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};h.Ba=function(a){return a?this.save():!0};h.save=function(){var a=new G(this);a.set(0,[this.da,this.Ta,this.Ua]);return a.data()};h.restore=function(a){if(a=a[0])hc(this,this.da=a[0]),Zb(this,this.Ta=a[1]),ic(this,a[2]);return!0};function jc(a,b,c){if(a=a.H[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ec(a,b){for(var c in a.i)jc(a,c,null!=b?b:a.i[c])} +function kc(a,b,c){if(a=a.H[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function fc(a){for(var b in a.b)kc(a,b,a.b[b][1])}function lc(a,b,c,d){if(a.H[b]){var e=a.F&&a.F.Aa||8;c=c||0;c=8==e?E(c,d):F(c,d);a.H[b].textContent!=c&&(a.H[b].textContent=c)}}function $b(a,b){var c=a.b[b];kc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=mc&&(a.G=b==nc,a.I=b==oc)} +function ac(a,b){var c=a.b[b];c[2]&&c[3]&&(kc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.mf=function(a){a||this.f.A.T||(a=this.f,a.C.reset(),pc(a),this.b[qc]&&this.b[qc][1]&&rc(this.f))};h.nf=function(){};h.hf=function(a){a||this.f.Z()}; +h.ff=function(a){if(!a&&!this.f.A.T)if(this.b[qc]&&this.b[qc][1])rc(this.f);else{if((a=this.F)&&!Ja(a,!0))Ka(a,!0),sc(a,0,null),Ka(a,!1);else try{var b=this.f.pc(1);0=a.f.ia?8:16,c=65472<=a.da&&a.da<65472+b,b=c?1:2,c=c?15:a.C.I;a.b[mc]&&a.b[mc][1]||(b=-b);hc(a,a.da&~c|a.da+b&c)} +function hc(a,b){a.da=b&a.C.I;if(a.B!==a.da){a.B=a.da;b=a.B;for(var c=0;22>c;c++)Bc(a,"A"+c,b&1<c;c++)Bc(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.G=this.M/this.j|0;this.U=this.G-1;this.Ma=[];this.la=0;this.D=!1;this.N=[];this.Xe=[Sc,Tc,Uc,Vc];this.b=this.v=[];this.B=this.L=this.w=this.O=this.P=0;a=new J(this);Wc(a,this.F);this.b=Array(this.G);this.v=Array(this.G);for(b=0;b>>this.g;this.L=0;this.w=this.I;y(this)}p(Qc,q);function Zc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.v[a.P]=a.b[a.O])}}h=Qc.prototype;h.reset=function(){for(var a=0;a>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.J)return l.Ob+=l.J-f,l.J=f,!0;if(f>=l.J+l.Ob){n=l.size-(f-m);n>g&&(n=g);l.Ob=f-l.J+n;f=m+a.j;g-=n;k++;continue}}return ad(bd,f,g)}f=new J(a,f,n,a.j,d,e);Wc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+cd[d]+" at "+E(b)),!0):ad(dd,b,c)}h.od=function(a){return this.v[(a&this.w)>>>this.g].yb(a&this.i,a)}; +h.oc=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Lb||b!=this.i?this.v[c].na(b,a):this.v[c++].yb(b,a)|this.v[c&this.U].yb(0,a+1)<<8};h.pd=function(a,b){this.v[(a&this.w)>>>this.g].Ab(a&this.i,b,a)};h.Sb=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Lb||c!=this.i?this.v[d].Bb(c,b,a):(this.v[d++].Ab(c,b&255,a),this.v[d&this.U].Ab(0,b>>8&255,a+1))};function ed(a,b){return a.b[(b&a.I)>>>a.g]} +function zc(a,b){var c;a.D=!1;a.la++;var d=b&a.i,e=ed(a,b);Lb||d!=a.i?c=e.B(d,b):c=e.K(d,b)|ed(a,b+1).K(0,b+1)<<8;a.la--;return c}function fd(a,b,c){a.D=!1;a.la++;ed(a,b).F(b&a.i,c&255,b);a.la--}function xc(a,b,c){a.D=!1;a.la++;var d=b&a.i,e=ed(a,b);Lb||d!=a.i?e.D(d,c&65535,b):(e.F(d,c&255,b),ed(a,b+1).F(0,c>>8&255,b+1));a.la--} +function $c(a){for(var b=0,c=[],d=0;da.f.ia)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t>8:e[2](f)&255):f&1&&(e=d.Ma[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&A(this.f,16|e[5])&&D(this.f,e[4]+".readByte("+K(this.f,b)+"): "+K(this.f,c),!0,!d.la),c;d.La(b,16,3);c=255;this.f&&A(this.f,16)&&D(this.f,"warning: unconverted read access to byte @"+K(this.f,b)+": "+K(this.f,c),!0,!d.la);return c} +function Tc(a,b,c){var d=!1,e=this.controller,f=e.Ma[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ma[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&A(this.f,16|f[5])&&D(this.f,f[4]+".writeByte("+K(this.f,c)+","+K(this.f,b)+")",!0,!e.la):(e.La(c,16,5),this.f&&A(this.f,16)&&D(this.f,"warning: unconverted write access to byte @"+K(this.f,c)+": "+K(this.f, +b),!0,!e.la))}function Uc(a,b){var c=-1,d=this.controller;a=d.Ma[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&A(this.f,16|a[5])&&D(this.f,a[4]+".readWord("+K(this.f,b)+"): "+K(this.f,c),!0,!d.la),c;d.La(b,16,2);c=65535;this.f&&A(this.f,16)&&D(this.f,"warning: unconverted read access to word @"+K(this.f,b)+": "+K(this.f,c),!0,!d.la);return c} +function Vc(a,b,c){var d=!1,e=this.controller;a=e.Ma[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&A(this.f,16|a[5])&&D(this.f,a[4]+".writeWord("+K(this.f,c)+","+K(this.f,b)+")",!0,!e.la):(e.La(c,16,4),this.f&&A(this.f,16)&&D(this.f,"warning: unconverted write access to word @"+K(this.f,c)+": "+K(this.f,b),!0,!e.la))}function M(a){q.call(this,"Device",a,256);this.b={ab:128,ld:-1}}p(M,q);h=M.prototype; +h.za=function(a,b,c,d){this.C=b;this.K=a;this.f=c;this.F=d;var e=this;this.b.ld=ld(c,function(){e.b.ab|=128;e.b.ab&64&&md(e.f,e.b.Lb);e.K&&I(e.K,1);nd(e.f,e.b.ld,1E3/60)});this.b.Lb=od(c,64,6,524288);bc(b,this,pd);dc(b,this.reset.bind(this));d&&qd(d,64,function(a){var b=e.f;rd(e,"KIPDR",b.B[0],0,a[0]);rd(e,"KDPDR",b.B[0],8,a[0]);rd(e,"KIPAR",b.M[0],0,a[0]);rd(e,"KDPAR",b.M[0],8,a[0],!0);rd(e,"SIPDR",b.B[1],0,a[0]);rd(e,"SDPDR",b.B[1],8,a[0]);rd(e,"SIPAR",b.M[1],0,a[0]);rd(e,"SDPAR",b.M[1],8,a[0], +!0);rd(e,"UIPDR",b.B[3],0,a[0]);rd(e,"UDPDR",b.B[3],8,a[0]);rd(e,"UIPAR",b.M[3],0,a[0]);rd(e,"UDPAR",b.M[3],8,a[0],!0);b.V&32&&rd(e,"UNIMAP",b.Fa,-1,a[0])});y(this)};function rd(a,b,c,d,e,f){a=a.F;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Fa[a>>1];return a&1?b>>16:b&65535};h.wh=function(a,b){b=b>>1&63;var c=b>>1;this.f.Fa[c]=b&1?this.f.Fa[c]&65535|(a&63)<<16:this.f.Fa[c]&-65536|a&65534};h.gg=function(a){return this.f.B[1][a>>1&7]};h.ph=function(a,b){this.f.B[1][b>>1&7]=a&65295};h.eg=function(a){return this.f.B[1][(a>>1&7)+8]};h.nh=function(a,b){this.f.B[1][(b>>1&7)+8]=a&65295};h.fg=function(a){return this.f.M[1][a>>1&7]}; +h.oh=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.dg=function(a){return this.f.M[1][(a>>1&7)+8]};h.mh=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.Af=function(a){return this.f.B[0][a>>1&7]};h.Kg=function(a,b){this.f.B[0][b>>1&7]=a&65295};h.yf=function(a){return this.f.B[0][(a>>1&7)+8]};h.Ig=function(a,b){this.f.B[0][(b>>1&7)+8]=a&65295};h.zf=function(a){return this.f.M[0][a>>1&7]};h.Jg=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.B[0][b]&=65295}; +h.xf=function(a){return this.f.M[0][(a>>1&7)+8]};h.Hg=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.B[0][b]&=65295};h.mg=function(a){return this.f.B[3][a>>1&7]};h.vh=function(a,b){this.f.B[3][b>>1&7]=a&65295};h.kg=function(a){return this.f.B[3][(a>>1&7)+8]};h.th=function(a,b){this.f.B[3][(b>>1&7)+8]=a&65295};h.lg=function(a){return this.f.M[3][a>>1&7]};h.uh=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.jg=function(a){return this.f.M[3][(a>>1&7)+8]}; +h.sh=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Mb=function(a){a&=7;return this.f.w&2048?this.f.pa[a]:this.f.g[a]};h.Qb=function(a,b){b&=7;this.f.w&2048?this.f.pa[b]=a:this.f.g[b]=a};h.Lf=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.Tg=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.Of=function(){return this.f.g[7]};h.Wg=function(a){this.f.g[7]=a};h.Nb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.pa[a]}; +h.Rb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.pa[b]=a};h.Mf=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Ug=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.Nf=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Vg=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.wf=function(a){return this.f.lc[a-65504>>1]};h.Gg=function(a,b){this.f.lc[b-65504>>1]=a};h.ce=function(a){return 65520==a?(gd(this.C)>>6)-1:0}; +h.he=function(){};h.ig=function(){return 1};h.rh=function(){};h.vf=function(){return this.f.P};h.Fg=function(){this.f.P=0};h.Cf=function(){return this.f.ic};h.Mg=function(a,b){b&1||(a&=255);this.f.ic=a};h.Hf=function(a,b){return b?0:this.f.Za};h.Pg=function(a){zd(this.f,a)};h.hg=function(a,b){return b?0:this.f.ua&65280};h.qh=function(a){this.f.ua=a|255};h.Kf=function(){return Ad(this.f)};h.Sg=function(a){Bd(this.f,a)};h.ge=function(a,b){A(this)&&D(this,"writeIgnored("+E(b)+"): "+E(a),!0,!0)}; +var N={},pd=(N[61568]=[null,null,M.prototype.ng,M.prototype.wh,"UNIMAP",64,1170],N[62592]=[null,null,M.prototype.gg,M.prototype.ph,"SIPDR",8,1145,64],N[62608]=[null,null,M.prototype.eg,M.prototype.nh,"SDPDR",8,1145,64],N[62624]=[null,null,M.prototype.fg,M.prototype.oh,"SIPAR",8,1145,64],N[62640]=[null,null,M.prototype.dg,M.prototype.mh,"SDPAR",8,1145,64],N[62656]=[null,null,M.prototype.Af,M.prototype.Kg,"KIPDR",8,1140,64],N[62672]=[null,null,M.prototype.yf,M.prototype.Ig,"KDPDR",8,1145,64],N[62688]= +[null,null,M.prototype.zf,M.prototype.Jg,"KIPAR",8,1140,64],N[62704]=[null,null,M.prototype.xf,M.prototype.Hg,"KDPAR",8,1145,64],N[62798]=[null,null,M.prototype.Gf,M.prototype.Og,"MMR3",1,1145,64],N[65382]=[null,null,M.prototype.Bf,M.prototype.Lg,"LKS"],N[65402]=[null,null,M.prototype.Df,M.prototype.Ng,"MMR0",1,1140,64],N[65404]=[null,null,M.prototype.Ef,M.prototype.ge,"MMR1",1,1145,64],N[65406]=[null,null,M.prototype.Ff,M.prototype.ge,"MMR2",1,1140,64],N[65408]=[null,null,M.prototype.mg,M.prototype.vh, +"UIPDR",8,1140,64],N[65424]=[null,null,M.prototype.kg,M.prototype.th,"UDPDR",8,1145,64],N[65440]=[null,null,M.prototype.lg,M.prototype.uh,"UIPAR",8,1140,64],N[65456]=[null,null,M.prototype.jg,M.prototype.sh,"UDPAR",8,1145,64],N[65472]=[null,null,M.prototype.Mb,M.prototype.Qb,"R0SET0"],N[65473]=[null,null,M.prototype.Mb,M.prototype.Qb,"R1SET0"],N[65474]=[null,null,M.prototype.Mb,M.prototype.Qb,"R2SET0"],N[65475]=[null,null,M.prototype.Mb,M.prototype.Qb,"R3SET0"],N[65476]=[null,null,M.prototype.Mb, +M.prototype.Qb,"R4SET0"],N[65477]=[null,null,M.prototype.Mb,M.prototype.Qb,"R5SET0"],N[65478]=[null,null,M.prototype.Lf,M.prototype.Tg,"R6KERNEL"],N[65479]=[null,null,M.prototype.Of,M.prototype.Wg,"R7KERNEL"],N[65480]=[null,null,M.prototype.Nb,M.prototype.Rb,"R0SET1",1,1145],N[65481]=[null,null,M.prototype.Nb,M.prototype.Rb,"R1SET1",1,1145],N[65482]=[null,null,M.prototype.Nb,M.prototype.Rb,"R2SET1",1,1145],N[65483]=[null,null,M.prototype.Nb,M.prototype.Rb,"R3SET1",1,1145],N[65484]=[null,null,M.prototype.Nb, +M.prototype.Rb,"R4SET1",1,1145],N[65485]=[null,null,M.prototype.Nb,M.prototype.Rb,"R5SET1",1,1145],N[65486]=[null,null,M.prototype.Mf,M.prototype.Ug,"R6SUPER",1,1145],N[65487]=[null,null,M.prototype.Nf,M.prototype.Vg,"R6USER",1,1145],N[65504]=[null,null,M.prototype.wf,M.prototype.Gg,"CTRL",8,1170],N[65520]=[null,null,M.prototype.ce,M.prototype.he,"LSIZE",1,1170],N[65522]=[null,null,M.prototype.ce,M.prototype.he,"HSIZE",1,1170],N[65524]=[null,null,M.prototype.ig,M.prototype.rh,"SYSID",1,1170],N[65526]= +[null,null,M.prototype.vf,M.prototype.Fg,"ERR",1,1170],N[65528]=[null,null,M.prototype.Cf,M.prototype.Mg,"MBR",1,1170],N[65530]=[null,null,M.prototype.Hf,M.prototype.Pg,"PIR"],N[65532]=[null,null,M.prototype.hg,M.prototype.qh,"SLR"],N[65534]=[null,null,M.prototype.Kf,M.prototype.Sg,"PSW"],N); +yb(function(){for(var a=x(document,w,"device"),b=0;b>1),this.b=new Int32Array(this.v,0,this.size>>2),Hd(this,Id?Jd:Kd);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.tf=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.tg=function(a,b){Kb&&a&1&&this.C.La(b,64,2);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}; +h.Dg=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.$a=!0};h.rf=function(a,b){this.f&&null!=this.J&&Zd(this.f,this.J+a);return this.K(a,b)};h.pg=function(a,b){this.f&&null!=this.J&&Zd(this.f,this.J+a,2);return this.B(a,b)}; +h.Bg=function(a,b,c){this.f&&null!=this.J&&$d(this.f,this.J+a);this.j?this.Pb(0,b,c):this.F(a,b,c)};h.yh=function(a,b,c){this.f&&null!=this.J&&$d(this.f,this.J+a,2);this.j?this.Pb(0,b,c):this.D(a,b,c)};h.qf=function(a){return this.g[a]};h.sf=function(a,b){a=this.g[a];this.f&&A(this.f,32)&&D(this.f,"Memory.readByte("+K(this.f,b)+"): "+K(this.f,a),!0);return a};h.og=function(a,b){Kb&&a&1&&this.C.La(b,64,2);return this.w.getUint16(a,!0)}; +h.sg=function(a,b){Kb&&a&1&&this.C.La(b,64,2);a=!Lb&&a&1?this.g[a]|this.g[a+1]<<8:this.G[a>>1];this.f&&A(this.f,32)&&D(this.f,"Memory.readWord("+K(this.f,b)+"): "+K(this.f,a),!0);return a};h.Ag=function(a,b){this.g[a]=b;this.$a=!0};h.Cg=function(a,b,c){this.g[a]=b;this.$a=!0;this.f&&A(this.f,32)&&D(this.f,"Memory.writeByte("+K(this.f,c)+","+K(this.f,b)+")",!0)};h.xh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);this.w.setUint16(a,b,!0);this.$a=!0}; +h.zh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);!Lb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.G[a>>1]=b;this.$a=!0;this.f&&A(this.f,32)&&D(this.f,"Memory.writeWord("+K(this.f,c)+","+K(this.f,b)+")",!0)};var Fd=0,hd=1,Gd=2,Yc=4,cd=["NONE","RAM","ROM","VID","H/W"],Ed=0,Ud=[],Ld=[J.prototype.tf,J.prototype.Dg,J.prototype.tg,J.prototype.Ah],Xd=[J.prototype.rf,J.prototype.Bg,J.prototype.pg,J.prototype.yh]; +if(Gb)var Kd=[J.prototype.qf,J.prototype.Ag,J.prototype.og,J.prototype.xh],Jd=[J.prototype.sf,J.prototype.Cg,J.prototype.sg,J.prototype.zh];var ae;if(Gb){var be=new ArrayBuffer(2);(new DataView(be)).setUint16(0,256,!0);ae=256===(new Uint16Array(be))[0]}else ae=!1;var Id=ae; +function ce(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Kc=0;this.Ic=b;this.hb=c;this.Sc=Math.round(this.Ic/1E4)/100;this.sb=this.Sc*this.hb;this.Tc=this.dc=this.vb=this.Jc=0;this.A.T=this.A.Dc=!1;this.A.sa=a.autoStart;"string"==typeof this.A.sa&&(this.A.sa="true"==this.A.sa);this.A.Gb=!1;this.bc=this.Ib=0;this.cc=+a.csStart;this.Hb=+a.csInterval;this.Jb=+a.csStop;this.ha=[];this.Id=this.xg.bind(this);this.ib=this.Ia=this.gb=this.b=this.ja=this.Ha=this.ac=this.fb=this.Kb= +this.Uc=this.rb=0;this.ra=null;y(this)}p(ce,q);h=ce.prototype;h.za=function(a,b,c,d){this.K=a;this.C=b;this.F=d;this.ra=a.i;for(a=0;a=a.Ib&&(a.Ib+=a.Hb,c=!0);0<=a.Jb&&a.Jb<=ke(a)&&(a.Hb=a.Jb=-1,ge(a),a.Z(),c=!0);c&&a.u(ke(a)+" cycles: checksum="+F(a.bc))}} +h.ta=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.H[b]=c,!0;case "run":return this.H[b]=c,c.onclick=function(){var a;if(a=d.K)if(a=d.K,a.A.ca)a=!0;else{var b=null,c,k=Aa(a.id);for(c=0;ca.rb/a.sb?b=1:d=!0;a.hb=b;b=a.Sc*a.hb;if(a.sb!=b){a.sb=b;b=a.sb.toFixed(2)+"Mhz";var e=a.H.setSpeed;e&&(e.textContent=b);a.u("target speed: "+b)}c&&a.K&&oe(a.K)}uc(a,a.Ia);a.Ia=0;a.Ha=ya();a.fb=0;me(a);return d}function ld(a,b){var c=a.ha.length;a.ha.push([-1,b]);return c}function nd(a,b,c,d){0<=b&&ba.ha[b][0])&&(c=a.Ic*a.hb/1E3*c|0,a.A.T&&(c+=pe(a)),a.ha[b][0]=c)} +function qe(a,b){for(var c=a.ha.length-1;0<=c;c--){var d=a.ha[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function re(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function pe(a,b){var c=a.gb-=a.b;a.b=a.ja=0;b&&(a.gb=0);return c} +h.xg=function(){if(this.A.T){this.Jc>=this.Ic&&me(this,!0);this.Kb=0;this.ac=ya();if(this.fb){var a=this.ac-this.fb;a>this.Tc&&(this.Ha+=a,this.Ha>this.ac&&(this.Ha=this.ac))}try{do{var b=qe(this,this.A.Gb?1:this.dc);try{this.pc(b)}catch(e){if("number"!=typeof e)throw e;}b=pe(this,!0);this.Kb+=b;this.Ia+=b;vc(this,b);tc(this,b);this.vb-=b;if(0>=this.vb){this.vb+=this.dc;++this.Uc>=se&&(this.K&&I(this.K,void 0),this.Uc=0);break}}while(this.A.T)}catch(e){this.Z();this.K&&this.K.stop(ya(),ke(this)); +Ga(this,e.stack||e.message);return}if(this.A.T){a=setTimeout;b=this.Id;this.fb=ya();var c=this.Tc;this.Kb&&(c=Math.round(c*this.Kb/this.dc));var c=c-(this.fb-this.ac),d=this.fb-this.Ha;d&&(this.rb=Math.round(this.Ia/(10*d))/100,864E5<=d&&(this.ib=0,le(this)));if(0>c||this.rbc&&(this.Ha-=c),c=0;this.Jc+=this.Kb;this.fb+=c;a(b,c)}}}; +function rc(a,b){if(!Ha(a))if(a.A.T)a.u(a.toString()+" busy");else{le(a);a.A.T=!0;a.A.Dc=!0;var c=a.H.run;c&&(c.textContent="Halt");a.K&&(b&&oe(a.K,!0),a.K.start(a.Ha,ke(a)));a.F||a.status("Started");setTimeout(a.Id,0)}}h.pc=function(){return 0};h.Z=function(a){var b=!1;if(this.A.T){pe(this);uc(this,this.Ia);this.Ia=0;this.A.T=!1;if(b=this.H.run)b.textContent="Run";this.K&&this.K.stop(ya(),ke(this));b=!0;this.F||this.status("Stopped")}this.A.complete=a;return b};var ne=30,se=15,de=["power","reset"]; +function te(a){var b=+a.model||1170;ce.call(this,a,6666667);this.ia=b;this.Bd=+a.addrReset||0;this.Ya=this.w=this.N=this.D=this.G=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Fa=this.lc=[];this.cb=this.O=this.zd=this.tb=this.ub=this.mb=this.eb=this.P=this.ic=this.Za=this.ua=this.U=this.jc=this.kc=this.V=this.i=0;this.Ed=[4,2,0,1];this.mc=0;this.Fd=255;1120>=this.ia?(this.yd=ue.bind(this),this.Eb=this.$e,this.mc=8,this.Fd=-1,this.Md=255,this.Ld=0):(this.yd=ve.bind(this),this.Eb=this.af, +this.Md=~(1792|(1140>=this.ia?2048:0))&65535,this.Ld=1140e.zb&&(e.zb=c,c+=4)}return ce.prototype.Ca.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.ia);this.A.T&&this.Z();this.D=65536;this.G=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Bd,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,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,65535,65535, +65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.lc=[0,0,0,0,0,0,0,0];this.N=0;this.Ya=-1;this.v=this.j=this.Hc=this.X=this.Y=this.i=this.ic=0;pc(this);fe(this);this.A.error=!1;ce.prototype.reset.call(this)};function pc(a){a.U=0;a.jc=0;a.kc=0;a.V=0;a.P=0;a.Za=0;a.ua=255;a.tb=0;a.ub=0;a.mb=0;a.eb=262143;a.cb=a.g[7];a.O=0;a.R=null;a.C&&(we(a),a.zd=gd(a.C))} +function we(a){a.Xb=a.Lc;a.Yb=a.Mc;a.Ec=a.Nc;a.Zb=a.Qc;a.fc&&(a.Xb=a.Vd,a.Yb=a.$d);a.gc&&(a.Ec=a.ee,a.Zb=a.fe);a.tb?(a.Ga=65536,a.ob=a.V&16?4186112:253952,a.Ea=a.Zd,a.na=a.fc?a.rg:a.gd,a.Bb=a.gc?a.Ch:a.md,Zc(a.C,a.V&16?22:18)):(a.Ga=0,a.ob=57344,a.Ea=a.df,a.na=a.fc?a.qg:a.de,a.Bb=a.gc?a.Bh:a.ie,Zc(a.C,16))}function td(a){var b=a.U;b&57344||(b=b&-3199|a.ub<<5|a.mb<<1);return b} +function vd(a,b){b&=-3073;if(a.U!=b){b&57344&&!(a.U&57344)&&(a.jc=a.O>>16&65535,a.kc=a.O&65535);a.U=b;a.ub=(b&96)>>5;a.mb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.tb!=c&&(a.tb=c,we(a))}}function wd(a){a.U&57344||(a.jc=a.O>>16&65535);a=a.jc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xd(a){a.U&57344||(a.kc=a.O&65535);return a.kc}function yd(a,b){1170>a.ia&&(b&=-49);a.V!=b&&(a.V=b,a.eb=b&16?4194303:262143,we(a))} +function xe(a,b,c){a.Bd=b;ye(a,b);Bd(a,0);a.C.reset();pc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.T||rc(a)}else a.F&&a.A.ca?a.Z()||(he(a.F),I(a.K,-1)):!1===c&&a.Z();!a.A.T&&a.ra&&a.ra.stop()}h.Wd=function(){return 0}; +h.save=function(){var a=new G(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Fa,this.lc,this.P,this.ic,this.Za,this.ua,this.ub,this.mb,this.cb,this.i,this.O,this.Ya,this.nc,this.qc]);a.set(1,[Ad(this),td(this),wd(this),xd(this),this.V]);a.set(2,[this.ib,this.hb,this.A.sa]);a.set(3,ze(this));a.set(4,re(this));return a.data()}; +h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Fa=b.next().value;this.lc=b.next().value;this.P=b.next().value;this.ic=b.next().value;this.Za=b.next().value;this.ua=b.next().value;this.ub=b.next().value;this.mb=b.next().value;this.cb=b.next().value;this.i=b.next().value;this.O=b.next().value;this.Ya=b.next().value;this.nc=b.next().value;this.qc=b.next().value;b=a[1];Bd(this,b[0]);vd(this,b[1]); +this.jc=b[2];this.kc=b[3];yd(this,b[4]);b=a[2];this.ib=b[0];le(this,b[1]);this.A.sa=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function ye(a,b){a.g[7]=b&65535}function od(a,b,c,d){b={zb:b,kb:c,message:d||0,name:Pb[b],next:null};a.$b.push(b);return b}function Fe(a,b){var c=a.R;if(c==b)a.R=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.R&&(a.i|=1)} +function md(a,b){if(b){if(b!=a.R){var c=a.R;if(!c||c.kb<=b.kb)b.next=c,a.R=b;else{do{var d=c.next;if(!d||d.kb<=b.kb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&A(a,b.message|8)&&D(a,"setIRQ(vector="+E(b.zb)+",priority="+b.kb+")",!0,!0)}}function sd(a,b){b&&(Fe(a,b),b.message&&A(a,b.message|8)&&D(a,"clearIRQ(vector="+E(b.zb)+",priority="+b.kb+")",!0,!0))}function ze(a){var b=[];for(a=a.R;a;)b.push(a.zb),a=a.next;return b} +function Ge(a){return a.i&64?(a.qa(168,64,-6),!0):a.i&32?(a.qa(4,32,-5),!0):a.i&16?(a.qa(12,16,-7),!0):!1}function Ad(a){return a.w=a.w&63728|De(a)|Ce(a)|Be(a)|Ae(a)}function Bd(a,b){b&=a.Md;a.I=b<<12;a.L=~b&4;a.G=b<<14;a.D=b<<16;if((b^a.w)&a.Ld)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.N=b>>14&3;c=a.w>>14&3;a.N!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.N]);a.w=b;a.i&=-3;a.i|=a.R?2:1}function zd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.Za=b} +h.Da=function(a){this.I=this.L=a;this.G=0};h.lb=function(a,b){this.I=this.L=this.D=a;this.G=b||0};function He(a,b){a.I=a.L=a.D=b;a.G=a.I^a.D>>1}function Ie(a,b,c,d){a.I=a.L=a.D=b;a.G=(c^d)&(d^b)} +h.qa=function(a,b,c){if(!this.oa){0>this.Ya?this.Ya=Ad(this):this.N||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.P|=4,this.g[6]=a=4);if(-1!=c){this.O=a|4143316992;this.N=0;var d=this.na(a|this.Ga),e=this.na(a+2&65535|this.Ga);Bd(this,e&-12289|this.Ya>>2&12288);Je(this,this.Ya);Je(this,this.g[7]);ye(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Ya=-1;this.nc=c;this.qc=a;-1==c&&this.Z();if(-4<=c)throw a;}}; +function Ke(a){var b=Le(a),c=Le(a);a.w&49152&&(c=c&-225|a.w&63712);ye(a,b);Bd(a,c);a.i&=-17}function Me(a,b){var c=b>>13&31;31>c&&(b=a.V&32?a.Fa[c]+(b&8191)&4194303:b&-3932161);return b} +function Ne(a,b,c){var d=[];if(c){c=Me(a,b);var e=b>>13&31;d.push(c);d.push(e);a.V&32&&(d.push(a.Fa[e]),d.push(b&8191))}else if(a.tb){var e=a.N<<1,f=b>>13;7>13;a.V&a.Ed[a.N]||(d&=7);e=a.B[a.N][d];f=(a.M[a.N][d]<<6)+(b&8191)&a.eb;3932160<=f&&(f=Me(a,f));if(a.oa)return f;f>=a.zd&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.B[a.N][d]=e;if(f!=(4194170&a.eb)||a.N)a.ub=a.N,a.mb=d;g&&(g&57344&&(0<=a.Ya&&(g|=128),a.U&57344||(g|=a.U&4096|a.ub<<5|a.mb<<1,vd(a,a.U&-61695|g&61694)),a.qa(168,64,-2)),a.U&61440||!(f<(4191360&a.eb)||f>(4194239&a.eb))||(a.U|=4096,a.U&512&&(a.i|=64)));return f}function Le(a){var b=a.na(a.g[6]|a.Ga);a.g[6]=a.g[6]+2&65535;return b}function Je(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.O=a.O&65535|(a.O&-65536)<<8|16121856;a.i&256||a.Eb(4,-2,c);a.Bb(c,b)} +function Oe(a,b,c,d){var e,f,g=d&8?0:a.Ga;switch(b){case 0:return a.qa(4,0,-3),0;case 1:return 6==c&&a.Eb(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Eb(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Eb(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,6==c&&a.Eb(d, +0,e),a.b-=6,e|g;case 7:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ga),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.O=a.O&65535|(a.O&-65536)<<8|(f<<3&248|c)<<16;return e}h.$e=function(a,b,c){!this.N&&0>=b&&c<=this.ua&&(this.i|=32)};h.af=function(a,b,c){this.N||(65534<=c&&(c|=-65536),a&4&&c<=this.ua&&(c<=this.ua-32?this.qa(4,0,-4):(this.P|=8,this.i|=32)))};h.Vd=function(a){this.F&&Zd(this.F,a,1);return this.Lc(a)};h.$d=function(a){this.F&&Zd(this.F,a,2);return this.Mc(a)}; +h.ee=function(a,b){this.F&&$d(this.F,a,1);this.Nc(a,b)};h.fe=function(a,b){this.F&&$d(this.F,a,2);this.Qc(a,b)};function Ac(a,b){a.oa++;b=a.C.oc(yc(a,b,2));a.oa--;return b}function Pe(a,b){(b?--a.gc:--a.fc)||we(a)}h.df=function(a,b,c){return Oe(this,a,b,c)};h.Zd=function(a,b,c){return yc(this,Oe(this,a,b,c),c)};h.de=function(a){return this.C.oc(this.cb=a)};h.qg=function(a){this.F&&Zd(this.F,a,2);return this.de(a)};h.gd=function(a){return this.C.oc(this.cb=yc(this,a,2))}; +h.rg=function(a){this.F&&Zd(this.F,a,2);return this.gd(a)};h.ie=function(a,b){this.C.Sb(this.cb=a,b)};h.Bh=function(a,b){this.F&&$d(this.F,a,2);this.ie(a,b)};h.md=function(a,b){this.C.Sb(this.cb=yc(this,a,4),b)};h.Ch=function(a,b){this.F&&$d(this.F,a,2);this.md(a,b)};function Qe(a,b,c){var d=a.j=b&7;(b=a.v=(b&56)>>3)?(d=Oe(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.N=a.w>>12&3,c=a.na(d|c&a.Ga),a.N=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} +function Re(a,b,c,d){a.O=a.O&65535|1441792;var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=Oe(a,b,e,4),c&65536||(e&=65535),a.N=a.w>>12&3,e=yc(a,e|c&65536,4),a.N=a.w>>14&3,a.Zb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Se(a,b){b>>=6;var c=a.Y=b&7;return(b=a.X=(b&56)>>3)?a.Xb(a.Ea(b,c,3)):a.g[c+a.mc]&a.Fd}function Te(a,b){var c;b>>=6;var d=a.Y=b&7;(b=a.X=(b&56)>>3)?c=a.Yb(a.Ea(b,d,2)):c=a.g[d+a.mc];return c}function Ue(a,b){var c=a.j=b&7;b=a.v=(b&56)>>3;return Oe(a,b,c,8)} +function Ve(a,b){var c=a.j=b&7;return(b=a.v=(b&56)>>3)?a.Xb(a.Ea(b,c,3)):a.g[c]&255}function We(a,b){var c,d=a.j=b&7;(b=a.v=(b&56)>>3)?c=a.Yb(a.Ea(b,d,2)):c=a.g[d];return c}function sf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Hc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.Ec(e,d.call(a,c,a.Xb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} +function R(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,6),a.Zb(e,d.call(a,0>c?a.g[-c-1]:c,a.Yb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function tf(a,b,c,d,e){var f=a.j=b&7;(b=a.v=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.Ec(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} +function uf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Zb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} +h.pc=function(a){this.A.complete=!0;var b=this.F?vf(this.F)?1:this.A.Dc?-1:0:0,c=a?this.A.Dc?0:1:-1;this.A.Dc=!1;this.gb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(wf(this.F,this.g[7],c)){this.Z();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.Za&224)>>5,f=this.R&&this.R.kb>e?this.R:null;f&&(d=f.zb,e=f.kb);e>(this.w&224)>>5?(this.i&8&&(Ee(this,2),this.i&=-9),this.qa(d,0,-10),e=!0):e=!1;e&&(f&&Fe(this,f),a=!0);this.R||this.Za||(this.i&=-3)}else this.i& +1&&this.i++;if(a){if(this.i&4&&wf(this.F,this.g[7],c)){this.Z();break}if(0>c)break}if(this.i&112&&Ge(this)){if(this.i&4&&wf(this.F,this.g[7],c)){this.Z();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.O=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.yd(f)}while(0>1|b<<16;He(this,a);return a&65535}function Cf(a,b){a=b&128|b>>1|b<<8;He(this,a<<8);return a&255}function Df(a,b){a=b&~a;this.Da(a);return a}function Ef(a,b){a=b&~a;this.Da(a<<8);return a} +function Ff(a,b){a|=b;this.Da(a);return a}function Gf(a,b){a|=b;this.Da(a<<8);return a}function Hf(a,b){a=~b|65536;this.lb(a);return a&65535}function If(a,b){a=~b|256;this.lb(a<<8);return a&255}function Jf(a,b){this.I=this.L=a=b-a;this.G=b&(b^a);return a&65535}function Kf(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.G=b&(b^c);return a&255}function Lf(a,b){this.I=this.L=a=b+a;this.G=a&(b^a);return a&65535}function Mf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.G=c&(b<<8^c);return a&255} +function Nf(a,b){a=-b;this.lb(a,a&b&32768);return a&65535}function Of(a,b){a=-b;this.lb(a<<8,(a&b&128)<<8);return a&255}function Pf(a,b){a=b<<1|this.D>>16&1;He(this,a);return a&65535}function Qf(a,b){a=b<<1|this.D>>16&1;He(this,a<<8);return a&255}function Rf(a,b){a=(this.D&65536|b)>>1|b<<16;He(this,a);return a&65535}function Sf(a,b){a=((this.D&65536)>>8|b)>>1|b<<8;He(this,a<<8);return a&255}function Tf(a,b){var c=b-a;Ie(this,c,a,b);return c&65535} +function Uf(a,b){var c=b-a;Ie(this,c<<8,a<<8,b<<8);return c&255}function Vf(a,b){this.I=this.L=b&65280;this.G=this.D=0;return(b<<8|b>>8)&65535}function Wf(a,b){a^=b;this.Da(a);return a&65535}function Xf(a){R(this,a,Te(this,a),xf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function Yf(a){var b=We(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.D=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.g[a]=c&65535;this.I=this.L=c;this.b-=(this.v?6:7)+b} +function Zf(a){var b=We(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.D=this.G=0;b&=63;if(b&32){b=64-b;32>b-1;this.D=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.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.v?6:7)+b}function $f(a){P(this,a,!Ae(this))}function ag(a){P(this,a,Ae(this))} +function bg(a){R(this,a,Te(this,a),Df);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function cg(a){sf(this,a,Se(this,a),Ef);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function dg(a){R(this,a,Te(this,a),Ff);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function eg(a){sf(this,a,Se(this,a),Gf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function fg(a){var b=Te(this,a);a=We(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function gg(a){var b=Se(this,a);a=Ve(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function hg(a){P(this,a,Ce(this))}function ig(a){P(this,a,!De(this)==!Be(this))}function jg(a){P(this,a,!Ce(this)&&!De(this)==!Be(this))}function kg(a){P(this,a,!Ae(this)&&!Ce(this))} +function lg(a){P(this,a,Ce(this)||!De(this)!=!Be(this))}function mg(a){P(this,a,Ae(this)||Ce(this))}function ng(a){P(this,a,!De(this)!=!Be(this))}function og(a){P(this,a,De(this))}function pg(a){P(this,a,!Ce(this))}function qg(a){P(this,a,!De(this))}function rg(){this.qa(12,0,-9)}function sg(a){P(this,a,!0)}function tg(a){P(this,a,!Be(this))}function ug(a){P(this,a,Be(this))}function vg(a){a&1&&(this.D=0);a&2&&(this.G=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} +function wg(a){var b=Te(this,a);a=We(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Ie(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function xg(a){var b=Se(this,a);a=Ve(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Ie(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} +function yg(a){var b=We(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.D=this.G=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.I=d>>16):(this.G=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.G=32768,this.D=65536,this.b-=7}function zg(){this.qa(24,0,-9);this.b-=20} +function Ag(){this.w&49152?(this.P|=128,this.qa(4,0,-8)):(this.ra&&1120==this.ia&&this.ra.setData(this.g[0],!0),this.F?Bg(this.F):this.Z());this.b-=7}function Cg(){this.qa(16,0,-9);this.b-=20}var Dg=[0,7,7,10,7,11,9,13];function Eg(a){this.ja=this.b;ye(this,Ue(this,a));this.b=this.ja-Dg[this.v]}var Fg=[0,14,14,17,14,18,16,20];function Gg(a){this.ja=this.b;var b=Ue(this,a);a=a>>6&7;Je(this,this.g[a]);this.g[a]=this.g[7];ye(this,b);this.b=this.ja-Fg[this.v]} +var Hg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ig(a){var b=Te(this,a);this.ja=this.b;uf(this,a,b,this.Da);this.b=this.ja-Hg[(this.X?8:0)+this.v]+(7!=this.j||this.v?0:2)}function Jg(a){var b=Se(this,a);tf(this,a,b,65535,this.Da);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Kg=[7,13,13,17,14,18,17,21]; +function Lg(a){var b=We(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.G=0;this.D=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)ye(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Sg(a){R(this,a,Te(this,a),Tf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Tg(a){R(this,a,0,Vf);this.b-=this.v?9:3+(7==this.j?2:0)}function Ug(){this.qa(28,0,-9)} +function Vg(){this.ra&&(this.ra.kd(this.g[7],!0),this.ra.setData(this.g[0],!0));this.i|=8;Ee(this,-2);this.b-=3}function Wg(a){R(this,a,this.g[(a>>6&7)+this.mc],Wf);this.b-=this.v?9:3+(7==this.j?2:0)}function S(a){var b;if(b=this.F)b=this.F,A(b,1)?(D(b,"undefined opcode "+K(b,a),!0,!0),b=Bg(b)):b=!1;b||this.qa(8,0,-9)}function ue(a){Xg[a>>12].call(this,a)}function Yg(a){Zg[a>>6&3].call(this,a)}function $g(a){ah[a>>6&3].call(this,a)}function bh(a){ch[a>>6&3].call(this,a)} +function dh(a){eh[a&15].call(this,a)}function fh(a){gh[a&15].call(this,a)}function hh(a){ih[a>>6&3].call(this,a)}function jh(a){kh[a>>6&3].call(this,a)}function lh(a){mh[a>>6&3].call(this,a)} +var Xg=[function(a){nh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Xf,S,function(a){oh[a>>8&15].call(this,a)},Jg,xg,gg,cg,eg,Sg,S],nh=[function(a){ph[a>>4&15].call(this,a)},sg,pg,hg,ig,ng,jg,lg,Gg,Gg,Yg,$g,bh,S,S,S],Zg=[function(a){uf(this,a,0,this.lb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Hf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,1,Lf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,1,Jf);this.b-=this.v?9:3+(7==this.j?2:0)}],ah=[function(a){R(this,a,0,Nf); +this.b-=this.v?11:6},function(a){R(this,a,Ae(this)?1:0,xf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,Ae(this)?1:0,Tf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=We(this,a);this.lb(a);this.b-=this.v?4:3+(7==this.j?2:0)}],ch=[function(a){R(this,a,0,Rf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Pf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Bf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,zf);this.b-=this.v?9:3+(7==this.j?2:0)}],ph= +[function(a){qh[a&15].call(this,a)},S,S,S,Eg,Eg,Eg,Eg,Og,S,dh,fh,Tg,Tg,Tg,Tg],qh=[Ag,Vg,Pg,rg,Cg,Ng,S,S,S,S,S,S,S,S,S,S],eh=[Mg,function(){this.D=0;this.b-=5},function(){this.G=0;this.b-=5},vg,function(){this.L=1;this.b-=5},vg,vg,vg,function(){this.I=0;this.b-=5},vg,vg,vg,vg,vg,vg,vg],gh=[Mg,function(){this.D=65536;this.b-=5},function(){this.G=32768;this.b-=5},Qg,function(){this.L=0;this.b-=5},Qg,Qg,Qg,function(){this.I=32768;this.b-=5},Qg,Qg,Qg,Qg,Qg,Qg,Qg],oh=[qg,og,kg,mg,tg,ug,$f,ag,zg,Ug,hh,jh, +lh,S,S,S],ih=[function(a){tf(this,a,0,255,this.lb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,0,If);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,1,Mf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,1,Kf);this.b-=this.v?9:3+(7==this.j?2:0)}],kh=[function(a){sf(this,a,0,Of);this.b-=this.v?11:6},function(a){sf(this,a,Ae(this)?1:0,yf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,Ae(this)?1:0,Uf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=Ve(this, +a);this.lb(a<<8);this.b-=this.v?4:3+(7==this.j?2:0)}],mh=[function(a){sf(this,a,0,Sf);this.b-=this.v?9+(this.Hc&1):3+(7==this.j?2:0)},function(a){sf(this,a,0,Qf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){sf(this,a,0,Cf);this.b-=this.v?9+(this.Hc&1):3+(7==this.j?2:0)},function(a){sf(this,a,0,Af);this.b-=this.v?9:3+(7==this.j?2:0)}];function ve(a){rh[a>>12].call(this,a)} +var rh=[function(a){sh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Xf,function(a){th[a>>8&15].call(this,a)},function(a){uh[a>>8&15].call(this,a)},Jg,xg,gg,cg,eg,Sg,S],sh=[function(a){vh[a>>4&15].call(this,a)},sg,pg,hg,ig,ng,jg,lg,Gg,Gg,Yg,$g,bh,function(a){wh[a>>6&3].call(this,a)},S,S],wh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.na(a|this.Ga);ye(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Qe(this,a,0);this.Da(a);Je(this,a);this.b-=11},function(a){var b=Le(this); +this.ja=this.b;this.Da(b);Re(this,a,0,b);this.b=this.ja-Kg[this.v]},function(a){uf(this,a,De(this)?65535:0,this.Da);this.b-=this.v?9:3+(7==this.j?2:0)}],vh=[function(a){xh[a&15].call(this,a)},S,S,S,Eg,Eg,Eg,Eg,Og,function(a){!(a&8)||1145>this.ia?S.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},dh,fh,Tg,Tg,Tg,Tg],xh=[Ag,Vg,function(){Ke(this);this.i|=this.w&16;this.b-=13},rg,Cg,Ng,Pg,function(a){S.call(this,a)},S,S,S,S,S,S,S,S],th=[Lg,Lg,yg,yg,Yf,Yf,Zf,Zf, +Wg,Wg,S,S,S,S,Rg,Rg],uh=[qg,og,kg,mg,tg,ug,$f,ag,zg,Ug,hh,jh,lh,function(a){1145>this.ia?S.call(this,a):yh[a>>6&3].call(this,a)},S,S],yh=[function(a){S.call(this,a)},function(a){a=Qe(this,a,65536);this.Da(a);Je(this,a);this.b-=11},function(a){var b=Le(this);this.ja=this.b;this.Da(b);Re(this,a,65536,b);this.b=this.ja-Kg[this.v]},function(a){S.call(this,a)}]; +function zh(a){q.call(this,"ROM",a,128);this.ea=this.g=null;this.v=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Ta(this.j);if(this.j){a=this.j;var b=Ua(this.B);"json"!=b&&"hex"!=b&&(a=hb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;fb(a,null,!0,function(a,b,f){f?(c.S("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(va(c.pb,a,b),(a=gb(a,b))?(c.g=a.aa,c.ea=a.ea):c.j=null);Ah(c)})}}p(zh,q); +h=zh.prototype;h.za=function(a,b,c,d){this.C=b;this.f=c;this.F=d;Ah(this)};h.Ca=function(){this.ea&&(this.F&&Bh(this.F,this.id,this.v,this.b,this.ea),delete this.ea);return!0};h.Ba=function(){return!0}; +function Ah(a){if(!Ia(a)){if(a.j){if(!a.g||!a.C)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Ga(a,"ROM size ("+F(a.g.length,8,!0)+") does not match specified size ("+F(a.b,8,!0)+")");else{var b;a:{b=a.v;if(57344<=b&&b<57344+Rc){var c={},c=(c[b]=[zh.prototype.cg,zh.prototype.lh,null,null,null,a.b>>1],c);if(bc(a.C,a,c)){a.status("Added "+a.b+"-byte ROM at "+E(b));b=a.w=!0;break a}}else if(Xc(a.C,b,a.b,Gd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){D(a,"invalid block at offset "+Sa(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,C=r-=6;0=b.length){D(a,"insufficient data for block at offset "+Sa(n),4096); +break}m+=b[l++]&255;if(m&255){D(a,"invalid checksum ("+F(m,2,!0)+") for block at offset "+Sa(n),4096);break}if(C)for(D(a,"loading "+Sa(C)+" bytes at "+Sa(u)+"-"+Sa(u+C),4096);C--;)fd(a.C,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&D(a,"starting address: "+Sa(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=ta.nd&&c<=ta.We&&(b=c-(ta.nd-ta.ke));b&&(a.preventDefault&&a.preventDefault(),d.Bc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ta.me&&(b=ta.le);d.Bc(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Bc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;var e=this;this.P=od(this.f,this.M?-1:48,4,262144);this.R=ld(this.f,function(){var a;a=-1;e.i.length&&(a=e.i.shift()&255,D(e,"receiveByte("+F(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),nd(e.f,e.R,1E3/Math.round(e.U/10)));0<=a&&(e.D=a,e.b&128?e.D|=49152:e.b|=128,e.b&64&&md(c,e.P))});this.N=od(this.f,this.M?-1:52,4,262144);this.X=ld(this.f,function(){e.g|=128;e.g&64&&md(c,e.N)});bc(b,this,Ih,this.M?64832+8*(this.M-1)-65392:0);dc(b,this.reset.bind(this)); +y(this)};h.ae=function(a){if(!this.j){var b=ee(this.K,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Za(c[0]);if(d!=this.Fb)return;c=Za(c[1]);if(this.j=Ba(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.G=e.receiveData){this.I=a;this.O=e.receiveStatus;this.status("Connected "+this.pb+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +h.Ca=function(a,b){if(!b)if(this.ae(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.Ba=function(a){return a?this.save():!0};h.reset=function(){Jh(this)};h.save=function(){var a=new G(this);a.set(0,[this.D,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Jh(this,a[0])};function Jh(a,b){b||(b=[0,8192,128,a.i]);b=ja(b);a.D=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0} +h.Bc=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Ya("",c)));this.V&&!this.B&&c&&(b=String.fromCharCode(this.V)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.B+=c}}else if(null!=this.w){if(10== +a||1024<=this.w.length)this.u(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}nd(this.f,this.X,1E3/Math.round(this.Y/10));this.g&=-129};var Hh="buffer",Kh={},Ih=(Kh[65392]=[null,null,Gh.prototype.Qf,Gh.prototype.Yg,"RCSR"],Kh[65394]=[null,null,Gh.prototype.Pf,Gh.prototype.Xg,"RBUF"],Kh[65396]=[null,null,Gh.prototype.vg,Gh.prototype.Eh,"XCSR"],Kh[65398]=[null,null,Gh.prototype.ug,Gh.prototype.Dh,"XBUF"],Kh); +yb(function(){for(var a=x(document,w,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.H[b]=c,!0;case "readTape":e=Oh;case "loadTape":return e||(e=Ph),this.H[b]=c,c.onclick= +function(){var a=d.H.listTapes;a&&Qh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.N){c.parentNode.removeChild(c);break}this.H[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;Qh(d,Ta(b,!0),b,Ph,a)}return!1};return!0;case Rh:return this.H[b]=c,!0}return!1}; +h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;this.I=Sh(a);var e=this;if(a=Lh(this,ee(this.K,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.G=od(this.f,56,4,4096);this.P=ld(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=Ua(c),f="json"==e||"gz"==e?encodeURI(c):hb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!fb(f,null,!0,function(e,f,g){var k=0>g&&!!a.K&&!a.K.A.ca;g?a.S('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(va(a.pb,e,f),(e=gb(e,f))&&ci(a,b,c,d,e.aa,e.wa, +e.va));a.A.jb=!1;a.g&&(a.g--,a.g||y(a));$h(a)})}function Vh(a,b,c,d){if((a=a.H.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ba);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ua(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Va(c,"/")&&(d="dir"),f=hb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.dd?"":e)+"&format=json"));return!!fb(f, +null,!0,function(b,c,d){ki(a,b,c,d)})} +function ki(a,b,c,d){var e=null,f=0>d&&!!a.K&&!a.K.A.ca;a.j=!1;if(d)a.controller.S('Unable to load disk "'+a.bb+'" (error '+d+": "+b+")",f);else{va(a.controller.pb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)v(k[0]);else{a.ba=k.length;a.ma=k[0].length;a.ga=k[0][0].length;var l=k[0][0][0];a.xa=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,C=u.length;C>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ja?f=a.Sa+a.Ja&&(a.Ja+=f-(a.Sa+a.Ja)+1):(a.Sa=f,a.Ja=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.S("Unable to restore disk '"+this.bb+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=mi(this,a++);)Ii(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function Ii(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var gi=0;function Ji(a,b,c,d,e,f){q.call(this,a,b,c);this.L=Ki(this,b.autoMount);this.G=0;this.O=d;this.P=e;this.R=f;this.N=d.rd;this.i=Array(this.N);this.M=!mb("Mobi")&&window&&"FileReader"in window;this.v=[];this.Lb=null;this.exports={selectDrive:this.yg}}p(Ji,q); +function Ki(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Ji.prototype; +h.ta=function(a,b,c){var d=this;switch(b){case "listDisks":return this.H[b]=c,c.onchange=function(){var a=d.H.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v(d.type+" option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.H[b]=c,c.onchange=function(){var a=La(c.value,10);null!=a&& +Li(d,a)},!0;case "loadDisk":return this.H[b]=c,c.onclick=function(){var a=d.H.listDisks;a&&a.options&&Mi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.H[b]=c,c.onclick=function(){var a,b=d.H.listDrives,b=b&&La(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.S("Unable to boot the selected drive"):a.ya?(xe(d.f,0,!0),(a=d.hc(a,0,0,0,512,0,2))&&d.S("Unable to read the boot sector ("+a+")")):d.S("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c); +break}this.H[b]=c;c.onclick=function(){var a=d.H.listDrives;if(a&&a.options&&d.i)if(a=d.i[La(a.value,10)||0])if(a=a.ya){var b;b="";for(var c=0,k;k=mi(a,c++);)for(var l=0,m=k.length;lg||9e||e>=a.i.length)a.S("Unable to load the selected drive");else if(c)if(c==Pi)a.S('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Qi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Ta(c);a.status("Attempting to load "+c+' as "'+b+'"')}Vi(a,e,b,c,!1,d)}else Si(a,e)} +function Vi(a,b,c,d,e,f){var g=-1,k=a.i[b];k.Na.toLowerCase()!=d.toLowerCase()&&(g++,Si(a,b,!0),k.cd?a.S(a.type+" busy"):(k.cd=!0,e&&(k.bd=!0,a.G++,A(a)&&D(a,"auto-loading disk: "+c)),k.yc=!!f,ji(new fi(a,k,"preload"),c,d,f,a.cf)&&g++));return g} +h.cf=function(a,b,c,d,e){a.cd=!1;b&&(b.ba>a.ba||b.ma>a.ma)&&(this.S('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.Ac)),b=null);if(b){a.ya=b;a.bb=c;a.Na=d;a:{var f;for(f=0;f=a.ba){m=U.rc;break}n=a.seek(b,c,d+1);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=U.sc;break}if(!k&&(xc(this.C,Me(this.f,f),u|t<<8),kd(this.C))){m=U.Vb;break}r>=a.xa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Fc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ya;var n=null,r;a||(m=U.Ad,e=0);for(;e;){var u=zc(this.C,Me(this.f,f));if(kd(this.C)){m=U.Vb;break}if(!n){if(b>=a.ba){m=U.rc;break}n=a.seek(b,c,d+1,!0);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}if(k){var t,C;if(0>(t=a.read(n,r++))||0>(C=a.read(n,r++))){m=U.sc;break}if(u!=(t|C<<8)){m=U.Od;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=U.sc;break}r>=a.xa&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Ce=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&~T.Db|f>>16-T.ka.Db&T.Db;this.B=65536-e&65535;this.j=this.j&~Yi.Xc|d&Yi.Xc;this.g|=a;Zi(this);return!0};function Zi(a){a.b&=~T.Ub;a.g&&(a.g|=U.pe,a.b|=T.Ub,a.g&U.Oc&&(a.b|=T.Oc),A(a)&&D(a,a.type+": ERROR: "+E(a.g)))}h.Vf=function(){return this.I};h.dh=function(){};h.Wf=function(){return this.g};h.eh=function(){};h.Sf=function(){return this.b&T.Wc}; +h.$g=function(a){this.b=this.b&~T.qb|a&T.qb;if(this.b&T.vd){a=!0;var b,c,d="",e=(this.j&Yi.nb)>>Yi.ka.nb,f=this.i[e],g,k,l,m,n,r;this.b&=~(T.Wa|T.Yc);this.g&=~U.Ne;switch(c=this.b&T.Pa){case $i.je:A(this)&&D(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=T.Wa;break;case $i.ye:d="RCHK";case $i.Ae:d||(d="READ"),b=this.hc;case $i.Zc:d||(d="WCHK");case $i.Ve:d||(d="WRITE");b||(b=this.Fc);g=(this.j&Yi.Tb)>>Yi.ka.Tb;k=(this.j&Yi.Pc)>>Yi.ka.Pc;l=this.j&Yi.Xc;m=65536-this.B&65535;n=(this.b&T.Db)<< +16-T.ka.Db|this.w;r=this.b&T.we?0:2;A(this)&&D(this,this.type+": "+d+"("+g+":"+k+":"+l+") "+E(n)+"--"+E(n+(m<<1)),!0,!0);if(g>=f.ba){this.g|=U.rc;break}if(l>=f.ga){this.g|=U.sc;break}a=b.call(this,f,g,k,l,m,n,r,c>=$i.Zc,this.Ce.bind(this));break;case $i.xc:g=(this.j&Yi.Tb)>>Yi.ka.Tb;A(this)&&D(this,this.type+": SEEK("+g+")",!0);g(n=a.read(k,m++))||0>(r=a.read(k,m++))){g=cj.Xa;break}xc(this.C,Me(this.f,f),n|r<<8);if(kd(this.C)){g=cj.Vb;break}f+=2;e--;if(m>=a.xa&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ba)))){g=cj.Xa;break}}return l?l(g,b,c,d,e,f):g}; +h.Fc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.ya;k=null;var m;a||(g=cj.Xa,e=0);for(;e;){var n=zc(this.C,Me(this.f,f));if(kd(this.C)){g=cj.Vb;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=cj.Xa;break}m=0}if(!a.write(k,m++,n&255)||!a.write(k,m++,n>>8)){g=cj.Xa;break}if(m>=a.xa&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ba)))){g=cj.Xa;break}}return l?l(g,b,c,d,e,f):g}; +h.He=function(a,b,c,d,e,f){this.D=f&65535;this.b=this.b&~V.Va|f>>16-V.ka.Va&V.Va;this.w=f>>16&dj.Vc;this.j=this.g=b<>V.ka.Va;if(!(this.b&V.Wa)){a=!0;var b,c="",d=this.i[(this.b&V.nb)>>V.ka.nb],e=d.ya,f,g,k;this.b&=~V.Cb;switch(this.b&V.Pa){case fj.Re:this.B&gj.wd&&(this.b&=V.Cb|V.Pa|V.Va);this.B=d.status|this.j&ej.wc|(e&&512==e.ba?gj.te:0);break;case fj.xc:(this.g&ej.se)==ej.Oe&&(b=this.g&ej.Wb,c=(this.g&ej.Qe)<<2,this.j=this.g&ej.Pe?this.j+b:this.j-b,this.g=this.j=this.j&ej.Wb|c);break;case fj.Be:this.B=this.j;break;case fj.ze:c="READ",b=this.hc; +case fj.Ue:c||(c="WRITE"),b||(b=this.Fc),f=this.g>>ej.ka.Wb,g=this.g&ej.wc?1:0,k=this.g&ej.Hd,!e||f>=e.ba||k>=e.ga?this.b=this.b|cj.Xa|V.Ub:(a=65536-this.B&65535,e=(this.w&dj.Vc)<<16|this.D,A(this)&&D(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+E(e)+"--"+E(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,2,!1,this.He.bind(this)))}a&&(this.b=this.b|V.Cb|V.Wa,this.b&V.Rc&&md(this.f,this.Lb))}};h.Yf=function(){return this.D};h.gh=function(a){this.D=a&hj.qb};h.ag=function(){return this.g}; +h.jh=function(a){this.g=a};h.bg=function(){return this.B};h.kh=function(a){this.B=a};h.Zf=function(){return this.w};h.hh=function(a){this.w=a&dj.Vc;this.b=this.b&~V.Va|(this.w&3)<a.v&&a.j.length&&(a.v=0);if(0>a.v||b!=a.j[a.v])a.j.splice(0,0,b),a.v=0;a.v--}else a.O?b="end":b=a.j[a.v+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(Za(b.substring(c,f))),c=f+1}}return a} +function lj(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 rj(a,b,c){var d;if(b){b=sj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=H(c,0,!0)+" "+c+". "+F(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.v((null!=b?b+": ":"")+d);return e} -function wj(a,b){if(b)return vj(a,b,a.U[b]);var c=0;for(b in a.U)vj(a,b,a.U[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function xj(a){oj.call(this,a);this.Ea=!1;this.ja=!0;this.H=W();this.za=W();this.N=W();this.B=[];this.g=this.L=this.F=[];yj(this);this.R=this.Z=0;this.i=[];this.oa=void 0;zj(this);this.G=this;this.ka={};this.ia=this.Ed=0;this.S=null;this.M=[];Aj(this,a.messages);this.ua=a.commands;this.Ha=Bj;this.W=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.X=this.la=0;this.b=this.V=null;var b=this;window?void 0===window[x]&&(window[x]=function(a){return ie(b,a)}):void 0===global[x]&&(global[x]= -function(a){return ie(b,a)})}p(xj,oj);function Cj(a){a=a&&a.K;null==a&&(a=-1);return a}function W(a,b,c){return{K:void 0===a?null:a,Ka:void 0===b?!1:b,Qa:!1,Ca:c}}h=xj.prototype;h.Wc=function(a,b){a.K=b;a.Qa=!1;a.Ca=void 0;return a};function Dj(a){return[a.K,a.Ka,a.Ca,a.Qa,a.tc]}function Ej(a,b){var c=W(b[0],b[1],b[2]);c.Qa=b[3];b[4]&&(c.Bd=pj(a,c.tc=b[4]));return c} -h.wa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.b=a.i;(a=de(a,"messages"))&&Aj(this,a);1140>this.f.ka&&(this.W=this.W.concat(Fj));1145>this.f.ka&&(this.W=this.W.concat(Gj));pd(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=Cj(Hj(d,c));if(-1===a){d.v("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.v("blockid physical blockaddr used size type");d.v("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.v("..."): -(c=n.type,m=bd[c],n&&d.v(H(n.id,8)+" %"+H(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -h.Kd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Nj:b=zd(this.f);break;case Oj:b=c.Va;break;case Pj:b=c.R;break;case Qj:b=c.za&65280;break;case Rj:b=td(c);break;case Sj:b=vd(c);break;case Tj:b=wd(c);break;case Uj:b=c.V;break;case Vj:d&&(b=d.ga);break;case Wj:d&&(b=d.Sa);break;case Xj:d&&Mc(d)&&(b=d.Ta)}}return b}; -h.message=function(a,b){b&&(a+=" @"+Kj(this,W(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.ia&1073741824)this.M.push(a);else{var c;if(this.ia&-2147483648&&this.f&&(c=this.f.A.T)||Ia(this,!0))this.ba(),c&&(a+=" (cpu halted)");this.v(a);this.f&&(a=this.f,oe(a),a.ub=0,a.J&&J(a.J,void 0))}}; -function zj(a){var b;if(!uf(a))a.i&&a.i.length&&a.v("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Yj);for(b=0;b>8;a.v("trapped to "+M(a,c&255,1)+" ("+(0>d?Mb[-d]:M(a,d))+")")}a.H=W(a.f.g[7]);b&&1!=a.I?ck(a):dk(a)}}function ak(a,b){var c;(c=!a.f||!Ha(a.f))||(c=a.f,c.A.fa?c=!0:(c.v(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.T?(b||a.v("cpu busy or unavailable, command ignored"),!1):!Ga(a.f)}h.ya=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; -h.xa=function(a,b){b&&this.v(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){zj(this);this.X=0;this.S=null;this.w=0;this.H=W(this.f.g[7]);this.A.T=!1;ek(this);a||ge(this)};h.save=function(){var a=new I(this);a.set(0,Dj(this.H));a.set(1,Dj(this.N));a.set(2,[this.j,this.P,this.ia]);a.set(3,this.B);return a.data()}; -h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=Ej(this,a[b++]),this.N=Ej(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.ia|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.v("running");this.A.T=!0;this.Fa=a;this.Ga=b}; -h.stop=function(a,b){if(this.A.T){this.A.T=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Kc(a.f,b)),65535!=(d&65535)&&(a.Wc(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function Ag(a){var b=a.f;if(b.A.T)throw xe(b,a.f.P&65535),a.ba(),-1;return!1}function Yd(a,b,c){fk(a,b,c||1,a.L)&&a.ba(!1)}function Zd(a,b,c){fk(a,b,c||1,a.F)&&a.ba(!1)} -function yj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Oe(a.f,!1);a.L=["br"];if(a.F)for(b=1;b>>c.g],!0)):Oe(a.f,!0);a.F=["bw"];a.la=0;a.Z=0} -h.tb=function(a,b,c){var d=!0;c||gk(this,a,b,!1,!0);if(a!=this.g){var e=Cj(b);if(-1===e)this.v("invalid address: "+Kj(this,b)),d=!1;else{var f=a==this.F;65535>>g.g].tb(e&g.i,f)}else e=this.f,(f?e.bc++:e.ac++)||ve(e)}}d&&(a.push(b),c?b.Qa=!0:(hk(this,a,a.length-1,"set"),zj(this)));return d}; -function gk(a,b,c,d,e){var f=!1;c=Cj(c);for(var g=1;g>>d.g],b)):Oe(a.f,b));k.Qa||zj(a);break}}return f}function ik(a,b){for(var c=1;c>23)&65535,z=M(t,u);else if(D==ok)u=u.K-((f&63)<<1)&65535,z=M(t,u);else if(D==pk)z=M(t,f&7,1);else if(D==qk)z=M(t,f&63,1);else if(D==rk)z=M(t,f&255,1);else if(D=f&E,E&sk&&(D>>=6,E>>=6),E&Y){var E=null,G=D& -tk;switch(D&uk){case 0:z=Mj(G);break;case 8:z="@"+Mj(G);E=vk(t,t.f.g[G]);break;case 16:7>G?z="("+Mj(G)+")+":(D=t.Oa(u,2),z="#"+M(t,D,0,!0));break;case 24:7>G?z="@("+Mj(G)+")+":(D=t.Oa(u,2),z="@#"+M(t,D,0,!0),E=vk(t,D));break;case 32:z="-("+Mj(G)+")";break;case 40:z="@-("+Mj(G)+")";break;case 48:D=t.Oa(u,2);z=M(t,D,0,!0)+"("+Mj(G)+")";7==G&&(z=M(t,D=D+u.K&65535),E=vk(t,D));break;case 56:D=t.Oa(u,2),z="@"+M(t,D)+"("+Mj(G)+")",7==G&&(z="@"+M(t,D=D+u.K&65535),E=vk(t,Kc(t.f,D)))}E&&(z=[z,E])}t=z;if(!t|| -!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.mb&&b=c.B&&(b=c.Ma[b&id])&&(a=b[4]);return a}function wk(a,b){switch(b){case "N":a=Ce(a.f);break;case "Z":a=Be(a.f);break;case "V":a=Ae(a.f);break;case "C":a=ze(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} -function Z(a,b){var c="",d=a.f;if(8>b)c=Mj(b),c+="="+M(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+M(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+M(a,d.W[b-16]);else switch(b){case Nj:c="PS="+M(a,zd(d));break;case Oj:c="PI="+M(a,d.Va);break;case Pj:c="ER="+M(a,d.R);break;case Qj:c="SL="+M(a,d.za&65280);break;case Rj:c="M0="+M(a,td(d));break;case Sj:c="M1="+M(a,vd(d));break;case Tj:c="M2="+M(a,wd(d));break;case Uj:c="M3="+M(a,d.V);break;case Vj:a.b&&(c="AR="+M(a,a.b.ga,3));break;case Wj:a.b&&(c="DR="+ -M(a,a.b.Sa));break;case Xj:a.b&&Mc(a.b)&&(c="SR="+M(a,a.b.Ta,3))}c&&(c+=" ");return c}function xk(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Nj)+Z(a,Oj)+Z(a,Qj);d+=wk(a,"T")+wk(a,"N")+wk(a,"Z")+wk(a,"V")+wk(a,"C");b&&(b=d,c=""+(Z(a,Rj)+Z(a,Sj)),c+=Z(a,Tj)+Z(a,Uj)+Z(a,Pj),c=c+"\n"+(Z(a,Xj)+Z(a,Vj)+Z(a,Wj)),d=b+("\n"+c));return d}h.Fd=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=cb(n,l,a.Fd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({Hi:b,K:c,Ke:d,ha:e,Cd:f})}function yk(a,b,c){var d=[],e=Cj(b)>>>0;for(b=0;b>>0,k=f.Ke;if(e>=g&&eb)){e.g[b]= -g&65535;break}a.v("unknown register: "+f);return}J(a.J);a.v("updated registers:")}}a.v(xk(a,d));c&&(a.H=W(e.g[7]),dk(a,Kj(a,a.H)))}}function Ck(a,b){b=ab(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.v(m)}k[3]&&(g=k[3],f=null);f=kk(a,b,g,f);a.v(f);a.H=b;e-=b.K-l;c++}}} -function jk(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.v(bk+b):(a.P&&(a.v("ended assemble at "+Kj(a,a.N)),a.H=a.N,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(Ha(a)&&0n||"z"Ka.length&&(a.v("note: only "+Ka.length+" available"),ua=Ka.length);Aa-=ua;0>Aa&&(null==Ka[Ka.length-1].K?(ua=Aa+ua,Aa=0):Aa+=Ka.length);var $e=[];"call"==xi&&(yc=1E5,$e=["CALL"]);for(void 0!==wi&&a.v(ua+" instructions earlier:");0=Ka.length&&(Aa=0);a.oa=ua;zi++;yc--}}zi||(a.v("no "+yi+"history available"),a.oa=void 0)}else{var ha=Hj(a,Ja);if(ha)if("da"==Ya){var af=ha.Ka||65535L.length?(2nb&&(nb=0);65536ef?String.fromCharCode(ef):"."),Ld=Ld>>8}pb&&(pb+="\n");pb=bf?pb+(qb+","):pb+(Ja+": "+qb+(Kd?"":" "+df))}pb&&a.v(pb);a.za=ha;a.Ca=fl}}}}break;case "e":if("else"== -g[0])break;var Tb,ff,gf,hf,jf=g[0],kf=g[1];"eb"==jf?(Tb=1,ff=255,gf=a.cd,hf=a.dd):"e"==jf||"ew"==jf?(Tb=2,ff=65535,gf=a.Oa,hf=a.de):kf=null;if(null==kf)a.v("edit memory commands:"),a.v("\teb [a] [...] edit bytes at address a"),a.v("\tew [a] [...] edit words at address a");else{var Md=Hj(a,kf);if(Md)for(var Nd=2;Ndnf;){for(var rb=null,jl=256;65536>Ec.K>>>0;){of.K=a.Oa(Ec,2);if(null==Ec.K||!jl--)break;if(!(of.K&1)){for(var kl=a,Od=of,Ei=null,Fc=Od.K,Fi=Fc,pf=1;6>=pf&&Fc;pf++){if(2> ";yb(function(){for(var a=y(document,x,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.v("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bKk){if(Lk(d,this.I)){this.u=new I(this,"1.32.2",Uk);Lk(this.u)&&(Vk(this,d),a=Wk,Xk(this.u));this.u.set(Rk,db());Yk(this.u);var e=this.b&&!this.F;if(a==Sk||za("Click OK to restore the previous "+Hb+" machine state, or CANCEL to reset the machine.")){if(c=Qk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Lk(d,g):("error"==f&&"no machine state"!= -g?(this.O("Error: "+g),"unable to verify user"==g&&(kb(Zk,""),this.g=null)):this.v(f+": "+g),Xk(d),Lk(d)?(c=Qk(d),e=!0):c=!1))}e&&Ok(this,c?d:null)}else a==Wk&&d.clear()}else Ok(this);delete this.I;delete this.w}e=Ba(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.A.fa=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.f&&($k(this,this.f,b,c,a),J(this,-2),this.f.va());this.N&&(Vk(this,b),b.clear());!c&&this.u&&(this.u.clear(),delete this.u);this.j=0}; -function Vk(a,b){if(za("There may be a problem with your "+Hb+" machine.\n\nTo help us diagnose it, click OK to send this "+Hb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Hb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;eb("http://www.pcjs.org/api/v1/report",d,!0)}} -function Ek(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new I(a,"1.32.2"),g=new I(a,"1.32.2",Pk),k=db();g.set(Rk,k);f.set(Rk,k);f.set(al,"1.32.2");f.set(bl,window?window.location.href:null);f.set(el,window?window.navigator.userAgent:"");a.f&&a.f.xa&&(c&&(b&&(a.f.A.va=a.f.A.T),a.f.ba()),d=a.f.xa(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.fa=!1,!1===d&&(e=null)));for(var k=Ba(a.id),l=0;l=d||30<=(c.Cc+=d))&&(e.textContent=c.A.T?c.pb.toFixed(2)+"Mhz":"Stopped",c.Cc=0)}if(a.i&&(a=a.i,b=b||0,a.u)){c=a.f.A.T;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;eb?a.ga=a.f.g[7]: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(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");eb(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 l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);vl(a,b,c)}})}else c(a,null)} -function wl(a,b,c,d){function e(a){if(void 0===k){var b=g&&y(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Va(a))}function f(a){e("Error: "+a);l&&(--sl||Cb(!0));l=!1}var g,k,l=!0;sl++;xa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?tl(c,null,null,!1,e,function(d,l){l?(wa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--sl||Cb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--sl||Cb(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?tl(b,a,d,!0,e,m):ul(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Cb(!1);return wl(a,b,c,d)};window.findMachineComponent=function(a,b){return Da(b,a+".machine")};window.enableEvents=Cb;window.sendEvent=Eb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11-dbg.map +function mj(a,b,c){var d;if(b){b=nj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=F(c,0,!0)+" "+c+". "+E(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.u((null!=b?b+": ":"")+d);return e} +function rj(a,b){if(b)return qj(a,b,a.U[b]);var c=0;for(b in a.U)qj(a,b,a.U[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; +function sj(a){jj.call(this,a);this.Ea=!1;this.ha=!0;this.G=W();this.ua=W();this.N=W();this.B=[];this.g=this.L=this.D=[];tj(this);this.P=this.Y=0;this.i=[];this.oa=void 0;uj(this);this.F=this;this.ia={};this.fa=this.Sd=0;this.R=null;this.M=[];vj(this,a.messages);this.ra=a.commands;this.Ha=wj;this.W=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.X=this.ja=0;this.b=this.V=null;var b=this;window?void 0===window[w]&&(window[w]=function(a){return je(b,a)}):void 0===global[w]&&(global[w]= +function(a){return je(b,a)})}p(sj,jj);function xj(a){a=a&&a.J;null==a&&(a=-1);return a}function W(a,b,c){return{J:void 0===a?null:a,Ka:void 0===b?!1:b,Ra:!1,Aa:c}}h=sj.prototype;h.kd=function(a,b){a.J=b;a.Ra=!1;a.Aa=void 0;return a};function yj(a){return[a.J,a.Ka,a.Aa,a.Ra,a.Cc]}function zj(a,b){var c=W(b[0],b[1],b[2]);c.Ra=b[3];b[4]&&(c.Pd=kj(a,c.Cc=b[4]));return c} +h.za=function(a,b,c,d){this.C=b;this.K=a;this.f=c;this.b=a.i;(a=ee(a,"messages"))&&vj(this,a);1140>this.f.ia&&(this.W=this.W.concat(Aj));1145>this.f.ia&&(this.W=this.W.concat(Bj));qd(this,16,function(a){a:{var b=d.C.b,c=a[0],e=a=0,l=b.length;if(c){a=xj(Cj(d,c));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.C.g;l=1}d.u("blockid physical blockaddr used size type");d.u("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.u("..."): +(c=n.type,m=cd[c],n&&d.u(F(n.id,8)+" %"+F(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} +h.Yd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Ij:b=Ad(this.f);break;case Jj:b=c.Za;break;case Kj:b=c.P;break;case Lj:b=c.ua&65280;break;case Mj:b=td(c);break;case Nj:b=wd(c);break;case Oj:b=xd(c);break;case Pj:b=c.V;break;case Qj:d&&(b=d.da);break;case Rj:d&&(b=d.Ta);break;case Sj:d&&Nc(d)&&(b=d.Ua)}}return b}; +h.message=function(a,b){b&&(a+=" @"+Fj(this,W(this.f.O&65535)));if(!this.R||a!=this.R)if(this.R=a,this.fa&1073741824)this.M.push(a);else{var c;if(this.fa&-2147483648&&this.f&&(c=this.f.A.T)||Ja(this,!0))this.Z(),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,pe(a),a.vb=0,a.K&&I(a.K,void 0))}}; +function uj(a){var b;if(!vf(a))a.i&&a.i.length&&a.u("instruction history buffer freed"),a.P=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Tj);for(b=0;b>8;a.u("trapped to "+K(a,c&255,1)+" ("+(0>d?Mb[-d]:K(a,d))+")")}a.G=W(a.f.g[7]);b&&1!=a.I?Xj(a):Yj(a)}}function Vj(a,b){var c;(c=!a.f||!Ia(a.f))||(c=a.f,c.A.ca?c=!0:(c.u(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.T?(b||a.u("cpu busy or unavailable, command ignored"),!1):!Ha(a.f)}h.Ca=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; +h.Ba=function(a,b){b&&this.u(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){uj(this);this.X=0;this.R=null;this.w=0;this.G=W(this.f.g[7]);this.A.T=!1;Zj(this);a||he(this)};h.save=function(){var a=new G(this);a.set(0,yj(this.G));a.set(1,yj(this.N));a.set(2,[this.j,this.O,this.fa]);a.set(3,this.B);return a.data()}; +h.restore=function(a){var b=0;void 0!==a[2]&&(this.G=zj(this,a[b++]),this.N=zj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.O=a[b][1],this.fa|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.u("running");this.A.T=!0;this.Fa=a;this.Ga=b}; +h.stop=function(a,b){if(this.A.T){this.A.T=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Ac(a.f,b)),65535!=(d&65535)&&(a.kd(a.i[a.P],b),++a.P==a.i.length&&(a.P=0)));return!1}function Bg(a){var b=a.f;if(b.A.T)throw ye(b,a.f.O&65535),a.Z(),-1;return!1}function Zd(a,b,c){ak(a,b,c||1,a.L)&&a.Z(!1)}function $d(a,b,c){ak(a,b,c||1,a.D)&&a.Z(!1)} +function tj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Pe(a.f,!1);a.L=["br"];if(a.D)for(b=1;b>>c.g],!0)):Pe(a.f,!0);a.D=["bw"];a.ja=0;a.Y=0} +h.wb=function(a,b,c){var d=!0;c||bk(this,a,b,!1,!0);if(a!=this.g){var e=xj(b);if(-1===e)this.u("invalid address: "+Fj(this,b)),d=!1;else{var f=a==this.D;65535>>g.g].wb(e&g.i,f)}else e=this.f,(f?e.gc++:e.fc++)||we(e)}}d&&(a.push(b),c?b.Ra=!0:(ck(this,a,a.length-1,"set"),uj(this)));return d}; +function bk(a,b,c,d,e){var f=!1;c=xj(c);for(var g=1;g>>d.g],b)):Pe(a.f,b));k.Ra||uj(a);break}}return f}function dk(a,b){for(var c=1;c>23)&65535,z=K(t,u);else if(B==jk)u=u.J-((f&63)<<1)&65535,z=K(t,u);else if(B==kk)z=K(t,f&7,1);else if(B==lk)z=K(t,f&63,1);else if(B==mk)z=K(t,f&255,1);else if(B=f&C,C&nk&&(B>>=6,C>>=6),C&Y){var C=null,H=B& +ok;switch(B&pk){case 0:z=Hj(H);break;case 8:z="@"+Hj(H);C=qk(t,t.f.g[H]);break;case 16:7>H?z="("+Hj(H)+")+":(B=t.Oa(u,2),z="#"+K(t,B,0,!0));break;case 24:7>H?z="@("+Hj(H)+")+":(B=t.Oa(u,2),z="@#"+K(t,B,0,!0),C=qk(t,B));break;case 32:z="-("+Hj(H)+")";break;case 40:z="@-("+Hj(H)+")";break;case 48:B=t.Oa(u,2);z=K(t,B,0,!0)+"("+Hj(H)+")";7==H&&(z=K(t,B=B+u.J&65535),C=qk(t,B));break;case 56:B=t.Oa(u,2),z="@"+K(t,B)+"("+Hj(H)+")",7==H&&(z="@"+K(t,B=B+u.J&65535),C=qk(t,Ac(t.f,B)))}C&&(z=[z,C])}t=z;if(!t|| +!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.ob&&b=c.B&&(b=c.Ma[b&jd])&&(a=b[4]);return a}function rk(a,b){switch(b){case "N":a=De(a.f);break;case "Z":a=Ce(a.f);break;case "V":a=Be(a.f);break;case "C":a=Ae(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} +function Z(a,b){var c="",d=a.f;if(8>b)c=Hj(b),c+="="+K(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+K(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+K(a,d.W[b-16]);else switch(b){case Ij:c="PS="+K(a,Ad(d));break;case Jj:c="PI="+K(a,d.Za);break;case Kj:c="ER="+K(a,d.P);break;case Lj:c="SL="+K(a,d.ua&65280);break;case Mj:c="M0="+K(a,td(d));break;case Nj:c="M1="+K(a,wd(d));break;case Oj:c="M2="+K(a,xd(d));break;case Pj:c="M3="+K(a,d.V);break;case Qj:a.b&&(c="AR="+K(a,a.b.da,3));break;case Rj:a.b&&(c="DR="+ +K(a,a.b.Ta));break;case Sj:a.b&&Nc(a.b)&&(c="SR="+K(a,a.b.Ua,3))}c&&(c+=" ");return c}function sk(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,Ij)+Z(a,Jj)+Z(a,Lj);d+=rk(a,"T")+rk(a,"N")+rk(a,"Z")+rk(a,"V")+rk(a,"C");b&&(b=d,c=""+(Z(a,Mj)+Z(a,Nj)),c+=Z(a,Oj)+Z(a,Pj)+Z(a,Kj),c=c+"\n"+(Z(a,Sj)+Z(a,Qj)+Z(a,Rj)),d=b+("\n"+c));return d}h.Td=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=ab(n,l,a.Td);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({Dj:b,J:c,ef:d,ea:e,Qd:f})}function tk(a,b,c){var d=[],e=xj(b)>>>0;for(b=0;b>>0,k=f.ef;if(e>=g&&eb)){e.g[b]= +g&65535;break}a.u("unknown register: "+f);return}I(a.K);a.u("updated registers:")}}a.u(sk(a,d));c&&(a.G=W(e.g[7]),Yj(a,Fj(a,a.G)))}}function xk(a,b){b=Za(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.u(m)}k[3]&&(g=k[3],f=null);f=fk(a,b,g,f);a.u(f);a.G=b;e-=b.J-l;c++}}} +function ek(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(Wj+b):(a.O&&(a.u("ended assemble at "+Fj(a,a.N)),a.G=a.N,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.R=null;if(Ia(a)&&0n||"z"Na.length&&(a.u("note: only "+Na.length+" available"),wa=Na.length);Ca-=wa;0>Ca&&(null==Na[Na.length-1].J?(wa=Ca+wa,Ca=0):Ca+=Na.length);var $e=[];"call"==ri&&(Cc=1E5,$e=["CALL"]);for(void 0!==qi&&a.u(wa+" instructions earlier:");0=Na.length&&(Ca=0);a.oa=wa;ti++;Cc--}}ti||(a.u("no "+si+"history available"),a.oa=void 0)}else{var ia=Cj(a,Ma);if(ia)if("da"==cb){var af=ia.Ka||65535L.length?(2rb&&(rb=0);65536ef?String.fromCharCode(ef):"."),Od=Od>>8}tb&&(tb+="\n");tb=bf?tb+(ub+","):tb+(Ma+": "+ub+(Nd?"":" "+df))}tb&&a.u(tb);a.ua=ia;a.Aa=al}}}}break;case "e":if("else"== +g[0])break;var Wb,ff,gf,hf,jf=g[0],kf=g[1];"eb"==jf?(Wb=1,ff=255,gf=a.sd,hf=a.td):"e"==jf||"ew"==jf?(Wb=2,ff=65535,gf=a.Oa,hf=a.re):kf=null;if(null==kf)a.u("edit memory commands:"),a.u("\teb [a] [...] edit bytes at address a"),a.u("\tew [a] [...] edit words at address a");else{var Pd=Cj(a,kf);if(Pd)for(var Qd=2;Qdnf;){for(var vb=null,el=256;65536>Ic.J>>>0;){of.J=a.Oa(Ic,2);if(null==Ic.J||!el--)break;if(!(of.J&1)){for(var fl=a,Rd=of,yi=null,Jc=Rd.J,zi=Jc,pf=1;6>=pf&&Jc;pf++){if(2> ";yb(function(){for(var a=x(document,w,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.u("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bFk){if(Gk(d,this.G)){this.v=new G(this,"1.32.2",Pk);Gk(this.v)&&(Qk(this,d),a=Rk,Sk(this.v));this.v.set(Mk,bb());Tk(this.v);var e=this.b&&!this.B;if(a==Nk||za("Click OK to restore the previous "+Hb+" machine state, or CANCEL to reset the machine.")){if(c=Lk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Gk(d,g):("error"==f&&"no machine state"!= +g?(this.S("Error: "+g),"unable to verify user"==g&&(lb(Uk,""),this.g=null)):this.u(f+": "+g),Sk(d),Gk(d)?(c=Lk(d),e=!0):c=!1))}e&&Jk(this,c?d:null)}else a==Rk&&d.clear()}else Jk(this);delete this.G;delete this.w}e=Aa(this.id);for(f=0;fa[1];a=a[2];this.P=!0;this.A.ca=!0;var d=this.H.power;d&&(d.textContent="Shutdown");this.f&&(Vk(this,this.f,b,c,a),I(this,-2),this.f.sa());this.N&&(Qk(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0}; +function Qk(a,b){if(za("There may be a problem with your "+Hb+" machine.\n\nTo help us diagnose it, click OK to send this "+Hb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Hb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;fb("http://www.pcjs.org/api/v1/report",d,!0)}} +function zk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new G(a,"1.32.2"),g=new G(a,"1.32.2",Kk),k=bb();g.set(Mk,k);f.set(Mk,k);f.set(Wk,"1.32.2");f.set(Xk,window?window.location.href:null);f.set($k,window?window.navigator.userAgent:"");a.f&&a.f.Ba&&(c&&(b&&(a.f.A.sa=a.f.A.T),a.f.Z()),d=a.f.Ba(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.ca=!1,!1===d&&(e=null)));for(var k=Aa(a.id),l=0;l=d||30<=(c.Kc+=d))&&(e.textContent=c.A.T?c.rb.toFixed(2)+"Mhz":"Stopped",c.Kc=0)}if(a.i&&(a=a.i,b=b||0,a.v)){c=a.f.A.T;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;eb?a.da=a.f.g[7]: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(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");fb(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 l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);ql(a,b,c)}})}else c(a,null)} +function rl(a,b,c,d){function e(a){if(void 0===k){var b=g&&x(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Wa(a))}function f(a){e("Error: "+a);l&&(--nl||Cb(!0));l=!1}var g,k,l=!0;nl++;xa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?ol(c,null,null,!1,e,function(d,l){l?(va(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--nl||Cb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--nl||Cb(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ol(b,a,d,!0,e,m):pl(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Cb(!1);return rl(a,b,c,d)};window.findMachineComponent=function(a,b){return Da(b,a+".machine")};window.enableEvents=Cb;window.sendEvent=Eb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11-dbg.map diff --git a/versions/pdpjs/1.32.2/pdp11.js b/versions/pdpjs/1.32.2/pdp11.js index 486323bcb..c5e301ca6 100644 --- a/versions/pdpjs/1.32.2/pdp11.js +++ b/versions/pdpjs/1.32.2/pdp11.js @@ -15,6 +15,7 @@ http://pcjs.org/modules/pdp11/lib/keyboard.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/pc11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/rk11.js (C) Jeff Parsons 2012-2017 + http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/es6/state.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/es6/embed.js (C) Jeff Parsons 2012-2017 @@ -29,267 +30,252 @@ http://pcjs.org/modules/pdp11/lib/serial.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/disk.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/drive.js (C) Jeff Parsons 2012-2017 - http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/es6/debugger.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2017 */ -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;function da(){da=function(){};ba.Symbol||(ba.Symbol=ea)}var fa=0;function ea(a){return"jscomp_symbol_"+(a||"")+fa++} -function ga(){da();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ha(this)}});ga=function(){}}function ha(a){var b=0;return ia(function(){return b":62,"?":63,"@":64,zc:65,Ag:66,Cg:67,$g:68,E:69,fh:70,hh:71,ih:72,jh:73,kh:74,lh:75,mh:76,nh:77,oh:78,ph:79,rh:80,Q:81,th:82,uh:83,yh:84,Ah:85,Bh:86,Ch:87,Gh:88,Hh:89,Pd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ih:97,Jh:98,Kh:99,d:100,e:101,Lh:102,Mh:103,Nh:104,Oh:105,Rh:106,k:107,Sh:108,Th:109,n:110,Uh:111,p:112,q:113,r:114,Vh:115,t:116,Wh:117,Xh:118,Yh:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,nd:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Mc=b.comment;this.Kd=b;this.exports={};this.l=this.bindings={};a=this.id.indexOf(".");0>a?this.La=this.id:(this.Ma=this.id.substr(0,a),this.La=this.id.substr(a+1));this.j={ready:!1,Ta:!1,qc:!1,S:!1,error:!1};this.Nb=null;this.j.error=!1;this.Jc=c||0;this.F=this.c=this.v=this.A=this.eb=null;r.push(this)}function ta(a,b,c){ua[a]&&b&&(ua[a][b]=c)} +var ra={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},sa={Vg:0,zd:1,$g:2,ah:3,bh:4,dh:5,eh:6,fh:7,Oc:8,gh:9,Ad:10,hh:11,ih:12,Bd:13,jh:14,kh:15,lh:16,mh:17,nh:18,oh:19,ph:20,qh:21,rh:22,sh:23,th:24,uh:25,vh:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42, +"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Nc:65,Ug:66,Xg:67,wh:68,E:69,Ch:70,Eh:71,Qh:72,Sh:73,Th:74,Uh:75,Vh:76,Yh:77,$h:78,bi:79,ei:80,Q:81,gi:82,ii:83,ri:84,ti:85,vi:86,wi:87,Ai:88,Bi:89,ke:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ci:97,Di:98,Gi:99,d:100,e:101,Hi:102,Ii:103,Ji:104,Ki:105,Oi:106,k:107,Pi:108,Qi:109,n:110,Ri:111,p:112,q:113,r:114,Si:115,t:116,Ui:117,Vi:118,Wi:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,Cd:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Zc=b.comment;this.ge=b;this.exports={};this.m=this.bindings={};a=this.id.indexOf(".");0>a?this.ab=this.id:(this.Na=this.id.substr(0,a),this.ab=this.id.substr(a+1));this.j={ready:!1,Va:!1,Ac:!1,P:!1,error:!1};this.Vb=null;this.j.error=!1;this.Xc=c||0;this.F=this.c=this.u=this.A=this.hb=null;r.push(this)}function ta(a,b,c){ua[a]&&b&&(ua[a][b]=c)} function va(){return Date.now()||+new Date}function u(a){window&&window.alert(a)}function wa(a){var b=!1;window&&(b=window.confirm(a));return b}function xa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=3;return""+c}function Da(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} -function D(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Ha[a]})}function Ja(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} -var Ha={"&":"&","<":"<",">":">",'"':""","'":"'"},Ka={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",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 La(){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 E(a,b,c,d){c=void 0===c?!1:c;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, +function Ca(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return""+c}function Ea(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} +function Fa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Ja[a]})}function Ka(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} +var Ja={"&":"&","<":"<",">":">",'"':""","'":"'"},La={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",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 Na(){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 Oa(a,b,c,d){c=void 0===c?!1:c;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 l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}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 Ma(a,b){var c,d={O:null,ka:null,ca:null,ba: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.ca=g.load;d.ba=g.exec;if(e=g.bytes)d.O=e;else if(e=g.words)for(d.O=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.O=Array(4*e.length),f=c=0;c>8&255,d.O[f++]=e[c]>>16&255,d.O[f++]=e[c]>>24&255;else d.O=g;d.ka=g.symbols;d.O.length?1==d.O.length&&(u(d.O[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.a["S"+a]=[0,0,!1,!1,this.ie,a];this.F=this.c=this.v=this.A=null;B(this)}n(jb,q);h=jb.prototype; -h.reset=function(a){this.stop();a&&lb(this,this.f=0)}; -h.ha=function(a,b,c,d){if(this.A&&this.A.ha(a,b,c,d)||this.c&&this.c.ha(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.l[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.l[b]=c,this.h[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.l[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){mb(a, -b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){nb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){mb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){nb(a,b)}}(this,b),!0):q.prototype.ha.call(this,a,b,c,d)}};h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;ob(b,this,pb);qb(b,this.reset.bind(this));rb(this);sb(this)};h.ga=function(a,b){if(!b)if(this.G&&tb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0}; -h.fa=function(a){return a?this.save():!0};h.save=function(){var a=new G(this);a.set(0,[this.U,this.f,this.b]);return a.data()};h.restore=function(a){if(a=a[0])ub(this,this.U=a[0]),lb(this,this.f=a[1]),vb(this,a[2]);return!0};function wb(a,b,c){if(a=a.l[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function rb(a,b){for(var c in a.h)wb(a,c,null!=b?b:a.h[c])}function xb(a,b,c){if(a=a.l[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} -function sb(a){for(var b in a.a)xb(a,b,a.a[b][1])}function yb(a,b,c,d){if(a.l[b]){var e=a.F&&a.F.h||8;c=c||0;c=8==e?Ca(c,d):Da(c,d);a.l[b].textContent!=c&&(a.l[b].textContent=c)}}function mb(a,b){var c=a.a[b];xb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=zb&&(a.w=b==Ab,a.C=b==Bb)}function nb(a,b){var c=a.a[b];c[2]&&c[3]&&(xb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.ge=function(a){a||this.c.j.N||(a=this.c,a.v.reset(),Cb(a),this.a[Db]&&this.a[Db][1]&&Eb(this.c))};h.he=function(){}; -h.ce=function(a){a||H(this.c)};h.ae=function(a){if(!a&&!this.c.j.N)if(this.a[Db]&&this.a[Db][1])Eb(this.c);else{a=this.F;var b;if(b=a)a.j.Ta&&(a.j.qc=!0),b=!a.j.Ta;if(b)Ba(a,!0),a.f(0,null),Ba(a,!1);else try{var c=this.c.bc(1);0=a.c.pa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.v.u;a.a[zb]&&a.a[zb][1]||(b=-b);ub(a,a.U&~c|a.U+b&c)}function ub(a,b){a.U=b&a.v.u;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Nb(a,"A"+c,b&1<c;c++)Nb(a,"D"+c,b&1<c;c++)a.a["S"+c][1]=b&1<>2;this.f=this.g-1;this.s=this.D/this.g|0;this.L=this.s-1;this.Ha=[];this.m=0;this.o=!1;this.G=[];this.Qd=[Sb,Tb,Ub,Vb];this.a=this.b=[];this.C=this.w=this.i=this.H=this.I=0;a=new I(this);Wb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.u;B(this)}n(Qb,q);function Zb(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Qb.prototype;h.reset=function(){for(var a=0;a>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Sa)return l.Bb+=l.Sa-f,l.Sa=f,!0;if(f>=l.Sa+l.Bb){p=l.size-(f-m);p>g&&(p=g);l.Bb=f-l.Sa+p;f=m+a.g;g-=p;k++;continue}}return ac(bc,f,g)}f=new I(a,f,p,a.g,d,e);Wb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+cc[d]+" at "+Ca(b)),!0):ac(dc,b,c)}h.gd=function(a){return this.b[(a&this.i)>>>this.h].hb(a&this.f,a)}; -h.Eb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return hb||b!=this.f?this.b[c].W(b,a):this.b[c++].hb(b,a)|this.b[c&this.L].hb(0,a+1)<<8};h.hd=function(a,b){this.b[(a&this.i)>>>this.h].kb(a&this.f,b,a)};h.Fb=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;hb||c!=this.f?this.b[d].nb(c,b,a):(this.b[d++].kb(c,b&255,a),this.b[d&this.L].kb(0,b>>8&255,a+1))};function ec(a,b){return a.a[(b&a.u)>>>a.h]} -function Mb(a,b){var c;a.o=!1;a.m++;var d=b&a.f,e=ec(a,b);hb||d!=a.f?c=e.F(d,b):c=e.i(d,b)|ec(a,b+1).i(0,b+1)<<8;a.m--;return c}function fc(a,b,c){a.o=!1;a.m++;ec(a,b).l(b&a.f,c&255,b);a.m--}function Kb(a,b,c){a.o=!1;a.m++;var d=b&a.f,e=ec(a,b);hb||d!=a.f?e.m(d,c&65535,b):(e.l(d,c&255,b),ec(a,b+1).l(0,c>>8&255,b+1));a.m--} -function $b(a){for(var b=0,c=[],d=0;da.c.pa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=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)));for(var t=g[4],y=g[5]||1,x=0;x>8:e[2](f)&255):f&1&&(e=d.Ha[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255} -function Tb(a,b,c){var d=!1,e=this.controller,f=e.Ha[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ha[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function Ub(a,b){var c=-1,d=this.controller;a=d.Ha[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535} -function Vb(a,b,c){var d=!1,e=this.controller;a=e.Ha[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function L(a){q.call(this,"Device",a,256);this.a={Aa:128,vc:-1}}n(L,q);h=L.prototype;h.ea=function(a,b,c,d){this.v=b;this.A=a;this.c=c;this.F=d;var e=this;this.a.vc=lc(c,function(){e.a.Aa|=128;e.a.Aa&64&&nc(e.c,e.a.Ja);e.A&&Ib(e.A,1);oc(e.c,e.a.vc,1E3/60)});this.a.Ja=pc(c,64,6,524288);ob(b,this,qc);qb(b,this.reset.bind(this));B(this)}; -h.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){this.a.Aa=128;oc(this.c,this.a.vc,1E3/60,!0)};h.save=function(){var a=new G(this);a.set(0,[this.a.Aa]);return a.data()};h.restore=function(a){a=ja(a[0]);this.a.Aa=a.next().value;return!0};h.ue=function(){return this.a.Aa};h.If=function(a){this.a.Aa=a&192;this.a.Aa&64||(a=this.a.Ja)&&rc(this.c,a)};h.we=function(){return sc(this.c)}; -h.Kf=function(a){tc(this.c,a&-129|this.c.K&128)};h.xe=function(){return uc(this.c)};h.ye=function(){return vc(this.c)};h.ze=function(){return this.c.qa};h.Lf=function(a){wc(this.c,a)};h.gf=function(a){a=a>>1&63;var b=this.c.Ga[a>>1];return a&1?b>>16:b&65535};h.sg=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ga[c]=b&1?this.c.Ga[c]&65535|(a&63)<<16:this.c.Ga[c]&-65536|a&65534};h.$e=function(a){return this.c.s[1][a>>1&7]};h.lg=function(a,b){this.c.s[1][b>>1&7]=a&65295}; -h.Ye=function(a){return this.c.s[1][(a>>1&7)+8]};h.jg=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.Ze=function(a){return this.c.H[1][a>>1&7]};h.kg=function(a,b){b=b>>1&7;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.Xe=function(a){return this.c.H[1][(a>>1&7)+8]};h.ig=function(a,b){b=(b>>1&7)+8;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.te=function(a){return this.c.s[0][a>>1&7]};h.Hf=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.re=function(a){return this.c.s[0][(a>>1&7)+8]}; -h.Ff=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.se=function(a){return this.c.H[0][a>>1&7]};h.Gf=function(a,b){b=b>>1&7;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.qe=function(a){return this.c.H[0][(a>>1&7)+8]};h.Ef=function(a,b){b=(b>>1&7)+8;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.ff=function(a){return this.c.s[3][a>>1&7]};h.rg=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.df=function(a){return this.c.s[3][(a>>1&7)+8]};h.pg=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295}; -h.ef=function(a){return this.c.H[3][a>>1&7]};h.qg=function(a,b){b=b>>1&7;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.cf=function(a){return this.c.H[3][(a>>1&7)+8]};h.og=function(a,b){b=(b>>1&7)+8;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.ib=function(a){a&=7;return this.c.i&2048?this.c.ra[a]:this.c.b[a]};h.lb=function(a,b){b&=7;this.c.i&2048?this.c.ra[b]=a:this.c.b[b]=a};h.Ee=function(){return this.c.i&49152?this.c.ja[0]:this.c.b[6]};h.Qf=function(a){this.c.i&49152?this.c.ja[0]=a:this.c.b[6]=a}; -h.He=function(){return this.c.b[7]};h.Tf=function(a){this.c.b[7]=a};h.jb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.ra[a]};h.mb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.ra[b]=a};h.Fe=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[1]};h.Rf=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[1]=a};h.Ge=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.ja[3]};h.Sf=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ja[3]=a}; -h.pe=function(a){return this.c.zb[a-65504>>1]};h.Df=function(a,b){this.c.zb[b-65504>>1]=a};h.bd=function(a){return 65520==a?(gc(this.v)>>6)-1:0};h.ed=function(){};h.bf=function(){return 1};h.ng=function(){};h.oe=function(){return this.c.G};h.Cf=function(){this.c.G=0};h.ve=function(){return this.c.wb};h.Jf=function(a,b){b&1||(a&=255);this.c.wb=a};h.Ae=function(a,b){return b?0:this.c.Ra};h.Mf=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Ra=a}; -h.af=function(a,b){return b?0:this.c.Fa&65280};h.mg=function(a){this.c.Fa=a|255};h.De=function(){return xc(this.c)};h.Pf=function(a){yc(this.c,a)};h.dd=function(){}; -var M={},qc=(M[61568]=[null,null,L.prototype.gf,L.prototype.sg,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.$e,L.prototype.lg,"SIPDR",8,1145,64],M[62608]=[null,null,L.prototype.Ye,L.prototype.jg,"SDPDR",8,1145,64],M[62624]=[null,null,L.prototype.Ze,L.prototype.kg,"SIPAR",8,1145,64],M[62640]=[null,null,L.prototype.Xe,L.prototype.ig,"SDPAR",8,1145,64],M[62656]=[null,null,L.prototype.te,L.prototype.Hf,"KIPDR",8,1140,64],M[62672]=[null,null,L.prototype.re,L.prototype.Ff,"KDPDR",8,1145,64],M[62688]= -[null,null,L.prototype.se,L.prototype.Gf,"KIPAR",8,1140,64],M[62704]=[null,null,L.prototype.qe,L.prototype.Ef,"KDPAR",8,1145,64],M[62798]=[null,null,L.prototype.ze,L.prototype.Lf,"MMR3",1,1145,64],M[65382]=[null,null,L.prototype.ue,L.prototype.If,"LKS"],M[65402]=[null,null,L.prototype.we,L.prototype.Kf,"MMR0",1,1140,64],M[65404]=[null,null,L.prototype.xe,L.prototype.dd,"MMR1",1,1145,64],M[65406]=[null,null,L.prototype.ye,L.prototype.dd,"MMR2",1,1140,64],M[65408]=[null,null,L.prototype.ff,L.prototype.rg, -"UIPDR",8,1140,64],M[65424]=[null,null,L.prototype.df,L.prototype.pg,"UDPDR",8,1145,64],M[65440]=[null,null,L.prototype.ef,L.prototype.qg,"UIPAR",8,1140,64],M[65456]=[null,null,L.prototype.cf,L.prototype.og,"UDPAR",8,1145,64],M[65472]=[null,null,L.prototype.ib,L.prototype.lb,"R0SET0"],M[65473]=[null,null,L.prototype.ib,L.prototype.lb,"R1SET0"],M[65474]=[null,null,L.prototype.ib,L.prototype.lb,"R2SET0"],M[65475]=[null,null,L.prototype.ib,L.prototype.lb,"R3SET0"],M[65476]=[null,null,L.prototype.ib, -L.prototype.lb,"R4SET0"],M[65477]=[null,null,L.prototype.ib,L.prototype.lb,"R5SET0"],M[65478]=[null,null,L.prototype.Ee,L.prototype.Qf,"R6KERNEL"],M[65479]=[null,null,L.prototype.He,L.prototype.Tf,"R7KERNEL"],M[65480]=[null,null,L.prototype.jb,L.prototype.mb,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.jb,L.prototype.mb,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.jb,L.prototype.mb,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.jb,L.prototype.mb,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.jb, -L.prototype.mb,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.jb,L.prototype.mb,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Fe,L.prototype.Rf,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Ge,L.prototype.Sf,"R6USER",1,1145],M[65504]=[null,null,L.prototype.pe,L.prototype.Df,"CTRL",8,1170],M[65520]=[null,null,L.prototype.bd,L.prototype.ed,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.bd,L.prototype.ed,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.bf,L.prototype.ng,"SYSID",1,1170],M[65526]= -[null,null,L.prototype.oe,L.prototype.Cf,"ERR",1,1170],M[65528]=[null,null,L.prototype.ve,L.prototype.Jf,"MBR",1,1170],M[65530]=[null,null,L.prototype.Ae,L.prototype.Mf,"PIR"],M[65532]=[null,null,L.prototype.af,L.prototype.mg,"SLR"],M[65534]=[null,null,L.prototype.De,L.prototype.Pf,"PSW"],M); -Xa(function(){for(var a=A(document,z,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),Dc(this,Ec?Fc:Gc);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.me=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.mf=function(a,b){gb&&a&1&&J(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; -h.Af=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.ya=!0};h.ke=function(a,b){return this.i(a,b)};h.jf=function(a,b){return this.F(a,b)};h.yf=function(a,b,c){this.A?this.Db(0,0,c):this.l(a,b,c)};h.ug=function(a,b,c){this.A?this.Db(0,0,c):this.m(a,b,c)};h.je=function(a){return this.a[a]}; -h.le=function(a){return this.a[a]};h.hf=function(a,b){gb&&a&1&&J(this.b,b,64);return this.v.getUint16(a,!0)};h.lf=function(a,b){gb&&a&1&&J(this.b,b,64);return!hb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.xf=function(a,b){this.a[a]=b;this.ya=!0};h.zf=function(a,b){this.a[a]=b;this.ya=!0};h.tg=function(a,b,c){gb&&a&1&&J(this.b,c,64);this.v.setUint16(a,b,!0);this.ya=!0};h.vg=function(a,b,c){gb&&a&1&&J(this.b,c,64);!hb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.ya=!0}; -var Bc=0,hc=1,Cc=2,Yb=4,cc=["NONE","RAM","ROM","VID","H/W"],Ac=0,Jc=[],Ic=[I.prototype.me,I.prototype.Af,I.prototype.mf,I.prototype.wg],Mc=[I.prototype.ke,I.prototype.yf,I.prototype.jf,I.prototype.ug];if(eb)var Gc=[I.prototype.je,I.prototype.xf,I.prototype.hf,I.prototype.tg],Fc=[I.prototype.le,I.prototype.zf,I.prototype.lf,I.prototype.vg];var Nc;if(eb){var Oc=new ArrayBuffer(2);(new DataView(Oc)).setUint16(0,256,!0);Nc=256===(new Uint16Array(Oc))[0]}else Nc=!1;var Ec=Nc; -function Pc(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.xc=0;this.Xb=b;this.Qa=c;this.gc=Math.round(this.Xb/1E4)/100;this.Za=this.gc*this.Qa;this.hc=this.vb=this.bb=this.Yb=0;this.j.N=this.j.uc=!1;this.j.da=a.autoStart;"string"==typeof this.j.da&&(this.j.da="true"==this.j.da);this.j.Lb=!1;this.Vb=this.ab=0;this.Wb=+a.csStart;this.tb=+a.csInterval;this.ub=+a.csStop;this.Y=[];this.Oc=this.rf.bind(this);this.Ea=this.va=this.Da=this.a=this.aa=this.ua=this.sb=this.Ca=this.cb= -this.ic=this.Na=0;this.ma=null;B(this)}n(Pc,q);h=Pc.prototype;h.ea=function(a,b,c,d){this.A=a;this.v=b;this.F=d;this.ma=a.f;for(a=0;a=a.ab&&(a.ab+=a.tb,c=!0);0<=a.ub&&a.ub<=Uc(a)&&(a.tb=a.ub=-1,Tc(a),H(a),c=!0);c&&a.Z(Uc(a)+" cycles: checksum="+Da(a.Vb))}} -h.ha=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.l[b]=c,!0;case "run":return this.l[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.S)a=!0;else{var b=null,c,k=xa(a.id);for(c=0;ca.Na/a.Za&&(b=1);a.Qa=b;b=a.gc*a.Qa;if(a.Za!=b){a.Za=b;b=a.Za.toFixed(2)+"Mhz";var d=a.l.setSpeed;d&&(d.textContent=b);a.Z("target speed: "+b)}c&&a.A&&Yc(a.A)}Gb(a,a.va);a.va=0;a.ua=va();a.Ca=0;Wc(a)}function lc(a,b){var c=a.Y.length;a.Y.push([-1,b]);return c}function oc(a,b,c,d){0<=b&&ba.Y[b][0])&&(c=a.Xb*a.Qa/1E3*c|0,a.j.N&&(c+=Zc(a)),a.Y[b][0]=c)}function $c(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Zc(a,b){var c=a.Da-=a.a;a.a=a.aa=0;b&&(a.Da=0);return c} -h.rf=function(){if(this.j.N){this.Yb>=this.Xb&&Wc(this,!0);this.cb=0;this.sb=va();if(this.Ca){var a=this.sb-this.Ca;a>this.hc&&(this.ua+=a,this.ua>this.sb&&(this.ua=this.sb))}try{do{for(var b,c=this.j.Lb?1:this.vb,d=this.Y.length-1;0<=d;d--){var e=this.Y[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.bc(b)}catch(f){if("number"!=typeof f)throw f;}b=Zc(this,!0);this.cb+=b;this.va+=b;Hb(this,b);Fb(this,b);this.bb-=b;if(0>=this.bb){this.bb+=this.vb;++this.ic>=ad&&(this.A&&Ib(this.A,void 0),this.ic=0);break}}while(this.j.N)}catch(f){H(this); -this.A&&this.A.stop(va(),Uc(this));a=f.stack||f.message;this.j.error=!0;this.B(a);return}if(this.j.N){a=setTimeout;b=this.Oc;this.Ca=va();c=this.hc;this.cb&&(c=Math.round(c*this.cb/this.vb));c-=this.Ca-this.sb;if(d=this.Ca-this.ua)this.Na=Math.round(this.va/(10*d))/100,864E5<=d&&(this.Ea=0,Vc(this));if(0>c||this.Nac&&(this.ua-=c),c=0;this.Yb+=this.cb;this.Ca+=c;a(b,c)}}}; -function Eb(a){var b;a.j.error?(a.Z(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.N)a.Z(a.toString()+" busy");else{Vc(a);a.j.N=!0;a.j.uc=!0;if(b=a.l.run)b.textContent="Halt";a.A&&a.A.start(a.ua,Uc(a));a.F||a.status("Started");setTimeout(a.Oc,0)}}h.bc=function(){return 0};function H(a){var b=!1;if(a.j.N){Zc(a);Gb(a,a.va);a.va=0;a.j.N=!1;if(b=a.l.run)b.textContent="Run";a.A&&a.A.stop(va(),Uc(a));b=!0;a.F||a.status("Stopped")}a.j.complete=void 0;return b}var Xc=30,ad=15,Qc=["power","reset"]; -function bd(a){var b=+a.model||1170;Pc.call(this,a,6666667);this.pa=b;this.Ic=+a.addrReset||0;this.wa=this.i=this.C=this.u=this.m=this.o=this.w=0;this.b=this.ra=this.ja=[];this.H=this.s=this.Ga=this.zb=[];this.Ba=this.D=this.Hc=this.$a=this.Oa=this.Pa=this.Wa=this.G=this.wb=this.Ra=this.Fa=this.K=this.xb=this.yb=this.qa=this.g=0;this.Jd=[4,2,0,1];this.Zb=0;this.Nc=255;1120>=this.pa?(this.Gc=cd.bind(this),this.Ya=this.Ud,this.Zb=8,this.Nc=-1,this.Sc=255,this.Pc=0):(this.Gc=dd.bind(this),this.Ya=this.Vd, -this.Sc=~(1792|(1140>=this.pa?2048:0))&65535,this.Pc=1140e.Cb&&(e.Cb=c,c+=4)}return Pc.prototype.ga.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.pa);this.j.N&&H(this);this.u=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.Ic,-1,-2,-3,-4,-5,-6,-7,-8];this.ra=[0,0,0,0,0,0];this.ja=[0,0,0,0];this.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,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,65535,65535, -65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ga=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.zb=[0,0,0,0,0,0,0,0];this.C=0;this.wa=-1;this.h=this.f=this.Ub=this.L=this.T=this.g=this.wb=0;Cb(this);Sc(this);this.j.error=!1;Pc.prototype.reset.call(this)};function Cb(a){a.K=0;a.xb=0;a.yb=0;a.qa=0;a.G=0;a.Ra=0;a.Fa=255;a.$a=0;a.Oa=0;a.Pa=0;a.Wa=262143;a.Ba=a.b[7];a.D=0;a.I=null;a.v&&(ed(a),a.Hc=gc(a.v))} -function ed(a){a.Pb=a.yc;a.Qb=a.$b;a.ac=a.cc;a.Rb=a.ec;a.$a?(a.ta=65536,a.Ob=a.qa&16?4186112:253952,a.oa=a.$c,a.W=a.cd,a.nb=a.fd,Zb(a.v,a.qa&16?22:18)):(a.ta=0,a.Ob=57344,a.oa=a.Yd,a.W=a.kf,a.nb=a.xg,Zb(a.v,16))}function sc(a){var b=a.K;b&57344||(b=b&-3199|a.Oa<<5|a.Pa<<1);return b}function tc(a,b){b&=-3073;if(a.K!=b){b&57344&&!(a.K&57344)&&(a.xb=a.D>>16&65535,a.yb=a.D&65535);a.K=b;a.Oa=(b&96)>>5;a.Pa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.$a!=c&&(a.$a=c,ed(a))}} -function uc(a){a.K&57344||(a.xb=a.D>>16&65535);a=a.xb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function vc(a){a.K&57344||(a.yb=a.D&65535);return a.yb}function wc(a,b){1170>a.pa&&(b&=-49);a.qa!=b&&(a.qa=b,a.Wa=b&16?4194303:262143,ed(a))}function fd(a,b,c){a.Ic=b;P(a,b);yc(a,0);a.v.reset();Cb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.N||Eb(a)}else a.F&&a.j.S?H(a)||(a.F.g(),Ib(a.A,-1)):!1===c&&H(a);!a.j.N&&a.ma&&a.ma.stop()}h.Zc=function(){return 0}; -h.save=function(){var a=new G(this);a.set(0,[this.b,this.ra,this.ja,this.H,this.s,this.Ga,this.zb,this.G,this.wb,this.Ra,this.Fa,this.Oa,this.Pa,this.Ba,this.g,this.D,this.wa,this.lc,this.mc]);a.set(1,[xc(this),sc(this),uc(this),vc(this),this.qa]);a.set(2,[this.Ea,this.Qa,this.j.da]);a.set(3,gd(this));a.set(4,$c(this));return a.data()}; -h.restore=function(a){var b=ja(a[0]);this.b=b.next().value;this.ra=b.next().value;this.ja=b.next().value;this.H=b.next().value;this.s=b.next().value;this.Ga=b.next().value;this.zb=b.next().value;this.G=b.next().value;this.wb=b.next().value;this.Ra=b.next().value;this.Fa=b.next().value;this.Oa=b.next().value;this.Pa=b.next().value;this.Ba=b.next().value;this.g=b.next().value;this.D=b.next().value;this.wa=b.next().value;this.lc=b.next().value;this.mc=b.next().value;b=a[1];yc(this,b[0]);tc(this,b[1]); -this.xb=b[2];this.yb=b[3];wc(this,b[4]);b=a[2];this.Ea=b[0];Vc(this,b[1]);this.j.da=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function P(a,b){a.b[7]=b&65535}function pc(a,b,c,d){b={Cb:b,gb:c,message:d||0,name:ib[b],next:null};a.rb.push(b);return b}function rc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.g|=1)}function nc(a,b){if(b){if(b!=a.I){var c=a.I;if(!c||c.gb<=b.gb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.gb<=b.gb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}} -function gd(a){var b=[];for(a=a.I;a;)b.push(a.Cb),a=a.next;return b}function kd(a){return a.g&64?(K(a,168,64,-6),!0):a.g&32?(K(a,4,32,-5),!0):a.g&16?(K(a,12,16,-7),!0):!1}function xc(a){return a.i=a.i&63728|id(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|hd(a)}function yc(a,b){b&=a.Sc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.u=b<<16;if((b^a.i)&a.Pc)for(var c=a.ra.length;0<=--c;){var d=a.b[c];a.b[c]=a.ra[c];a.ra[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.ja[c]=a.b[6],a.b[6]=a.ja[a.C]);a.i=b;a.g&=-3;a.g|=a.I?2:1} -h.ia=function(a){this.w=this.o=a;this.m=0};h.Ka=function(a,b){this.w=this.o=this.u=a;this.m=b||0};function ld(a,b){a.w=a.o=a.u=b;a.m=a.w^a.u>>1}function md(a,b,c,d){a.w=a.o=a.u=b;a.m=(c^d)&(d^b)} -function K(a,b,c,d){if(!a.fb){0>a.wa?a.wa=xc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.D=b|4143316992;a.C=0;var e=a.W(b|a.ta),f=a.W(b+2&65535|a.ta);yc(a,f&-12289|a.wa>>2&12288);nd(a,a.wa);nd(a,a.b[7]);P(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.lc=d;a.mc=b;-1==d&&H(a);if(-4<=d)throw b;}}function od(a){var b=pd(a),c=pd(a);a.i&49152&&(c=c&-225|a.i&63712);P(a,b);yc(a,c);a.g&=-17} -function qd(a,b){var c=b>>13&31;31>c&&(b=a.qa&32?a.Ga[c]+(b&8191)&4194303:b&-3932161);return b} -function Lb(a,b,c){var d,e,f;if(!(c&a.$a))return f=b&65535,57344<=f&&(f|=a.Ob),f;d=b>>13;a.qa&a.Jd[a.C]||(d&=7);e=a.s[a.C][d];f=(a.H[a.C][d]<<6)+(b&8191)&a.Wa;3932160<=f&&(f=qd(a,f));if(a.fb)return f;f>=a.Hc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.s[a.C][d]=e;if(f!=(4194170&a.Wa)||a.C)a.Oa=a.C,a.Pa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.K&57344||(g|=a.K&4096|a.Oa<<5|a.Pa<<1,tc(a,a.K&-61695|g&61694)),K(a,168,64,-2)),a.K&61440||!(f<(4191360&a.Wa)||f>(4194239&a.Wa))||(a.K|=4096,a.K&512&&(a.g|=64)));return f}function pd(a){var b=a.W(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function nd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.D=a.D&65535|(a.D&-65536)<<8|16121856;a.g&256||a.Ya(4,-2,c);a.nb(c,b)} -function rd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return K(a,4,0,-3),0;case 1:return 6==c&&a.Ya(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Ya(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Ya(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.W(e)|g;a.a-=8;break;case 6:return e=a.W(jd(a,2)),e=e+a.b[c]&65535,6==c&&a.Ya(d,0, -e),a.a-=6,e|g;case 7:return e=a.W(jd(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.ta),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.D=a.D&65535|(a.D&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ud=function(a,b,c){!this.C&&0>=b&&c<=this.Fa&&(this.g|=32)};h.Vd=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Fa&&(c<=this.Fa-32?K(this,4,0,-4):(this.G|=8,this.g|=32)))};h.Xd=function(a){return this.yc(a)};h.Zd=function(a){return this.$b(a)};h.uf=function(a,b){this.cc(a,b)};h.wf=function(a,b){this.ec(a,b)}; -h.Yd=function(a,b,c){return rd(this,a,b,c)};h.$c=function(a,b,c){return Lb(this,rd(this,a,b,c),c)};h.kf=function(a){return this.v.Eb(this.Ba=a)};h.cd=function(a){return this.v.Eb(this.Ba=Lb(this,a,2))};h.xg=function(a,b){this.v.Fb(this.Ba=a,b)};h.fd=function(a,b){this.v.Fb(this.Ba=Lb(this,a,4),b)}; -function sd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=rd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.W(d|c&a.ta),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.ja[a.i>>12&3];return c}function td(a,b,c,d){a.D=a.D&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=rd(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=Lb(a,e|c&65536,4),a.C=a.i>>14&3,a.Rb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.ja[a.i>>12&3]=d} -function ud(a,b){b>>=6;var c=a.T=b&7;return(b=a.L=(b&56)>>3)?a.Pb(a.oa(b,c,3)):a.b[c+a.Zb]&a.Nc}function vd(a,b){var c;b>>=6;var d=a.T=b&7;(b=a.L=(b&56)>>3)?c=a.Qb(a.oa(b,d,2)):c=a.b[d+a.Zb];return c}function wd(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return rd(a,b,c,8)}function xd(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Pb(a.oa(b,c,3)):a.b[c]&255}function yd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Qb(a.oa(b,d,2)):c=a.b[d];return c} -function R(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Ub=a.oa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.ac(e,d.call(a,c,a.Pb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function S(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,6),a.Rb(e,d.call(a,0>c?a.b[-c-1]:c,a.Qb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} -function zd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.oa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.ac(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function Ad(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Rb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} -h.bc=function(a){this.j.complete=!0;var b=a?this.j.uc?0:1:-1;this.j.uc=!1;this.Da=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Ra&224)>>5,e=this.I&&this.I.gb>d?this.I:null;e&&(c=e.Cb,d=e.gb);d>(this.i&224)>>5?(this.g&8&&(jd(this,2),this.g&=-9),K(this,c,0,-10),d=!0):d=!1;d&&(e&&rc(this,e),a=!0);this.I||this.Ra||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.F.b(this.b[7],b)){H(this);break}if(0>b)break}if(this.g&112&&kd(this)){if(this.g& -4&&this.F.b(this.b[7],b)){H(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.D=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.Gc(e)}while(0>1|b<<16;ld(this,a);return a&65535}function Gd(a,b){a=b&128|b>>1|b<<8;ld(this,a<<8);return a&255}function Hd(a,b){a=b&~a;this.ia(a);return a}function Id(a,b){a=b&~a;this.ia(a<<8);return a}function Jd(a,b){a|=b;this.ia(a);return a}function Kd(a,b){a|=b;this.ia(a<<8);return a} -function Ld(a,b){a=~b|65536;this.Ka(a);return a&65535}function Md(a,b){a=~b|256;this.Ka(a<<8);return a&255}function Nd(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function Od(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function Pd(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function Qd(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function Rd(a,b){a=-b;this.Ka(a,a&b&32768);return a&65535} -function Sd(a,b){a=-b;this.Ka(a<<8,(a&b&128)<<8);return a&255}function Td(a,b){a=b<<1|this.u>>16&1;ld(this,a);return a&65535}function Ud(a,b){a=b<<1|this.u>>16&1;ld(this,a<<8);return a&255}function Vd(a,b){a=(this.u&65536|b)>>1|b<<16;ld(this,a);return a&65535}function Wd(a,b){a=((this.u&65536)>>8|b)>>1|b<<8;ld(this,a<<8);return a&255}function Xd(a,b){var c=b-a;md(this,c,a,b);return c&65535}function Yd(a,b){var c=b-a;md(this,c<<8,a<<8,b<<8);return c&255} -function Zd(a,b){this.w=this.o=b&65280;this.m=this.u=0;return(b<<8|b>>8)&65535}function $d(a,b){a^=b;this.ia(a);return a&65535}function ae(a){S(this,a,vd(this,a),Bd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} -function be(a){var b=yd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.u=this.m=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} -function ce(a){var b=yd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&=63;if(b&32){b=64-b;32>b-1;this.u=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.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function de(a){Q(this,a,!hd(this))}function ee(a){Q(this,a,hd(this))} -function fe(a){S(this,a,vd(this,a),Hd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ge(a){R(this,a,ud(this,a),Id);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function he(a){S(this,a,vd(this,a),Jd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function ie(a){R(this,a,ud(this,a),Kd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)} -function je(a){var b=vd(this,a);a=yd(this,a);this.ia((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function ke(a){var b=ud(this,a);a=xd(this,a);this.ia(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function le(a){Q(this,a,this.o&65535?0:4)}function me(a){Q(this,a,!id(this)==!(this.m&32768))}function ne(a){Q(this,a,!!(this.o&65535)&&!id(this)==!(this.m&32768))} -function oe(a){Q(this,a,!hd(this)&&!!(this.o&65535))}function pe(a){Q(this,a,(this.o&65535?0:4)||!id(this)!=!(this.m&32768))}function qe(a){Q(this,a,hd(this)||(this.o&65535?0:4))}function re(a){Q(this,a,!id(this)!=!(this.m&32768))}function se(a){Q(this,a,id(this))}function te(a){Q(this,a,!!(this.o&65535))}function ue(a){Q(this,a,!id(this))}function ve(){K(this,12,0,-9)}function we(a){Q(this,a,!0)}function xe(a){Q(this,a,!(this.m&32768))}function ye(a){Q(this,a,this.m&32768?2:0)} -function T(a){a&1&&(this.u=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function ze(a){var b=vd(this,a);a=yd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;md(this,c,a,b);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)}function Ae(a){var b=ud(this,a);a=xd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);md(this,c,a,b);this.a-=this.h?4+(this.T&&6<=this.f?1:0):(this.L?4:3)+(7==this.f?2:0)} -function Be(a){var b=yd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.u=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.u=65536,this.a-=7}function Ce(){K(this,24,0,-9);this.a-=20} -function De(){this.i&49152?(this.G|=128,K(this,4,0,-8)):(this.ma&&1120==this.pa&&this.ma.setData(this.b[0],!0),this.F?this.F.i():H(this));this.a-=7}function Ee(){K(this,16,0,-9);this.a-=20}var Fe=[0,7,7,10,7,11,9,13];function Ge(a){this.aa=this.a;P(this,wd(this,a));this.a=this.aa-Fe[this.h]}var He=[0,14,14,17,14,18,16,20];function Ie(a){this.aa=this.a;var b=wd(this,a);a=a>>6&7;nd(this,this.b[a]);this.b[a]=this.b[7];P(this,b);this.a=this.aa-He[this.h]} -var Je=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ke(a){var b=vd(this,a);this.aa=this.a;Ad(this,a,b,this.ia);this.a=this.aa-Je[(this.L?8:0)+this.h]+(7!=this.f||this.h?0:2)}function Le(a){var b=ud(this,a);zd(this,a,b,65535,this.ia);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}var Me=[7,13,13,17,14,18,17,21]; -function Ne(a){var b=yd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.m=0;this.u=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)P(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Te(a){S(this,a,vd(this,a),Xd);this.a-=this.h?9+(this.T&&6<=this.f?1:0):(this.L?5:3)+(7==this.f?2:0)}function Ue(a){S(this,a,0,Zd);this.a-=this.h?9:3+(7==this.f?2:0)}function Ve(){K(this,28,0,-9)} -function We(){this.ma&&(this.ma.U=this.b[7],this.ma.setData(this.b[0],!0));this.g|=8;jd(this,-2);this.a-=3}function Xe(a){S(this,a,this.b[(a>>6&7)+this.Zb],$d);this.a-=this.h?9:3+(7==this.f?2:0)}function V(){K(this,8,0,-9)}function cd(a){Ye[a>>12].call(this,a)}function Ze(a){$e[a>>6&3].call(this,a)}function af(a){bf[a>>6&3].call(this,a)}function cf(a){df[a>>6&3].call(this,a)}function ef(a){ff[a&15].call(this,a)}function gf(a){hf[a&15].call(this,a)}function jf(a){kf[a>>6&3].call(this,a)} -function lf(a){mf[a>>6&3].call(this,a)}function nf(a){of[a>>6&3].call(this,a)} -var Ye=[function(a){pf[a>>8&15].call(this,a)},Ke,ze,je,fe,he,ae,V,function(a){qf[a>>8&15].call(this,a)},Le,Ae,ke,ge,ie,Te,V],pf=[function(a){rf[a>>4&15].call(this,a)},we,te,le,me,re,ne,pe,Ie,Ie,Ze,af,cf,V,V,V],$e=[function(a){Ad(this,a,0,this.Ka);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ld);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Pd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Nd);this.a-=this.h?9:3+(7==this.f?2:0)}],bf=[function(a){S(this,a,0,Rd); -this.a-=this.h?11:6},function(a){S(this,a,hd(this)?1:0,Bd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,hd(this)?1:0,Xd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=yd(this,a);this.Ka(a);this.a-=this.h?4:3+(7==this.f?2:0)}],df=[function(a){S(this,a,0,Vd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Fd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Dd);this.a-=this.h?9:3+(7==this.f?2:0)}],rf= -[function(a){sf[a&15].call(this,a)},V,V,V,Ge,Ge,Ge,Ge,Qe,V,ef,gf,Ue,Ue,Ue,Ue],sf=[De,We,Re,ve,Ee,Pe,V,V,V,V,V,V,V,V,V,V],ff=[Oe,function(){this.u=0;this.a-=5},function(){this.m=0;this.a-=5},T,function(){this.o=1;this.a-=5},T,T,T,function(){this.w=0;this.a-=5},T,T,T,T,T,T,T],hf=[Oe,function(){this.u=65536;this.a-=5},function(){this.m=32768;this.a-=5},U,function(){this.o=0;this.a-=5},U,U,U,function(){this.w=32768;this.a-=5},U,U,U,U,U,U,U],qf=[ue,se,oe,qe,xe,ye,de,ee,Ce,Ve,jf,lf,nf,V,V,V],kf=[function(a){zd(this, -a,0,255,this.Ka);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Md);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Qd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Od);this.a-=this.h?9:3+(7==this.f?2:0)}],mf=[function(a){R(this,a,0,Sd);this.a-=this.h?11:6},function(a){R(this,a,hd(this)?1:0,Cd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,hd(this)?1:0,Yd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=xd(this,a);this.Ka(a<<8);this.a-=this.h?4:3+ -(7==this.f?2:0)}],of=[function(a){R(this,a,0,Wd);this.a-=this.h?9+(this.Ub&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ud);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Gd);this.a-=this.h?9+(this.Ub&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)}];function dd(a){tf[a>>12].call(this,a)} -var tf=[function(a){uf[a>>8&15].call(this,a)},Ke,ze,je,fe,he,ae,function(a){vf[a>>8&15].call(this,a)},function(a){wf[a>>8&15].call(this,a)},Le,Ae,ke,ge,ie,Te,V],uf=[function(a){xf[a>>4&15].call(this,a)},we,te,le,me,re,ne,pe,Ie,Ie,Ze,af,cf,function(a){yf[a>>6&3].call(this,a)},V,V],yf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.ta);P(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=sd(this,a,0);this.ia(a);nd(this,a);this.a-=11},function(a){var b=pd(this);this.aa= -this.a;this.ia(b);td(this,a,0,b);this.a=this.aa-Me[this.h]},function(a){Ad(this,a,id(this)?65535:0,this.ia);this.a-=this.h?9:3+(7==this.f?2:0)}],xf=[function(a){zf[a&15].call(this,a)},V,V,V,Ge,Ge,Ge,Ge,Qe,function(a){!(a&8)||1145>this.pa?K(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},ef,gf,Ue,Ue,Ue,Ue],zf=[De,We,function(){od(this);this.g|=this.i&16;this.a-=13},ve,Ee,Pe,Re,function(){K(this,8,0,-9)},V,V,V,V,V,V,V,V],vf=[Ne,Ne,Be,Be,be,be,ce,ce,Xe,Xe,V, -V,V,V,Se,Se],wf=[ue,se,oe,qe,xe,ye,de,ee,Ce,Ve,jf,lf,nf,function(a){1145>this.pa?K(this,8,0,-9):Af[a>>6&3].call(this,a)},V,V],Af=[function(){K(this,8,0,-9)},function(a){a=sd(this,a,65536);this.ia(a);nd(this,a);this.a-=11},function(a){var b=pd(this);this.aa=this.a;this.ia(b);td(this,a,65536,b);this.a=this.aa-Me[this.h]},function(){K(this,8,0,-9)}]; -function Bf(a){q.call(this,"ROM",a,128);this.ka=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=D(this.g);if(this.g){a=this.g;var b=Ea(this.m);"json"!=b&&"hex"!=b&&(a=Na()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;E(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ta(c.Ma,a,b),(a=Ma(a,b))?(c.b=a.O,c.ka=a.ka):c.g=null);Cf(c)})}}n(Bf,q);h=Bf.prototype; -h.ea=function(a,b,c,d){this.v=b;this.c=c;this.F=d;Cf(this)};h.ga=function(){this.ka&&(this.F&&this.F.a(this.id,this.h,this.a,this.ka),delete this.ka);return!0};h.fa=function(){return!0}; -function Cf(a){if(!Aa(a)){if(a.g){if(!a.b||!a.v)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+Da(a.b.length,8,!0)+") does not match specified size ("+Da(a.a,8,!0)+")";a.j.error=!0;a.B(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Rb){var c={},c=(c[b]=[Bf.prototype.We,Bf.prototype.hg,null,null,null,a.a>>1],c);if(ob(a.v,a,c)){a.status("Added "+a.a+"-byte ROM at "+Ca(b));b=a.i=!0;break a}}else if(Xb(a.v,b,a.a,Cc)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),y=l,x=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(x)for(;x--;)fc(a.v,t++,b[y++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< -b.length;e++)fc(a.v,c+e,b[e]);k=!0}if(k){if(null==d||g)H(a.c),f=!1;null!=d&&fd(a.c,d,f)}return k}Xa(function(){for(var a=A(document,z,"ram"),b=0;b=sa.zc&&c<=sa.Pd&&(b=c-(sa.zc-sa.kd));b&&(a.preventDefault&&a.preventDefault(),d.Sb(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==sa.md&&(b=sa.ld);d.Sb(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); -a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Sb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;var e=this;this.H=pc(this.c,this.C?-1:48,4,262144);this.I=lc(this.c,function(){var a;a=-1;e.f.length&&(a=e.f.shift()&255,e.w&&97<=a&&122>a&&(a-=32),oc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&nc(c,e.H))});this.D=pc(this.c,this.C?-1:52,4,262144);this.Y=lc(this.c,function(){e.b|=128;e.b&64&&nc(c,e.D)});ob(b,this,If,this.C?64832+8*(this.C-1)-65392:0);qb(b,this.reset.bind(this));B(this)}; -h.ad=function(a){if(!this.g){var b=Rc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ja(c[0]);if(d!=this.La)return;c=Ja(c[1]);if(this.g=ya(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.u);if(this.s=e.receiveData){this.u=a;this.G=e.receiveStatus;this.status("Connected "+this.Ma+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ga=function(a,b){if(!b)if(this.ad(this.u),!a)this.reset();else if(!this.restore(a))return!1;return!0}; -h.fa=function(a){return a?this.save():!0};h.reset=function(){Jf(this)};h.save=function(){var a=new G(this);a.set(0,[this.o,this.a,this.b,this.f]);return a.data()};h.restore=function(a){return Jf(this,a[0])};function Jf(a,b){b||(b=[0,8192,128,a.f]);b=ja(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.f=b.next().value;return!0} -h.Sb=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.m%a,this.T&&(b=" ".slice(0,c)));this.L&&!this.m&&c&&(b=String.fromCharCode(this.L)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.m+=c}}else if(null!= -this.i){if(10==a||1024<=this.i.length)this.Z(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}oc(this.c,this.Y,1E3/Math.round(this.aa/10));this.b&=-129};var Hf="buffer",Kf={},If=(Kf[65392]=[null,null,W.prototype.Je,W.prototype.Vf,"RCSR"],Kf[65394]=[null,null,W.prototype.Ie,W.prototype.Uf,"RBUF"],Kf[65396]=[null,null,W.prototype.pf,W.prototype.zg,"XCSR"],Kf[65398]=[null,null,W.prototype.nf,W.prototype.yg,"XBUF"],Kf); -Xa(function(){for(var a=A(document,z,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.l[b]=c,!0;case "readTape":e=Of;case "loadTape":return e||(e=Pf),this.l[b]=c,c.onclick= -function(){var a=d.l.listTapes;a&&Qf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.D){c.parentNode.removeChild(c);break}this.l[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;Qf(d,D(b,!0),b,Pf,a)}return!1};return!0;case Rf:return this.l[b]=c,!0}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;this.u=Sf(a);var e=this;if(a=Lf(this,Rc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.s=pc(this.c,56,4,4096);this.H=lc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.mc.indexOf("/api/v1/dump")&&(e=Ea(c),f="json"==e||"gz"==e?encodeURI(c):Na()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!E(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.S;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ta(a.Ma,e,f),(e=Ma(e,f))&&cg(a,b,c,d,e.O,e.ca,e.ba)); -a.j.Ta=!1;a.b&&(a.b--,a.b||B(a));$f(a)})}function Vf(a,b,c,d){if((a=a.l.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ea(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Fa(c,"/")&&(d="dir"),f=Na()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Mb?"":e)+"&format=json"));return!!E(f, -null,!0,function(b,c,d){kg(a,b,c,d)})} -function kg(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.S;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.na+'" (error '+d+": "+b+")",f);else{ta(a.controller.Ma,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)u(k[0]);else{a.J=k.length;a.R=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.V=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var y=l.bytes;if(void 0!==y&&y.length){for(var x=m<<2,ca=y.length;ca>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.la?f=a.sa+a.la&&(a.la+=f-(a.sa+a.la)+1):(a.sa=f,a.la=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.B("Unable to restore disk '"+this.na+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=mg(this,a++);)pg(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function pg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var gg=0;function qg(a,b,c,d,e,f){q.call(this,a,b,c);this.w=rg(this,b.autoMount);this.o=0;this.G=d;this.H=e;this.I=f;this.D=d.rd;this.f=Array(this.D);this.C=!Sa("Mobi")&&window&&"FileReader"in window;this.h=[];this.Ja=null}n(qg,q); -function rg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){u(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=qg.prototype; -h.ha=function(a,b,c){var d=this;switch(b){case "listDisks":return this.l[b]=c,c.onchange=function(){var a=d.l.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){u(d.type+" option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=C(c.value);null!=a&&sg(d, -a)},!0;case "loadDisk":return this.l[b]=c,c.onclick=function(){var a=d.l.listDisks;a&&a.options&&tg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.l[b]=c,c.onclick=function(){var a,b=d.l.listDrives,b=b&&C(b.value);null==b||0>b||b>=d.f.length||!(a=d.f[b])?d.B("Unable to boot the selected drive"):a.P?(fd(d.c,0,!0),(a=d.fc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.C){c.parentNode.removeChild(c); -break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.f&&((a=d.f[C(a.value)||0])?(a=a.P)?(a=Va(og(a),a.Tb.replace(".json",".img")),u(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.C)return this.l[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;tg(d,D(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;if(a=rg(this,Rc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);this.qb();this.Ja=pc(this.c,this.G.Md,this.G.vd,this.Jc);ob(b,this,this.I);qb(b,this.reset.bind(this));ug(this,"None",vg,!0);this.C&&ug(this,"Local Disk",wg);ug(this,"Remote Disk",xg);yg(this)||B(this)}; -h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){this.h=[];for(a=0;ag||9e||e>=a.f.length)a.B("Unable to load the selected drive");else if(c)if(c==wg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==xg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=D(c);a.status("Attempting to load "+c+' as "'+b+'"')}Cg(a,e,b,c,!1,d)}else zg(a,e)} -function Cg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,zg(a,b,!0),k.Va?a.B(a.type+" busy"):(k.Va=!0,e&&(k.Ua=!0,a.o++),k.za=!!f,jg(new fg(a,k,"preload"),c,d,f,a.sd)&&g++));return g} -h.sd=function(a,b,c,d,e){a.Va=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.Ia)),b=null);if(b){a.P=b;a.na=c;a.X=d;a:{var f;for(f=0;f=a.J){m=Y.Hb;break}p=a.seek(b,c,d+1);if(!p){m=Y.Tc;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}var y,x;if(0>(y=a.read(p,t++))||0>(x=a.read(p,t++))){m=Y.Ib;break}if(!k&&(Kb(this.v,qd(this.c,f),y|x<<8),kc(this.v))){m=Y.Lc;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Cc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.P;var p=null,t;a||(m=Y.Kc,e=0);for(;e;){var y=Mb(this.v,qd(this.c,f));if(kc(this.v)){m=Y.Lc;break}if(!p){if(b>=a.J){m=Y.Hb;break}p=a.seek(b,c,d+1,!0);if(!p){m=Y.Tc;break}t=0;++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b))}if(k){var x,ca;if(0>(x=a.read(p,t++))||0>(ca=a.read(p,t++))){m=Y.Ib;break}if(y!=(x|ca<<8)){m=Y.Nd;break}}else if(!a.write(p,t++,y&255)||!a.write(p,t++,y>>8)){m=Y.Ib;break}t>=a.V&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.yd=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&~X.Xa|f>>16-X.xa.Xa&X.Xa;this.m=65536-e&65535;this.g=this.g&~Z.nc|d&Z.nc;this.b|=a;Fg(this);return!0};function Fg(a){a.a&=~X.Dc;a.b&&(a.b|=Y.pd,a.a|=X.Dc,a.b&Y.jc&&(a.a|=X.jc))}h.Oe=function(){return this.u};h.$f=function(){};h.Pe=function(){return this.b};h.ag=function(){};h.Le=function(){return this.a&X.Fd}; -h.Xf=function(a){this.a=this.a&~X.Wc|a&X.Wc;if(this.a&X.Ec){a=!0;var b,c,d=(this.g&Z.dc)>>Z.xa.dc,e=this.f[d],f,g,k,l,m,p;this.a&=~(X.pb|X.oc);this.b&=~Y.Hd;switch(c=this.a&X.Gb){case Gg.jd:this.b=this.g=0;this.a=X.pb;break;case Gg.wd:case Gg.xd:b=this.fc;case Gg.Vc:case Gg.Od:b||(b=this.Cc);f=(this.g&Z.ob)>>Z.xa.ob;g=(this.g&Z.kc)>>Z.xa.kc;k=this.g&Z.nc;l=65536-this.m&65535;m=(this.a&X.Xa)<<16-X.xa.Xa|this.i;p=this.a&X.td?0:2;if(f>=e.J){this.b|=Y.Hb;break}if(k>=e.M){this.b|=Y.Ib;break}a=b.call(this, -e,f,g,k,l,m,p,c>=Gg.Vc,this.yd.bind(this));break;case Gg.Id:f=(this.g&Z.ob)>>Z.xa.ob;f'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=C(c.value);null!=a&&Jg(d,a)}, -!0;case "loadDisk":return this.l[b]=c,c.onclick=function(){var a=d.l.listDisks;a&&a.options&&Kg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.l[b]=c,c.onclick=function(){var a,b=d.l.listDrives,b=b&&C(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.P?(fd(d.c,0,!0),(a=d.Qc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.u){c.parentNode.removeChild(c); -break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.b&&((a=d.b[C(a.value)||0])?(a=a.P)?(a=Va(og(a),a.Tb.replace(".json",".img")),u(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.u)return this.l[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;Kg(d,D(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ea=function(a,b,c,d){this.A=a;this.v=b;this.c=c;this.F=d;if(a=Ig(this,Rc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.s[e]=a[e]);Lg(this);this.Ja=pc(this.c,112,5,131072);ob(b,this,Mg);qb(b,this.reset.bind(this));Ng(this,"None",Og,!0);this.u&&Ng(this,"Local Disk",Pg);Ng(this,"Remote Disk",Qg);Rg(this)||B(this)}; -h.ga=function(a,b){if(!b){if(!a){if(this.reset(),this.A.m){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Jg(this,0)}}return!0};h.fa=function(a){return a?this.save():!0};h.reset=function(){Lg(this)};h.save=function(){return(new G(this)).data()}; -h.restore=function(a){return Lg(this,a[0])};function Rg(a,b){b||(a.o=0);for(var c in a.s){var d=a.s[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.l.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==Pg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Qg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=D(c);a.status("Attempting to load "+c+' as "'+b+'"')}Tg(a,e,b,c,!1,d)}else Sg(a,e)} -function Tg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.X.toLowerCase()!=d.toLowerCase()&&(g++,Sg(a,b,!0),k.Va?a.B("RL11 busy"):(k.Va=!0,e&&(k.Ua=!0,a.o++),k.za=!!f,jg(new fg(a,k,"preload"),c,d,f,a.Dd)&&g++));return g}h.Dd=function(a,b,c,d,e){a.Va=!1;b&&(b.J>a.J||b.R>a.R)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Ia)),b=null);b?(a.P=b,a.na=c,a.X=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Ia),a.Ua||e),this.A&&Yc(this.A)):a.za=!1;a.Ua&&(a.Ua=!1,--this.o||B(this));Jg(this,a.Ia)}; -function Ng(a,b,c,d){if((a=a.l.listDisks)&&a.options){for(var e=0;e(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}Kb(this.v,qd(this.c,f),p|t<<8);if(kc(this.v)){k=8192;break}f+=2;e--;if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Ed=function(a,b,c,d,e,f,g){var k=0;a=a.P;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Mb(this.v,qd(this.c,f));if(kc(this.v)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.V&&(l=null,++d>=a.M&&(d=0,++c>=a.R&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k}; -h.Cd=function(a,b,c,d,e,f){this.m=f&65535;this.a=this.a&-49|f>>12&48;this.h=f>>16&63;this.g=this.f=b<<7|(c?64:0)|d&63;this.i=65536-e&65535;a&&(this.a=this.a|a|32768);return!0};h.Te=function(){return this.a&65535}; -h.eg=function(a){this.a=this.a&-1023|a&1022;this.h=this.h&60|(a&48)>>4;if(!(this.a&128)){a=!0;var b,c=this.b[(this.a&768)>>8],d=c.P,e,f,g;this.a&=-2;switch(this.a&14){case 4:this.i&8&&(this.a&=63);this.i=c.status|this.g&64|(d&&512==d.J?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.g=this.f&4?this.g+b:this.g-b,this.f=this.g=this.g&65408|c);break;case 8:this.i=this.g;break;case 12:b=this.Qc;case 10:b||(b=this.Ed),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.J||g>=d.M? -this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Cd.bind(this)))}a&&(this.a|=129,this.a&64&&nc(this.c,this.Ja))}};h.Re=function(){return this.m};h.cg=function(a){this.m=a&65534};h.Ue=function(){return this.f};h.fg=function(a){this.f=a};h.Ve=function(){return this.i};h.gg=function(a){this.i=a};h.Se=function(){return this.h};h.dg=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4}; -var Og="",Pg="?",Qg="??",Ug={},Mg=(Ug[63744]=[null,null,N.prototype.Te,N.prototype.eg,"RLCS"],Ug[63746]=[null,null,N.prototype.Re,N.prototype.cg,"RLBA"],Ug[63748]=[null,null,N.prototype.Ue,N.prototype.fg,"RLDA"],Ug[63750]=[null,null,N.prototype.Ve,N.prototype.gg,"RLMP"],Ug[63752]=[null,null,N.prototype.Se,N.prototype.dg,"RLBE"],Ug); -function Vg(a,b,c){q.call(this,"Computer",a,33554432);this.j.S=!1;this.G=null;Wg(this,b);this.C=Rc(this,"autoPower",a,6);this.g=0;this.K=+a.busWidth||+a.buswidth;this.u=this.s=this.w=null;this.o=this.I=!1;this.i=this.h=null;this.H=this.m=this.D=!1;this.L=Rc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Xg(this);if(this.c=za("CPU",this.id)){this.F=za("Debugger",this.id);this.v=new Qb({id:this.Ma+".bus",busWidth:this.K},this.c,this.F);var d,e=xa(this.id);if((this.f=za("Panel",this.id))&&this.f.eb)for(b= -0;b\nLicense: GPL version 3 or later ");this.Z("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bYg){if(Zg(d,this.u)){this.h=new G(this,"1.32.2",hh);Zg(this.h)&&(ih(this,d),a=lh,mh(this.h));this.h.set(eh,La());nh(this.h);var e=this.a&&!this.o;if(a==fh||wa("Click OK to restore the previous "+fb+" machine state, or CANCEL to reset the machine.")){if(c=dh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Zg(d,g):("error"==f&&"no machine state"!= -g?(this.B("Error: "+g),"unable to verify user"==g&&(Ra(oh,""),this.b=null)):this.Z(f+": "+g),mh(d),Zg(d)?(c=dh(d),e=!0):c=!1))}e&&bh(this,c?d:null)}else a==lh&&d.clear()}else bh(this);delete this.u;delete this.i}e=xa(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.S=!0;var d=this.l.power;d&&(d.textContent="Shutdown");this.c&&(ph(this,this.c,b,c,a),Ib(this,-2),this.c.da());this.D&&(ih(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; -function ih(a,b){if(wa("There may be a problem with your "+fb+" machine.\n\nTo help us diagnose it, click OK to send this "+fb+" machine state to http://www.pcjs.org.")){var c=a.L;a=a.b||"";b=b.toString();var d={};d.app=fb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;E("http://www.pcjs.org/api/v1/report",d,!0)}} -function qh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new G(a,"1.32.2"),g=new G(a,"1.32.2",ch),k=La();g.set(eh,k);f.set(eh,k);f.set(rh,"1.32.2");f.set(sh,window?window.location.href:null);f.set(th,window?window.navigator.userAgent:"");a.c&&a.c.fa&&(c&&(b&&(a.c.j.da=a.c.j.N),H(a.c)),d=a.c.fa(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.S=!1,!1===d&&(e=null)));for(var k=xa(a.id),l=0;l=d||30<=(c.xc+=d))&&(e.textContent=c.j.N?c.Na.toFixed(2)+"Mhz":"Stopped",c.xc=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.j.N;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]:0b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.aa=g.load;d.Z=g.exec;if(e=g.bytes)d.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.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=g;d.ga=g.symbols;d.M.length?1==d.M.length&&(u(d.M[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.a["S"+a]=[0,0,!1,!1,this.De,a];this.F=this.c=this.u=this.A=null;B(this)}n(lb,q);h=lb.prototype; +h.reset=function(a){this.stop();a&&nb(this,this.g=0)}; +h.ka=function(a,b,c,d){if(this.A&&this.A.ka(a,b,c,d)||this.c&&this.c.ka(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.m[b]=c,this.l++,!0;default:return"led"==a||"rled"==a?(this.m[b]=c,this.h[b]=d?1:0,this.l++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.m[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ob(a, +b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){pb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ob(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){pb(a,b)}}(this,b),!0):q.prototype.ka.call(this,a,b,c,d)}};h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;qb(b,this,rb);sb(b,this.reset.bind(this));tb(this);ub(this)};h.ja=function(a,b){if(!b)if(this.D&&vb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0}; +h.ia=function(a){return a?this.save():!0};h.save=function(){var a=new E(this);a.set(0,[this.U,this.g,this.b]);return a.data()};h.restore=function(a){if(a=a[0])wb(this,this.U=a[0]),nb(this,this.g=a[1]),xb(this,a[2]);return!0};function yb(a,b,c){if(a=a.m[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function tb(a,b){for(var c in a.h)yb(a,c,null!=b?b:a.h[c])}function zb(a,b,c){if(a=a.m[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} +function ub(a){for(var b in a.a)zb(a,b,a.a[b][1])}function Ab(a,b,c,d){if(a.m[b]){var e=a.F&&a.F.h||8;c=c||0;c=8==e?Da(c,d):Ea(c,d);a.m[b].textContent!=c&&(a.m[b].textContent=c)}}function ob(a,b){var c=a.a[b];zb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=Bb&&(a.w=b==Cb,a.B=b==Db)}function pb(a,b){var c=a.a[b];c[2]&&c[3]&&(zb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Be=function(a){a||this.c.j.L||(a=this.c,a.u.reset(),Eb(a),this.a[Fb]&&this.a[Fb][1]&&Gb(this.c))};h.Ce=function(){}; +h.xe=function(a){a||F(this.c)};h.ve=function(a){if(!a&&!this.c.j.L)if(this.a[Fb]&&this.a[Fb][1])Gb(this.c);else{a=this.F;var b;if(b=a)a.j.Va&&(a.j.Ac=!0),b=!a.j.Va;if(b)Ba(a,!0),a.g(0,null),Ba(a,!1);else try{var c=this.c.kc(1);0=a.c.pa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.u.v;a.a[Bb]&&a.a[Bb][1]||(b=-b);wb(a,a.U&~c|a.U+b&c)}function wb(a,b){a.U=b&a.u.v;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Pb(a,"A"+c,b&1<c;c++)Pb(a,"D"+c,b&1<c;c++)a.a["S"+c][1]=b&1<>2;this.g=this.f-1;this.s=this.C/this.f|0;this.K=this.s-1;this.Ka=[];this.l=0;this.o=!1;this.D=[];this.le=[Ub,Vb,Wb,Xb];this.a=this.b=[];this.B=this.w=this.i=this.H=this.I=0;a=new G(this);Yb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.v;B(this)}n(Sb,q);function ac(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Sb.prototype;h.reset=function(){for(var a=0;a>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ua)return l.Hb+=l.Ua-f,l.Ua=f,!0;if(f>=l.Ua+l.Hb){p=l.size-(f-m);p>g&&(p=g);l.Hb=f-l.Ua+p;f=m+a.f;g-=p;k++;continue}}return cc(dc,f,g)}f=new G(a,f,p,a.f,d,e);Yb(f,l);a.a[k++]=f;f=m+a.f;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+ec[d]+" at "+Da(b)),!0):cc(fc,b,c)}h.wd=function(a){return this.b[(a&this.i)>>>this.h].lb(a&this.g,a)}; +h.Kb=function(a){var b=a&this.g,c=(a&this.i)>>>this.h;return jb||b!=this.g?this.b[c].V(b,a):this.b[c++].lb(b,a)|this.b[c&this.K].lb(0,a+1)<<8};h.xd=function(a,b){this.b[(a&this.i)>>>this.h].ob(a&this.g,b,a)};h.Lb=function(a,b){var c=a&this.g,d=(a&this.i)>>>this.h;jb||c!=this.g?this.b[d].rb(c,b,a):(this.b[d++].ob(c,b&255,a),this.b[d&this.K].ob(0,b>>8&255,a+1))};function gc(a,b){return a.a[(b&a.v)>>>a.h]} +function Ob(a,b){var c;a.o=!1;a.l++;var d=b&a.g,e=gc(a,b);jb||d!=a.g?c=e.l(d,b):c=e.i(d,b)|gc(a,b+1).i(0,b+1)<<8;a.l--;return c}function hc(a,b,c){a.o=!1;a.l++;gc(a,b).m(b&a.g,c&255,b);a.l--}function Mb(a,b,c){a.o=!1;a.l++;var d=b&a.g,e=gc(a,b);jb||d!=a.g?e.F(d,c&65535,b):(e.m(d,c&255,b),gc(a,b+1).m(0,c>>8&255,b+1));a.l--} +function bc(a){for(var b=0,c=[],d=0;da.c.pa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=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)));for(var t=g[4],z=g[5]||1,y=0;y>8:e[2](f)&255):f&1&&(e=d.Ka[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;H(d,b,16);return 255} +function Vb(a,b,c){var d=!1,e=this.controller,f=e.Ka[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ka[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||H(e,c,16)}function Wb(a,b){var c=-1,d=this.controller;a=d.Ka[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;H(d,b,16);return 65535} +function Xb(a,b,c){var d=!1,e=this.controller;a=e.Ka[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||H(e,c,16)}function J(a){q.call(this,"Device",a,256);this.a={Ca:128,Jc:-1}}n(J,q);h=J.prototype;h.ha=function(a,b,c,d){this.u=b;this.A=a;this.c=c;this.F=d;var e=this;this.a.Jc=nc(c,function(){e.a.Ca|=128;e.a.Ca&64&&oc(e.c,e.a.jb);e.A&&Kb(e.A,1);qc(e.c,e.a.Jc,1E3/60)});this.a.jb=rc(c,64,6,524288);qb(b,this,sc);sb(b,this.reset.bind(this));B(this)}; +h.ja=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){this.a.Ca=128;qc(this.c,this.a.Jc,1E3/60,!0)};h.save=function(){var a=new E(this);a.set(0,[this.a.Ca]);return a.data()};h.restore=function(a){a=ja(a[0]);this.a.Ca=a.next().value;return!0};h.Pe=function(){return this.a.Ca};h.bg=function(a){this.a.Ca=a&192;this.a.Ca&64||(a=this.a.jb)&&tc(this.c,a)};h.Re=function(){return uc(this.c)}; +h.dg=function(a){vc(this.c,a&-129|this.c.J&128)};h.Se=function(){return wc(this.c)};h.Te=function(){return xc(this.c)};h.Ue=function(){return this.c.qa};h.eg=function(a){yc(this.c,a)};h.Df=function(a){a=a>>1&63;var b=this.c.Ja[a>>1];return a&1?b>>16:b&65535};h.Mg=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ja[c]=b&1?this.c.Ja[c]&65535|(a&63)<<16:this.c.Ja[c]&-65536|a&65534};h.wf=function(a){return this.c.s[1][a>>1&7]};h.Fg=function(a,b){this.c.s[1][b>>1&7]=a&65295}; +h.uf=function(a){return this.c.s[1][(a>>1&7)+8]};h.Dg=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.vf=function(a){return this.c.H[1][a>>1&7]};h.Eg=function(a,b){b=b>>1&7;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.tf=function(a){return this.c.H[1][(a>>1&7)+8]};h.Cg=function(a,b){b=(b>>1&7)+8;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.Oe=function(a){return this.c.s[0][a>>1&7]};h.ag=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.Me=function(a){return this.c.s[0][(a>>1&7)+8]}; +h.Zf=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.Ne=function(a){return this.c.H[0][a>>1&7]};h.$f=function(a,b){b=b>>1&7;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.Le=function(a){return this.c.H[0][(a>>1&7)+8]};h.Yf=function(a,b){b=(b>>1&7)+8;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.Cf=function(a){return this.c.s[3][a>>1&7]};h.Lg=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.Af=function(a){return this.c.s[3][(a>>1&7)+8]};h.Jg=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295}; +h.Bf=function(a){return this.c.H[3][a>>1&7]};h.Kg=function(a,b){b=b>>1&7;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.zf=function(a){return this.c.H[3][(a>>1&7)+8]};h.Ig=function(a,b){b=(b>>1&7)+8;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.mb=function(a){a&=7;return this.c.i&2048?this.c.sa[a]:this.c.b[a]};h.pb=function(a,b){b&=7;this.c.i&2048?this.c.sa[b]=a:this.c.b[b]=a};h.Ze=function(){return this.c.i&49152?this.c.fa[0]:this.c.b[6]};h.jg=function(a){this.c.i&49152?this.c.fa[0]=a:this.c.b[6]=a}; +h.bf=function(){return this.c.b[7]};h.mg=function(a){this.c.b[7]=a};h.nb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.sa[a]};h.qb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.sa[b]=a};h.$e=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.fa[1]};h.kg=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.fa[1]=a};h.af=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.fa[3]};h.lg=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.fa[3]=a}; +h.Ke=function(a){return this.c.Eb[a-65504>>1]};h.Xf=function(a,b){this.c.Eb[b-65504>>1]=a};h.rd=function(a){return 65520==a?(ic(this.u)>>6)-1:0};h.ud=function(){};h.yf=function(){return 1};h.Hg=function(){};h.Je=function(){return this.c.D};h.Wf=function(){this.c.D=0};h.Qe=function(){return this.c.Bb};h.cg=function(a,b){b&1||(a&=255);this.c.Bb=a};h.Ve=function(a,b){return b?0:this.c.Sa};h.fg=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.f|=1}b.Sa=a}; +h.xf=function(a,b){return b?0:this.c.Ia&65280};h.Gg=function(a){this.c.Ia=a|255};h.Ye=function(){return zc(this.c)};h.ig=function(a){Ac(this.c,a)};h.td=function(){}; +var K={},sc=(K[61568]=[null,null,J.prototype.Df,J.prototype.Mg,"UNIMAP",64,1170],K[62592]=[null,null,J.prototype.wf,J.prototype.Fg,"SIPDR",8,1145,64],K[62608]=[null,null,J.prototype.uf,J.prototype.Dg,"SDPDR",8,1145,64],K[62624]=[null,null,J.prototype.vf,J.prototype.Eg,"SIPAR",8,1145,64],K[62640]=[null,null,J.prototype.tf,J.prototype.Cg,"SDPAR",8,1145,64],K[62656]=[null,null,J.prototype.Oe,J.prototype.ag,"KIPDR",8,1140,64],K[62672]=[null,null,J.prototype.Me,J.prototype.Zf,"KDPDR",8,1145,64],K[62688]= +[null,null,J.prototype.Ne,J.prototype.$f,"KIPAR",8,1140,64],K[62704]=[null,null,J.prototype.Le,J.prototype.Yf,"KDPAR",8,1145,64],K[62798]=[null,null,J.prototype.Ue,J.prototype.eg,"MMR3",1,1145,64],K[65382]=[null,null,J.prototype.Pe,J.prototype.bg,"LKS"],K[65402]=[null,null,J.prototype.Re,J.prototype.dg,"MMR0",1,1140,64],K[65404]=[null,null,J.prototype.Se,J.prototype.td,"MMR1",1,1145,64],K[65406]=[null,null,J.prototype.Te,J.prototype.td,"MMR2",1,1140,64],K[65408]=[null,null,J.prototype.Cf,J.prototype.Lg, +"UIPDR",8,1140,64],K[65424]=[null,null,J.prototype.Af,J.prototype.Jg,"UDPDR",8,1145,64],K[65440]=[null,null,J.prototype.Bf,J.prototype.Kg,"UIPAR",8,1140,64],K[65456]=[null,null,J.prototype.zf,J.prototype.Ig,"UDPAR",8,1145,64],K[65472]=[null,null,J.prototype.mb,J.prototype.pb,"R0SET0"],K[65473]=[null,null,J.prototype.mb,J.prototype.pb,"R1SET0"],K[65474]=[null,null,J.prototype.mb,J.prototype.pb,"R2SET0"],K[65475]=[null,null,J.prototype.mb,J.prototype.pb,"R3SET0"],K[65476]=[null,null,J.prototype.mb, +J.prototype.pb,"R4SET0"],K[65477]=[null,null,J.prototype.mb,J.prototype.pb,"R5SET0"],K[65478]=[null,null,J.prototype.Ze,J.prototype.jg,"R6KERNEL"],K[65479]=[null,null,J.prototype.bf,J.prototype.mg,"R7KERNEL"],K[65480]=[null,null,J.prototype.nb,J.prototype.qb,"R0SET1",1,1145],K[65481]=[null,null,J.prototype.nb,J.prototype.qb,"R1SET1",1,1145],K[65482]=[null,null,J.prototype.nb,J.prototype.qb,"R2SET1",1,1145],K[65483]=[null,null,J.prototype.nb,J.prototype.qb,"R3SET1",1,1145],K[65484]=[null,null,J.prototype.nb, +J.prototype.qb,"R4SET1",1,1145],K[65485]=[null,null,J.prototype.nb,J.prototype.qb,"R5SET1",1,1145],K[65486]=[null,null,J.prototype.$e,J.prototype.kg,"R6SUPER",1,1145],K[65487]=[null,null,J.prototype.af,J.prototype.lg,"R6USER",1,1145],K[65504]=[null,null,J.prototype.Ke,J.prototype.Xf,"CTRL",8,1170],K[65520]=[null,null,J.prototype.rd,J.prototype.ud,"LSIZE",1,1170],K[65522]=[null,null,J.prototype.rd,J.prototype.ud,"HSIZE",1,1170],K[65524]=[null,null,J.prototype.yf,J.prototype.Hg,"SYSID",1,1170],K[65526]= +[null,null,J.prototype.Je,J.prototype.Wf,"ERR",1,1170],K[65528]=[null,null,J.prototype.Qe,J.prototype.cg,"MBR",1,1170],K[65530]=[null,null,J.prototype.Ve,J.prototype.fg,"PIR"],K[65532]=[null,null,J.prototype.xf,J.prototype.Gg,"SLR"],K[65534]=[null,null,J.prototype.Ye,J.prototype.ig,"PSW"],K); +Za(function(){for(var a=A(document,x,"device"),b=0;b>1),this.c=new Int32Array(this.g,0,this.size>>2),Fc(this,Gc?Hc:Ic);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.He=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.If=function(a,b){ib&&a&1&&H(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8}; +h.Uf=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.Ba=!0};h.Fe=function(a,b){return this.i(a,b)};h.Ff=function(a,b){return this.l(a,b)};h.Sf=function(a,b,c){this.A?this.Jb(0,0,c):this.m(a,b,c)};h.Og=function(a,b,c){this.A?this.Jb(0,0,c):this.F(a,b,c)};h.Ee=function(a){return this.a[a]}; +h.Ge=function(a){return this.a[a]};h.Ef=function(a,b){ib&&a&1&&H(this.b,b,64);return this.u.getUint16(a,!0)};h.Hf=function(a,b){ib&&a&1&&H(this.b,b,64);return!jb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Rf=function(a,b){this.a[a]=b;this.Ba=!0};h.Tf=function(a,b){this.a[a]=b;this.Ba=!0};h.Ng=function(a,b,c){ib&&a&1&&H(this.b,c,64);this.u.setUint16(a,b,!0);this.Ba=!0};h.Pg=function(a,b,c){ib&&a&1&&H(this.b,c,64);!jb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.Ba=!0}; +var Dc=0,jc=1,Ec=2,$b=4,ec=["NONE","RAM","ROM","VID","H/W"],Cc=0,Lc=[],Kc=[G.prototype.He,G.prototype.Uf,G.prototype.If,G.prototype.Qg],Oc=[G.prototype.Fe,G.prototype.Sf,G.prototype.Ff,G.prototype.Og];if(gb)var Ic=[G.prototype.Ee,G.prototype.Rf,G.prototype.Ef,G.prototype.Ng],Hc=[G.prototype.Ge,G.prototype.Tf,G.prototype.Hf,G.prototype.Pg];var Pc;if(gb){var Qc=new ArrayBuffer(2);(new DataView(Qc)).setUint16(0,256,!0);Pc=256===(new Uint16Array(Qc))[0]}else Pc=!1;var Gc=Pc; +function Rc(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Lc=0;this.ec=b;this.Ra=c;this.nc=Math.round(this.ec/1E4)/100;this.bb=this.nc*this.Ra;this.oc=this.Ab=this.fb=this.fc=0;this.j.L=this.j.Ic=!1;this.j.ba=a.autoStart;"string"==typeof this.j.ba&&(this.j.ba="true"==this.j.ba);this.j.Tb=!1;this.cc=this.eb=0;this.dc=+a.csStart;this.yb=+a.csInterval;this.zb=+a.csStop;this.W=[];this.bd=this.Mf.bind(this);this.Ha=this.za=this.Ga=this.a=this.Y=this.ya=this.xb=this.Fa=this.gb= +this.pc=this.Oa=0;this.ma=null;B(this)}n(Rc,q);h=Rc.prototype;h.ha=function(a,b,c,d){this.A=a;this.u=b;this.F=d;this.ma=a.g;for(a=0;a=a.eb&&(a.eb+=a.yb,c=!0);0<=a.zb&&a.zb<=Wc(a)&&(a.yb=a.zb=-1,Vc(a),F(a),c=!0);c&&a.X(Wc(a)+" cycles: checksum="+Ea(a.cc))}} +h.ka=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.m[b]=c,!0;case "run":return this.m[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.P)a=!0;else{var b=null,c,k=xa(a.id);for(c=0;ca.Oa/a.bb&&(b=1);a.Ra=b;b=a.nc*a.Ra;if(a.bb!=b){a.bb=b;b=a.bb.toFixed(2)+"Mhz";var d=a.m.setSpeed;d&&(d.textContent=b);a.X("target speed: "+b)}c&&a.A&&$c(a.A)}Ib(a,a.za);a.za=0;a.ya=va();a.Fa=0;Yc(a)}function nc(a,b){var c=a.W.length;a.W.push([-1,b]);return c}function qc(a,b,c,d){0<=b&&ba.W[b][0])&&(c=a.ec*a.Ra/1E3*c|0,a.j.L&&(c+=ad(a)),a.W[b][0]=c)}function bd(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ad(a,b){var c=a.Ga-=a.a;a.a=a.Y=0;b&&(a.Ga=0);return c} +h.Mf=function(){if(this.j.L){this.fc>=this.ec&&Yc(this,!0);this.gb=0;this.xb=va();if(this.Fa){var a=this.xb-this.Fa;a>this.oc&&(this.ya+=a,this.ya>this.xb&&(this.ya=this.xb))}try{do{for(var b,c=this.j.Tb?1:this.Ab,d=this.W.length-1;0<=d;d--){var e=this.W[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.kc(b)}catch(f){if("number"!=typeof f)throw f;}b=ad(this,!0);this.gb+=b;this.za+=b;Jb(this,b);Hb(this,b);this.fb-=b;if(0>=this.fb){this.fb+=this.Ab;++this.pc>=cd&&(this.A&&Kb(this.A,void 0),this.pc=0);break}}while(this.j.L)}catch(f){F(this); +this.A&&this.A.stop(va(),Wc(this));a=f.stack||f.message;this.j.error=!0;this.G(a);return}if(this.j.L){a=setTimeout;b=this.bd;this.Fa=va();c=this.oc;this.gb&&(c=Math.round(c*this.gb/this.Ab));c-=this.Fa-this.xb;if(d=this.Fa-this.ya)this.Oa=Math.round(this.za/(10*d))/100,864E5<=d&&(this.Ha=0,Xc(this));if(0>c||this.Oac&&(this.ya-=c),c=0;this.fc+=this.gb;this.Fa+=c;a(b,c)}}}; +function Gb(a){var b;a.j.error?(a.X(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.L)a.X(a.toString()+" busy");else{Xc(a);a.j.L=!0;a.j.Ic=!0;if(b=a.m.run)b.textContent="Halt";a.A&&a.A.start(a.ya,Wc(a));a.F||a.status("Started");setTimeout(a.bd,0)}}h.kc=function(){return 0};function F(a){var b=!1;if(a.j.L){ad(a);Ib(a,a.za);a.za=0;a.j.L=!1;if(b=a.m.run)b.textContent="Run";a.A&&a.A.stop(va(),Wc(a));b=!0;a.F||a.status("Stopped")}a.j.complete=void 0;return b}var Zc=30,cd=15,Sc=["power","reset"]; +function dd(a){var b=+a.model||1170;Rc.call(this,a,6666667);this.pa=b;this.Wc=+a.addrReset||0;this.Aa=this.i=this.B=this.v=this.l=this.o=this.w=0;this.b=this.sa=this.fa=[];this.H=this.s=this.Ja=this.Eb=[];this.Ea=this.C=this.Vc=this.cb=this.Pa=this.Qa=this.Xa=this.D=this.Bb=this.Sa=this.Ia=this.J=this.Cb=this.Db=this.qa=this.f=0;this.fe=[4,2,0,1];this.hc=0;this.$c=255;1120>=this.pa?(this.Uc=ed.bind(this),this.$a=this.oe,this.hc=8,this.$c=-1,this.fd=255,this.cd=0):(this.Uc=fd.bind(this),this.$a=this.pe, +this.fd=~(1792|(1140>=this.pa?2048:0))&65535,this.cd=1140e.Ib&&(e.Ib=c,c+=4)}return Rc.prototype.ja.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.pa);this.j.L&&F(this);this.v=65536;this.l=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.Wc,-1,-2,-3,-4,-5,-6,-7,-8];this.sa=[0,0,0,0,0,0];this.fa=[0,0,0,0];this.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,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,65535,65535, +65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ja=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Eb=[0,0,0,0,0,0,0,0];this.B=0;this.Aa=-1;this.h=this.g=this.bc=this.K=this.R=this.f=this.Bb=0;Eb(this);Uc(this);this.j.error=!1;Rc.prototype.reset.call(this)};function Eb(a){a.J=0;a.Cb=0;a.Db=0;a.qa=0;a.D=0;a.Sa=0;a.Ia=255;a.cb=0;a.Pa=0;a.Qa=0;a.Xa=262143;a.Ea=a.b[7];a.C=0;a.I=null;a.u&&(gd(a),a.Vc=ic(a.u))} +function gd(a){a.Yb=a.Mc;a.Zb=a.ic;a.jc=a.lc;a.$b=a.mc;a.cb?(a.wa=65536,a.Xb=a.qa&16?4186112:253952,a.oa=a.od,a.V=a.sd,a.rb=a.vd,ac(a.u,a.qa&16?22:18)):(a.wa=0,a.Xb=57344,a.oa=a.te,a.V=a.Gf,a.rb=a.Rg,ac(a.u,16))}function uc(a){var b=a.J;b&57344||(b=b&-3199|a.Pa<<5|a.Qa<<1);return b}function vc(a,b){b&=-3073;if(a.J!=b){b&57344&&!(a.J&57344)&&(a.Cb=a.C>>16&65535,a.Db=a.C&65535);a.J=b;a.Pa=(b&96)>>5;a.Qa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.cb!=c&&(a.cb=c,gd(a))}} +function wc(a){a.J&57344||(a.Cb=a.C>>16&65535);a=a.Cb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xc(a){a.J&57344||(a.Db=a.C&65535);return a.Db}function yc(a,b){1170>a.pa&&(b&=-49);a.qa!=b&&(a.qa=b,a.Xa=b&16?4194303:262143,gd(a))}function hd(a,b,c){a.Wc=b;id(a,b);Ac(a,0);a.u.reset();Eb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.L||Gb(a)}else a.F&&a.j.P?F(a)||(a.F.f(),Kb(a.A,-1)):!1===c&&F(a);!a.j.L&&a.ma&&a.ma.stop()}h.nd=function(){return 0}; +h.save=function(){var a=new E(this);a.set(0,[this.b,this.sa,this.fa,this.H,this.s,this.Ja,this.Eb,this.D,this.Bb,this.Sa,this.Ia,this.Pa,this.Qa,this.Ea,this.f,this.C,this.Aa,this.sc,this.uc]);a.set(1,[zc(this),uc(this),wc(this),xc(this),this.qa]);a.set(2,[this.Ha,this.Ra,this.j.ba]);a.set(3,jd(this));a.set(4,bd(this));return a.data()}; +h.restore=function(a){var b=ja(a[0]);this.b=b.next().value;this.sa=b.next().value;this.fa=b.next().value;this.H=b.next().value;this.s=b.next().value;this.Ja=b.next().value;this.Eb=b.next().value;this.D=b.next().value;this.Bb=b.next().value;this.Sa=b.next().value;this.Ia=b.next().value;this.Pa=b.next().value;this.Qa=b.next().value;this.Ea=b.next().value;this.f=b.next().value;this.C=b.next().value;this.Aa=b.next().value;this.sc=b.next().value;this.uc=b.next().value;b=a[1];Ac(this,b[0]);vc(this,b[1]); +this.Cb=b[2];this.Db=b[3];yc(this,b[4]);b=a[2];this.Ha=b[0];Xc(this,b[1]);this.j.ba=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function id(a,b){a.b[7]=b&65535}function rc(a,b,c,d){b={Ib:b,kb:c,message:d||0,name:kb[b],next:null};a.wb.push(b);return b}function tc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.f|=1)}function oc(a,b){if(b){if(b!=a.I){var c=a.I;if(!c||c.kb<=b.kb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.kb<=b.kb){b.next=d;c.next=b;break}c=d}while(c)}}a.f|=1}} +function jd(a){var b=[];for(a=a.I;a;)b.push(a.Ib),a=a.next;return b}function nd(a){return a.f&64?(I(a,168,64,-6),!0):a.f&32?(I(a,4,32,-5),!0):a.f&16?(I(a,12,16,-7),!0):!1}function zc(a){return a.i=a.i&63728|ld(a)|(a.o&65535?0:4)|(a.l&32768?2:0)|kd(a)}function Ac(a,b){b&=a.fd;a.w=b<<12;a.o=~b&4;a.l=b<<14;a.v=b<<16;if((b^a.i)&a.cd)for(var c=a.sa.length;0<=--c;){var d=a.b[c];a.b[c]=a.sa[c];a.sa[c]=d}a.B=b>>14&3;c=a.i>>14&3;a.B!=c&&(a.fa[c]=a.b[6],a.b[6]=a.fa[a.B]);a.i=b;a.f&=-3;a.f|=a.I?2:1} +h.ea=function(a){this.w=this.o=a;this.l=0};h.La=function(a,b){this.w=this.o=this.v=a;this.l=b||0};function od(a,b){a.w=a.o=a.v=b;a.l=a.w^a.v>>1}function pd(a,b,c,d){a.w=a.o=a.v=b;a.l=(c^d)&(d^b)} +function I(a,b,c,d){if(!a.ib){0>a.Aa?a.Aa=zc(a):a.B||(d=-4);-4==d&&(a.f&256&&(d=-1),a.f|=256,a.D|=4,a.b[6]=b=4);if(-1!=d){a.C=b|4143316992;a.B=0;var e=a.V(b|a.wa),f=a.V(b+2&65535|a.wa);Ac(a,f&-12289|a.Aa>>2&12288);qd(a,a.Aa);qd(a,a.b[7]);id(a,e)}a.a-=5;a.f&=~(c|19);a.f|=129;a.Aa=-1;a.sc=d;a.uc=b;-1==d&&F(a);if(-4<=d)throw b;}}function rd(a){var b=sd(a),c=sd(a);a.i&49152&&(c=c&-225|a.i&63712);id(a,b);Ac(a,c);a.f&=-17} +function td(a,b){var c=b>>13&31;31>c&&(b=a.qa&32?a.Ja[c]+(b&8191)&4194303:b&-3932161);return b} +function Nb(a,b,c){var d,e,f;if(!(c&a.cb))return f=b&65535,57344<=f&&(f|=a.Xb),f;d=b>>13;a.qa&a.fe[a.B]||(d&=7);e=a.s[a.B][d];f=(a.H[a.B][d]<<6)+(b&8191)&a.Xa;3932160<=f&&(f=td(a,f));if(a.ib)return f;f>=a.Vc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.s[a.B][d]=e;if(f!=(4194170&a.Xa)||a.B)a.Pa=a.B,a.Qa=d;g&&(g&57344&&(0<=a.Aa&&(g|=128),a.J&57344||(g|=a.J&4096|a.Pa<<5|a.Qa<<1,vc(a,a.J&-61695|g&61694)),I(a,168,64,-2)),a.J&61440||!(f<(4191360&a.Xa)||f>(4194239&a.Xa))||(a.J|=4096,a.J&512&&(a.f|=64)));return f}function sd(a){var b=a.V(a.b[6]|a.wa);a.b[6]=a.b[6]+2&65535;return b}function qd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.C=a.C&65535|(a.C&-65536)<<8|16121856;a.f&256||a.$a(4,-2,c);a.rb(c,b)} +function ud(a,b,c,d){var e,f,g=d&8?0:a.wa;switch(b){case 0:return I(a,4,0,-3),0;case 1:return 6==c&&a.$a(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.$a(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.$a(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(md(a,2)),e=e+a.b[c]&65535,6==c&&a.$a(d,0, +e),a.a-=6,e|g;case 7:return e=a.V(md(a,2)),e=e+a.b[c]&65535,e=a.V(e|a.wa),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.C=a.C&65535|(a.C&-65536)<<8|(f<<3&248|c)<<16;return e}h.oe=function(a,b,c){!this.B&&0>=b&&c<=this.Ia&&(this.f|=32)};h.pe=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.Ia&&(c<=this.Ia-32?I(this,4,0,-4):(this.D|=8,this.f|=32)))};h.se=function(a){return this.Mc(a)};h.ue=function(a){return this.ic(a)};h.Of=function(a,b){this.lc(a,b)};h.Qf=function(a,b){this.mc(a,b)}; +h.te=function(a,b,c){return ud(this,a,b,c)};h.od=function(a,b,c){return Nb(this,ud(this,a,b,c),c)};h.Gf=function(a){return this.u.Kb(this.Ea=a)};h.sd=function(a){return this.u.Kb(this.Ea=Nb(this,a,2))};h.Rg=function(a,b){this.u.Lb(this.Ea=a,b)};h.vd=function(a,b){this.u.Lb(this.Ea=Nb(this,a,4),b)}; +function vd(a,b,c){var d=a.g=b&7;(b=a.h=(b&56)>>3)?(d=ud(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.B=a.i>>12&3,c=a.V(d|c&a.wa),a.B=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.fa[a.i>>12&3];return c}function wd(a,b,c,d){a.C=a.C&65535|1441792;var e=a.g=b&7;(b=a.h=(b&56)>>3)?(e=ud(a,b,e,4),c&65536||(e&=65535),a.B=a.i>>12&3,e=Nb(a,e|c&65536,4),a.B=a.i>>14&3,a.$b(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.fa[a.i>>12&3]=d} +function xd(a,b){b>>=6;var c=a.R=b&7;return(b=a.K=(b&56)>>3)?a.Yb(a.oa(b,c,3)):a.b[c+a.hc]&a.$c}function yd(a,b){var c;b>>=6;var d=a.R=b&7;(b=a.K=(b&56)>>3)?c=a.Zb(a.oa(b,d,2)):c=a.b[d+a.hc];return c}function zd(a,b){var c=a.g=b&7;b=a.h=(b&56)>>3;return ud(a,b,c,8)}function Ad(a,b){var c=a.g=b&7;return(b=a.h=(b&56)>>3)?a.Yb(a.oa(b,c,3)):a.b[c]&255}function Bd(a,b){var c,d=a.g=b&7;(b=a.h=(b&56)>>3)?c=a.Zb(a.oa(b,d,2)):c=a.b[d];return c} +function O(a,b,c,d){var e=a.g=b&7;(b=a.h=(b&56)>>3)?(e=a.bc=a.oa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.jc(e,d.call(a,c,a.Yb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function P(a,b,c,d){var e=a.g=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,6),a.$b(e,d.call(a,0>c?a.b[-c-1]:c,a.Zb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} +function Cd(a,b,c,d,e){var f=a.g=b&7;(b=a.h=(b&56)>>3)?(d=a.oa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.jc(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function Dd(a,b,c,d){var e=a.g=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.$b(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} +h.kc=function(a){this.j.complete=!0;var b=a?this.j.Ic?0:1:-1;this.j.Ic=!1;this.Ga=this.a=a;this.f=this.f&-5|0;do{if(this.f){if(a=this.f&11)if(a=!1,this.f&2){var c=160,d=(this.Sa&224)>>5,e=this.I&&this.I.kb>d?this.I:null;e&&(c=e.Ib,d=e.kb);d>(this.i&224)>>5?(this.f&8&&(md(this,2),this.f&=-9),I(this,c,0,-10),d=!0):d=!1;d&&(e&&tc(this,e),a=!0);this.I||this.Sa||(this.f&=-3)}else this.f&1&&this.f++;if(a){if(this.f&4&&this.F.b(this.b[7],b)){F(this);break}if(0>b)break}if(this.f&112&&nd(this)){if(this.f& +4&&this.F.b(this.b[7],b)){F(this);break}if(0>b)break}}this.f=this.f&15|this.i&16;a=this.C=this.b[7];e=this.V(a);this.b[7]=a+2&65535;this.Uc(e)}while(0>1|b<<16;od(this,a);return a&65535}function Jd(a,b){a=b&128|b>>1|b<<8;od(this,a<<8);return a&255}function Kd(a,b){a=b&~a;this.ea(a);return a}function Ld(a,b){a=b&~a;this.ea(a<<8);return a}function Md(a,b){a|=b;this.ea(a);return a}function Nd(a,b){a|=b;this.ea(a<<8);return a} +function Od(a,b){a=~b|65536;this.La(a);return a&65535}function Pd(a,b){a=~b|256;this.La(a<<8);return a&255}function Qd(a,b){this.w=this.o=a=b-a;this.l=b&(b^a);return a&65535}function Rd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.l=b&(b^c);return a&255}function Sd(a,b){this.w=this.o=a=b+a;this.l=a&(b^a);return a&65535}function Td(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.l=c&(b<<8^c);return a&255}function Ud(a,b){a=-b;this.La(a,a&b&32768);return a&65535} +function Vd(a,b){a=-b;this.La(a<<8,(a&b&128)<<8);return a&255}function Wd(a,b){a=b<<1|this.v>>16&1;od(this,a);return a&65535}function Xd(a,b){a=b<<1|this.v>>16&1;od(this,a<<8);return a&255}function Yd(a,b){a=(this.v&65536|b)>>1|b<<16;od(this,a);return a&65535}function Zd(a,b){a=((this.v&65536)>>8|b)>>1|b<<8;od(this,a<<8);return a&255}function $d(a,b){var c=b-a;pd(this,c,a,b);return c&65535}function ae(a,b){var c=b-a;pd(this,c<<8,a<<8,b<<8);return c&255} +function be(a,b){this.w=this.o=b&65280;this.l=this.v=0;return(b<<8|b>>8)&65535}function ce(a,b){a^=b;this.ea(a);return a&65535}function de(a){P(this,a,yd(this,a),Ed);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)} +function ee(a){var b=Bd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.v=this.l=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.l=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} +function fe(a){var b=Bd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.l=0;b&=63;if(b&32){b=64-b;32>b-1;this.v=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.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function ge(a){N(this,a,!kd(this))}function he(a){N(this,a,kd(this))} +function ie(a){P(this,a,yd(this,a),Kd);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}function je(a){O(this,a,xd(this,a),Ld);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}function ke(a){P(this,a,yd(this,a),Md);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}function le(a){O(this,a,xd(this,a),Nd);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)} +function me(a){var b=yd(this,a);a=Bd(this,a);this.ea((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.R&&6<=this.g?1:0):(this.K?4:3)+(7==this.g?2:0)}function ne(a){var b=xd(this,a);a=Ad(this,a);this.ea(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.R&&6<=this.g?1:0):(this.K?4:3)+(7==this.g?2:0)}function oe(a){N(this,a,this.o&65535?0:4)}function pe(a){N(this,a,!ld(this)==!(this.l&32768))}function qe(a){N(this,a,!!(this.o&65535)&&!ld(this)==!(this.l&32768))} +function re(a){N(this,a,!kd(this)&&!!(this.o&65535))}function se(a){N(this,a,(this.o&65535?0:4)||!ld(this)!=!(this.l&32768))}function te(a){N(this,a,kd(this)||(this.o&65535?0:4))}function ue(a){N(this,a,!ld(this)!=!(this.l&32768))}function ve(a){N(this,a,ld(this))}function we(a){N(this,a,!!(this.o&65535))}function xe(a){N(this,a,!ld(this))}function ye(){I(this,12,0,-9)}function ze(a){N(this,a,!0)}function Ae(a){N(this,a,!(this.l&32768))}function Be(a){N(this,a,this.l&32768?2:0)} +function Q(a){a&1&&(this.v=0);a&2&&(this.l=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function Ce(a){var b=yd(this,a);a=Bd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;pd(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.g?1:0):(this.K?4:3)+(7==this.g?2:0)}function De(a){var b=xd(this,a);a=Ad(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);pd(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.g?1:0):(this.K?4:3)+(7==this.g?2:0)} +function Ee(a){var b=Bd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.l=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.l=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.l=32768,this.v=65536,this.a-=7}function Fe(){I(this,24,0,-9);this.a-=20} +function Ge(){this.i&49152?(this.D|=128,I(this,4,0,-8)):(this.ma&&1120==this.pa&&this.ma.setData(this.b[0],!0),this.F?this.F.i():F(this));this.a-=7}function He(){I(this,16,0,-9);this.a-=20}var Ie=[0,7,7,10,7,11,9,13];function Je(a){this.Y=this.a;id(this,zd(this,a));this.a=this.Y-Ie[this.h]}var Ke=[0,14,14,17,14,18,16,20];function Le(a){this.Y=this.a;var b=zd(this,a);a=a>>6&7;qd(this,this.b[a]);this.b[a]=this.b[7];id(this,b);this.a=this.Y-Ke[this.h]}var Me=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function Ne(a){var b=yd(this,a);this.Y=this.a;Dd(this,a,b,this.ea);this.a=this.Y-Me[(this.K?8:0)+this.h]+(7!=this.g||this.h?0:2)}function Oe(a){var b=xd(this,a);Cd(this,a,b,65535,this.ea);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}var Pe=[7,13,13,17,14,18,17,21];function Qe(a){var b=Bd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.l=0;this.v=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)id(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6} +function We(a){P(this,a,yd(this,a),$d);this.a-=this.h?9+(this.R&&6<=this.g?1:0):(this.K?5:3)+(7==this.g?2:0)}function Xe(a){P(this,a,0,be);this.a-=this.h?9:3+(7==this.g?2:0)}function Ye(){I(this,28,0,-9)}function Ze(){this.ma&&(this.ma.U=this.b[7],this.ma.setData(this.b[0],!0));this.f|=8;md(this,-2);this.a-=3}function $e(a){P(this,a,this.b[(a>>6&7)+this.hc],ce);this.a-=this.h?9:3+(7==this.g?2:0)}function S(){I(this,8,0,-9)}function ed(a){af[a>>12].call(this,a)} +function bf(a){cf[a>>6&3].call(this,a)}function df(a){ef[a>>6&3].call(this,a)}function ff(a){gf[a>>6&3].call(this,a)}function hf(a){jf[a&15].call(this,a)}function kf(a){lf[a&15].call(this,a)}function mf(a){nf[a>>6&3].call(this,a)}function of(a){pf[a>>6&3].call(this,a)}function qf(a){rf[a>>6&3].call(this,a)} +var af=[function(a){sf[a>>8&15].call(this,a)},Ne,Ce,me,ie,ke,de,S,function(a){tf[a>>8&15].call(this,a)},Oe,De,ne,je,le,We,S],sf=[function(a){uf[a>>4&15].call(this,a)},ze,we,oe,pe,ue,qe,se,Le,Le,bf,df,ff,S,S,S],cf=[function(a){Dd(this,a,0,this.La);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,0,Od);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,1,Sd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,1,Qd);this.a-=this.h?9:3+(7==this.g?2:0)}],ef=[function(a){P(this,a,0,Ud); +this.a-=this.h?11:6},function(a){P(this,a,kd(this)?1:0,Ed);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,kd(this)?1:0,$d);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){a=Bd(this,a);this.La(a);this.a-=this.h?4:3+(7==this.g?2:0)}],gf=[function(a){P(this,a,0,Yd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,0,Wd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,0,Id);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){P(this,a,0,Gd);this.a-=this.h?9:3+(7==this.g?2:0)}],uf= +[function(a){vf[a&15].call(this,a)},S,S,S,Je,Je,Je,Je,Te,S,hf,kf,Xe,Xe,Xe,Xe],vf=[Ge,Ze,Ue,ye,He,Se,S,S,S,S,S,S,S,S,S,S],jf=[Re,function(){this.v=0;this.a-=5},function(){this.l=0;this.a-=5},Q,function(){this.o=1;this.a-=5},Q,Q,Q,function(){this.w=0;this.a-=5},Q,Q,Q,Q,Q,Q,Q],lf=[Re,function(){this.v=65536;this.a-=5},function(){this.l=32768;this.a-=5},R,function(){this.o=0;this.a-=5},R,R,R,function(){this.w=32768;this.a-=5},R,R,R,R,R,R,R],tf=[xe,ve,re,te,Ae,Be,ge,he,Fe,Ye,mf,of,qf,S,S,S],nf=[function(a){Cd(this, +a,0,255,this.La);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,0,Pd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,1,Td);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,1,Rd);this.a-=this.h?9:3+(7==this.g?2:0)}],pf=[function(a){O(this,a,0,Vd);this.a-=this.h?11:6},function(a){O(this,a,kd(this)?1:0,Fd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,kd(this)?1:0,ae);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){a=Ad(this,a);this.La(a<<8);this.a-=this.h?4:3+ +(7==this.g?2:0)}],rf=[function(a){O(this,a,0,Zd);this.a-=this.h?9+(this.bc&1):3+(7==this.g?2:0)},function(a){O(this,a,0,Xd);this.a-=this.h?9:3+(7==this.g?2:0)},function(a){O(this,a,0,Jd);this.a-=this.h?9+(this.bc&1):3+(7==this.g?2:0)},function(a){O(this,a,0,Hd);this.a-=this.h?9:3+(7==this.g?2:0)}];function fd(a){wf[a>>12].call(this,a)} +var wf=[function(a){xf[a>>8&15].call(this,a)},Ne,Ce,me,ie,ke,de,function(a){yf[a>>8&15].call(this,a)},function(a){zf[a>>8&15].call(this,a)},Oe,De,ne,je,le,We,S],xf=[function(a){Af[a>>4&15].call(this,a)},ze,we,oe,pe,ue,qe,se,Le,Le,bf,df,ff,function(a){Bf[a>>6&3].call(this,a)},S,S],Bf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.V(a|this.wa);id(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=vd(this,a,0);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this); +this.Y=this.a;this.ea(b);wd(this,a,0,b);this.a=this.Y-Pe[this.h]},function(a){Dd(this,a,ld(this)?65535:0,this.ea);this.a-=this.h?9:3+(7==this.g?2:0)}],Af=[function(a){Cf[a&15].call(this,a)},S,S,S,Je,Je,Je,Je,Te,function(a){!(a&8)||1145>this.pa?I(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.f|=1,this.f&=-3),this.a-=5)},hf,kf,Xe,Xe,Xe,Xe],Cf=[Ge,Ze,function(){rd(this);this.f|=this.i&16;this.a-=13},ye,He,Se,Ue,function(){I(this,8,0,-9)},S,S,S,S,S,S,S,S],yf=[Qe,Qe,Ee,Ee,ee,ee,fe,fe,$e, +$e,S,S,S,S,Ve,Ve],zf=[xe,ve,re,te,Ae,Be,ge,he,Fe,Ye,mf,of,qf,function(a){1145>this.pa?I(this,8,0,-9):Df[a>>6&3].call(this,a)},S,S],Df=[function(){I(this,8,0,-9)},function(a){a=vd(this,a,65536);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this);this.Y=this.a;this.ea(b);wd(this,a,65536,b);this.a=this.Y-Pe[this.h]},function(){I(this,8,0,-9)}]; +function Ef(a){q.call(this,"ROM",a,128);this.ga=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.g=a.alias;"string"==typeof this.g&&(this.g=eval(this.g));this.f=a.file;this.l=Fa(this.f);if(this.f){a=this.f;var b=Ga(this.l);"json"!=b&&"hex"!=b&&(a=Qa()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Oa(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.f=null):(ta(c.Na,a,b),(a=Pa(a,b))?(c.b=a.M,c.ga=a.ga):c.f=null);Ff(c)})}}n(Ef,q); +h=Ef.prototype;h.ha=function(a,b,c,d){this.u=b;this.c=c;this.F=d;Ff(this)};h.ja=function(){this.ga&&(this.F&&this.F.a(this.id,this.h,this.a,this.ga),delete this.ga);return!0};h.ia=function(){return!0}; +function Ff(a){if(!Aa(a)){if(a.f){if(!a.b||!a.u)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+Ea(a.b.length,8,!0)+") does not match specified size ("+Ea(a.a,8,!0)+")";a.j.error=!0;a.G(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Tb){var c={},c=(c[b]=[Ef.prototype.sf,Ef.prototype.Bg,null,null,null,a.a>>1],c);if(qb(a.u,a,c)){a.status("Added "+a.a+"-byte ROM at "+Da(b));b=a.i=!0;break a}}else if(Zb(a.u,b,a.a,Ec)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),z=l,y=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(y)for(;y--;)hc(a.u,t++,b[z++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< +b.length;e++)hc(a.u,c+e,b[e]);k=!0}if(k){if(null==d||g)F(a.c),f=!1;null!=d&&hd(a.c,d,f)}return k}Za(function(){for(var a=A(document,x,"ram"),b=0;b=sa.Nc&&c<=sa.ke&&(b=c-(sa.Nc-sa.zd));b&&(a.preventDefault&&a.preventDefault(),d.ac(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==sa.Bd&&(b=sa.Ad);d.ac(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.ac(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;var e=this;this.H=rc(this.c,this.B?-1:48,4,262144);this.I=nc(this.c,function(){var a;a=-1;e.g.length&&(a=e.g.shift()&255,e.w&&97<=a&&122>a&&(a-=32),qc(e.c,e.I,1E3/Math.round(e.J/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&oc(c,e.H))});this.C=rc(this.c,this.B?-1:52,4,262144);this.W=nc(this.c,function(){e.b|=128;e.b&64&&oc(c,e.C)});qb(b,this,Lf,this.B?64832+8*(this.B-1)-65392:0);sb(b,this.reset.bind(this));B(this)}; +h.pd=function(a){if(!this.f){var b=Tc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ka(c[0]);if(d!=this.ab)return;c=Ka(c[1]);if(this.f=ya(c)){var e=this.f.exports;if(e){var f=e.connect;f&&f.call(this.f,this.v);if(this.s=e.receiveData){this.v=a;this.D=e.receiveStatus;this.status("Connected "+this.Na+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ja=function(a,b){if(!b)if(this.pd(this.v),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +h.ia=function(a){return a?this.save():!0};h.reset=function(){Mf(this)};h.save=function(){var a=new E(this);a.set(0,[this.o,this.a,this.b,this.g]);return a.data()};h.restore=function(a){return Mf(this,a[0])};function Mf(a,b){b||(b=[0,8192,128,a.g]);b=ja(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.g=b.next().value;return!0} +h.ac=function(a){if("number"==typeof a)this.g.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.R||8,c=a-this.l%a,this.R&&(b=" ".slice(0,c)));this.K&&!this.l&&c&&(b=String.fromCharCode(this.K)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.l+=c}}else if(null!= +this.i){if(10==a||1024<=this.i.length)this.X(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}qc(this.c,this.W,1E3/Math.round(this.Y/10));this.b&=-129};var Kf="buffer",Nf={},Lf=(Nf[65392]=[null,null,T.prototype.df,T.prototype.og,"RCSR"],Nf[65394]=[null,null,T.prototype.cf,T.prototype.ng,"RBUF"],Nf[65396]=[null,null,T.prototype.Kf,T.prototype.Tg,"XCSR"],Nf[65398]=[null,null,T.prototype.Jf,T.prototype.Sg,"XBUF"],Nf); +Za(function(){for(var a=A(document,x,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.m[b]=c,!0;case "readTape":e=Rf;case "loadTape":return e||(e=Sf),this.m[b]=c,c.onclick= +function(){var a=d.m.listTapes;a&&Tf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.C){c.parentNode.removeChild(c);break}this.m[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;Tf(d,Fa(b,!0),b,Sf,a)}return!1};return!0;case Uf:return this.m[b]=c,!0}return!1}; +h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;this.v=Vf(a);var e=this;if(a=Of(this,Tc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.B[f]=a[f]);this.s=rc(this.c,56,4,4096);this.H=nc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.lc.indexOf("/api/v1/dump")&&(e=Ga(c),f="json"==e||"gz"==e?encodeURI(c):Qa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Oa(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.P;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ta(a.Na,e,f),(e=Pa(e,f))&&fg(a,b,c,d,e.M,e.aa,e.Z)); +a.j.Va=!1;a.b&&(a.b--,a.b||B(a));cg(a)})}function Yf(a,b,c,d){if((a=a.m.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.N);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ga(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):Ha(c,"/")&&(d="dir"),f=Qa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Dc?"":e)+"&format=json"));return!!Oa(f, +null,!0,function(b,c,d){ng(a,b,c,d)})} +function ng(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.P;a.f=!1;if(d)a.controller.G('Unable to load disk "'+a.Da+'" (error '+d+": "+b+")",f);else{ta(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)u(k[0]);else{a.N=k.length;a.T=k[0].length;a.O=k[0][0].length;var l=k[0][0][0];a.ca=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var z=l.bytes;if(void 0!==z&&z.length){for(var y=m<<2,fa=z.length;fa>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.f)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.la?f=a.ta+a.la&&(a.la+=f-(a.ta+a.la)+1):(a.ta=f,a.la=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.f){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;lb&&-2!=b&&this.controller.G("Unable to restore disk '"+this.Da+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=pg(this,a++);)rg(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function rg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var jg=0;function sg(a,b,c,d,e,f){q.call(this,a,b,c);this.w=tg(this,b.autoMount);this.s=0;this.D=d;this.H=e;this.I=f;this.C=d.Pc;this.g=Array(this.C);this.B=!Va("Mobi")&&window&&"FileReader"in window;this.h=[];this.jb=null;this.exports={selectDrive:this.Nf}}n(sg,q); +function tg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){u(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=sg.prototype; +h.ka=function(a,b,c){var d=this;switch(b){case "listDisks":return this.m[b]=c,c.onchange=function(){var a=d.m.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){u(d.type+" option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.m[b]=c,c.onchange=function(){var a=Ca(c.value);null!=a&&ug(d, +a)},!0;case "loadDisk":return this.m[b]=c,c.onclick=function(){var a=d.m.listDisks;a&&a.options&&vg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.m[b]=c,c.onclick=function(){var a,b=d.m.listDrives,b=b&&Ca(b.value);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.G("Unable to boot the selected drive"):a.da?(hd(d.c,0,!0),(a=d.Gb(a,0,0,0,512,0,2))&&d.G("Unable to read the boot sector ("+a+")")):d.G("Load a disk into the drive first")},!0;case "saveDisk":if(!this.B){c.parentNode.removeChild(c); +break}this.m[b]=c;c.onclick=function(){var a=d.m.listDrives;if(a&&a.options&&d.g)if(a=d.g[Ca(a.value)||0])if(a=a.da){var b;b="";for(var c=0,k;k=pg(a,c++);)for(var l=0,m=k.length;lg||9e||e>=a.g.length)a.G("Unable to load the selected drive");else if(c)if(c==yg)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==zg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Fa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Eg(a,e,b,c,!1,d)}else Bg(a,e)} +function Eg(a,b,c,d,e,f){var g=-1,k=a.g[b];k.na.toLowerCase()!=d.toLowerCase()&&(g++,Bg(a,b,!0),k.Cc?a.G(a.type+" busy"):(k.Cc=!0,e&&(k.Bc=!0,a.s++),k.Ub=!!f,mg(new ig(a,k,"preload"),c,d,f,a.re)&&g++));return g} +h.re=function(a,b,c,d,e){a.Cc=!1;b&&(b.N>a.N||b.T>a.T)&&(this.G('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.Wb)),b=null);if(b){a.da=b;a.Da=c;a.na=d;a:{var f;for(f=0;f=a.N){m=V.Mb;break}p=a.seek(b,c,d+1);if(!p){m=V.gd;break}t=0;++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b))}var z,y;if(0>(z=a.read(p,t++))||0>(y=a.read(p,t++))){m=V.Nb;break}if(!k&&(Mb(this.u,td(this.c,f),z|y<<8),mc(this.u))){m=V.ub;break}t>=a.ca&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.gc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var p=null,t;a||(m=V.Yc,e=0);for(;e;){var z=Ob(this.u,td(this.c,f));if(mc(this.u)){m=V.ub;break}if(!p){if(b>=a.N){m=V.Mb;break}p=a.seek(b,c,d+1,!0);if(!p){m=V.gd;break}t=0;++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b))}if(k){var y,fa;if(0>(y=a.read(p,t++))||0>(fa=a.read(p,t++))){m=V.Nb;break}if(z!=(y|fa<<8)){m=V.kd;break}}else if(!a.write(p,t++,z&255)||!a.write(p,t++,z>>8)){m=V.Nb;break}t>=a.ca&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Qd=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&~U.Za|f>>16-U.S.Za&U.Za;this.l=65536-e&65535;this.f=this.f&~W.xc|d&W.xc;this.b|=a;Hg(this);return!0};function Hg(a){a.a&=~U.tb;a.b&&(a.b|=V.Ed,a.a|=U.tb,a.b&V.qc&&(a.a|=U.qc))}h.jf=function(){return this.v};h.tg=function(){};h.kf=function(){return this.b};h.ug=function(){};h.ff=function(){return this.a&U.wc}; +h.qg=function(a){this.a=this.a&~U.Ta|a&U.Ta;if(this.a&U.Rc){a=!0;var b,c,d=(this.f&W.Ma)>>W.S.Ma,e=this.g[d],f,g,k,l,m,p;this.a&=~(U.va|U.yc);this.b&=~V.ae;switch(c=this.a&U.ra){case Ig.yd:this.b=this.f=0;this.a=U.va;break;case Ig.Md:case Ig.Od:b=this.Gb;case Ig.zc:case Ig.je:b||(b=this.gc);f=(this.f&W.sb)>>W.S.sb;g=(this.f&W.rc)>>W.S.rc;k=this.f&W.xc;l=65536-this.l&65535;m=(this.a&U.Za)<<16-U.S.Za|this.i;p=this.a&U.Kd?0:2;if(f>=e.N){this.b|=V.Mb;break}if(k>=e.O){this.b|=V.Nb;break}a=b.call(this, +e,f,g,k,l,m,p,c>=Ig.zc,this.Qd.bind(this));break;case Ig.Sb:f=(this.f&W.sb)>>W.S.sb;f(p=a.read(k,m++))||0>(t=a.read(k,m++))){g=Y.xa;break}Mb(this.u,td(this.c,f),p|t<<8);if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(m>=a.ca&&(k=null,++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.xa;break}}return l?l(g,b,c,d,e,f):g}; +h.gc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.da;k=null;var m;a||(g=Y.xa,e=0);for(;e;){var p=Ob(this.u,td(this.c,f));if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=Y.xa;break}m=0}if(!a.write(k,m++,p&255)||!a.write(k,m++,p>>8)){g=Y.xa;break}if(m>=a.ca&&(k=null,++d>=a.O&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.xa;break}}return l?l(g,b,c,d,e,f):g}; +h.Vd=function(a,b,c,d,e,f){this.o=f&65535;this.a=this.a&~X.ua|f>>16-X.S.ua&X.ua;this.i=f>>16&Lg.vc;this.f=this.b=b<>X.S.ua;if(!(this.a&X.va)){a=!0;var b,c=this.g[(this.a&X.Ma)>>X.S.Ma],d=c.da,e,f,g;this.a&=~X.Ya;switch(this.a&X.ra){case Mg.ee:this.l&Ng.Sc&&(this.a&=X.Ya|X.ra|X.ua);this.l=c.status|this.f&Z.Rb|(d&&512==d.N?Ng.Hd:0);break;case Mg.Sb:(this.b&Z.Gd)==Z.be&&(b=this.b&Z.vb,c=(this.b&Z.de)<<2,this.f=this.b&Z.ce?this.f+b:this.f-b,this.b=this.f=this.f&Z.vb|c);break;case Mg.Pd:this.l=this.f;break;case Mg.Nd:b=this.Gb;case Mg.ie:b||(b=this.gc), +e=this.b>>Z.S.vb,f=this.b&Z.Rb?1:0,g=this.b&Z.ed,!d||e>=d.N||g>=d.O?this.a=this.a|Y.xa|X.tb:(a=65536-this.l&65535,d=(this.i&Lg.vc)<<16|this.o,a=b.call(this,c,e,f,g,a,d,2,!1,this.Vd.bind(this)))}a&&(this.a=this.a|X.Ya|X.va,this.a&X.tc&&oc(this.c,this.jb))}};h.mf=function(){return this.o};h.wg=function(a){this.o=a&Og.Ta};h.qf=function(){return this.b};h.zg=function(a){this.b=a};h.rf=function(){return this.l};h.Ag=function(a){this.l=a};h.nf=function(){return this.i}; +h.xg=function(a){this.i=a&Lg.vc;this.a=this.a&~X.ua|(this.i&3)<\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bTg){if(Ug(d,this.s)){this.h=new E(this,"1.32.2",ch);Ug(this.h)&&(dh(this,d),a=gh,hh(this.h));this.h.set($g,Na());ih(this.h);var e=this.a&&!this.l;if(a==ah||wa("Click OK to restore the previous "+hb+" machine state, or CANCEL to reset the machine.")){if(c=Zg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ug(d,g):("error"==f&&"no machine state"!= +g?(this.G("Error: "+g),"unable to verify user"==g&&(Ua(jh,""),this.b=null)):this.X(f+": "+g),hh(d),Ug(d)?(c=Zg(d),e=!0):c=!1))}e&&Xg(this,c?d:null)}else a==gh&&d.clear()}else Xg(this);delete this.s;delete this.i}e=xa(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.P=!0;var d=this.m.power;d&&(d.textContent="Shutdown");this.c&&(kh(this,this.c,b,c,a),Kb(this,-2),this.c.ba());this.C&&(dh(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.f=0}; +function dh(a,b){if(wa("There may be a problem with your "+hb+" machine.\n\nTo help us diagnose it, click OK to send this "+hb+" machine state to http://www.pcjs.org.")){var c=a.K;a=a.b||"";b=b.toString();var d={};d.app=hb;d.ver="1.32.2";d.url=c;d.user=a;d.type="bug";d.data=b;Oa("http://www.pcjs.org/api/v1/report",d,!0)}} +function lh(a,b,c){var d,e="none";if(a.f)return null;a.f--;var f=new E(a,"1.32.2"),g=new E(a,"1.32.2",Yg),k=Na();g.set($g,k);f.set($g,k);f.set(mh,"1.32.2");f.set(nh,window?window.location.href:null);f.set(oh,window?window.navigator.userAgent:"");a.c&&a.c.ia&&(c&&(b&&(a.c.j.ba=a.c.j.L),F(a.c)),d=a.c.ia(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.P=!1,!1===d&&(e=null)));for(var k=xa(a.id),l=0;l=d||30<=(c.Lc+=d))&&(e.textContent=c.j.L?c.Oa.toFixed(2)+"Mhz":"Stopped",c.Lc=0)}if(a.g&&(a=a.g,b=b||0,a.l)){c=a.c.j.L;d=!!(a.c.f&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]: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(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");E(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 l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Bh(a,b,c)}})}else c(a,null)} -function Ch(a,b,c,d){function e(a){if(void 0===k){var b=g&&A(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ga(a))}function f(a){e("Error: "+a);l&&(--yh||ab(!0));l=!1}var g,k,l=!0;yh++;ua[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| -(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?zh(c,null,null,!1,e,function(d,l){l?(ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--yh||ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--yh||ab(!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,m):Ah(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(y){f(y.message)}return l}window.embedPDP11=function(a,b,c,d){ab(!1);return Ch(a,b,c,d)};window.findMachineComponent=function(a,b){return za(b,a+".machine")};window.enableEvents=ab;window.sendEvent=cb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map +h.ka=function(a,b,c){var d=this;switch(b){case "power":return this.m[b]=c,c.onclick=function(){d.f||(d.j.P?lh(d,!1,!0):Wg(d,d.Fb))},!0;case "reset":return this.m[b]=c,c.onclick=function(){if(d.j.P&&!d.f)if(d.a&&!d.o){var a=wa("Click OK to save changes to this "+hb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");lh(d,a,!0);!a&&d.v?window&&window.location.reload():(a||(d.B=!0),d.Fb(Tg),d.B=!1)}else d.reset(),d.c&&d.c.ba()},!0;case "save":if(Ha(Qa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.m[b]= +c,c.onclick=function(){var a=Sg(d,!0);if(a){var b=!!(d.a&&!d.o||d.v),c=lh(d,b);b?ph(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1};function Sg(a,b){var c=a.b;c||((c=Ta(jh),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=rh(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c} +function rh(a,b){a.b=null;b=Oa(Qa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ua(jh,b.data),a.b=b.data)}catch(d){u(d.message+" ("+c+")")}return a.b}function Vg(a){var b=null;a.b&&(b=Qa()+"/api/v1/user?req=load&user="+a.b+"&state="+sh(a,"1.32.2"));return b} +function ph(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=sh(a,"1.32.2");d.data=c;b=Oa(Qa()+"/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(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Oa(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 l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}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===k){var b=g&&A(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ia(a))}function f(a){e("Error: "+a);l&&(--th||cb(!0));l=!1}var g,k,l=!0;th++;ua[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c|| +(c="/versions/pdpjs/1.32.2/components.xsl");m=function(d,k){k?uh(c,null,null,!1,e,function(d,l){l?(ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--th||cb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--th||cb(!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,m):vh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(z){f(z.message)}return l}window.embedPDP11=function(a,b,c,d){cb(!1);return xh(a,b,c,d)};window.findMachineComponent=function(a,b){return za(b,a+".machine")};window.enableEvents=cb;window.sendEvent=eb;})();//# sourceMappingURL=/tmp/pdpjs/1.32.2/pdp11.map