Added PC11 support for loading tapes remotely
This commit is contained in:
parent
aa131d5413
commit
961dce8f78
15 changed files with 993 additions and 441 deletions
|
|
@ -636,4 +636,4 @@
|
|||
0x2442 /*022102*/,0x2418 /*022030*/,0x8142 /*100502*/,0x0000 /*000000*/,0xCC00 /*146000*/,0x0000 /*000000*/,0x0000 /*000000*/,0x0000 /*000000*/,
|
||||
0x0000 /*000000*/,0x0000 /*000000*/,0x0000 /*000000*/,0x0000 /*000000*/,0x0000 /*000000*/,0x0000 /*000000*/,0x0000 /*000000*/,0x0000 /*000000*/,
|
||||
0x0000 /*000000*/,0xFF00 /*177400*/]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<device id="pc11" type="pc11" autoMount='{name:"BASIC",path:"/devices/pdp11/tape/BASIC.json"}' pos="left" padLeft="8px" padBottom="8px">
|
||||
<device id="pc11" type="pc11" autoMount='{path:"/apps/pdp11/tapes/DEC-11-L2PC-PO.json"}' pos="left" padLeft="8px" padBottom="8px">
|
||||
<control type="container" width="300px">
|
||||
<control type="list" binding="listTapes">
|
||||
<tape id="tape00" name="Bootstrap Loader (16Kb)" path="/apps/pdp11/boot/bootstrap/BOOTSTRAP-16KB.json"/>
|
||||
|
|
|
|||
|
|
@ -738,21 +738,32 @@
|
|||
<xsl:template match="device[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/device"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
<xsl:apply-templates select="document($componentFile)/device">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="mount" select="@automount"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="device[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:param name="mount" select="''"/>
|
||||
<xsl:variable name="type">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="autoMount">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mount != ''"><xsl:value-of select="$mount"/></xsl:when>
|
||||
<xsl:when test="@automount"><xsl:value-of select="@automount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@autoMount"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">device</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>',autoMount:'<xsl:value-of select="$autoMount"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
@ -878,10 +889,11 @@
|
|||
<xsl:template match="fdc[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:param name="mount" select="''"/>
|
||||
<xsl:variable name="automount">
|
||||
<xsl:variable name="autoMount">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mount != ''"><xsl:value-of select="$mount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@automount"/></xsl:otherwise>
|
||||
<xsl:when test="@automount"><xsl:value-of select="@automount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@autoMount"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="sortBy">
|
||||
|
|
@ -893,7 +905,7 @@
|
|||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">fdc</xsl:with-param>
|
||||
<xsl:with-param name="parms">,autoMount:'<xsl:value-of select="$automount"/>',sortBy:'<xsl:value-of select="$sortBy"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,autoMount:'<xsl:value-of select="$autoMount"/>',sortBy:'<xsl:value-of select="$sortBy"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
|
|||
|
|
@ -1094,7 +1094,6 @@ Disk.prototype.load = function(sDiskName, sDiskPath, file, fnNotify, controller)
|
|||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* build(buffer, fModified)
|
||||
*
|
||||
* Builds a disk image from an ArrayBuffer (eg, from a FileReader object), rather than from JSON-encoded data.
|
||||
|
|
@ -1217,24 +1216,6 @@ Disk.prototype.doneLoad = function(sURL, sDiskData, nErrorCode)
|
|||
}
|
||||
/*
|
||||
* The most likely source of any exception will be here, where we're parsing the disk data.
|
||||
*
|
||||
* TODO: IE9 is rather unfriendly and restrictive with regard to how much data it's willing to
|
||||
* eval(). In particular, the 10Mb disk image we use for the Windows 1.01 demo config fails in
|
||||
* IE9 with an "Out of memory" exception. One work-around would be to chop the data into chunks
|
||||
* (perhaps one track per chunk, using regular expressions) and then manually re-assemble it.
|
||||
*
|
||||
* However, it turns out that using JSON.parse(sDiskData) instead of eval("(" + sDiskData + ")")
|
||||
* is a much easier fix. The only drawback is that we must first quote any unquoted property names
|
||||
* and remove any comments, because while eval() was cool with them, JSON.parse() is more particular;
|
||||
* the following RegExp replacements take care of those requirements.
|
||||
*
|
||||
* The use of hex values is something else that eval() was OK with, but JSON.parse() is not, and
|
||||
* while I've stopped using hex values in DumpAPI responses (at least when "format=json" is specified),
|
||||
* I can't guarantee they won't show up in "legacy" images, and there's no simple RegExp replacement
|
||||
* for transforming hex values into decimal values, so I cop out and fall back to eval() if I detect
|
||||
* any hex prefixes ("0x") in the sequence. Ditto for error messages, which appear like so:
|
||||
*
|
||||
* ["unrecognized disk path: test.img"]
|
||||
*/
|
||||
var aDiskData;
|
||||
if (sDiskData.substr(0, 1) == "<") { // if the "data" begins with a "<"...
|
||||
|
|
@ -1249,6 +1230,25 @@ Disk.prototype.doneLoad = function(sURL, sDiskData, nErrorCode)
|
|||
*/
|
||||
aDiskData = ["Missing disk image: " + this.sDiskName];
|
||||
} else {
|
||||
/*
|
||||
* TODO: IE9 is rather unfriendly and restrictive with regard to how much data it's willing to
|
||||
* eval(). In particular, the 10Mb disk image we use for the Windows 1.01 demo config fails in
|
||||
* IE9 with an "Out of memory" exception. One work-around would be to chop the data into chunks
|
||||
* (perhaps one track per chunk, using regular expressions) and then manually re-assemble it.
|
||||
*
|
||||
* However, it turns out that using JSON.parse(sDiskData) instead of eval("(" + sDiskData + ")")
|
||||
* is a much easier fix. The only drawback is that we must first quote any unquoted property names
|
||||
* and remove any comments, because while eval() was cool with them, JSON.parse() is more particular;
|
||||
* the following RegExp replacements take care of those requirements.
|
||||
*
|
||||
* The use of hex values is something else that eval() was OK with, but JSON.parse() is not, and
|
||||
* while I've stopped using hex values in DumpAPI responses (at least when "format=json" is specified),
|
||||
* I can't guarantee they won't show up in "legacy" images, and there's no simple RegExp replacement
|
||||
* for transforming hex values into decimal values, so I cop out and fall back to eval() if I detect
|
||||
* any hex prefixes ("0x") in the sequence. Ditto for error messages, which appear like so:
|
||||
*
|
||||
* ["unrecognized disk path: test.img"]
|
||||
*/
|
||||
if (sDiskData.indexOf("0x") < 0 && sDiskData.substr(0, 2) != "[\"") {
|
||||
aDiskData = JSON.parse(sDiskData.replace(/([a-z]+):/gm, "\"$1\":").replace(/\/\/[^\n]*/gm, ""));
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -659,10 +659,7 @@ FDC.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|||
bus.addPortOutputTable(this, FDC.aPortOutput);
|
||||
|
||||
this.addDiskette("None", "", true);
|
||||
|
||||
if (this.fLocalDisks) {
|
||||
this.addDiskette("Local Disk", "?");
|
||||
}
|
||||
if (this.fLocalDisks) this.addDiskette("Local Disk", "?");
|
||||
this.addDiskette("Remote Disk", "??");
|
||||
|
||||
if (!this.autoMount()) this.setReady();
|
||||
|
|
@ -1535,6 +1532,7 @@ FDC.prototype.doneLoadDiskette = function onFDCLoadNotify(drive, disk, sDiskette
|
|||
/**
|
||||
* addDiskette(sName, sPath, fTop)
|
||||
*
|
||||
* @this {FDC}
|
||||
* @param {string} sName
|
||||
* @param {string} sPath
|
||||
* @param {boolean} [fTop] (default is bottom)
|
||||
|
|
@ -1563,6 +1561,7 @@ FDC.prototype.addDiskette = function(sName, sPath, fTop)
|
|||
* This is used to deal with mount requests (eg, autoMount) that supply a path without a name;
|
||||
* if we can find the path in the "listDisks" control, then we return the associated disk name.
|
||||
*
|
||||
* @this {FDC}
|
||||
* @param {string} sPath
|
||||
* @return {string|null}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var State = require("../../shared/lib/state");
|
||||
var PDP11 = require("./defines");
|
||||
|
|
@ -48,14 +49,30 @@ function PC11(parms)
|
|||
{
|
||||
Component.call(this, "PC11", parms, PC11);
|
||||
|
||||
/*
|
||||
* We record any 'autoMount' object now, but we no longer parse it until initBus(), because the Computer's
|
||||
* getMachineParm() service may have an override for us.
|
||||
*/
|
||||
this.configMount = parms['autoMount'] || null;
|
||||
|
||||
/*
|
||||
* TODO: Technically, the PC11 should have a timer that "clocks" data from the abReader buffer into the
|
||||
* PRB register at the appropriate rate (300 CPS for the high-speed version, 10 CPS for the low-speed version).
|
||||
*/
|
||||
this.prs = 0; // PRS register
|
||||
this.prb = 0; // PRB register
|
||||
this.iReader = 0; // buffer index
|
||||
this.abReader = []; // buffer for the PRB register
|
||||
this.prs = 0; // PRS register
|
||||
this.prb = 0; // PRB register
|
||||
this.iReader = 0; // buffer index
|
||||
this.abReader = []; // buffer for the PRB register
|
||||
|
||||
this.flags.local = false;
|
||||
this.sTapeName = this.sTapePath = this.sTapeFile = "";
|
||||
|
||||
/*
|
||||
* Support for local tape images is currently limited to desktop browsers with FileReader support;
|
||||
* when this flag is set, setBinding() allows local tape bindings and informs initBus() to update the
|
||||
* "listTapes" binding accordingly.
|
||||
*/
|
||||
this.fLocalTapes = (!web.isMobile() && window && 'FileReader' in window);
|
||||
}
|
||||
|
||||
Component.subclass(PC11);
|
||||
|
|
@ -64,14 +81,103 @@ Component.subclass(PC11);
|
|||
* setBinding(sType, sBinding, control, sValue)
|
||||
*
|
||||
* @this {PC11}
|
||||
* @param {string|null} sType is the type of the HTML control (eg, "button", "textarea", "register", "flag", "rled", etc)
|
||||
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "buffer")
|
||||
* @param {string|null} sType is the type of the HTML control (eg, "button", "list", "text", etc)
|
||||
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "listTapes")
|
||||
* @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {string} [sValue] optional data value
|
||||
* @return {boolean} true if binding was successful, false if unrecognized binding request
|
||||
*/
|
||||
PC11.prototype.setBinding = function(sType, sBinding, control, sValue)
|
||||
{
|
||||
var pc11 = this;
|
||||
|
||||
switch (sBinding) {
|
||||
|
||||
case "listTapes":
|
||||
this.bindings[sBinding] = control;
|
||||
|
||||
control.onchange = function onChangeListTapes(event) {
|
||||
var controlDesc = pc11.bindings["descTape"];
|
||||
var controlOption = control.options[control.selectedIndex];
|
||||
if (controlDesc && controlOption) {
|
||||
var dataValue = {};
|
||||
var sValue = controlOption.getAttribute("data-value");
|
||||
if (sValue) {
|
||||
try {
|
||||
dataValue = eval("(" + sValue + ")");
|
||||
} catch (e) {
|
||||
Component.error("PC11 option error: " + e.message);
|
||||
}
|
||||
}
|
||||
var sHTML = dataValue['desc'];
|
||||
if (sHTML === undefined) sHTML = "";
|
||||
var sHRef = dataValue['href'];
|
||||
if (sHRef !== undefined) sHTML = "<a href=\"" + sHRef + "\" target=\"_blank\">" + sHTML + "</a>";
|
||||
controlDesc.innerHTML = sHTML;
|
||||
}
|
||||
};
|
||||
return true;
|
||||
|
||||
case "descTape":
|
||||
this.bindings[sBinding] = control;
|
||||
return true;
|
||||
|
||||
case "loadTape":
|
||||
this.bindings[sBinding] = control;
|
||||
|
||||
control.onclick = function onClickLoadTape(event) {
|
||||
var controlTapes = pc11.bindings["listTapes"];
|
||||
if (controlTapes) {
|
||||
var sTapeName = controlTapes.options[controlTapes.selectedIndex].text;
|
||||
var sTapePath = controlTapes.value;
|
||||
pc11.loadSelectedTape(sTapeName, sTapePath);
|
||||
}
|
||||
};
|
||||
return true;
|
||||
|
||||
case "mountTape":
|
||||
if (!this.fLocalTapes) {
|
||||
if (DEBUG) this.log("Local tape support not available");
|
||||
/*
|
||||
* We could also simply hide the control; eg:
|
||||
*
|
||||
* control.style.display = "none";
|
||||
*
|
||||
* but removing the control altogether seems better.
|
||||
*/
|
||||
control.parentNode.removeChild(/** @type {Node} */ (control));
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bindings[sBinding] = control;
|
||||
|
||||
/*
|
||||
* Enable "Mount" button only if a file is actually selected
|
||||
*/
|
||||
control.addEventListener('change', function() {
|
||||
var fieldset = control.children[0];
|
||||
var files = fieldset.children[0].files;
|
||||
var submit = fieldset.children[1];
|
||||
submit.disabled = !files.length;
|
||||
});
|
||||
|
||||
control.onsubmit = function(event) {
|
||||
var file = event.currentTarget[1].files[0];
|
||||
if (file) {
|
||||
var sTapePath = file.name;
|
||||
var sTapeName = str.getBaseName(sTapePath, true);
|
||||
pc11.loadSelectedTape(sTapeName, sTapePath, file);
|
||||
}
|
||||
/*
|
||||
* Prevent reloading of web page after form submission
|
||||
*/
|
||||
return false;
|
||||
};
|
||||
return true;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
|
@ -91,9 +197,30 @@ PC11.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|||
this.cpu = cpu;
|
||||
this.dbg = dbg;
|
||||
|
||||
this.configMount = this.cmp.getMachineParm('autoMount') || this.configMount;
|
||||
|
||||
if (this.configMount) {
|
||||
if (typeof this.configMount == "string") {
|
||||
try {
|
||||
/*
|
||||
* The most likely source of any exception will be right here, where we're parsing
|
||||
* this JSON-encoded data.
|
||||
*/
|
||||
this.configMount = eval("(" + this.configMount + ")");
|
||||
} catch (e) {
|
||||
Component.error("PC11 auto-mount error: " + e.message + " (" + this.configMount + ")");
|
||||
this.configMount = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bus.addIOTable(this, PC11.UNIBUS_IOTABLE);
|
||||
|
||||
this.setReady();
|
||||
this.addTape("None", "", true);
|
||||
if (this.fLocalTapes) this.addTape("Local Tape", "?");
|
||||
this.addTape("Remote Tape", "??");
|
||||
|
||||
if (!this.autoMount()) this.setReady();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -142,6 +269,318 @@ PC11.prototype.reset = function()
|
|||
this.abReader = [];
|
||||
};
|
||||
|
||||
/**
|
||||
* autoMount(fRemount)
|
||||
*
|
||||
* @this {PC11}
|
||||
* @param {boolean} [fRemount] is true if we're remounting all auto-mounted tapes
|
||||
* @return {boolean} true if one or more tape images are being auto-mounted, false if none
|
||||
*/
|
||||
PC11.prototype.autoMount = function(fRemount)
|
||||
{
|
||||
if (!fRemount) this.cAutoMount = 0;
|
||||
if (this.configMount) {
|
||||
var sTapePath = this.configMount['path'];
|
||||
var sTapeName = this.configMount['name'] || this.findTape(sTapePath);
|
||||
if (sTapePath && sTapeName) {
|
||||
if (!this.loadTape(sTapeName, sTapePath, true) && fRemount) {
|
||||
this.setReady(false);
|
||||
}
|
||||
} else {
|
||||
this.notice("Incorrect auto-mount settings for PC11 (" + JSON.stringify(this.configMount) + ")");
|
||||
}
|
||||
}
|
||||
return !!this.cAutoMount;
|
||||
};
|
||||
|
||||
/**
|
||||
* loadSelectedTape(sTapeName, sTapePath, file)
|
||||
*
|
||||
* @this {PC11}
|
||||
* @param {string} sTapeName
|
||||
* @param {string} sTapePath
|
||||
* @param {File} [file] is set if there's an associated File object
|
||||
*/
|
||||
PC11.prototype.loadSelectedTape = function(sTapeName, sTapePath, file)
|
||||
{
|
||||
if (!sTapePath) {
|
||||
this.unloadTape();
|
||||
return;
|
||||
}
|
||||
|
||||
if (sTapePath == "?") {
|
||||
this.notice('Use "Choose File" and "Mount" to select and load a local tape.');
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the special path of "??" is selected, then we want to prompt the user for a URL. Oh, and
|
||||
* make sure we pass an empty string as the 2nd parameter to prompt(), so that IE won't display
|
||||
* "undefined" -- because after all, undefined and "undefined" are EXACTLY the same thing, right?
|
||||
*
|
||||
* TODO: This is literally all I've done to support remote tape images. There's probably more
|
||||
* I should do, like dynamically updating "listTapes" to include new entries, and adding new entries
|
||||
* to the save/restore data.
|
||||
*/
|
||||
if (sTapePath == "??") {
|
||||
sTapePath = window.prompt("Enter the URL of a remote tape image.", "") || "";
|
||||
if (!sTapePath) return;
|
||||
sTapeName = str.getBaseName(sTapePath);
|
||||
if (DEBUG) this.println("Attempting to load " + sTapePath + " as \"" + sTapeName + "\"");
|
||||
}
|
||||
|
||||
this.loadTape(sTapeName, sTapePath, false, file);
|
||||
};
|
||||
|
||||
/**
|
||||
* loadTape(sTapeName, sTapePath, fAutoMount, file)
|
||||
*
|
||||
* NOTE: If sTapePath is already loaded, nothing needs to be done.
|
||||
*
|
||||
* @this {PC11}
|
||||
* @param {string} sTapeName
|
||||
* @param {string} sTapePath
|
||||
* @param {boolean} [fAutoMount]
|
||||
* @param {File} [file] is set if there's an associated File object
|
||||
* @return {number} 1 if tape loaded, 0 if queued up (or busy), -1 if already loaded
|
||||
*/
|
||||
PC11.prototype.loadTape = function(sTapeName, sTapePath, fAutoMount, file)
|
||||
{
|
||||
if (sTapePath) {
|
||||
if (this.sTapePath.toLowerCase() != sTapePath.toLowerCase()) {
|
||||
|
||||
this.unloadTape(fAutoMount, true);
|
||||
|
||||
if (this.flags.busy) {
|
||||
this.notice("PC11 busy");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// if (DEBUG) this.println("tape queued: " + sTapeName);
|
||||
|
||||
this.flags.busy = true;
|
||||
if (fAutoMount) {
|
||||
this.fAutoMount = true;
|
||||
this.cAutoMount++;
|
||||
if (this.messageEnabled()) this.printMessage("auto-loading tape: " + sTapeName);
|
||||
}
|
||||
|
||||
this.flags.local = !!file;
|
||||
if (!this.load(sTapeName, sTapePath, file)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (DEBUG) this.println("tape loaded");
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
|
||||
/**
|
||||
* load(sTapeName, sTapePath, file)
|
||||
*
|
||||
* @this {PC11}
|
||||
* @param {string} sTapeName
|
||||
* @param {string} sTapePath
|
||||
* @param {File} [file] is set if there's an associated File object
|
||||
* @return {boolean} true if load completed (successfully or not), false if queued
|
||||
*/
|
||||
PC11.prototype.load = function(sTapeName, sTapePath, file)
|
||||
{
|
||||
var sTapeURL = sTapePath;
|
||||
|
||||
if (DEBUG) {
|
||||
var sMessage = 'load("' + sTapeName + '","' + sTapePath + '")';
|
||||
this.printMessage(sMessage);
|
||||
}
|
||||
|
||||
var sTapeFile = str.getBaseName(sTapePath);
|
||||
|
||||
var pc11 = this;
|
||||
|
||||
if (file) {
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
pc11.build(reader.result);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* If there's an occurrence of API_ENDPOINT anywhere in the path, we assume we can use it as-is;
|
||||
* ie, that the user has already formed a URL of the type we use ourselves for unconverted tape images.
|
||||
*/
|
||||
if (sTapePath.indexOf(DumpAPI.ENDPOINT) < 0) {
|
||||
/*
|
||||
* If the selected tape image has a "json" extension, then we assume it's a pre-converted
|
||||
* JSON-encoded tape image, so we load it as-is; otherwise, we ask our server-side tape image
|
||||
* converter to return the corresponding JSON-encoded data.
|
||||
*/
|
||||
var sTapeExt = str.getExtension(sTapePath);
|
||||
if (sTapeExt == DumpAPI.FORMAT.JSON || sTapeExt == DumpAPI.FORMAT.JSON_GZ) {
|
||||
sTapeURL = encodeURI(sTapePath);
|
||||
} else {
|
||||
var sTapeParm = DumpAPI.QUERY.PATH;
|
||||
sTapeURL = web.getHost() + DumpAPI.ENDPOINT + '?' + sTapeParm + '=' + encodeURIComponent(sTapePath) + "&" + DumpAPI.QUERY.FORMAT + "=" + DumpAPI.FORMAT.JSON;
|
||||
}
|
||||
}
|
||||
|
||||
return !!web.getResource(sTapeURL, null, true, function(sURL, sResponse, nErrorCode) {
|
||||
pc11.doneLoad(sURL, sTapeName, sTapePath, sResponse, nErrorCode);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* build(buffer)
|
||||
*
|
||||
* Builds a disk image from an ArrayBuffer (eg, from a FileReader object), rather than from JSON-encoded data.
|
||||
*
|
||||
* @this {PC11}
|
||||
* @param {?} buffer (we KNOW this is an ArrayBuffer, but we can't seem to convince the Closure Compiler)
|
||||
*/
|
||||
PC11.prototype.build = function(buffer)
|
||||
{
|
||||
if (buffer) {
|
||||
this.aTapeData = new Uint8Array(buffer, 0, buffer.byteLength);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* doneLoad(sURL, sTapeName, sTapePath, sTapeData, nErrorCode)
|
||||
*
|
||||
* @this {PC11}
|
||||
* @param {string} sURL
|
||||
* @param {string} sTapeName
|
||||
* @param {string} sTapePath
|
||||
* @param {string} sTapeData
|
||||
* @param {number} nErrorCode (response from server if anything other than 200)
|
||||
*/
|
||||
PC11.prototype.doneLoad = function(sURL, sTapeName, sTapePath, sTapeData, nErrorCode)
|
||||
{
|
||||
this.flags.busy = false;
|
||||
|
||||
var fPrintOnly = (nErrorCode < 0 && this.cmp && !this.cmp.flags.powered);
|
||||
|
||||
if (nErrorCode) {
|
||||
/*
|
||||
* This can happen for innocuous reasons, such as the user switching away too quickly, forcing
|
||||
* the request to be cancelled. And unfortunately, the browser cancels XMLHttpRequest requests
|
||||
* BEFORE it notifies any page event handlers, so if the Computer's being powered down, we won't know
|
||||
* that yet. For now, we rely on the lack of a specific error (nErrorCode < 0), and suppress the
|
||||
* notify() alert if there's no specific error AND the computer is not powered up yet.
|
||||
*/
|
||||
this.notice("Unable to load tape \"" + sTapeName + "\" (error " + nErrorCode + ": " + sURL + ")", fPrintOnly);
|
||||
}
|
||||
else {
|
||||
if (DEBUG && this.messageEnabled()) {
|
||||
this.printMessage('doneLoad("' + sTapePath + '")');
|
||||
}
|
||||
|
||||
Component.addMachineResource(this.idMachine, sURL, sTapeData);
|
||||
|
||||
var resource = web.parseMemoryResource(sURL, sTapeData);
|
||||
if (resource) {
|
||||
this.sTapeName = sTapeName;
|
||||
this.sTapePath = sTapePath;
|
||||
this.aTapeData = resource.aBytes;
|
||||
if (DEBUG) this.println("tape loaded: " + sTapeName);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.fAutoMount) {
|
||||
this.fAutoMount = false;
|
||||
if (!--this.cAutoMount) this.setReady();
|
||||
}
|
||||
|
||||
this.displayTape();
|
||||
};
|
||||
|
||||
/**
|
||||
* addTape(sName, sPath, fTop)
|
||||
*
|
||||
* @this {PC11}
|
||||
* @param {string} sName
|
||||
* @param {string} sPath
|
||||
* @param {boolean} [fTop] (default is bottom)
|
||||
*/
|
||||
PC11.prototype.addTape = function(sName, sPath, fTop)
|
||||
{
|
||||
var controlTapes = this.bindings["listTapes"];
|
||||
if (controlTapes && controlTapes.options) {
|
||||
for (var i = 0; i < controlTapes.options.length; i++) {
|
||||
if (controlTapes.options[i].value == sPath) return;
|
||||
}
|
||||
var controlOption = document.createElement("option");
|
||||
controlOption.text = sName;
|
||||
controlOption.value = sPath;
|
||||
if (fTop && controlTapes.childNodes[0]) {
|
||||
controlTapes.insertBefore(controlOption, controlTapes.childNodes[0]);
|
||||
} else {
|
||||
controlTapes.appendChild(controlOption);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* findTape(sPath)
|
||||
*
|
||||
* This is used to deal with mount requests (eg, autoMount) that supply a path without a name;
|
||||
* if we can find the path in the "listTapes" control, then we return the associated tape name.
|
||||
*
|
||||
* @this {PC11}
|
||||
* @param {string} sPath
|
||||
* @return {string|null}
|
||||
*/
|
||||
PC11.prototype.findTape = function(sPath)
|
||||
{
|
||||
var controlTapes = this.bindings["listTapes"];
|
||||
if (controlTapes && controlTapes.options) {
|
||||
for (var i = 0; i < controlTapes.options.length; i++) {
|
||||
var control = controlTapes.options[i];
|
||||
if (control.value == sPath) return control.text;
|
||||
}
|
||||
}
|
||||
return str.getBaseName(sPath, true);
|
||||
};
|
||||
|
||||
/**
|
||||
* displayTape()
|
||||
*
|
||||
* @this {PC11}
|
||||
*/
|
||||
PC11.prototype.displayTape = function()
|
||||
{
|
||||
var controlTapes = this.bindings["listTapes"];
|
||||
|
||||
if (controlTapes && controlTapes.options) {
|
||||
var sTargetPath = (this.flags.local? "?" : this.sTapePath);
|
||||
for (var i = 0; i < controlTapes.options.length; i++) {
|
||||
if (controlTapes.options[i].value == sTargetPath) {
|
||||
if (controlTapes.selectedIndex != i) {
|
||||
controlTapes.selectedIndex = i;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == controlTapes.options.length) controlTapes.selectedIndex = 0;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* unloadTape(fAutoUnload, fQuiet)
|
||||
*
|
||||
* @this {PC11}
|
||||
* @param {boolean} [fAutoUnload] is true if this unload is being forced as part of an automount and/or restored mount
|
||||
* @param {boolean} [fQuiet]
|
||||
*/
|
||||
PC11.prototype.unloadTape = function(fAutoUnload, fQuiet)
|
||||
{
|
||||
this.sTapeName = "";
|
||||
this.sTapePath = "";
|
||||
this.flags.local = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* save()
|
||||
*
|
||||
|
|
|
|||
|
|
@ -298,10 +298,45 @@ web.parseMemoryResource = function(sURL, sData)
|
|||
nLoad: null,
|
||||
nExec: null
|
||||
};
|
||||
|
||||
if (sData.charAt(0) == "[" || sData.charAt(0) == "{") {
|
||||
try {
|
||||
var a, ib;
|
||||
var data = eval("(" + sData + ")");
|
||||
var a, ib, data;
|
||||
|
||||
if (sData.substr(0, 1) == "<") { // if the "data" begins with a "<"...
|
||||
/*
|
||||
* Early server configs reported an error (via the nErrorCode parameter) if a tape URL was invalid,
|
||||
* but more recent server configs now display a somewhat friendlier HTML error page. The downside,
|
||||
* however, is that the original error has been buried, and we've received "data" that isn't actually
|
||||
* tape data. So if the data we've received appears to be "HTML-like", we treat it as an error message.
|
||||
*/
|
||||
throw new Error(sData);
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: IE9 is rather unfriendly and restrictive with regard to how much data it's willing to
|
||||
* eval(). In particular, the 10Mb disk image we use for the Windows 1.01 demo config fails in
|
||||
* IE9 with an "Out of memory" exception. One work-around would be to chop the data into chunks
|
||||
* (perhaps one track per chunk, using regular expressions) and then manually re-assemble it.
|
||||
*
|
||||
* However, it turns out that using JSON.parse(sDiskData) instead of eval("(" + sDiskData + ")")
|
||||
* is a much easier fix. The only drawback is that we must first quote any unquoted property names
|
||||
* and remove any comments, because while eval() was cool with them, JSON.parse() is more particular;
|
||||
* the following RegExp replacements take care of those requirements.
|
||||
*
|
||||
* The use of hex values is something else that eval() was OK with, but JSON.parse() is not, and
|
||||
* while I've stopped using hex values in DumpAPI responses (at least when "format=json" is specified),
|
||||
* I can't guarantee they won't show up in "legacy" images, and there's no simple RegExp replacement
|
||||
* for transforming hex values into decimal values, so I cop out and fall back to eval() if I detect
|
||||
* any hex prefixes ("0x") in the sequence. Ditto for error messages, which appear like so:
|
||||
*
|
||||
* ["unrecognized disk path: test.img"]
|
||||
*/
|
||||
if (sData.indexOf("0x") < 0 && sData.substr(0, 2) != "[\"") {
|
||||
data = JSON.parse(sData.replace(/([a-z]+):/gm, "\"$1\":").replace(/\/\/[^\n]*/gm, ""));
|
||||
} else {
|
||||
data = eval("(" + sData + ")");
|
||||
}
|
||||
|
||||
resource.nLoad = data['load'];
|
||||
resource.nExec = data['exec'];
|
||||
|
|
@ -347,22 +382,26 @@ web.parseMemoryResource = function(sURL, sData)
|
|||
resource = null;
|
||||
}
|
||||
} catch (e) {
|
||||
Component.error("Resource data error: " + e.message);
|
||||
Component.error("Resource data error (" + sURL + "): " + e.message);
|
||||
resource = null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* Parse the data manually; we'll assume it's in "simplified" hex form
|
||||
* (a series of hex byte-values separated by whitespace).
|
||||
* Parse the data manually; we assume it's a series of hex byte-values separated by whitespace.
|
||||
*/
|
||||
var ab = [];
|
||||
var sHexData = sData.replace(/\n/gm, " ").replace(/ +$/, "");
|
||||
var asHexData = sHexData.split(" ");
|
||||
resource.aBytes = new Array(asHexData.length);
|
||||
for (i = 0; i < asHexData.length; i++) {
|
||||
resource.aBytes[i] = parseInt(asHexData[i], 16);
|
||||
Component.assert(!isNaN(resource.aBytes[i]));
|
||||
var n = parseInt(asHexData[i], 16);
|
||||
if (isNaN(n)) {
|
||||
Component.error("Resource data error (" + sURL + "): invalid hex byte (" + asHexData[i] + ")");
|
||||
break;
|
||||
}
|
||||
ab.push(n & 0xff);
|
||||
}
|
||||
if (i == asHexData.length) resource.aBytes = ab;
|
||||
}
|
||||
return resource;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -740,21 +740,32 @@
|
|||
<xsl:template match="device[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/device"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
<xsl:apply-templates select="document($componentFile)/device">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="mount" select="@automount"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="device[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:param name="mount" select="''"/>
|
||||
<xsl:variable name="type">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="autoMount">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mount != ''"><xsl:value-of select="$mount"/></xsl:when>
|
||||
<xsl:when test="@automount"><xsl:value-of select="@automount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@autoMount"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">device</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>',autoMount:'<xsl:value-of select="$autoMount"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
@ -880,10 +891,11 @@
|
|||
<xsl:template match="fdc[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:param name="mount" select="''"/>
|
||||
<xsl:variable name="automount">
|
||||
<xsl:variable name="autoMount">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mount != ''"><xsl:value-of select="$mount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@automount"/></xsl:otherwise>
|
||||
<xsl:when test="@automount"><xsl:value-of select="@automount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@autoMount"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="sortBy">
|
||||
|
|
@ -895,7 +907,7 @@
|
|||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">fdc</xsl:with-param>
|
||||
<xsl:with-param name="parms">,autoMount:'<xsl:value-of select="$automount"/>',sortBy:'<xsl:value-of select="$sortBy"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,autoMount:'<xsl:value-of select="$autoMount"/>',sortBy:'<xsl:value-of select="$sortBy"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
|
|||
|
|
@ -738,21 +738,32 @@
|
|||
<xsl:template match="device[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/device"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
<xsl:apply-templates select="document($componentFile)/device">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="mount" select="@automount"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="device[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:param name="mount" select="''"/>
|
||||
<xsl:variable name="type">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="autoMount">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mount != ''"><xsl:value-of select="$mount"/></xsl:when>
|
||||
<xsl:when test="@automount"><xsl:value-of select="@automount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@autoMount"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">device</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>',autoMount:'<xsl:value-of select="$autoMount"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
@ -878,10 +889,11 @@
|
|||
<xsl:template match="fdc[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:param name="mount" select="''"/>
|
||||
<xsl:variable name="automount">
|
||||
<xsl:variable name="autoMount">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mount != ''"><xsl:value-of select="$mount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@automount"/></xsl:otherwise>
|
||||
<xsl:when test="@automount"><xsl:value-of select="@automount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@autoMount"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="sortBy">
|
||||
|
|
@ -893,7 +905,7 @@
|
|||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">fdc</xsl:with-param>
|
||||
<xsl:with-param name="parms">,autoMount:'<xsl:value-of select="$automount"/>',sortBy:'<xsl:value-of select="$sortBy"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,autoMount:'<xsl:value-of select="$autoMount"/>',sortBy:'<xsl:value-of select="$sortBy"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
|
|||
|
|
@ -39,8 +39,9 @@ function pa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a
|
|||
function sa(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;c<d;c++)if(c in a&&a[c]===b)return c;return-1}
|
||||
function va(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"==
|
||||
typeof b){var k="",n;for(n in b)b.hasOwnProperty(n)&&(k&&(k+="&"),k+=n+"="+encodeURIComponent(b[n]));k=k.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(k)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g}
|
||||
function wa(a,b){var c,d={za:null,Ea:null,Rb:null,Qb:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g=eval("("+b+")");d.Rb=g.load;d.Qb=g.exec;if(e=g.bytes)d.za=e;else if(e=g.words)for(d.za=Array(2*e.length),f=c=0;c<e.length;c++)d.za[f++]=e[c]&255,d.za[f++]=e[c]>>8&255;else if(e=g.data)for(d.za=Array(4*e.length),f=c=0;c<e.length;c++)d.za[f++]=e[c]&255,d.za[f++]=e[c]>>8&255,d.za[f++]=e[c]>>16&255,d.za[f++]=e[c]>>24&255;else d.za=g;d.Ea=g.symbols;d.za.length?1==d.za.length&&(w(d.za[0]),d=null):
|
||||
(w("Empty resource: "+a),d=null)}catch(h){w("Resource data error: "+h.message),d=null}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),d.za=Array(a.length),c=0;c<a.length;c++)d.za[c]=parseInt(a[c],16);return d}function ja(){return"http://"+(window?window.location.host:"www.pcjs.org")}function xa(){return window?window.navigator.userAgent:""}function w(a){window&&window.alert(a)}function ya(a){var b=!1;window&&(b=window.confirm(a));return b}var za=null;
|
||||
function wa(a,b){var c,d={Aa:null,Ea:null,Rb:null,Qb: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.Rb=g.load;d.Qb=g.exec;if(e=g.bytes)d.Aa=e;else if(e=g.words)for(d.Aa=Array(2*e.length),f=c=0;c<e.length;c++)d.Aa[f++]=e[c]&255,d.Aa[f++]=e[c]>>8&255;else if(e=g.data)for(d.Aa=Array(4*e.length),f=c=0;c<e.length;c++)d.Aa[f++]=
|
||||
e[c]&255,d.Aa[f++]=e[c]>>8&255,d.Aa[f++]=e[c]>>16&255,d.Aa[f++]=e[c]>>24&255;else d.Aa=g;d.Ea=g.symbols;d.Aa.length?1==d.Aa.length&&(w(d.Aa[0]),d=null):(w("Empty resource: "+a),d=null)}catch(h){w("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){w("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.Aa=e)}return d}
|
||||
function ja(){return"http://"+(window?window.location.host:"www.pcjs.org")}function xa(){return window?window.navigator.userAgent:""}function w(a){window&&window.alert(a)}function ya(a){var b=!1;window&&(b=window.confirm(a));return b}var za=null;
|
||||
function Aa(){if(null==za){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}za=a}return za}function Ba(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Ca(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}
|
||||
function Da(a){if(window){var b=xa();return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Ea(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||
function Fa(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Ja={init:[],show:[],exit:[]},Ka=!1,La=!1,Ma=!0;function Na(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Oa(a){Ja.init.push(a)}
|
||||
|
|
@ -74,26 +75,26 @@ w:function(a,b){this.I&&jb(this.I,129)&&this.I.message("attempt to write "+u(b)+
|
|||
null!=this.H){var d=this.I;jc(d,this.H+a,2,d.C)&&d.ra(!0)}this.N?this.w(a,b,c):this.Wb(a,b,c)},M:function(a){return this.u[a]},P:function(a){return this.u[a]},ba:function(a){return this.C.getUint16(a,!0)},ea:function(a){return a&1?this.u[a]|this.u[a+1]<<8:this.K[a>>1]},ha:function(a,b){this.u[a]=b;this.Pa=!0},eb:function(a,b){this.u[a]=b;this.Pa=!0},la:function(a,b){this.C.setUint16(a,b,!0);this.Pa=!0},na:function(a,b){a&1?(this.u[a]=b,this.u[a+1]=b>>8):this.K[a>>1]=b;this.Pa=!0}};
|
||||
function xb(a,b,c){a.I=b;a.A=a.j=0;c&&((a.A=c.A)&&ic(a,hc,!1),(a.j=c.j)&&gc(a,hc,!1))}function kc(a,b){b?--a.j||(a.nb=a.N?a.w:a.Bb,a.Fc=a.N?a.G:a.Wb):--a.A||(a.lb=a.yb,a.Dc=a.Sb)}function gc(a,b,c){c&&a.j||(a.nb=!a.N&&b[1]||a.w,a.Fc=!a.N&&b[3]||a.G);if(c||void 0===c)a.Bb=b[1]||a.w,a.Wb=b[3]||a.G}function ic(a,b,c){c&&a.A||(a.lb=b[0]||a.J,a.Dc=b[2]||a.L);if(c||void 0===c)a.yb=b[0]||a.J,a.Sb=b[2]||a.L}function cc(a,b){b||(b=lc);ic(a,b,void 0);gc(a,b,void 0)}
|
||||
var lc=[],fc=[G.prototype.Y,G.prototype.fb,G.prototype.fa,G.prototype.wa],hc=[G.prototype.O,G.prototype.ja,G.prototype.ca,G.prototype.ma];if(qb)var ec=[G.prototype.M,G.prototype.ha,G.prototype.ba,G.prototype.la],dc=[G.prototype.P,G.prototype.eb,G.prototype.ea,G.prototype.na];
|
||||
function mc(a,b){z.call(this,"CPU",a,mc,1);var c=a.multiplier||1;this.Y=a.cycles||b;this.Sa=c;this.ha=Math.round(this.Y/1E4)/100;this.bb=this.ha*this.Sa;this.D.Aa=!1;this.D.Vb=!1;this.D.tb=a.autoStart;this.D.yc=!1;this.D.hb=!1;this.vb=this.O=0;this.wb=a.csStart;this.jb=a.csInterval;this.kb=a.csStop;this.w=[];this.Ha=this.cb.bind(this);F(this)}A(mc);var nc=["power","reset"];l=mc.prototype;
|
||||
function mc(a,b){z.call(this,"CPU",a,mc,1);var c=a.multiplier||1;this.Y=a.cycles||b;this.Sa=c;this.ha=Math.round(this.Y/1E4)/100;this.bb=this.ha*this.Sa;this.D.za=!1;this.D.Vb=!1;this.D.tb=a.autoStart;this.D.yc=!1;this.D.hb=!1;this.vb=this.O=0;this.wb=a.csStart;this.jb=a.csInterval;this.kb=a.csStop;this.w=[];this.Ha=this.cb.bind(this);F(this)}A(mc);var nc=["power","reset"];l=mc.prototype;
|
||||
l.Ra=function(a,b,c,d){this.A=a;this.u=b;this.I=d;for(b=0;b<nc.length;b++)(c=this.N[nc[b]])&&this.A.qa(null,nc[b],c);this.F=ub(a,"ChipSet");a=Ac(a,"autoStart");null!=a&&(this.D.tb="true"==a?!0:"false"==a?!1:!!a);F(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};
|
||||
l.Ga=function(a,b){if(!b){if(a&&this.restore){Bc(this);if(!this.restore(a))return!1;Cc(this)}else this.reset();this.I?(a=this.I,a.g("Type ? for help with PC8080 Debugger commands"),a.La(),a.Ba&&(b=a.Ba,a.Ba=null,Dc(a,b))):this.g("No debugger detected")}Ec(this);return!0};l.Ka=function(a){return a?this.save():!0};l.tb=function(){return this.D.tb||!this.I&&void 0===this.N.run?(this.cb(!0),!0):!1};l.Bc=function(){return 0};
|
||||
function Cc(a){void 0===a.wb&&(a.wb=0);void 0===a.jb&&(a.jb=-1);void 0===a.kb&&(a.kb=-1);a.D.hb=0<=a.wb&&0<a.jb;a.D.hb&&(a.vb=0,a.O=a.wb-a.M)}function Fc(a,b){if(a.D.hb){var c=!1;a.vb=a.vb+a.Bc()|0;a.O-=b;0>=a.O&&(a.O+=a.jb,c=!0);0<=a.kb&&a.kb<=Gc(a)&&(a.jb=a.kb=-1,Cc(a),a.ra(),c=!0);c&&a.g(Gc(a)+" cycles: checksum="+t(a.vb))}}
|
||||
l.qa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.N[b]=c;a=!0;break;case "run":this.N[b]=c;c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.D.xa)a=!0;else{var b=null,c,h=db(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.D.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.D.xa);c++);c==h.length&&(b=a);w("The "+b.type+" component ("+b.id+") is not "+(b.D.ready?"powered yet":"ready yet"+(b.Fb?" (waiting for notification)":""))+".");a=!1}a&&(d.D.Aa?d.ra():d.cb())};
|
||||
l.qa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.N[b]=c;a=!0;break;case "run":this.N[b]=c;c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.D.xa)a=!0;else{var b=null,c,h=db(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.D.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.D.xa);c++);c==h.length&&(b=a);w("The "+b.type+" component ("+b.id+") is not "+(b.D.ready?"powered yet":"ready yet"+(b.Fb?" (waiting for notification)":""))+".");a=!1}a&&(d.D.za?d.ra():d.cb())};
|
||||
a=!0;break;case "speed":this.N[b]=c;a=!0;break;case "setSpeed":this.N[b]=c,c.onclick=function(){Hc(d,d.Sa<<1,!0)},c.textContent=this.bb.toFixed(2)+"Mhz",a=!0}return a};function Ic(a,b,c){a.M+=b;c&&(a.L=a.b=0)}function Jc(a,b){var c=1;b&&1<a.Sa&&a.K&&(c=a.K/a.ha);a.wa=Math.round(1E3/30);a.fa=Math.floor(a.Y/30*c);b||(a.P=a.fa);a.ja=0}function Gc(a){return a.M+a.G+a.L-a.b}function Bc(a){a.K=0;a.Ba=0;a.M=a.G=a.L=a.b=0;Cc(a);Hc(a,1)}
|
||||
function Hc(a,b,c){var d=!1;if(void 0!==b){.8>a.K/a.bb?b=1:d=!0;a.Sa=b;b=a.ha*a.Sa;if(a.bb!=b){a.bb=b;b=a.bb.toFixed(2)+"Mhz";var e=a.N.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.A&&a.A.zb()}Ic(a,a.G);a.G=0;a.C=qa();a.J=0;Jc(a);return d}function Kc(a,b){var c=a.w.length;a.w.push([-1,b]);return c}function Lc(a,b,c){0<=b&&b<a.w.length&&0>a.w[b][0]&&(c*=a.Y*a.Sa/1E3,a.w[b][0]=c+Mc(a))}function Mc(a,b){var c=a.L-=a.b;a.b=0;b&&(a.L=0);return c}
|
||||
l.cb=function(a){if(kb(this,!0)){if(!this.D.Aa){Hc(this);this.A&&this.A.start(this.C,Gc(this));this.D.Aa=!0;this.D.Vb=!0;this.F&&this.F.start();var b=this.N.run;b&&(b.textContent="Halt");this.A&&(this.A.La(!0),a&&this.A.zb(!0))}this.ja>=this.Y&&Jc(this,!0);this.ba=0;this.ea=qa();this.J&&(a=this.ea-this.J,a>this.wa&&(this.C+=a,this.C>this.ea&&(this.C=this.ea)));try{do{for(var c,d=this.D.hb?1:this.fa,e=this.w.length-1;0<=e;e--){var f=this.w[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.mb(c);c=Mc(this,!0);this.ba+=
|
||||
c;this.G+=c;Fc(this,c);a=c;for(var g=this.w.length-1;0<=g;g--){var h=this.w[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.P-=c;if(0>=this.P){this.P+=this.fa;15<=++this.Ba&&(this.A&&this.A.La(),this.Ba=0);break}}while(this.D.Aa)}catch(k){this.ra();Ec(this);this.A&&this.A.stop(qa(),Gc(this));kb(this,!1);nb(this,k.stack||k.message);return}c=setTimeout;d=this.Ha;this.J=qa();e=this.wa;this.ba&&(e=Math.round(e*this.ba/this.fa));e-=this.J-this.ea;if(f=this.J-this.C)this.K=Math.round(this.G/(10*f))/
|
||||
100,864E5<=f&&(this.M=0,Hc(this));if(0>e||this.K<this.bb)-1E3>e&&(this.C-=e),e=0;this.ja+=this.ba;this.J+=e;c(d,e)}else Ec(this),this.A&&this.A.stop(qa(),Gc(this))};l.mb=function(){return 0};l.ra=function(a){lb(this,!0);Mc(this);Ic(this,this.G);this.G=0;if(this.D.Aa){this.D.Aa=!1;this.F&&this.F.stop();var b=this.N.run;b&&(b.textContent="Run")}this.D.complete=a};function Ec(a,b){if(a.A){for(var c=a.A,d=0;d<c.G.length;d++)Nc(c.G[d],b);a.A.La(b)}}
|
||||
function Oc(a){this.Zd=+a.model||8080;mc.call(this,a,1E6);this.la=Pc;Bc(this);this.D.complete=this.D.Nd=!1;this.na=0;this.ca=[];this.ma=0;Qc(this)}A(Oc,mc);function Rc(a,b){a.ca.push(b)}l=Oc.prototype;l.reset=function(){this.D.Aa&&this.ra();Qc(this);Bc(this);this.D.error=!1;this.parent.reset.call(this)};function Qc(a){a.i=0;a.S=0;a.T=0;a.U=0;a.V=0;a.W=0;a.Z=0;a.pa=0;I(a,a.ma);Sc(a,0);a.j=0}function Tc(a,b){a.ma=b;I(a,b)}
|
||||
l.cb=function(a){if(kb(this,!0)){if(!this.D.za){Hc(this);this.A&&this.A.start(this.C,Gc(this));this.D.za=!0;this.D.Vb=!0;this.F&&this.F.start();var b=this.N.run;b&&(b.textContent="Halt");this.A&&(this.A.La(!0),a&&this.A.zb(!0))}this.ja>=this.Y&&Jc(this,!0);this.ba=0;this.ea=qa();this.J&&(a=this.ea-this.J,a>this.wa&&(this.C+=a,this.C>this.ea&&(this.C=this.ea)));try{do{for(var c,d=this.D.hb?1:this.fa,e=this.w.length-1;0<=e;e--){var f=this.w[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.mb(c);c=Mc(this,!0);this.ba+=
|
||||
c;this.G+=c;Fc(this,c);a=c;for(var g=this.w.length-1;0<=g;g--){var h=this.w[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.P-=c;if(0>=this.P){this.P+=this.fa;15<=++this.Ba&&(this.A&&this.A.La(),this.Ba=0);break}}while(this.D.za)}catch(k){this.ra();Ec(this);this.A&&this.A.stop(qa(),Gc(this));kb(this,!1);nb(this,k.stack||k.message);return}c=setTimeout;d=this.Ha;this.J=qa();e=this.wa;this.ba&&(e=Math.round(e*this.ba/this.fa));e-=this.J-this.ea;if(f=this.J-this.C)this.K=Math.round(this.G/(10*f))/
|
||||
100,864E5<=f&&(this.M=0,Hc(this));if(0>e||this.K<this.bb)-1E3>e&&(this.C-=e),e=0;this.ja+=this.ba;this.J+=e;c(d,e)}else Ec(this),this.A&&this.A.stop(qa(),Gc(this))};l.mb=function(){return 0};l.ra=function(a){lb(this,!0);Mc(this);Ic(this,this.G);this.G=0;if(this.D.za){this.D.za=!1;this.F&&this.F.stop();var b=this.N.run;b&&(b.textContent="Run")}this.D.complete=a};function Ec(a,b){if(a.A){for(var c=a.A,d=0;d<c.G.length;d++)Nc(c.G[d],b);a.A.La(b)}}
|
||||
function Oc(a){this.Zd=+a.model||8080;mc.call(this,a,1E6);this.la=Pc;Bc(this);this.D.complete=this.D.Nd=!1;this.na=0;this.ca=[];this.ma=0;Qc(this)}A(Oc,mc);function Rc(a,b){a.ca.push(b)}l=Oc.prototype;l.reset=function(){this.D.za&&this.ra();Qc(this);Bc(this);this.D.error=!1;this.parent.reset.call(this)};function Qc(a){a.i=0;a.S=0;a.T=0;a.U=0;a.V=0;a.W=0;a.Z=0;a.pa=0;I(a,a.ma);Sc(a,0);a.j=0}function Tc(a,b){a.ma=b;I(a,b)}
|
||||
l.Bc=function(){var a=this.i+this.S+this.T+this.U+this.V+this.W+this.Z|0;return a=a+this.pa+this.R+Uc(this)|0};l.save=function(){var a=new J(this);a.set(0,[this.i,this.S,this.T,this.U,this.V,this.W,this.Z,this.pa,this.R,Uc(this)]);a.set(1,[this.j,this.M,this.Sa]);a.set(2,Fb(this.u));return a.data()};
|
||||
l.restore=function(a){var b=a[0];this.i=b[0];this.S=b[1];this.T=b[2];this.U=b[3];this.V=b[4];this.W=b[5];this.Z=b[6];this.pa=b[7]&65535;I(this,b[8]);Sc(this,b[9]);b=a[1];this.j=b[0];this.M=b[1];Hc(this,b[3]);a:{b=this.u;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.M){for(var f=0,g=Array(b.M),h=0;h<e.length-1;)for(var k=e[h++],n=e[h++];k--;)g[f++]=n;e=g}f=b.X[d];if(!f||!f.restore(e)){w("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
||||
l.qa=function(a,b,c){switch(b){case "A":case "B":case "C":case "BC":case "D":case "E":case "DE":case "H":case "L":case "HL":case "SP":case "PC":case "PS":case "IF":case "SF":case "ZF":case "AF":case "PF":case "CF":this.N[b]=c;this.na++;a=!0;break;default:a=this.parent.qa.call(this,a,b,c)}return a};function Vc(a){return a.S<<8|a.T}function Wc(a,b){a.S=b>>8&255;a.T=b&255}function Xc(a){return a.U<<8|a.V}function Yc(a,b){a.U=b>>8&255;a.V=b&255}function K(a){return a.W<<8|a.Z}
|
||||
function Zc(a,b){a.W=b>>8&255;a.Z=b&255}function I(a,b){a.R=b&65535}function $c(a){return a.da&256?1:0}function ad(a,b){a.da=a.da&255|b}function bd(a){return rb[a.ga&255]?4:0}function cd(a){return(a.ga^a.ya)&16?16:0}function dd(a){return a.da&255?0:64}function ed(a){return a.ga&128?128:0}function Uc(a){return a.ua&-214|ed(a)|dd(a)|cd(a)|bd(a)|$c(a)}function Sc(a,b){a.da=a.ga=a.ya=0;b&1&&(a.da|=256);b&4||(a.ga|=1);b&16&&(a.ya|=16);b&64||(a.da|=255);b&128&&(a.ga^=192);a.ua=a.ua&-726|b&512|2}
|
||||
function fd(a,b){a.ya=a.i^b;return a.ga=(a.da=a.i+b)&255}function gd(a,b){a.ya=a.i^b;return a.ga=(a.da=a.i+b+(a.da&256?1:0))&255}function hd(a,b){a.da=a.ga=a.ya=a.i&b;(a.i|b)&8&&(a.ya^=16);return a.da}function id(a,b){a.ya=b^255;b=a.ga=b+255&255;a.da=a.da&-256|b;return b}function jd(a,b){a.ya=b;b=a.ga=b+1&255;a.da=a.da&-256|b;return b}function Ed(a,b){return a.ga=a.da=a.ya=a.i|b}function L(a,b){b^=255;a.ya=a.i^b;return a.ga=(a.da=a.i+b+1^256)&255}
|
||||
function Fd(a,b){b^=255;a.ya=a.i^b;return a.ga=(a.da=a.i+b+(a.da&256?0:1)^256)&255}function Gd(a,b){return a.ga=a.da=a.ya=a.i^b}l.aa=function(a){return this.u.aa(a)};l.va=function(a,b){this.u.va(a,b)};function M(a){var b=a.aa(a.R);I(a,a.R+1);return b}function O(a){var b=a.u.ab(a.R);I(a,a.R+2);return b}function P(a){var b=a.u.ab(a.pa);a.pa=a.pa+2&65535;return b}function Q(a,b){a.pa=a.pa-2&65535;a.u.Jb(a.pa,b)}
|
||||
function Hd(a){if(a.b&&a.j&255&&a.ua&512){for(var b=0;8>b&&!(a.j&1<<b);b++);a.j&=~(0>b?255:1<<b);a.ua&=-513;a.j&=-257;a.la[199|b<<3].call(a)}return a.j&256?(Mc(a),!1):!0}function Id(a,b){a.j|=1<<b;a.ua&512&&Mc(a)}function R(a,b,c,d){d=d||2;a.N[b]&&(void 0===c&&(nb(a,"Value for "+b+" is invalid"),a.ra()),c=!a.D.Aa||a.D.yc?t(c,d):"--------".substr(0,d),a.N[b].textContent!=c&&(a.N[b].textContent=c))}
|
||||
l.La=function(a){this.na&&(a||!this.D.Aa||this.D.yc)&&(R(this,"A",this.i),R(this,"B",this.S),R(this,"C",this.T),R(this,"BC",Vc(this),4),R(this,"D",this.U),R(this,"E",this.V),R(this,"DE",Xc(this),4),R(this,"H",this.W),R(this,"L",this.Z),R(this,"HL",K(this),4),R(this,"SP",this.pa,4),R(this,"PC",this.R,4),a=Uc(this),R(this,"PS",a,4),R(this,"IF",a&512?1:0,1),R(this,"SF",a&128?1:0,1),R(this,"ZF",a&64?1:0,1),R(this,"AF",a&16?1:0,1),R(this,"PF",a&4?1:0,1),R(this,"CF",a&1?1:0,1));if(a=this.N.speed)a.textContent=
|
||||
this.D.Aa&&this.K?this.K.toFixed(2)+"Mhz":"Stopped"};l.mb=function(a){this.D.complete=!0;var b=this.D.Nd=this.I&&Jd(this.I),c=a?this.D.Vb?0:1:-1;this.D.Vb=!1;this.L=this.b=a;if(Hd(this)){do{if(b){if(Kd(this.I,this.R,c)){this.ra();break}c=1}this.la[M(this)].call(this)}while(0<this.b)}return this.D.complete?this.L-this.b:void 0===this.D.complete?0:-1};Oa(function(){for(var a=D(document,"pc8080","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Oc(d);gb(d,c)}});function Ld(){this.b-=4}
|
||||
function Hd(a){if(a.b&&a.j&255&&a.ua&512){for(var b=0;8>b&&!(a.j&1<<b);b++);a.j&=~(0>b?255:1<<b);a.ua&=-513;a.j&=-257;a.la[199|b<<3].call(a)}return a.j&256?(Mc(a),!1):!0}function Id(a,b){a.j|=1<<b;a.ua&512&&Mc(a)}function R(a,b,c,d){d=d||2;a.N[b]&&(void 0===c&&(nb(a,"Value for "+b+" is invalid"),a.ra()),c=!a.D.za||a.D.yc?t(c,d):"--------".substr(0,d),a.N[b].textContent!=c&&(a.N[b].textContent=c))}
|
||||
l.La=function(a){this.na&&(a||!this.D.za||this.D.yc)&&(R(this,"A",this.i),R(this,"B",this.S),R(this,"C",this.T),R(this,"BC",Vc(this),4),R(this,"D",this.U),R(this,"E",this.V),R(this,"DE",Xc(this),4),R(this,"H",this.W),R(this,"L",this.Z),R(this,"HL",K(this),4),R(this,"SP",this.pa,4),R(this,"PC",this.R,4),a=Uc(this),R(this,"PS",a,4),R(this,"IF",a&512?1:0,1),R(this,"SF",a&128?1:0,1),R(this,"ZF",a&64?1:0,1),R(this,"AF",a&16?1:0,1),R(this,"PF",a&4?1:0,1),R(this,"CF",a&1?1:0,1));if(a=this.N.speed)a.textContent=
|
||||
this.D.za&&this.K?this.K.toFixed(2)+"Mhz":"Stopped"};l.mb=function(a){this.D.complete=!0;var b=this.D.Nd=this.I&&Jd(this.I),c=a?this.D.Vb?0:1:-1;this.D.Vb=!1;this.L=this.b=a;if(Hd(this)){do{if(b){if(Kd(this.I,this.R,c)){this.ra();break}c=1}this.la[M(this)].call(this)}while(0<this.b)}return this.D.complete?this.L-this.b:void 0===this.D.complete?0:-1};Oa(function(){for(var a=D(document,"pc8080","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Oc(d);gb(d,c)}});function Ld(){this.b-=4}
|
||||
function Md(){I(this,O(this));this.b-=10}function Nd(){I(this,P(this));this.b-=10}function Od(){var a=O(this);Q(this,this.R);I(this,a);this.b-=17}
|
||||
var Pc=[Ld,function(){Wc(this,O(this));this.b-=10},function(){this.va(Vc(this),this.i);this.b-=7},function(){Wc(this,Vc(this)+1);this.b-=5},function(){this.S=jd(this,this.S);this.b-=5},function(){this.S=id(this,this.S);this.b-=5},function(){this.S=M(this);this.b-=7},function(){var a=this.i<<1;this.i=a&255|a>>8;ad(this,a&256);this.b-=4},Ld,function(){var a;Zc(this,a=K(this)+Vc(this));ad(this,a>>8&256);this.b-=10},function(){this.i=this.aa(Vc(this));this.b-=7},function(){Wc(this,Vc(this)-1);this.b-=
|
||||
5},function(){this.T=jd(this,this.T);this.b-=5},function(){this.T=id(this,this.T);this.b-=5},function(){this.T=M(this);this.b-=7},function(){var a=this.i<<8&256;this.i=(a|this.i)>>1;ad(this,a);this.b-=4},Ld,function(){Yc(this,O(this));this.b-=10},function(){this.va(Xc(this),this.i);this.b-=7},function(){Yc(this,Xc(this)+1);this.b-=5},function(){this.U=jd(this,this.U);this.b-=5},function(){this.U=id(this,this.U);this.b-=5},function(){this.U=M(this);this.b-=7},function(){var a=this.i<<1;this.i=a&255|
|
||||
|
|
@ -139,7 +140,7 @@ function Vd(a,b,c,d){if(d)a.ka("Unable to load system ROM (error "+d+": "+b+")")
|
|||
" ").replace(/ +$/,"").split(" "),a.A=Array(b.length),e=0;e<b.length;e++)a.A[e]=aa(b[e],16);Wd(a)}}
|
||||
function Wd(a){if(!mb(a))if(!a.w)F(a);else if(a.A&&a.u){a.j||(a.j=a.A.length);if(a.A.length!=a.j)nb(a,"ROM size ("+t(a.A.length,8,!0)+") does not match specified size ("+t(a.j,8,!0)+")");else{var b;b=a.C;if(yb(a.u,b,a.j,bc)){var c;for(c=0;c<a.A.length;c++)Db(a.u,b+c,a.A[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.F?b.push(a.F):null!=a.F&&a.F.length&&(b=a.F);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.u,g=d.j,h=[],k=d.C>>>f.ia;0<g&&k<f.X.length;)h.push(f.X[k++]),g-=f.Ja;f=d.u;d=d.j;g=0;for(e>>>=
|
||||
f.ia;0<d&&e<f.X.length;){k=h[g++];if(!k)break;f.X[e++]=k;d-=f.Ja}}delete a.A}}F(a)}}Oa(function(){for(var a=D(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Ud(d);gb(d,c)}});
|
||||
function Xd(a){z.call(this,"RAM",a,Xd);this.Ea=this.j=null;this.G=a.addr;this.K=a.size;this.F=a.load;this.w=a.exec;this.C=!1;this.A=a.file;this.J=ea(this.A);if(this.A){a=this.A;var b=fa(this.J);"json"!=b&&"hex"!=b&&(a=ja()+"/api/v1/dump?file="+this.A+"&format=bytes&decimal=true");var c=this;va(a,null,!0,function(a,b,f){f?c.ka("Unable to load RAM resource (error "+f+": "+a+")"):(cb(c.fb,a,b),(a=wa(a,b))?(c.j=a.za,c.Ea=a.Ea,null==c.F&&null!=a.Rb&&(c.F=a.Rb),null==c.w&&null!=a.Qb&&(c.w=a.Qb)):c.A=null,
|
||||
function Xd(a){z.call(this,"RAM",a,Xd);this.Ea=this.j=null;this.G=a.addr;this.K=a.size;this.F=a.load;this.w=a.exec;this.C=!1;this.A=a.file;this.J=ea(this.A);if(this.A){a=this.A;var b=fa(this.J);"json"!=b&&"hex"!=b&&(a=ja()+"/api/v1/dump?file="+this.A+"&format=bytes&decimal=true");var c=this;va(a,null,!0,function(a,b,f){f?c.ka("Unable to load RAM resource (error "+f+": "+a+")"):(cb(c.fb,a,b),(a=wa(a,b))?(c.j=a.Aa,c.Ea=a.Ea,null==c.F&&null!=a.Rb&&(c.F=a.Rb),null==c.w&&null!=a.Qb&&(c.w=a.Qb)):c.A=null,
|
||||
Yd(c))})}}A(Xd);var Zd=[0,5];Xd.prototype.Ra=function(a,b,c,d){this.u=b;this.b=c;this.I=d;Yd(this)};Xd.prototype.Ga=function(){return!0};Xd.prototype.Ka=function(){return!0};
|
||||
function Yd(a){!a.C&&a.K&&yb(a.u,a.G,a.K,1)&&(a.C=!0);if(!mb(a)){if(!a.C)w("No RAM allocated");else if(a.A){if(!a.j||!a.u)return;var b=a.G;null!==a.F&&(b=a.F);for(var c=0;c<a.j.length;c++)Db(a.u,b+c,a.j[c]);if(null!==a.w){if(256==a.w){for(c=0;c<Zd.length;c++)Db(a.u,Zd[c],118);Rc(a.b,function(a){return function(b){if(0<=Zd.indexOf(b)){var c=!1,d=a.b,e=a.I;if(5==b)switch(c=!0,d.T){case 2:$d(a,String.fromCharCode(d.V));break;case 9:for(var k=Xc(d),n="",p=255;p--;){var q=a.b.aa(k++);if(36==q)break;n+=
|
||||
String.fromCharCode(q)}$d(a,n);break;default:c=!1}c?Nd.call(d):e&&(a.g("\nCP/M vector "+u(b)),I(d,b),e.ra());b=!0}else b=!1;return b}}(a))}Tc(a.b,a.w)}delete a.j}F(a)}}Xd.prototype.reset=function(){};function $d(a,b){b=b.replace(/\r/g,"");a.Ia&&(a.Ia.value+=b,a.Ia.scrollTop=a.Ia.scrollHeight)}Oa(function(){for(var a=D(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Xd(d);gb(d,c)}});
|
||||
|
|
@ -214,14 +215,14 @@ function zf(a,b){b=De(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=a.Nb(b,c+1
|
|||
function hb(a,b,c,d,e,f,g,h){h|=256;null!=f&&(a.ta&h)!=h||a.message(b.eb+"."+(null!=d?"outPort":"inPort")+"("+u(c)+","+(f?f:"unknown")+(null!=d?","+ca(d):"")+")"+(null!=g?": "+ca(g):"")+(null!=e?" at "+Z(e):""))}
|
||||
function Le(a){var b;if(Jd(a)){if(!a.L||!a.L.length){a.L=Array(1E3);for(b=0;b<a.L.length;b++)a.L[b]=Y();a.fa=0;a.g("instruction history buffer allocated")}if(!a.K||!a.K.length)for(a.K=Array(256),b=0;b<a.K.length;b++)a.K[b]=[b,0]}else a.L&&a.L.length&&a.g("instruction history buffer freed"),a.fa=0,a.L=[],a.K=[]}l.cb=function(a){if(!Af(this))return!1;this.b.cb(a);return!0};
|
||||
l.mb=function(a,b,c){if(!Af(this))return!1;this.J=0;a||Jd(this)&&Kd(this,this.b.R,0);try{var d=this.b.mb(a);0<d&&(this.J+=d,Ic(this.b,d,!0),Fc(this.b,d),this.ba++)}catch(e){"number"!=typeof e&&(this.J=0,nb(this.b,e.stack||e.message))}!1!==c&&Ec(this.b);this.La(b||!1);return 0<this.J};l.ra=function(a){this.b&&this.b.ra(a)};l.La=function(a){void 0===a&&(a=!0);this.M=Y(this.b.R);a&&1!=this.Y?Bf(this):Cf(this)};
|
||||
function Af(a){var b;if(b=a.b&&mb(a.b))b=a.b,b.D.xa?b=!0:(b.g(b.toString()+" not powered"),b=!1);b&&!lb(a.b)?(a=a.b,a.D.error?(a.g(a.toString()+" error"),a=!0):a=!1,a=!a):a=!1;return a}l.Ga=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};l.Ka=function(a,b){b&&this.g(a?"suspending":"shutting down");return a?this.save():!0};l.reset=function(a){Le(this);this.ba=this.na=0;this.la=null;this.J=0;this.M=Y(this.b.R);this.D.Aa=!1;Df(this);a||this.La()};
|
||||
l.save=function(){var a=new J(this);a.set(0,uf(this.M));a.set(1,uf(this.ca));a.set(2,[this.w,this.P,this.ta]);a.set(3,this.G);return a.data()};l.restore=function(a){var b=0;void 0!==a[2]&&(this.M=vf(a[b++]),this.ca=vf(a[b++]),this.w=a[b][0],"string"==typeof this.w&&(this.w=[this.w]),this.P=a[b][1],this.ta|=a[b][2]);a[3]&&(this.G=a[3]);return!0};l.start=function(a,b){this.Y||this.g("running");this.D.Aa=!0;this.pb=a;this.qb=b};
|
||||
l.stop=function(a,b){if(this.D.Aa){this.D.Aa=!1;this.J=b-this.qb;if(!this.Y){b="stopped";if(this.J){a-=this.pb;var c=0<a?Math.round(1E3*this.J/a):0;b+=" (";Jd(this)&&(b+=this.ba+" opcodes, ",this.na-=this.ba,this.ba=0);b+=this.J+" cycles, "+a+" ms, "+c+" hz)"}else jb(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.g(b)}this.La(!0);this.zb();Df(this,this.b.R)}};function Jd(a){return 1<a.F.length||!!a.ja}
|
||||
function Af(a){var b;if(b=a.b&&mb(a.b))b=a.b,b.D.xa?b=!0:(b.g(b.toString()+" not powered"),b=!1);b&&!lb(a.b)?(a=a.b,a.D.error?(a.g(a.toString()+" error"),a=!0):a=!1,a=!a):a=!1;return a}l.Ga=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};l.Ka=function(a,b){b&&this.g(a?"suspending":"shutting down");return a?this.save():!0};l.reset=function(a){Le(this);this.ba=this.na=0;this.la=null;this.J=0;this.M=Y(this.b.R);this.D.za=!1;Df(this);a||this.La()};
|
||||
l.save=function(){var a=new J(this);a.set(0,uf(this.M));a.set(1,uf(this.ca));a.set(2,[this.w,this.P,this.ta]);a.set(3,this.G);return a.data()};l.restore=function(a){var b=0;void 0!==a[2]&&(this.M=vf(a[b++]),this.ca=vf(a[b++]),this.w=a[b][0],"string"==typeof this.w&&(this.w=[this.w]),this.P=a[b][1],this.ta|=a[b][2]);a[3]&&(this.G=a[3]);return!0};l.start=function(a,b){this.Y||this.g("running");this.D.za=!0;this.pb=a;this.qb=b};
|
||||
l.stop=function(a,b){if(this.D.za){this.D.za=!1;this.J=b-this.qb;if(!this.Y){b="stopped";if(this.J){a-=this.pb;var c=0<a?Math.round(1E3*this.J/a):0;b+=" (";Jd(this)&&(b+=this.ba+" opcodes, ",this.na-=this.ba,this.ba=0);b+=this.J+" cycles, "+a+" ms, "+c+" hz)"}else jb(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.g(b)}this.La(!0);this.zb();Df(this,this.b.R)}};function Jd(a){return 1<a.F.length||!!a.ja}
|
||||
function Kd(a,b,c){var d=a.b;if(0<c&&(a.ja&&!--a.ja||jc(a,b,1,a.F)))return!0;0<=c&&a.K.length&&(a.ba++,b=Bb(a.u,b),null!=b&&(a.K[b][1]++,b=a.L[a.fa],b.H=d.R,b.Qa=!1,++a.fa==a.L.length&&(a.fa=0)));return!1}function Sb(a,b,c){a.g("break on input from port "+u(b)+": "+t(c));a.ra(!0)}function Wb(a,b,c){a.g("break on output to port "+u(b)+": "+t(c));a.ra(!0)}
|
||||
function Ke(a){var b,c;a.F=["bp"];if(a.O)for(b=1;b<a.O.length;b++){c=a.O[b];var d=a.u;kc(d.X[Se(c)>>>d.ia],!1)}a.O=["br"];if(a.C)for(b=1;b<a.C.length;b++)c=a.C[b],d=a.u,kc(d.X[Se(c)>>>d.ia],!0);a.C=["bw"];a.Xa=0}l.$a=function(a,b,c){var d=!0;c||Ef(this,a,b,!1,!0);if(a!=this.F){var e=Se(b);if(-1===e)this.g("invalid address: "+Z(b.H)),d=!1;else{var f=this.u;f.X[e>>>f.ia].$a(e&f.u,a==this.C)}}d&&(a.push(b),c?b.Qa=!0:(Ff(this,a,a.length-1,"set"),Le(this)));return d};
|
||||
function Ef(a,b,c,d,e){var f=!1;c=Se(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==Se(h)&&(!d||h.Qa)){f=!0;h.Qa||e||Ff(a,b,g,"cleared");b.splice(g,1);b!=a.F&&(d=a.u,kc(d.X[c>>>d.ia],b==a.C));h.Qa||Le(a);break}}return f}function Gf(a,b){for(var c=1;c<b.length;c++)Ff(a,b,c);return b.length-1}function Ff(a,b,c,d){c=b[c];a.g(b[0]+" "+Z(c.H)+(d?" "+d:c.Ec?' "'+c.Ec+'"':""))}
|
||||
function Df(a,b){if(void 0!==b)jc(a,b,1,a.F,!0),a.Y=0;else for(b=1;b<a.F.length;b++){var c=a.F[b];if(c.Qa){if(!Ef(a,a.F,c,!0))break;b=0}}}
|
||||
function jc(a,b,c,d,e){var f=!1;if(!a.Xa++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Qa)for(var k=Se(h),n=0;n<c;n++)if(b+n==k){var p,f=!0;h.Qa&&(Ef(a,d,h,!0),e=!0);if(p=h.Id){for(var f=!1,q=0;q<p.length;q++)if(!Hf(a,p[q],!0)){if(p[q].indexOf("if")){f=!0;break}for(var x=q+1;x<p.length&&p[x].indexOf("else");x++)q++;if(x==p.length){f=!0;break}}a.b.D.Aa||(f=!0)}if(f){e||Ff(a,d,g,"hit");break}}}a.Xa--;return f}
|
||||
function jc(a,b,c,d,e){var f=!1;if(!a.Xa++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Qa)for(var k=Se(h),n=0;n<c;n++)if(b+n==k){var p,f=!0;h.Qa&&(Ef(a,d,h,!0),e=!0);if(p=h.Id){for(var f=!1,q=0;q<p.length;q++)if(!Hf(a,p[q],!0)){if(p[q].indexOf("if")){f=!0;break}for(var x=q+1;x<p.length&&p[x].indexOf("else");x++)q++;if(x==p.length){f=!0;break}}a.b.D.za||(f=!0)}if(f){e||Ff(a,d,g,"hit");break}}}a.Xa--;return f}
|
||||
function If(a,b,c,d){for(var e=Y(b.H),f=a.aa(b,1),g=a.Ha[f],h="",k=(8086!=a.style?Oe:Pe)[g[0]],n=g.length-1,p=0,q,x=1;x<=n;x++){var v="";q=g[x];if(void 0!==q&&!(q&16384&&a.style==Je)){var r=q&240;if(r){var y=q&15;y?p=y:q|=p;q&61440||(q|=1==x?8192:4096);if(r&32)a:{v=a;r=q;y=b;switch(r&15){case 1:y=t(v.aa(y,1),2);break;case 2:y=t(v.aa(y,1)<<24>>24,4);break;case 3:y=t(v.ab(y,2),4);break;default:v="imm("+u(r)+")";break a}8086==v.style&&r&64?y="["+y+"]":r&16||(y=(v.style==Je?"$":"0x")+y);v=y}else r&16?
|
||||
(v=(q&3840)>>8,r=Qe[v],8086==a.style&&q&64&&(6==v&&(r="HL"),r="["+r+"]"),v=r):r&128&&(v=(f>>3&7).toString());if(!v||!v.length){h="INVALID";break}0<h.length&&(h+=",");h+=v||"???"}}}f="";g=Z(e.H)+" ";if(-1!==e.H&&-1!==b.H){do if(f+=t(a.aa(e,1),2),null==e.H)break;while(e.H!=b.H)}g+=ma(f,10);g=g+(q&32768?"*":" ")+ma(k,7);h&&(g+=" "+h);c&&(g=ma(g,40)+";"+c,g=a.b.D.hb?g+("cycles="+Gc(a.b).toString()+" cs="+t(a.b.vb)):g+(null!=d?"="+d.toString():""));return g}
|
||||
function Jf(a,b){switch(b){case "IF":a=a.b.ua&512;break;case "SF":a=ed(a.b);break;case "ZF":a=dd(a.b);break;case "AF":a=cd(a.b);break;case "PF":a=bd(a.b);break;case "CF":a=$c(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}function Kf(a,b){return Qe[b]+"="+yf(a,b)+" "}function Lf(a){return Kf(a,7)+Kf(a,8)+Kf(a,9)+Kf(a,10)+Kf(a,11)+Jf(a,"IF")+Jf(a,"SF")+Jf(a,"ZF")+Jf(a,"AF")+Jf(a,"PF")+Jf(a,"CF")}l.xc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
|
|
@ -245,7 +246,7 @@ da){for(T in sb)if(f[1]==T){var Ye=a.wa[T];Ye?(f.shift(),f.shift(),Ye(f)):a.g("n
|
|||
Ib&&ua!=a.fa;){var cf=Ga[ua++];if(null==cf.H)break;var Jb=Y(cf.H),lg=ia--,df=If(a,Jb,"history",lg);(!md.length||0<=df.indexOf(md[0]))&&a.g(df);Jb.Mb&&(ua+=Jb.Mb,Ib-=Jb.Mb,ia-=Jb.Mb);ua>=Ga.length&&(ua=0);a.gb=ia;bf++;Ib--}}bf||(a.g("no "+af+"history available"),a.gb=void 0)}else{var oc=Te(a,X);if(oc){var pc=0;ta&&("l"==ta.charAt(0)&&(ta=ta.substr(1)||Eb),pc=Ee(a,ta)>>>0,65536<pc&&(pc=65536));for(var Kb="",qc="dd"==da?4:"dw"==da?2:1,rc=qc*pc||128,mg=rc+15>>4||1;mg--&&0<rc;){var sc=0,nd=0,Lb,od="",
|
||||
ef="",X=Z(oc.H);for(Lb=16;0<Lb&&0<rc;Lb--){var tc=a.aa(oc,1),sc=sc|tc<<(nd++<<3);nd==qc&&(od+=t(sc,2*qc),od+=1==qc?9==Lb?"-":" ":" ",sc=nd=0);ef+=32<=tc&&128>tc?String.fromCharCode(tc):".";rc--}Kb&&(Kb+="\n");Kb+=X+" "+od+(Lb?"":" "+ef)}Kb&&a.g(Kb);a.Va=oc}}}}break;case "e":if("else"==f[0])break;var uc=1,ff=255,gf=a.aa,hf=a.va;"ew"==f[0]&&(uc=2,ff=65535,gf=a.ab,hf=a.Jb);var jf=uc<<1,kf=f[1];if(null==kf)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a");
|
||||
else{var vc=Te(a,kf);if(vc)for(var wc=2;wc<f.length;wc++){var Mb=Ce(a,f[wc]);if(void 0===Mb){a.g("unrecognized value: "+f[wc]);break}Mb&~ff&&a.g("warning: "+t(Mb)+" exceeds "+uc+"-byte value");var ng=gf.call(a,vc);a.g("changing "+Z(vc.H)+" from "+t(ng,jf,!0)+" to "+t(Mb,jf,!0));hf.call(a,vc,Mb,uc)}}break;case "f":Of(a,f[1]);break;case "g":a:{var lf=f[1],og=b;if(void 0!==lf){var pd=Te(a,lf,!0);if(!pd)break a;wf(a,pd,og);a.$a(a.F,pd,!0)}a.cb(!0)||c||a.g("cpu busy or unavailable, run command ignored")}break;
|
||||
case "h":a:{var qd;if(a.D.Aa)qd="halting",a.ra();else{if(lb(a,!0))break a;qd="already halted"}c||a.g(qd)}break;case "i":if("if"==f[0]){var rd;var Nb=b.substr(2),Nb=na(Nb);Ce(a,Nb)?(c||a.g("true: "+Nb),rd=!0):(c||a.g("false: "+Nb),rd=!1);rd||(d=!1);break}if("int"==f[0]){var xc;var pg=f[1];if(a.b.ua&512){var sd=Ce(a,pg);null==sd?xc=!1:(a.g("requesting interrupt level "+sd),Id(a.b,sd),xc=!0)}else a.g("interrupts disabled (use rif=1 to enable)"),xc=!1;xc||(d=!1);break}var td=f[1];if(td&&"?"!=td){var ud=
|
||||
case "h":a:{var qd;if(a.D.za)qd="halting",a.ra();else{if(lb(a,!0))break a;qd="already halted"}c||a.g(qd)}break;case "i":if("if"==f[0]){var rd;var Nb=b.substr(2),Nb=na(Nb);Ce(a,Nb)?(c||a.g("true: "+Nb),rd=!0):(c||a.g("false: "+Nb),rd=!1);rd||(d=!1);break}if("int"==f[0]){var xc;var pg=f[1];if(a.b.ua&512){var sd=Ce(a,pg);null==sd?xc=!1:(a.g("requesting interrupt level "+sd),Id(a.b,sd),xc=!0)}else a.g("interrupts disabled (use rif=1 to enable)"),xc=!1;xc||(d=!1);break}var td=f[1];if(td&&"?"!=td){var ud=
|
||||
Ee(a,td);if(void 0!==ud){var qg=Rb(a.u,ud);a.g(u(ud)+": "+ca(qg))}}else a.g("input commands:"),a.g("\ti [p]\tread port [p]"),a.g("warning: port accesses can affect hardware state");break;case "k":var rg=f[0];if("?"==f[1])a.g("stack trace commands:"),a.g("\tk\tshow frame addresses"),a.g("\tks\tshow symbol information");else{var vd=0,mf=Y(),Ob=Y(a.b.pa);for(a.g("stack trace for "+Z(Ob.H));10>vd;){for(var Za=null,sg=256;65536>Ob.H>>>0;){mf.H=a.ab(Ob,2);if(null==Ob.H||!sg--)break;for(var tg=a,yc=mf,nf=
|
||||
null,Pb=yc.H,of=Pb,wd=1;6>=wd&&Pb;wd++){if(2<wd){yc.H=Pb;var zc=If(tg,yc);if(0<=zc.indexOf("CALL")){var pf=zc.indexOf(" ");if(Pb+(zc.indexOf(" ",pf+1)-pf-1)/2==of){nf=zc;break}}}Pb--}yc.H=of;if(Za=nf)break}if(!Za||null==Za)break;var qf=null;if("ks"==rg){var rf=Za.match(/[0-9A-F]+$/);rf&&(qf=Qf(a,rf[0]))}Za=ma(Za,50)+" ;"+(qf||"stack="+Z(Ob.H));a.g(Za);vd++}vd||a.g("no return addresses found")}break;case "l":"ln"==f[0]&&Qf(a,f[1],!0);break;case "m":a:{var Ha,Ia=null,N=f[1];"?"==N&&(N=void 0);if(void 0!==
|
||||
N){var Ra=0;if("all"==N)Ra=1878917119,N=null;else if("on"==N)Ia=!0,N=null;else if("off"==N)Ia=!1,N=null;else{"keys"==N&&(N="key");"kbd"==N&&(N="keyboard");for(Ha in sb)if(N==Ha){Ra=sb[Ha];Ia=!!(a.ta&Ra);break}if(!Ra){a.g("unknown message category: "+N);break a}}if(Ra)if("on"==f[2])a.ta|=Ra,Ia=!0;else if("off"==f[2]&&(a.ta&=~Ra,Ia=!1,1073741824==Ra)){for(var xd=0;xd<a.ma.length;xd++)a.g(a.ma[xd]);a.ma=[]}}var ug=0,Qb="";for(Ha in sb)if(!N||N==Ha){var vg=!!(a.ta&sb[Ha]);if(null===Ia||Ia==vg)Qb&&(Qb+=
|
||||
|
|
|
|||
|
|
@ -38,24 +38,24 @@ var ia={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9
|
|||
function ka(){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 la(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"==
|
||||
typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g}
|
||||
function ma(a,b){var c,d={Y:null,wa:null,jb:null,ib:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g=eval("("+b+")");d.jb=g.load;d.ib=g.exec;if(e=g.bytes)d.Y=e;else if(e=g.words)for(d.Y=Array(2*e.length),f=c=0;c<e.length;c++)d.Y[f++]=e[c]&255,d.Y[f++]=e[c]>>8&255;else if(e=g.data)for(d.Y=Array(4*e.length),f=c=0;c<e.length;c++)d.Y[f++]=e[c]&255,d.Y[f++]=e[c]>>8&255,d.Y[f++]=e[c]>>16&255,d.Y[f++]=e[c]>>24&255;else d.Y=g;d.wa=g.symbols;d.Y.length?1==d.Y.length&&(q(d.Y[0]),d=null):(q("Empty resource: "+
|
||||
a),d=null)}catch(h){q("Resource data error: "+h.message),d=null}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),d.Y=Array(a.length),c=0;c<a.length;c++)d.Y[c]=parseInt(a[c],16);return d}function ea(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function na(a){var b=!1;window&&(b=window.confirm(a));return b}var oa=null;
|
||||
function pa(){if(null==oa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}oa=a}return oa}function qa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function ra(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}
|
||||
function ta(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var ua={init:[],show:[],exit:[]},va=!1,wa=!1,xa=!0;function ya(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function za(a){ua.init.push(a)}
|
||||
function Aa(a){if(xa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){Ba("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks.",void 0,void 0)}}function Ca(a){!xa&&a?(xa=!0,va&&Da("init"),wa&&Da("show")):xa=a}function Da(a){ua[a]&&Aa(ua[a])}ya("onload",function(){va=!0;Aa(ua.init)});ya("onpageshow",function(){wa=!0;Aa(ua.show)});ya(ta("Opera")||ta("iOS")?"onunload":"onbeforeunload",function(){Aa(ua.exit)});
|
||||
function r(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.yb=b.comment;this.Qc=b;b=this.id.indexOf(".");0>b?this.Va=this.id:(this.ya=this.id.substr(0,b),this.Va=this.id.substr(b+1));this[a]=c;this.l={ready:!1,Ya:!1,gb:!1,Z:!1,error:!1};this.ab=null;this.l.error=!1;this.A={};this.O=null;v.push(this)}var Ea=void 0,Fa={};
|
||||
function ma(a,b){var c,d={aa:null,wa:null,jb:null,ib:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.jb=g.load;d.ib=g.exec;if(e=g.bytes)d.aa=e;else if(e=g.words)for(d.aa=Array(2*e.length),f=c=0;c<e.length;c++)d.aa[f++]=e[c]&255,d.aa[f++]=e[c]>>8&255;else if(e=g.data)for(d.aa=Array(4*e.length),f=c=0;c<e.length;c++)d.aa[f++]=
|
||||
e[c]&255,d.aa[f++]=e[c]>>8&255,d.aa[f++]=e[c]>>16&255,d.aa[f++]=e[c]>>24&255;else d.aa=g;d.wa=g.symbols;d.aa.length?1==d.aa.length&&(q(d.aa[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){q("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.aa=e)}return d}
|
||||
function ea(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function na(a){var b=!1;window&&(b=window.confirm(a));return b}var oa=null;function pa(){if(null==oa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}oa=a}return oa}
|
||||
function qa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function ra(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function ta(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var ua={init:[],show:[],exit:[]},va=!1,wa=!1,xa=!0;
|
||||
function ya(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function za(a){ua.init.push(a)}function Aa(a){if(xa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){Ba("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks.",void 0,void 0)}}function Ca(a){!xa&&a?(xa=!0,va&&Da("init"),wa&&Da("show")):xa=a}function Da(a){ua[a]&&Aa(ua[a])}ya("onload",function(){va=!0;Aa(ua.init)});
|
||||
ya("onpageshow",function(){wa=!0;Aa(ua.show)});ya(ta("Opera")||ta("iOS")?"onunload":"onbeforeunload",function(){Aa(ua.exit)});function r(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.yb=b.comment;this.Qc=b;b=this.id.indexOf(".");0>b?this.Va=this.id:(this.ya=this.id.substr(0,b),this.Va=this.id.substr(b+1));this[a]=c;this.l={ready:!1,Ya:!1,gb:!1,Y:!1,error:!1};this.ab=null;this.l.error=!1;this.A={};this.O=null;v.push(this)}var Ea=void 0,Fa={};
|
||||
if(window){Ea||(Ea=window.location.search.substr(1));for(var Ga,Ha=/\+/g,Ia=/([^&=]+)=?([^&]*)/g;Ga=Ia.exec(Ea);)Fa[decodeURIComponent(Ga[1].replace(Ha," "))]=decodeURIComponent(Ga[2].replace(Ha," "))}function Ja(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
|
||||
function w(a,b){b||(b=r);a.prototype=Ja(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ka=window.PCjs.Machines||(window.PCjs.Machines={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else Ka={},v=[];function La(a,b,c){Ka[a]&&b&&(Ka[a][b]=c)}function Ba(a,b,c){b||q((c?c+": ":"")+a)}
|
||||
function Ma(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<v.length;b++){var d=v[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Na(a){if(void 0!==a){var b;for(b=0;b<v.length;b++)if(v[b].id===a)return v[b]}return null}function Oa(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<v.length;d++)if(c)c==v[d]&&(c=null);else if(!(a!=v[d].type||b&&v[d].id.indexOf(b)))return v[d]}return null}
|
||||
function z(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b}function Qa(a,b){b=A(b.parentNode,"pc8080-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pc8080-binding":(g=z(f))&&g.binding&&a.V(g.type,g.binding,f,g.value),l=h.length}}}}
|
||||
function y(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b}function Qa(a,b){b=A(b.parentNode,"pc8080-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pc8080-binding":(g=y(f))&&g.binding&&a.V(g.type,g.binding,f,g.value),l=h.length}}}}
|
||||
function A(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
||||
r.prototype={constructor:r,parent:null,toString:function(){return this.name?this.name:this.id||this.type},V:function(a,b,c){switch(b){case "clear":return this.A[b]||(this.A[b]=c,c.onclick=function(a){return function(){a.A.print&&(a.A.print.value="")}}(this)),!0;case "print":return this.A[b]||(this.xa=this.A[b]=c,c.value="",this.ea=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||
this.K=function(a){this.ea(a,this.Va)}),!0;default:return!1}},log:function(){},ea:function(){},status:function(a){this.ea(this.Va+": "+a)},K:function(a,b,c){Ba(a,b,c||this.type)},ga:function(){return this.l.Z=!0},ia:function(a,b){b&&(this.l.Z=!1);return!0}};function Ra(a,b){if(a.l.gb)return a.l.Ya=!1,a.l.gb=!1;if(a.l.error)return a.ea(a.toString()+" error"),!1;a.l.Ya=b;return a.l.Ya}function B(a){if(!a.l.error&&(a.l.ready=!0,a.l.ready)){var b=a.ab;a.ab=null;b&&b()}}
|
||||
this.K=function(a){this.ea(a,this.Va)}),!0;default:return!1}},log:function(){},ea:function(){},status:function(a){this.ea(this.Va+": "+a)},K:function(a,b,c){Ba(a,b,c||this.type)},ga:function(){return this.l.Y=!0},ia:function(a,b){b&&(this.l.Y=!1);return!0}};function Ra(a,b){if(a.l.gb)return a.l.Ya=!1,a.l.gb=!1;if(a.l.error)return a.ea(a.toString()+" error"),!1;a.l.Ya=b;return a.l.Ya}function B(a){if(!a.l.error&&(a.l.ready=!0,a.l.ready)){var b=a.ab;a.ab=null;b&&b()}}
|
||||
function Sa(a,b){b&&(a.l.ready?b():a.ab=b);return a.l.ready}Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});
|
||||
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
|
||||
var Ta="undefined"!==typeof ArrayBuffer,Ua=[1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,
|
||||
0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1];function Va(a){r.call(this,"Panel",a,Va)}w(Va);k=Va.prototype;k.V=function(a,b,c,d){return this.v&&this.v.V(a,b,c,d)||this.a&&this.a.V(a,b,c,d)||this.m&&this.m.V(a,b,c,d)?!0:this.parent.V.call(this,a,b,c,d)};k.ra=function(a,b,c,d){this.v=a;this.j=b;this.a=c;this.O=d;this.m=Wa(a,"Keyboard")};k.ga=function(a,b){b||Xa();return!0};k.ia=function(){return!0};k.Da=function(){};
|
||||
function Xa(){for(var a=!1,b=A(document,"pc8080","panel"),c=0;c<b.length;c++){var d=b[c],e=z(d),f=Na(e.id);f||(a=!0,f=new Va(e));Qa(f,d);a&&B(f)}}za(Xa);
|
||||
function Xa(){for(var a=!1,b=A(document,"pc8080","panel"),c=0;c<b.length;c++){var d=b[c],e=y(d),f=Na(e.id);f||(a=!0,f=new Va(e));Qa(f,d);a&&B(f)}}za(Xa);
|
||||
function Ya(a,b,c){r.call(this,"Bus",a,Ya);this.a=b;this.O=c;this.s=a.busWidth||16;this.u=Math.pow(2,this.s);this.g=this.u-1|0;this.j=(this.s>>1)+2;10>this.j&&(this.j=10);15<this.j&&(this.j=15);this.c=1<<this.j;this.w=this.c>>2;this.f=this.c-1;this.i=this.u/this.c|0;this.o=this.i-1;this.m=[];this.v=[];this.B=[];this.C=[];a=new C;Za(a,this.O);this.b=Array(this.i);for(b=0;b<this.i;b++)this.b[b]=a;B(this)}w(Ya);Ya.prototype.reset=function(){};Ya.prototype.ga=function(a,b){b||this.reset();return!0};
|
||||
function $a(a,b,c,d){for(var e=b,f=c,g=e>>>a.j;0<f&&g<a.b.length;){var h=a.b[g],l=g*a.c,n=a.c-(e-l);n>f&&(n=f);if(h&&h.size){if(h.type==d){if(e+f<=h.Pa)return h.fb+=h.Pa-e,h.Pa=e,!0;if(e>=h.Pa+h.fb){n=h.size-(e-l);n>f&&(n=f);h.fb=e-h.Pa+n;e=l+a.c;f-=n;g++;continue}}return ab(1,e,f)}e=new C(e,n,a.c,d);Za(e,a.O,h);a.b[g++]=e;e=l+a.c;f-=n}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+bb[d]+" at "+p(b,4,!0)),!0):ab(2,b,c)}Ya.prototype.J=function(a){return this.b[(a&this.g)>>>this.j].Sa(a&this.f,a)};
|
||||
function cb(a,b){return a.b[(b&a.g)>>>a.j].eb(b&a.f,b)}function db(a,b){var c=b&a.f,d=(b&a.g)>>>a.j;return c!=a.f?a.b[d].od(c,b):a.b[d++].Sa(c,b)|a.b[d&a.o].Sa(0,b+1)<<8}Ya.prototype.ba=function(a,b){this.b[(a&this.g)>>>this.j].Ta(a&this.f,b&255,a)};function eb(a,b,c){a.b[(b&a.g)>>>a.j].Lb(b&a.f,c&255,b)}function gb(a,b,c){var d=b&a.f,e=(b&a.g)>>>a.j;d!=a.f?a.b[e].pd(d,c&65535,b):(a.b[e++].Ta(d,c&255,b),a.b[e&a.o].Ta(0,c>>8&255,b+1))}
|
||||
|
|
@ -63,17 +63,17 @@ function hb(a){for(var b=0,c=[],d=0;d<a.i;d++){var e=a.b[d];if(e.oa||e.Eb){c[b++
|
|||
function jb(a,b,c,d){void 0===d&&(d=0);if(c)for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(h)for(var l=+e+d;l<=g;l++)void 0!==f.v[l]?q("Output port "+p(l,4,!0)+" already registered"):f.v[l]=[h,!1]}}function ab(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}var kb;if(Ta){var lb=new ArrayBuffer(2);(new DataView(lb)).setUint16(0,256,!0);kb=256===(new Uint16Array(lb))[0]}else kb=!1;var mb=kb;
|
||||
function C(a,b,c,d){this.id=nb+=2;this.a=null;this.Pa=a;this.fb=b;this.size=c||0;this.type=d||ob;this.c=d==pb;Za(this);this.oa=this.Eb=!1;if(c)if(Ta)this.j=new ArrayBuffer(c),this.A=new DataView(this.j,0,c),this.b=new Uint8Array(this.j,0,c),this.i=new Uint16Array(this.j,0,c>>1),this.a=new Int32Array(this.j,0,c>>2),qb(this,mb?rb:sb);else{this.a=Array(c>>2);for(a=0;a<this.a.length;a++)this.a[a]=0;qb(this,tb)}else qb(this)}var ob=0,pb=2,bb=["NONE","RAM","ROM","VID","H/W"],nb=0;
|
||||
C.prototype={constructor:C,parent:null,save:function(){var a,b;if(Ta)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.A.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(a&&this.size==a.length<<2){var b;if(Ta)for(b=0;b<a.length;b++)this.A.setInt32(b<<2,a[b],!0);else this.a=a;return this.oa=!0}return!1},m:function(){return 255},o:function(){},v:function(a,b){return this.Sa(a++,b++)|this.Sa(a,b)<<8},s:function(a,b,c){this.Ta(a++,b&255,c++);this.Ta(a,b>>8,c)},C:function(a){return this.a[a>>
|
||||
2]>>>((a&3)<<3)&255},I:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},S:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.oa=!0},aa:function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|b>>8);this.oa=!0},w:function(a,b){return this.eb(a,b)},H:function(a,b){return this.Ib(a,b)},N:function(a,b,c){this.c||this.Lb(a,b,c)},W:function(a,
|
||||
2]>>>((a&3)<<3)&255},I:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},S:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.oa=!0},Z:function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|b>>8);this.oa=!0},w:function(a,b){return this.eb(a,b)},H:function(a,b){return this.Ib(a,b)},N:function(a,b,c){this.c||this.Lb(a,b,c)},W:function(a,
|
||||
b,c){this.c||this.X(a,b,c)},u:function(a){return this.b[a]},B:function(a){return this.b[a]},G:function(a){return this.A.getUint16(a,!0)},M:function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.i[a>>1]},L:function(a,b){this.b[a]=b;this.oa=!0},R:function(a,b){this.b[a]=b;this.oa=!0},U:function(a,b){this.A.setUint16(a,b,!0);this.oa=!0},ya:function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.i[a>>1]=b;this.oa=!0}};function Za(a,b,c){a.O=b;a.f=a.g=0;c&&((a.f=c.f)&&ub(a,vb,!1),(a.g=c.g)&&wb(a,vb,!1))}
|
||||
function wb(a,b,c){c&&a.g||(a.Ta=!a.c&&b[1]||a.o,a.pd=!a.c&&b[3]||a.s);if(c||void 0===c)a.Lb=b[1]||a.o,a.X=b[3]||a.s}function ub(a,b,c){c&&a.f||(a.Sa=b[0]||a.m,a.od=b[2]||a.v);if(c||void 0===c)a.eb=b[0]||a.m,a.Ib=b[2]||a.v}function qb(a,b){b||(b=xb);ub(a,b,void 0);wb(a,b,void 0)}var xb=[],tb=[C.prototype.C,C.prototype.S,C.prototype.I,C.prototype.aa],vb=[C.prototype.w,C.prototype.N,C.prototype.H,C.prototype.W];
|
||||
if(Ta)var sb=[C.prototype.u,C.prototype.L,C.prototype.G,C.prototype.U],rb=[C.prototype.B,C.prototype.R,C.prototype.M,C.prototype.ya];function yb(a,b){r.call(this,"CPU",a,yb);var c=a.multiplier||1;this.ma=a.cycles||b;this.L=c;this.Fa=Math.round(this.ma/1E4)/100;this.U=this.Fa*this.L;this.l.pa=!1;this.l.Jb=!1;this.l.Qa=a.autoStart;this.l.Cb=!1;this.l.Za=!1;this.ua=this.X=0;this.va=a.csStart;this.aa=a.csInterval;this.ja=a.csStop;this.G=[];this.Xa=this.lb.bind(this);B(this)}w(yb);var zb=["power","reset"];
|
||||
function wb(a,b,c){c&&a.g||(a.Ta=!a.c&&b[1]||a.o,a.pd=!a.c&&b[3]||a.s);if(c||void 0===c)a.Lb=b[1]||a.o,a.X=b[3]||a.s}function ub(a,b,c){c&&a.f||(a.Sa=b[0]||a.m,a.od=b[2]||a.v);if(c||void 0===c)a.eb=b[0]||a.m,a.Ib=b[2]||a.v}function qb(a,b){b||(b=xb);ub(a,b,void 0);wb(a,b,void 0)}var xb=[],tb=[C.prototype.C,C.prototype.S,C.prototype.I,C.prototype.Z],vb=[C.prototype.w,C.prototype.N,C.prototype.H,C.prototype.W];
|
||||
if(Ta)var sb=[C.prototype.u,C.prototype.L,C.prototype.G,C.prototype.U],rb=[C.prototype.B,C.prototype.R,C.prototype.M,C.prototype.ya];function yb(a,b){r.call(this,"CPU",a,yb);var c=a.multiplier||1;this.ma=a.cycles||b;this.L=c;this.Fa=Math.round(this.ma/1E4)/100;this.U=this.Fa*this.L;this.l.pa=!1;this.l.Jb=!1;this.l.Qa=a.autoStart;this.l.Cb=!1;this.l.Za=!1;this.ua=this.X=0;this.va=a.csStart;this.Z=a.csInterval;this.ja=a.csStop;this.G=[];this.Xa=this.lb.bind(this);B(this)}w(yb);var zb=["power","reset"];
|
||||
k=yb.prototype;k.ra=function(a,b,c,d){this.v=a;this.j=b;this.O=d;for(b=0;b<zb.length;b++)(c=this.A[zb[b]])&&this.v.V(null,zb[b],c);this.M=Wa(a,"ChipSet");a=Ab(a,"autoStart");null!=a&&(this.l.Qa="true"==a?!0:"false"==a?!1:!!a);B(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};k.ga=function(a,b){if(!b){if(a&&this.restore){Bb(this);if(!this.restore(a))return!1;Cb(this)}else this.reset();this.ea("No debugger detected")}Db(this);return!0};
|
||||
k.ia=function(a){return a?this.save():!0};k.Qa=function(){return this.l.Qa||void 0===this.A.run?(this.lb(!0),!0):!1};k.Fb=function(){return 0};function Cb(a){void 0===a.va&&(a.va=0);void 0===a.aa&&(a.aa=-1);void 0===a.ja&&(a.ja=-1);a.l.Za=0<=a.va&&0<a.aa;a.l.Za&&(a.ua=0,a.X=a.va-a.H)}
|
||||
k.V=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.A[b]=c;a=!0;break;case "run":this.A[b]=c;c.onclick=function(){var a;if(a=d.v)if(a=d.v,a.l.Z)a=!0;else{var b=null,c,h=Ma(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.l.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.l.Z);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.l.ready?"powered yet":"ready yet"+(b.ab?" (waiting for notification)":""))+".");a=!1}a&&(d.l.pa?Eb(d):d.lb())};a=!0;
|
||||
k.ia=function(a){return a?this.save():!0};k.Qa=function(){return this.l.Qa||void 0===this.A.run?(this.lb(!0),!0):!1};k.Fb=function(){return 0};function Cb(a){void 0===a.va&&(a.va=0);void 0===a.Z&&(a.Z=-1);void 0===a.ja&&(a.ja=-1);a.l.Za=0<=a.va&&0<a.Z;a.l.Za&&(a.ua=0,a.X=a.va-a.H)}
|
||||
k.V=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.A[b]=c;a=!0;break;case "run":this.A[b]=c;c.onclick=function(){var a;if(a=d.v)if(a=d.v,a.l.Y)a=!0;else{var b=null,c,h=Ma(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.l.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.l.Y);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.l.ready?"powered yet":"ready yet"+(b.ab?" (waiting for notification)":""))+".");a=!1}a&&(d.l.pa?Eb(d):d.lb())};a=!0;
|
||||
break;case "speed":this.A[b]=c;a=!0;break;case "setSpeed":this.A[b]=c,c.onclick=function(){Fb(d,d.L<<1,!0)},c.textContent=this.U.toFixed(2)+"Mhz",a=!0}return a};function Gb(a,b){var c=1;b&&1<a.L&&a.R&&(c=a.R/a.Fa);a.Na=Math.round(1E3/30);a.Aa=Math.floor(a.ma/30*c);b||(a.la=a.Aa);a.Ga=0}function Hb(a){return a.H+a.N+a.W-a.a}function Bb(a){a.R=0;a.Oa=0;a.H=a.N=a.W=a.a=0;Cb(a);Fb(a,1)}
|
||||
function Fb(a,b,c){if(void 0!==b){.8>a.R/a.U&&(b=1);a.L=b;b=a.Fa*a.L;if(a.U!=b){a.U=b;b=a.U.toFixed(2)+"Mhz";var d=a.A.setSpeed;d&&(d.textContent=b);a.ea("target speed: "+b)}c&&a.v&&Ib(a.v)}a.H+=a.N;a.N=0;a.I=ja();a.S=0;Gb(a)}function Jb(a,b){var c=a.G.length;a.G.push([-1,b]);return c}function Kb(a,b,c){0<=b&&b<a.G.length&&0>a.G[b][0]&&(c*=a.ma*a.L/1E3,a.G[b][0]=c+Mb(a))}function Mb(a,b){var c=a.W-=a.a;a.a=0;b&&(a.W=0);return c}
|
||||
k.lb=function(a){if(Ra(this,!0)){if(!this.l.pa){Fb(this);this.v&&this.v.start(this.I,Hb(this));this.l.pa=!0;this.l.Jb=!0;this.M&&this.M.start();var b=this.A.run;b&&(b.textContent="Halt");this.v&&(this.v.Da(!0),a&&Ib(this.v,!0))}this.Ga>=this.ma&&Gb(this,!0);this.qa=0;this.ta=ja();this.S&&(a=this.ta-this.S,a>this.Na&&(this.I+=a,this.I>this.ta&&(this.I=this.ta)));try{do{for(var c,d=this.l.Za?1:this.Aa,e=this.G.length-1;0<=e;e--){var f=this.G[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.Kb(c);c=Mb(this,!0);
|
||||
this.qa+=c;this.N+=c;a=c;this.l.Za&&(b=!1,this.ua=this.ua+this.Fb()|0,this.X-=a,0>=this.X&&(this.X+=this.aa,b=!0),0<=this.ja&&this.ja<=Hb(this)&&(this.aa=this.ja=-1,Cb(this),Eb(this),b=!0),b&&this.ea(Hb(this)+" cycles: checksum="+p(this.ua)));a=c;for(var g=this.G.length-1;0<=g;g--){var h=this.G[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.la-=c;if(0>=this.la){this.la+=this.Aa;15<=++this.Oa&&(this.v&&this.v.Da(),this.Oa=0);break}}while(this.l.pa)}catch(l){Eb(this);Db(this);this.v&&this.v.stop(ja(),
|
||||
this.qa+=c;this.N+=c;a=c;this.l.Za&&(b=!1,this.ua=this.ua+this.Fb()|0,this.X-=a,0>=this.X&&(this.X+=this.Z,b=!0),0<=this.ja&&this.ja<=Hb(this)&&(this.Z=this.ja=-1,Cb(this),Eb(this),b=!0),b&&this.ea(Hb(this)+" cycles: checksum="+p(this.ua)));a=c;for(var g=this.G.length-1;0<=g;g--){var h=this.G[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.la-=c;if(0>=this.la){this.la+=this.Aa;15<=++this.Oa&&(this.v&&this.v.Da(),this.Oa=0);break}}while(this.l.pa)}catch(l){Eb(this);Db(this);this.v&&this.v.stop(ja(),
|
||||
Hb(this));Ra(this,!1);c=l.stack||l.message;this.l.error=!0;this.K(c);return}c=setTimeout;d=this.Xa;this.S=ja();e=this.Na;this.qa&&(e=Math.round(e*this.qa/this.Aa));e-=this.S-this.ta;if(f=this.S-this.I)this.R=Math.round(this.N/(10*f))/100,864E5<=f&&(this.H=0,Fb(this));if(0>e||this.R<this.U)-1E3>e&&(this.I-=e),e=0;this.Ga+=this.qa;this.S+=e;c(d,e)}else Db(this),this.v&&this.v.stop(ja(),Hb(this))};k.Kb=function(){return 0};
|
||||
function Eb(a){a.l.Ya&&(a.l.gb=!0);Mb(a);a.H+=a.N;a.N=0;if(a.l.pa){a.l.pa=!1;a.M&&a.M.stop();var b=a.A.run;b&&(b.textContent="Run")}a.l.complete=void 0}function Db(a){if(a.v){for(var b=a.v,c=0;c<b.m.length;c++)Nb(b.m[c],void 0);a.v.Da(void 0)}}function Ob(a){yb.call(this,a,1E6);this.Ka=Pb;Bb(this);this.l.complete=this.l.Rc=!1;this.Ma=0;this.sa=[];this.La=0;Qb(this)}w(Ob,yb);function Rb(a,b){a.sa.push(b)}k=Ob.prototype;k.reset=function(){this.l.pa&&Eb(this);Qb(this);Bb(this);this.l.error=!1;this.parent.reset.call(this)};
|
||||
function Qb(a){a.b=0;a.c=0;a.D=0;a.f=0;a.F=0;a.g=0;a.i=0;a.u=0;E(a,a.La);Sb(a,0);a.B=0}function Tb(a,b){a.La=b;E(a,b)}k.Fb=function(){var a=this.b+this.c+this.D+this.f+this.F+this.g+this.i|0;return a=a+this.u+this.o+Ub(this)|0};k.save=function(){var a=new F(this);a.set(0,[this.b,this.c,this.D,this.f,this.F,this.g,this.i,this.u,this.o,Ub(this)]);a.set(1,[this.B,this.H,this.L]);a.set(2,hb(this.j));return a.data()};
|
||||
|
|
@ -84,7 +84,7 @@ function $b(a,b){a.w=a.b^b;return a.s=(a.m=a.b+b+(a.m&256?1:0))&255}function ac(
|
|||
k.ba=function(a,b){this.j.ba(a,b)};function N(a){var b=a.J(a.o);E(a,a.o+1);return b}function O(a){var b=db(a.j,a.o);E(a,a.o+2);return b}function P(a){var b=db(a.j,a.u);a.u=a.u+2&65535;return b}function R(a,b){a.u=a.u-2&65535;gb(a.j,a.u,b)}function gc(a){if(a.a&&a.B&255&&a.C&512){for(var b=0;8>b&&!(a.B&1<<b);b++);a.B&=~(0>b?255:1<<b);a.C&=-513;a.B&=-257;a.Ka[199|b<<3].call(a)}return a.B&256?(Mb(a),!1):!0}function hc(a,b){a.B|=1<<b;a.C&512&&Mb(a)}
|
||||
function S(a,b,c,d){d=d||2;a.A[b]&&(void 0===c&&(a.l.error=!0,a.K("Value for "+b+" is invalid"),Eb(a)),c=!a.l.pa||a.l.Cb?p(c,d):"--------".substr(0,d),a.A[b].textContent!=c&&(a.A[b].textContent=c))}
|
||||
k.Da=function(a){this.Ma&&(a||!this.l.pa||this.l.Cb)&&(S(this,"A",this.b),S(this,"B",this.c),S(this,"C",this.D),S(this,"BC",Vb(this),4),S(this,"D",this.f),S(this,"E",this.F),S(this,"DE",Xb(this),4),S(this,"H",this.g),S(this,"L",this.i),S(this,"HL",G(this),4),S(this,"SP",this.u,4),S(this,"PC",this.o,4),a=Ub(this),S(this,"PS",a,4),S(this,"IF",a&512?1:0,1),S(this,"SF",a&128?1:0,1),S(this,"ZF",a&64?1:0,1),S(this,"AF",a&16?1:0,1),S(this,"PF",a&4?1:0,1),S(this,"CF",a&1?1:0,1));if(a=this.A.speed)a.textContent=
|
||||
this.l.pa&&this.R?this.R.toFixed(2)+"Mhz":"Stopped"};k.Kb=function(a){this.l.complete=!0;this.l.Rc=!1;this.l.Jb=!1;this.W=this.a=a;if(gc(this)){do this.Ka[N(this)].call(this);while(0<this.a)}return this.l.complete?this.W-this.a:void 0===this.l.complete?0:-1};za(function(){for(var a=A(document,"pc8080","cpu"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Ob(d);Qa(d,c)}});function ic(){this.a-=4}function jc(){E(this,O(this));this.a-=10}function kc(){E(this,P(this));this.a-=10}
|
||||
this.l.pa&&this.R?this.R.toFixed(2)+"Mhz":"Stopped"};k.Kb=function(a){this.l.complete=!0;this.l.Rc=!1;this.l.Jb=!1;this.W=this.a=a;if(gc(this)){do this.Ka[N(this)].call(this);while(0<this.a)}return this.l.complete?this.W-this.a:void 0===this.l.complete?0:-1};za(function(){for(var a=A(document,"pc8080","cpu"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Ob(d);Qa(d,c)}});function ic(){this.a-=4}function jc(){E(this,O(this));this.a-=10}function kc(){E(this,P(this));this.a-=10}
|
||||
function lc(){var a=O(this);R(this,this.o);E(this,a);this.a-=17}
|
||||
var Pb=[ic,function(){Wb(this,O(this));this.a-=10},function(){this.ba(Vb(this),this.b);this.a-=7},function(){Wb(this,Vb(this)+1);this.a-=5},function(){this.c=cc(this,this.c);this.a-=5},function(){this.c=bc(this,this.c);this.a-=5},function(){this.c=N(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|a>>8;K(this,a&256);this.a-=4},ic,function(){var a;I(this,a=G(this)+Vb(this));K(this,a>>8&256);this.a-=10},function(){this.b=this.J(Vb(this));this.a-=7},function(){Wb(this,Vb(this)-1);this.a-=5},
|
||||
function(){this.D=cc(this,this.D);this.a-=5},function(){this.D=bc(this,this.D);this.a-=5},function(){this.D=N(this);this.a-=7},function(){var a=this.b<<8&256;this.b=(a|this.b)>>1;K(this,a);this.a-=4},ic,function(){Yb(this,O(this));this.a-=10},function(){this.ba(Xb(this),this.b);this.a-=7},function(){Yb(this,Xb(this)+1);this.a-=5},function(){this.f=cc(this,this.f);this.a-=5},function(){this.f=bc(this,this.f);this.a-=5},function(){this.f=N(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|J(this);
|
||||
|
|
@ -111,25 +111,25 @@ O(this);Zb(this)&&(R(this,this.o),E(this,a),this.a-=6);this.a-=11},lc,function()
|
|||
Ub(this)&255|this.b<<8);this.a-=11},function(){this.b=dc(this,N(this));this.a-=7},function(){R(this,this.o);E(this,48);this.a-=11},function(){this.s&128&&(E(this,P(this)),this.a-=6);this.a-=5},function(){this.u=G(this)&65535;this.a-=5},function(){var a=O(this);this.s&128&&E(this,a);this.a-=10},function(){this.C|=512;this.a-=4;gc(this)},function(){var a=O(this);this.s&128&&(R(this,this.o),E(this,a),this.a-=6);this.a-=11},lc,function(){M(this,N(this));this.a-=7},function(){R(this,this.o);E(this,56);
|
||||
this.a-=11}];function T(a){r.call(this,"ChipSet",a,T);var b=a.model;b&&!mc[b]&&Ba("Unrecognized ChipSet model: "+b);this.c=mc[b]||{};a.sound&&(this.I=null,window&&(this.I=window.AudioContext||window.webkitAudioContext),this.I&&new this.I);B(this)}w(T);
|
||||
var V={ca:1978.1,Dc:{da:0,xd:1,Bd:16,Id:32,Rd:64,Qd:128,Ia:14},Ca:{da:1,Tb:1,wc:2,sc:4,tc:16,uc:32,vc:64,Ia:8},Ec:{da:2,wd:3,$d:4,yd:8,Md:16,Nd:32,Od:64,zd:128,Ia:0},Vd:{da:3},Td:{da:2,Jd:7},Xd:{da:3,ae:1,Wd:2,Pd:4,Gd:8,Ad:16,qd:32},Ud:{da:4},Yd:{da:5,Cd:1,Dd:2,Ed:4,Fd:8,be:16}},W={ca:100,ka:{da:66,zb:1,oc:2,pc:4,Ld:8,Kd:16,wb:32,vb:64,rb:128},Rb:{da:66,INIT:0},za:{da:194,sd:0,pb:16,yc:32,xb:48,ac:0,bc:32},Ua:{da:162,Sd:0,dc:0,$b:0,cc:0,Zb:0},na:{Hd:{da:98},Ea:{Ob:0,Nb:1,Bc:2,Jc:4,Ub:5,zc:6,Zd:7},
|
||||
Wa:16383}},mc={SI1978:V,VT100:W};T.prototype.V=function(){return!1};T.prototype.ra=function(a,b,c,d){this.j=b;this.a=c;this.O=d;this.v=a;this.m=Wa(a,"Keyboard");this.aa=Wa(a,"SerialPort");this.video=Wa(a,"Video");ib(b,this,this.c.bb);jb(b,this,this.c.cb)};T.prototype.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};T.prototype.ia=function(a){return a?this.save():!0};V.INIT=[[V.Dc.Ia,V.Ca.Ia,V.Ec.Ia,0,0,0,0]];
|
||||
Wa:16383}},mc={SI1978:V,VT100:W};T.prototype.V=function(){return!1};T.prototype.ra=function(a,b,c,d){this.j=b;this.a=c;this.O=d;this.v=a;this.m=Wa(a,"Keyboard");this.Z=Wa(a,"SerialPort");this.video=Wa(a,"Video");ib(b,this,this.c.bb);jb(b,this,this.c.cb)};T.prototype.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};T.prototype.ia=function(a){return a?this.save():!0};V.INIT=[[V.Dc.Ia,V.Ca.Ia,V.Ec.Ia,0,0,0,0]];
|
||||
W.INIT=[[W.Rb.INIT,W.ka.oc|W.ka.pc],[W.za.ac,W.za.bc],[W.Ua.dc,W.Ua.$b,W.Ua.cc,W.Ua.Zb],[0,0,0,0,[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11776,11984,11888,11776,11808,11776,12E3,12E3,11901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||
[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11808,11984,11856,11776,11808,11776,12E3,12E3,11881,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]];k=T.prototype;k.reset=function(){this.c.INIT&&!this.restore(this.c.INIT)&&this.K("reset error")};
|
||||
k.save=function(){var a=new F(this);switch(this.c.ca){case V.ca:a.set(0,[this.W,this.g,this.X,this.C,this.M,this.S,this.U]);break;case W.ca:a.set(0,[this.L,this.u]),a.set(1,[this.o,this.s]),a.set(2,[this.f,this.G,this.R,this.N]),a.set(3,[this.B,this.b,this.w,this.H,this.i])}return a.data()};
|
||||
k.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.c.ca){case V.ca:return this.W=b[0],this.g=b[1],this.X=b[2],this.C=b[3],this.M=b[4],this.S=b[5],this.U=b[6],!0;case W.ca:return this.L=b[0],this.u=b[1],b=a[1],this.o=b[0],this.s=b[1],b=a[2],this.f=b[0],this.G=b[1],this.R=b[2],this.N=b[3],b=a[3],this.B=b[0],this.b=b[1],this.w=b[2],this.H=b[3],this.i=b[4],!0}return!1};k.start=function(){};k.stop=function(){};k.Wc=function(){return this.W};k.Xc=function(){return this.g};k.Yc=function(){return this.X};
|
||||
k.Vc=function(){return this.C>>8-this.M&255};k.dd=function(a,b){this.M=b};k.fd=function(a,b){this.S=b};k.ed=function(a,b){this.C=b<<8|this.C>>8};k.gd=function(a,b){this.U=b};k.hd=function(){};function nc(a){var b=0,c=0,d=~a.B;for(a=0;10>a;a++)d&1&&(b=9-a),d>>=1;for(a=0;10>a;a++)d&1&&(c=9-a),d>>=1;return 10*b+c}
|
||||
k.Zc=function(){var a=this.u,a=a&~W.ka.vb;if((Hb(this.a)&64)<<1&&(a|=W.ka.vb,a!=this.u)){var b,c;b=this.w&1;switch(this.w>>1&7){case W.na.Ea.Nb:this.B=this.B<<1|b;break;case W.na.Ea.Ub:b=nc(this);this.i[b]=W.na.Wa;break;case W.na.Ea.Ob:this.b=this.b<<1|b;break;case W.na.Ea.Jc:b=nc(this);c=this.b&W.na.Wa;this.i[b]=c;break;case W.na.Ea.zc:b=nc(this);c=this.i[b];null==c&&(c=W.na.Wa);this.b=c;break;case W.na.Ea.Bc:this.b<<=1,this.H=this.b&W.na.Wa+1}}a&=~W.ka.wb;this.H&&(a|=W.ka.wb);a&=~W.ka.rb;if(b=this.m){b=
|
||||
this.m;if(c=b.f)c=b.a,c=Hb(b.a)>=b.m+c.ma*c.L/1E3*1.2731488;c&&(b.f=!1);b=!b.f}b&&(a|=W.ka.rb);a&=~W.ka.zb;this.aa&&this.aa.fa&1&&(a|=W.ka.zb);return this.u=a};k.jd=function(a,b){this.L=b};k.md=function(a,b){this.w=b};k.ld=function(a,b){a=b&3;switch(b>>2&3){case 0:this.f=this.f&-4|a;break;case 1:this.f=this.f&-13|a<<2;this.video&&(b=this.video,a=this.f,b.qa!==a&&((b.qa=a)?Nb(b,!0):b.ta=!0));break;case 2:switch(a){case 0:this.G=~this.G;break;case 2:case 3:this.R=3-a}break;case 3:this.N=a}};
|
||||
this.m;if(c=b.f)c=b.a,c=Hb(b.a)>=b.m+c.ma*c.L/1E3*1.2731488;c&&(b.f=!1);b=!b.f}b&&(a|=W.ka.rb);a&=~W.ka.zb;this.Z&&this.Z.fa&1&&(a|=W.ka.zb);return this.u=a};k.jd=function(a,b){this.L=b};k.md=function(a,b){this.w=b};k.ld=function(a,b){a=b&3;switch(b>>2&3){case 0:this.f=this.f&-4|a;break;case 1:this.f=this.f&-13|a<<2;this.video&&(b=this.video,a=this.f,b.qa!==a&&((b.qa=a)?Nb(b,!0):b.ta=!0));break;case 2:switch(a){case 0:this.G=~this.G;break;case 2:case 3:this.R=3-a}break;case 3:this.N=a}};
|
||||
k.kd=function(a,b){b&W.za.yc?(b&=W.za.xb,this.s!=b&&(this.s=b,this.video&&(this.video.Hb=this.s==W.za.xb?50:60))):(b&=W.za.pb,this.o!=b&&(this.o=b,this.video&&(a=this.video,b=this.o==W.za.pb?132:80,a.H=b,a.T=a.Aa,80<b&&a.T--,oc(a)&&pc(a))))};V.bb={0:T.prototype.Wc,1:T.prototype.Xc,2:T.prototype.Yc,3:T.prototype.Vc};V.cb={2:T.prototype.dd,3:T.prototype.fd,4:T.prototype.ed,5:T.prototype.gd,6:T.prototype.hd};W.bb={66:T.prototype.Zc};W.cb={66:T.prototype.jd,98:T.prototype.md,162:T.prototype.ld,194:T.prototype.kd};
|
||||
za(function(){for(var a=A(document,"pc8080","chipset"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new T(d);Qa(d,c)}});function qc(a){r.call(this,"ROM",a,qc);this.b=null;this.i=a.addr;this.c=a.size;this.g=a.alias;this.f=a.file;this.m=ba(this.f);if(this.f){a=this.f;var b=ca(this.m);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;la(a,null,!0,function(a,b,f){rc(c,a,b,f)})}}w(qc);qc.prototype.ra=function(a,b,c,d){this.j=b;this.a=c;this.O=d;sc(this)};
|
||||
za(function(){for(var a=A(document,"pc8080","chipset"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new T(d);Qa(d,c)}});function qc(a){r.call(this,"ROM",a,qc);this.b=null;this.i=a.addr;this.c=a.size;this.g=a.alias;this.f=a.file;this.m=ba(this.f);if(this.f){a=this.f;var b=ca(this.m);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;la(a,null,!0,function(a,b,f){rc(c,a,b,f)})}}w(qc);qc.prototype.ra=function(a,b,c,d){this.j=b;this.a=c;this.O=d;sc(this)};
|
||||
qc.prototype.ga=function(){this.wa&&(this.O&&this.O.a(this.id,this.i,this.c,this.wa),delete this.wa);return!0};qc.prototype.ia=function(){return!0};
|
||||
function rc(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{La(a.ya,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,g=e.data;if(f)a.b=f;else if(g)for(a.b=Array(4*g.length),d=c=0;c<g.length;c++)a.b[d++]=g[c]&255,a.b[d++]=g[c]>>8&255,a.b[d++]=g[c]>>16&255,a.b[d++]=g[c]>>24&255;else a.b=e;a.wa=e.symbols;if(!a.b.length){q("Empty ROM: "+b);return}if(1==a.b.length){q(a.b[0]);return}}catch(h){a.K("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm,
|
||||
" ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e<b.length;e++)a.b[e]=aa(b[e]);sc(a)}}
|
||||
function sc(a){if(!Sa(a))if(!a.f)B(a);else if(a.b&&a.j){a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+p(a.b.length,8,!0)+") does not match specified size ("+p(a.c,8,!0)+")";a.l.error=!0;a.K(b)}else{b=a.i;if($a(a.j,b,a.c,pb)){var c;for(c=0;c<a.b.length;c++)eb(a.j,b+c,a.b[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.g?b.push(a.g):null!=a.g&&a.g.length&&(b=a.g);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.j,g=d.c,h=[],l=d.i>>>f.j;0<g&&l<f.b.length;)h.push(f.b[l++]),g-=f.c;f=d.j;
|
||||
d=d.c;g=0;for(e>>>=f.j;0<d&&e<f.b.length;){l=h[g++];if(!l)break;f.b[e++]=l;d-=f.c}}delete a.b}}B(a)}}za(function(){for(var a=A(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new qc(d);Qa(d,c)}});
|
||||
function tc(a){r.call(this,"RAM",a,tc);this.wa=this.c=null;this.m=a.addr;this.v=a.size;this.g=a.load;this.f=a.exec;this.i=!1;this.b=a.file;this.o=ba(this.b);if(this.b){a=this.b;var b=ca(this.o);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;la(a,null,!0,function(a,b,f){f?c.K("Unable to load RAM resource (error "+f+": "+a+")"):(La(c.ya,a,b),(a=ma(a,b))?(c.c=a.Y,c.wa=a.wa,null==c.g&&null!=a.jb&&(c.g=a.jb),null==c.f&&null!=a.ib&&(c.f=a.ib)):c.b=null,
|
||||
d=d.c;g=0;for(e>>>=f.j;0<d&&e<f.b.length;){l=h[g++];if(!l)break;f.b[e++]=l;d-=f.c}}delete a.b}}B(a)}}za(function(){for(var a=A(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new qc(d);Qa(d,c)}});
|
||||
function tc(a){r.call(this,"RAM",a,tc);this.wa=this.c=null;this.m=a.addr;this.v=a.size;this.g=a.load;this.f=a.exec;this.i=!1;this.b=a.file;this.o=ba(this.b);if(this.b){a=this.b;var b=ca(this.o);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;la(a,null,!0,function(a,b,f){f?c.K("Unable to load RAM resource (error "+f+": "+a+")"):(La(c.ya,a,b),(a=ma(a,b))?(c.c=a.aa,c.wa=a.wa,null==c.g&&null!=a.jb&&(c.g=a.jb),null==c.f&&null!=a.ib&&(c.f=a.ib)):c.b=null,
|
||||
uc(c))})}}w(tc);var vc=[0,5];tc.prototype.ra=function(a,b,c,d){this.j=b;this.a=c;this.O=d;uc(this)};tc.prototype.ga=function(){return!0};tc.prototype.ia=function(){return!0};
|
||||
function uc(a){!a.i&&a.v&&$a(a.j,a.m,a.v,1)&&(a.i=!0);if(!Sa(a)){if(!a.i)q("No RAM allocated");else if(a.b){if(!a.c||!a.j)return;var b=a.m;null!==a.g&&(b=a.g);for(var c=0;c<a.c.length;c++)eb(a.j,b+c,a.c[c]);if(null!==a.f){if(256==a.f){for(c=0;c<vc.length;c++)eb(a.j,vc[c],118);Rb(a.a,function(a){return function(b){if(0<=vc.indexOf(b)){var c=!1,d=a.a,e=a.O;if(5==b)switch(c=!0,d.D){case 2:wc(a,String.fromCharCode(d.F));break;case 9:for(var l=Xb(d),n="",u=255;u--;){var y=a.a.J(l++);if(36==y)break;n+=
|
||||
String.fromCharCode(y)}wc(a,n);break;default:c=!1}c?kc.call(d):e&&(a.ea("\nCP/M vector "+p(b,4,!0)),E(d,b),Eb(e));b=!0}else b=!1;return b}}(a))}Tb(a.a,a.f)}delete a.c}B(a)}}tc.prototype.reset=function(){};function wc(a,b){b=b.replace(/\r/g,"");a.xa&&(a.xa.value+=b,a.xa.scrollTop=a.xa.scrollHeight)}za(function(){for(var a=A(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new tc(d);Qa(d,c)}});
|
||||
function uc(a){!a.i&&a.v&&$a(a.j,a.m,a.v,1)&&(a.i=!0);if(!Sa(a)){if(!a.i)q("No RAM allocated");else if(a.b){if(!a.c||!a.j)return;var b=a.m;null!==a.g&&(b=a.g);for(var c=0;c<a.c.length;c++)eb(a.j,b+c,a.c[c]);if(null!==a.f){if(256==a.f){for(c=0;c<vc.length;c++)eb(a.j,vc[c],118);Rb(a.a,function(a){return function(b){if(0<=vc.indexOf(b)){var c=!1,d=a.a,e=a.O;if(5==b)switch(c=!0,d.D){case 2:wc(a,String.fromCharCode(d.F));break;case 9:for(var l=Xb(d),n="",u=255;u--;){var z=a.a.J(l++);if(36==z)break;n+=
|
||||
String.fromCharCode(z)}wc(a,n);break;default:c=!1}c?kc.call(d):e&&(a.ea("\nCP/M vector "+p(b,4,!0)),E(d,b),Eb(e));b=!0}else b=!1;return b}}(a))}Tb(a.a,a.f)}delete a.c}B(a)}}tc.prototype.reset=function(){};function wc(a,b){b=b.replace(/\r/g,"");a.xa&&(a.xa.value+=b,a.xa.scrollTop=a.xa.scrollHeight)}za(function(){for(var a=A(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new tc(d);Qa(d,c)}});
|
||||
function X(a){r.call(this,"Keyboard",a,X);(a=a.model)&&!xc[a]&&Ba("Unrecognized Keyboard8080 model: "+a);this.b=xc[a]||{};this.reset();B(this)}w(X);var yc={};yc[m.nb]=37;yc[m.qb]=39;yc[m.sb]=32;var Ac={ca:1978.1,h:{},ob:yc,Ja:{},Ba:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},Y={ca:100,h:{},ob:{},Ja:{},Ba:{setup:120},Pb:{da:130,INIT:127},ha:{da:130,kc:1,jc:2,ic:4,hc:8,lc:16,ub:32,tb:63,Cc:64,rd:128,INIT:0},gc:127};Y.h[46]=3;Y.h[m.rc]=5;Y.h[m.qc]=6;Y.h[m.Lc]=7;Y.h[m.Fc]=8;Y.h[m.Ic]=9;
|
||||
Y.h[m.Q]=10;Y.h[39]=16;Y.h[221]=20;Y.h[219]=21;Y.h[m.Yb]=22;Y.h[m.Gc]=23;Y.h[m.xc]=24;Y.h[m.E]=25;Y.h[49]=26;Y.h[37]=32;Y.h[40]=34;Y.h[117]=35;Y.h[19]=35;Y.h[192]=36;Y.h[189]=37;Y.h[57]=38;Y.h[55]=39;Y.h[52]=40;Y.h[51]=41;Y.h[27]=42;Y.h[38]=48;Y.h[114]=49;Y.h[112]=50;Y.h[8]=51;Y.h[187]=52;Y.h[48]=53;Y.h[56]=54;Y.h[54]=55;Y.h[53]=56;Y.h[50]=57;Y.h[9]=58;Y.h[103]=64;Y.h[115]=65;Y.h[113]=66;Y.h[96]=67;Y.h[118]=68;Y.h[220]=69;Y.h[m.sb]=70;Y.h[m.fc]=71;Y.h[m.Wb]=72;Y.h[m.Vb]=73;Y.h[m.nb]=74;Y.h[104]=80;
|
||||
Y.h[2013]=81;Y.h[98]=82;Y.h[97]=83;Y.h[222]=85;Y.h[186]=86;Y.h[m.ec]=87;Y.h[m.Xb]=88;Y.h[m.qb]=89;Y.h[m.Ac]=90;Y.h[110]=96;Y.h[116]=97;Y.h[101]=98;Y.h[100]=99;Y.h[13]=100;Y.h[190]=101;Y.h[188]=102;Y.h[m.nc]=103;Y.h[m.Qb]=104;Y.h[m.Kc]=105;Y.h[119]=106;Y.h[105]=112;Y.h[99]=113;Y.h[102]=114;Y.h[109]=115;Y.h[191]=117;Y.h[m.mc]=118;Y.h[m[" "]]=119;Y.h[m.Hc]=120;Y.h[m.Sb]=121;Y.h[m.Mc]=122;Y.h[120]=123;Y.h[17]=124;Y.h[16]=125;Y.h[20]=126;
|
||||
|
|
@ -140,24 +140,24 @@ k.save=function(){var a=new F(this);switch(this.b.ca){case Y.ca:a.set(0,[this.i,
|
|||
function Bc(a,b,c){var d=!0,e;a:if(e=b.keyCode,e=a.b.ob[e]||e,!a.b.h[e]){for(var f in a.b.Ba)if(a.b.Ba[f]===e){e=f;break a}e=null}e&&(d=Cc(a,e,c),b.preventDefault());return d}
|
||||
function Cc(a,b,c){var d;a:{for(d=0;d<a.j.length;d++)if(a.j[d].mb==b)break a;d=-1}if(c)0>d?a.j.push({mb:b,hb:Date.now(),$a:!1}):(a.j[d].hb=Date.now(),a.j[d].$a=!1);else if(0<=d){if(!a.j[d].$a){var e=a.j[d].hb;if(e&&100>Date.now()-e)return a.j[d].$a=!0,Ec(a),!0}a.j.splice(d,1)}if(a.M){d=0;switch(b){case "1p":d=V.Ca.sc;break;case "2p":d=V.Ca.wc;break;case "coin":d=V.Ca.Tb;break;case "left":d=V.Ca.uc;break;case "right":d=V.Ca.vc;break;case "fire":d=V.Ca.tc}d&&(a=a.M,b=d,a.g&=~b,c&&(a.g|=b))}return!0}
|
||||
function Ec(a){for(var b=0,c=-1;b<a.j.length;){if(a.j[b].$a){var d=a.j[b].mb,e=100-(Date.now()-a.j[b].hb);if(0<e){if(0>c||c>e)c=e}else{Cc(a,d,!1);b=0;continue}}b++}0<=c&&setTimeout(function(){Ec(a)},c)}k.$c=function(){var a=this.g;0<=this.c&&(this.c<this.j.length?(a=this.j[this.c],this.c++,a=Y.h[a.mb],a&128&&(a&=127)):(this.c=-1,a=Y.gc),this.g=a,hc(this.a,1));return a};k.nd=function(a,b){this.i=b;this.f=!0;this.m=Hb(this.a);Dc(this,b&Y.ha.tb);b&Y.ha.Cc&&(this.c=0,hc(this.a,1))};Y.bb={130:X.prototype.$c};
|
||||
Y.cb={130:X.prototype.nd};za(function(){for(var a=A(document,"pc8080","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new X(d);Qa(d,c)}});
|
||||
Y.cb={130:X.prototype.nd};za(function(){for(var a=A(document,"pc8080","keyboard"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new X(d);Qa(d,c)}});
|
||||
function Fc(a,b,c,d,e){var f=this;this.La=ta("Gecko/");var g=["","moz","ms","webkit"];r.call(this,"Video",a,Fc);this.C=a.screenWidth;this.w=a.screenHeight;this.ja=a.bufferAddr;this.Oc=a.bufferRAM;var h=a.bufferFormat;this.U=h&&Gc[h.toUpperCase()]||Hc;this.H=a.bufferCols;this.W=a.bufferRows;this.Aa=this.T=a.cellWidth||1;this.P=a.cellHeight||1;this.X=null;this.Ka=!1;this.la=a.bufferBits||1;this.Pc=a.bufferLeft||0;if(this.c=a.bufferRotate)this.c=this.c%360,0<this.c&&(this.c-=360),-90!=this.c&&(this.K("unsupported buffer rotation: "+
|
||||
this.c),this.c=0);this.ma=a.interruptRate;this.Ab=a.refreshRate||60;this.u=b;this.f=c;this.R=(this.Sc=d)||b||null;this.Nc=this.C;this.Mb=this.w;this.Fa=this.C/this.H|0;this.Ga=this.w/this.W|0;1<this.P&&(this.W++,this.qa=0,this.ta=!1);b=a.smoothing;(c=Fa.smoothing)&&(b="true"==c);if(null!=b)for(c=0;c<g.length;c++)if(d=(d=g[c])?d+"ImageSmoothingEnabled":"imageSmoothingEnabled",void 0!==this.f[d]){this.f[d]=b;break}if(this.g=a.screenRotate)this.g=this.g%360,0<this.g&&(this.g-=360),-90!=this.g?(this.K("unsupported screen rotation: "+
|
||||
this.g),this.g=0):(this.f.translate(0,this.w),this.f.rotate(this.g*Math.PI/180),this.f.scale(this.w/this.C,this.C/this.w));if(this.b=e)if(this.b.Ha=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.b.Ha){for(c=0;c<g.length;c++)if(d=g[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){Ic(f,document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?!0:!1)},!1);
|
||||
break}for(c=0;c<g.length;c++)if(d=g[c]+"fullscreenerror","on"+d in document){document.addEventListener(d,function(){Ic(f,null)},!1);break}}if(this.M=a.fontROM)"json"!=ca(this.M)&&(this.M=ea()+"/api/v1/dump?file="+this.M+"&format=bytes"),la(this.M,null,!0,function(a,b,c){Jc(f,a,b,c)});this.va={}}w(Fc);var Hc=0,Gc={SI1978:1,VT100:2};
|
||||
function oc(a){a.o=a.H*a.T;a.G=a.W*a.P;var b=a.o,c=a.G;a.c&&(b=a.G,c=a.o);a.B=0;if(!a.Oc&&(a.B=(a.o*a.la>>3)*a.G,!$a(a.j,a.ja,a.B,3)))return!1;a.B?(a.Ma=a.f.createImageData(b,c),a.Oa=16/a.la|0,Kc(a,a.B>>1)):Kc(a,(a.H+1)*a.W);a.s=document.createElement("canvas");a.s.width=b;a.s.height=c;a.sa=a.s.getContext("2d");a.I={};a.S=1<<a.la;a.L=Array(a.S+2);a.L[0]=[0,0,0,255];a.L[1]=[255,255,255,255];1==a.U&&(a.L[a.S+0]=[255,255,0,255],a.L[a.S+1]=[0,255,0,255]);2==a.U&&(a.Hb=60,a.ua=!1,a.aa=Array(a.H));return!0}
|
||||
function oc(a){a.o=a.H*a.T;a.G=a.W*a.P;var b=a.o,c=a.G;a.c&&(b=a.G,c=a.o);a.B=0;if(!a.Oc&&(a.B=(a.o*a.la>>3)*a.G,!$a(a.j,a.ja,a.B,3)))return!1;a.B?(a.Ma=a.f.createImageData(b,c),a.Oa=16/a.la|0,Kc(a,a.B>>1)):Kc(a,(a.H+1)*a.W);a.s=document.createElement("canvas");a.s.width=b;a.s.height=c;a.sa=a.s.getContext("2d");a.I={};a.S=1<<a.la;a.L=Array(a.S+2);a.L[0]=[0,0,0,255];a.L[1]=[255,255,255,255];1==a.U&&(a.L[a.S+0]=[255,255,0,255],a.L[a.S+1]=[0,255,0,255]);2==a.U&&(a.Hb=60,a.ua=!1,a.Z=Array(a.H));return!0}
|
||||
Fc.prototype.ra=function(a,b,c,d){this.v=a;this.j=b;this.a=c;this.O=d;oc(this);if(this.m=Wa(a,"Keyboard")){for(var e in this.va)this.m.V("led",e,this.va[e]);this.u&&this.m.V(this.Sc?"textarea":"canvas","kbd",this.R)}var f=this;this.Bb=Jb(this.a,function(){Nb(f)});Kb(this.a,this.Bb,1E3/Math.max(this.Ab,this.ma));this.Xa=0;this.M||B(this)};
|
||||
function Jc(a,b,c,d){if(d)a.K("Unable to load font ROM (error "+d+": "+b+")");else{La(a.ya,b,c);try{var e=eval("("+c+")"),f=e.bytes||e;if(!f||!f.length){q("Empty font ROM: "+b);return}if(1==f.length){q(f[0]);return}if(2048==f.length)a.X=f,pc(a);else{a.K("Unrecognized font data length ("+f.length+")");return}}catch(g){a.K("Font ROM data error: "+g.message);return}(a.f||a.O)&&B(a)}}
|
||||
function pc(a){a.X&&(a.Ka=2==a.U,a.I[96]=[Lc(a,a.T,a.P),Lc(a,a.T,a.P,a.ua)],a.I[64]=[Lc(a,2*a.T,a.P),Lc(a,2*a.T,a.P,a.ua)],a.I[32]=a.I[0]=[Lc(a,2*a.T,2*a.P),Lc(a,2*a.T,2*a.P,a.ua)])}
|
||||
function Lc(a,b,c,d){var e=8>=a.Aa?8:16,f=8<e?15:0,g=a.X.length/e,h=!1===d,l={T:b,P:c};l.canvas=document.createElement("canvas");l.canvas.width=16*b;l.canvas.height=g/16*c;l.context=l.canvas.getContext("2d");for(var n=l.context.createImageData(b,c),u=0;u<g;u++){for(var y=0,H=y;y<a.P;y++)for(var x=u*e+(f+y&e-1),x=d&&8==y?255:a.X[x],t=0;t<c/a.P;t++){for(var D=0,Q=0,U=Q;Q<a.T;Q++){for(var Z=x&128>>(7<Q?7:Q),D=a.Ka&&!Z&&D?D:Z,sa=0;sa<b/a.T;sa++)h&&(D=!D),Mc(a,n,U,H,D?1:0),U++;D=Z}H++}l.context.putImageData(n,
|
||||
function Lc(a,b,c,d){var e=8>=a.Aa?8:16,f=8<e?15:0,g=a.X.length/e,h=!1===d,l={T:b,P:c};l.canvas=document.createElement("canvas");l.canvas.width=16*b;l.canvas.height=g/16*c;l.context=l.canvas.getContext("2d");for(var n=l.context.createImageData(b,c),u=0;u<g;u++){for(var z=0,H=z;z<a.P;z++)for(var x=u*e+(f+z&e-1),x=d&&8==z?255:a.X[x],t=0;t<c/a.P;t++){for(var D=0,Q=0,U=Q;Q<a.T;Q++){for(var Z=x&128>>(7<Q?7:Q),D=a.Ka&&!Z&&D?D:Z,sa=0;sa<b/a.T;sa++)h&&(D=!D),Mc(a,n,U,H,D?1:0),U++;D=Z}H++}l.context.putImageData(n,
|
||||
(u&15)*b,(u>>4)*c)}return l}Fc.prototype.ga=function(){return!0};Fc.prototype.V=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.va[b]=c,!0;switch(b){case "fullScreen":return this.A[b]=c,this.b&&this.b.Ha?c.onclick=function(){d.Ha()}:c.parentNode.removeChild(c),!0}return!1};
|
||||
Fc.prototype.Ha=function(){var a=!1;if(this.b){if(this.b.Ha){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.C/this.w;b>c&&(a=Math.round(c/b*100)+"%")}this.La?(this.u.style.width=a,this.u.style.width=a,this.u.style.display="block",this.u.style.margin="auto"):(this.b.style.width=a,this.b.style.height="auto");this.b.style.backgroundColor="black";this.b.Ha();a=!0}this.R&&this.R.focus()}return a};
|
||||
function Ic(a,b){!b&&a.b&&(a.La?a.u.style.width=a.u.style.height="":a.b.style.width=a.b.style.height="")}function Kc(a,b){a.Na=b;a.N=!1;if(void 0===a.i||a.i.length!=a.Na)a.i=Array(a.Na)}function Mc(a,b,c,d,e){d=a.c?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.U&&(208<=c&&236>c?e=a.S+0:28<=c&&72>c&&(e=a.S+1));a=a.L[e];d*=a.length;b.data[d]=a[0];b.data[d+1]=a[1];b.data[d+2]=a[2];b.data[d+3]=a[3]}
|
||||
function Nb(a,b){var c=!0;if(!b){a.ma&&(120==a.ma?a.Xa&1?(hc(a.a,2),c=!1):hc(a.a,1):hc(a.a,4));if(c&&a.N&&a.B){for(var d=a.j,e=a.B,f=!0,g=a.ja>>>d.j;0<e&&g<d.b.length;)d.b[g].oa&&(d.b[g].oa=f=!1,d.b[g].Eb=!0),e-=d.c,g++;f&&(c=!1)}Kb(a.a,a.Bb,1E3/Math.max(a.Ab,a.ma));a.Xa++}if(c)if(1<a.T)switch(a.U){case 2:for(var c=a.ja,d=-1,e=0,f=60==a.Hb?2:5,h=g=0,l=-1;e<a.W;){var n=0,u=c,y=d,H=a.H;for(96!=y&&(H>>=1);;){var x=cb(a.j,u++);if(127==(x&127)){var t=cb(a.j,u++),d=t&96,c=(t&15)<<8|cb(a.j,u),c=c+(t&16?
|
||||
8192:16384);break}if(n<H)a.aa[n++]=x;else break}if(f)f--;else{for(;n<a.aa.length;)a.aa[n++]=0;if(0<=y)for(u=a.N&&a.i[g]==H,a.i[g++]=H,H=0;H<n;H++){x=a.aa[H];if(!u||x!==a.i[g]){a.i[l=g]=x;var t=a,D=a.sa,Q=x&127;if(x=t.I[y][x&128?1:0]){var U=(Q&15)*x.T,Q=(Q>>4)*x.P,Z,sa,Pa,fb,zc=x.T,Lb=x.P;D?(Z=H*t.T,sa=e*t.P,Pa=t.T,fb=t.P):(Z=H*t.Fa,sa=e*t.Ga,Pa=t.Fa,fb=t.Ga);x.T>t.T&&(Z*=2,Pa*=2);x.P>t.P&&(y||(Q+=t.P),Lb=t.P);D?D.drawImage(x.canvas,U,Q,zc,Lb,Z,sa,Pa,fb):(Z+=0,sa+=0,t.f.drawImage(x.canvas,U,Q,zc,Lb,
|
||||
Z,sa,Pa,fb))}h++}g++}e++}}a.N=!0;!b&&a.ta&&1==h&&(a.i[l]=-1,h=0);a.ta=!1;(h||b)&&a.sa&&a.f.drawImage(a.s,0,a.qa,a.o,a.G-a.P,0,0,a.Nc,a.Mb)}else{e=a.ja;f=e+a.B;l=h=g=0;b=a.o;n=0;c=a.G;y=d=0;u=a.la;H=(1<<u)-1;a.Pc&&(u=-u,y=16+u);for(;e<f;){t=a.j;D=e;x=D&t.f;U=(D&t.g)>>>t.j;t=x!=t.f?t.b[U].Ib(x,D):t.b[U++].eb(x,D)|t.b[U&t.o].eb(0,D+1)<<8;if(a.N&&t===a.i[g])h+=a.Oa;else{a.i[g]=t;(D=y)&&(t=t>>8|(t&255)<<8);h<b&&(b=h);for(x=a.Oa;x--;)U=t>>D&H,Mc(a,a.Ma,h++,l,U),D+=u;h>n&&(n=h);l<c&&(c=l);l>=d&&(d=l+1)}e+=
|
||||
function Nb(a,b){var c=!0;if(!b){a.ma&&(120==a.ma?a.Xa&1?(hc(a.a,2),c=!1):hc(a.a,1):hc(a.a,4));if(c&&a.N&&a.B){for(var d=a.j,e=a.B,f=!0,g=a.ja>>>d.j;0<e&&g<d.b.length;)d.b[g].oa&&(d.b[g].oa=f=!1,d.b[g].Eb=!0),e-=d.c,g++;f&&(c=!1)}Kb(a.a,a.Bb,1E3/Math.max(a.Ab,a.ma));a.Xa++}if(c)if(1<a.T)switch(a.U){case 2:for(var c=a.ja,d=-1,e=0,f=60==a.Hb?2:5,h=g=0,l=-1;e<a.W;){var n=0,u=c,z=d,H=a.H;for(96!=z&&(H>>=1);;){var x=cb(a.j,u++);if(127==(x&127)){var t=cb(a.j,u++),d=t&96,c=(t&15)<<8|cb(a.j,u),c=c+(t&16?
|
||||
8192:16384);break}if(n<H)a.Z[n++]=x;else break}if(f)f--;else{for(;n<a.Z.length;)a.Z[n++]=0;if(0<=z)for(u=a.N&&a.i[g]==H,a.i[g++]=H,H=0;H<n;H++){x=a.Z[H];if(!u||x!==a.i[g]){a.i[l=g]=x;var t=a,D=a.sa,Q=x&127;if(x=t.I[z][x&128?1:0]){var U=(Q&15)*x.T,Q=(Q>>4)*x.P,Z,sa,Pa,fb,zc=x.T,Lb=x.P;D?(Z=H*t.T,sa=e*t.P,Pa=t.T,fb=t.P):(Z=H*t.Fa,sa=e*t.Ga,Pa=t.Fa,fb=t.Ga);x.T>t.T&&(Z*=2,Pa*=2);x.P>t.P&&(z||(Q+=t.P),Lb=t.P);D?D.drawImage(x.canvas,U,Q,zc,Lb,Z,sa,Pa,fb):(Z+=0,sa+=0,t.f.drawImage(x.canvas,U,Q,zc,Lb,Z,
|
||||
sa,Pa,fb))}h++}g++}e++}}a.N=!0;!b&&a.ta&&1==h&&(a.i[l]=-1,h=0);a.ta=!1;(h||b)&&a.sa&&a.f.drawImage(a.s,0,a.qa,a.o,a.G-a.P,0,0,a.Nc,a.Mb)}else{e=a.ja;f=e+a.B;l=h=g=0;b=a.o;n=0;c=a.G;z=d=0;u=a.la;H=(1<<u)-1;a.Pc&&(u=-u,z=16+u);for(;e<f;){t=a.j;D=e;x=D&t.f;U=(D&t.g)>>>t.j;t=x!=t.f?t.b[U].Ib(x,D):t.b[U++].eb(x,D)|t.b[U&t.o].eb(0,D+1)<<8;if(a.N&&t===a.i[g])h+=a.Oa;else{a.i[g]=t;(D=z)&&(t=t>>8|(t&255)<<8);h<b&&(b=h);for(x=a.Oa;x--;)U=t>>D&H,Mc(a,a.Ma,h++,l,U),D+=u;h>n&&(n=h);l<c&&(c=l);l>=d&&(d=l+1)}e+=
|
||||
2;g++;if(h>=a.o&&(h=0,l++,l>a.G))break}a.N=!0;b<a.o&&(e=n-b,d-=c,a.c&&(f=b,g=e,b=c,e=d,c=a.o-(f+g),d=g),a.sa.putImageData(a.Ma,0,0,b,c,e,d),a.f.drawImage(a.s,0,0,a.s.width,a.s.height,0,0,a.C,a.w))}}
|
||||
za(function(){for(var a=A(document,"pc8080","video"),b=0;b<a.length;b++){var c=a[b],d=z(c),e=document.createElement("canvas");if(!e||!e.getContext){c.innerHTML="<br/>Missing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height=
|
||||
za(function(){for(var a=A(document,"pc8080","video"),b=0;b<a.length;b++){var c=a[b],d=y(c),e=document.createElement("canvas");if(!e||!e.getContext){c.innerHTML="<br/>Missing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height=
|
||||
(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Fa.aspect);f&&.3<=f&&3.33>=f&&(ya("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");ta("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new Fc(d,e,g,f,c);Qa(d,c)}});
|
||||
function Nc(a){this.I=+a.adapter;switch(this.I){case 0:this.L=0;this.R=2;break;default:q("Unrecognized serial adapter #"+this.I);return}this.b=this.c=null;this.N=a.tabSize;this.H=a.charBOL;this.f=0;this.C=!1;r.call(this,"SerialPort",a,Nc);var b=a.binding;if("console"==b)this.c="";else{var c;a=Oc;b&&(void 0===c&&(c="Panel"),(c=Oa(c,this.id))&&(b=c.A[b])&&this.V(null,a,b))}this.g="";this.i=this.s=null;this.exports={connect:this.Gb,receiveData:this.kb}}w(Nc);
|
||||
var Pc=[50,75,110,134.5,150,200,300,600,1200,1800,2E3,2400,3600,4800,9600,19200],Qc=[!1,0,0,133,142,39,238],Oc="buffer";k=Nc.prototype;
|
||||
|
|
@ -167,28 +167,28 @@ k.Gb=function(){if(!this.i){var a=Ab(this.v,"connection");if(a){var b=a.split("-
|
|||
k.ia=function(a){return a?this.save():!0};k.reset=function(){Uc(this)};k.save=function(){var a=new F(this),b=0,c=[];c[b++]=this.o;c[b++]=this.B;c[b++]=this.G;c[b++]=this.fa;c[b++]=this.m;c[b++]=this.w;c[b]=this.u;a.set(0,c);return a.data()};k.restore=function(a){return Uc(this,a[0])};function Uc(a,b){var c=0;b||(b=Qc);a.o=b[c++];a.B=b[c++];a.G=b[c++];a.fa=b[c++];a.m=b[c++];a.w=b[c++];a.u=b[c];return!0}
|
||||
function Vc(a,b){var c=a.u&b;b&15||(c>>=4);b=Pc[c];c=((a.m&12)>>2)+6;a.m&16&&c++;c+=((a.m&192)>>6)+1>>1;return 1E3/Math.round(b/c)}function Rc(a,b){return a.C||a.fa&2?!1:(a.B=b,a.fa|=2,hc(a.a,a.R),!0)}k.kb=function(a){null!=a&&(this.g="number"!=typeof a?a:this.g+String.fromCharCode(a));this.g&&(Rc(this,this.g.charCodeAt(0))&&(this.g=this.g.substr(1)),this.g&&this.a&&Kb(this.a,this.S,Vc(this,15)));return!0};k.Uc=function(){var a=this.B;this.fa&=-3;return a};k.Tc=function(){return this.fa};
|
||||
k.cd=function(a,b){this.G=b;this.fa&=-6;if(19==b)this.C=!0;else if(17==b)this.C=!1;else if(this.s&&this.s.call(this.i,b),this.b)if(8==b)this.b.value=this.b.value.slice(0,-1),0<this.f&&this.f--;else{a=(a=ia[b])?"<"+a+">":String.fromCharCode(b);var c=a.length;9==b?(b=this.N||8,c=b-this.f%b,this.N&&(a=" ".slice(0,c))):13==b&&(this.f=c=0,a="\n");this.H&&!this.f&&c&&(a=String.fromCharCode(this.H)+a);this.b.value+=a;this.b.scrollTop=this.b.scrollHeight;this.f+=c}else if(null!=
|
||||
this.c){if(10==b||1024<=this.c.length)this.ea(this.c),this.c="";10!=b&&(this.c+=String.fromCharCode(b))}this.a&&Kb(this.a,this.U,Vc(this,240))};k.bd=function(a,b){this.o?(this.w=b,this.w&64&&(this.o=!1)):(this.m=b,this.o=!0)};k.ad=function(a,b){this.u=b};var Sc={0:Nc.prototype.Uc,1:Nc.prototype.Tc},Tc={0:Nc.prototype.cd,1:Nc.prototype.bd,2:Nc.prototype.ad};za(function(){for(var a=A(document,"pc8080","serial"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Nc(d);Qa(d,c)}});
|
||||
function Wc(a,b,c){r.call(this,"Computer",a,Wc);this.l.Z=!1;Xc(this,b);this.w=Ab(this,"autoPower",a);this.f=0;this.M=a.busWidth||a.buswidth;this.b=Yc;this.s=null;this.v=this.G=!1;this.I=Ab(this,"url")||"";(Math.random()+.1).toString(36);this.c=Zc(this);if(this.a=Oa("CPU",this.id)){this.O=Oa("Debugger",this.id);this.m=[];for(b=null;b=Wa(this,"Video",b);)this.m.push(b);this.j=new Ya({id:this.ya+".bus",busWidth:this.M},this.a,this.O);var d,e=Ma(this.id);if((this.g=Oa("Panel",this.id))&&this.g.xa)for(b=
|
||||
this.c){if(10==b||1024<=this.c.length)this.ea(this.c),this.c="";10!=b&&(this.c+=String.fromCharCode(b))}this.a&&Kb(this.a,this.U,Vc(this,240))};k.bd=function(a,b){this.o?(this.w=b,this.w&64&&(this.o=!1)):(this.m=b,this.o=!0)};k.ad=function(a,b){this.u=b};var Sc={0:Nc.prototype.Uc,1:Nc.prototype.Tc},Tc={0:Nc.prototype.cd,1:Nc.prototype.bd,2:Nc.prototype.ad};za(function(){for(var a=A(document,"pc8080","serial"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Nc(d);Qa(d,c)}});
|
||||
function Wc(a,b,c){r.call(this,"Computer",a,Wc);this.l.Y=!1;Xc(this,b);this.w=Ab(this,"autoPower",a);this.f=0;this.M=a.busWidth||a.buswidth;this.b=Yc;this.s=null;this.v=this.G=!1;this.I=Ab(this,"url")||"";(Math.random()+.1).toString(36);this.c=Zc(this);if(this.a=Oa("CPU",this.id)){this.O=Oa("Debugger",this.id);this.m=[];for(b=null;b=Wa(this,"Video",b);)this.m.push(b);this.j=new Ya({id:this.ya+".bus",busWidth:this.M},this.a,this.O);var d,e=Ma(this.id);if((this.g=Oa("Panel",this.id))&&this.g.xa)for(b=
|
||||
0;b<e.length;b++)d=e[b],d.K=this.g.K,d.ea=this.g.ea,d.xa=this.g.xa;this.ea("PC8080 v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.ra&&d.ra(this,this.j,this.a,this.O);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.o=d:this.b=parseInt(d,10));var f;if(a=Ab(this,"state")||(f=!0,a.state))b=this.B=a,f||(this.v=!0,this.b=Yc),this.b&&(this.u=new F(this,"1.30.1"),$c(this.u)?b=null:delete this.u);
|
||||
!b&&this.b&&(b=ad(this))&&(this.v=!0);if(b){var g=this;la(b,null,!0,function(a,b,c){c?(g.o=null,g.v=!1,g.K("Unable to load machine state from server (error "+c+(b?": "+ha(b):"")+")")):(g.s=b,g.G=!0);B(g)})}else B(this);this.A.power||(this.w=!0);!c&&this.w&&bd(this,this.Ra)}else q("Unable to find CPU component")}w(Wc);var Yc=0;function Xc(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.H=b}
|
||||
function Ab(a,b,c){var d=b.toLowerCase(),d=Fa[b]||Fa[d];void 0===d&&a.H&&(d=a.H[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function bd(a,b,c){for(var d=Ma(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Sa(f)){Sa(f,function(){bd(a,b,c)});return}}b.call(a,c)}
|
||||
function cd(a,b){var c=new F(a,"1.30.1","validate");if($c(c)&&dd(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.K("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Wc.prototype;
|
||||
k.Ra=function(a){void 0===a&&(a=this.b||(this.s?1:Yc));if(!this.f){this.f++;var b=!1,c=!1;this.C=!1;var d=this.u||new F(this,"1.30.1");if(-1==a)b=!0;else if(a>Yc){if($c(d,this.s)){this.i=new F(this,"1.30.1","failsafe");$c(this.i)&&(ed(this,d),a=2,fd(this.i));this.i.set("timestamp",ka());gd(this.i);var e=this.b&&!this.v;if(1==a||na("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=dd(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?$c(d,g):("error"==
|
||||
f&&"no machine state"!=g?(this.K("Error: "+g),"unable to verify user"==g&&(ra("user",""),this.c=null)):this.ea(f+": "+g),fd(d),$c(d)?(c=dd(d),e=!0):c=!1))}e&&cd(this,c?d:null)}else 2==a&&d.clear()}else cd(this);delete this.s;delete this.u}e=Ma(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=hd(this,g,d,b,c));b=[d,a,c];-1!=a?bd(this,this.Db,b):this.Db(b)}};
|
||||
function hd(a,b,c,d,e){if(!b.l.Z){b.l.Z=!0;if(b.ga){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ga(f,d)&&f&&(q("Unable to restore state for "+b.type),a.B&&!a.G?(c.clear(),a.b=Yc,window&&window.location.reload()):a.C=!0,b.ga(null),e=!1)}if(!d&&b.yb)for(a=b.yb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
k.Db=function(a){var b=a[0],c=0>a[1];a=a[2];this.L=!0;this.l.Z=!0;var d=this.A.power;d&&(d.textContent="Shutdown");this.a&&(hd(this,this.a,b,c,a),this.a.Qa());this.C&&(ed(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.f=0};
|
||||
function hd(a,b,c,d,e){if(!b.l.Y){b.l.Y=!0;if(b.ga){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ga(f,d)&&f&&(q("Unable to restore state for "+b.type),a.B&&!a.G?(c.clear(),a.b=Yc,window&&window.location.reload()):a.C=!0,b.ga(null),e=!1)}if(!d&&b.yb)for(a=b.yb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
k.Db=function(a){var b=a[0],c=0>a[1];a=a[2];this.L=!0;this.l.Y=!0;var d=this.A.power;d&&(d.textContent="Shutdown");this.a&&(hd(this,this.a,b,c,a),this.a.Qa());this.C&&(ed(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.f=0};
|
||||
function ed(a,b){if(na("There may be a problem with your PC8080 machine.\n\nTo help us diagnose it, click OK to send this PC8080 machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PC8080",ver:"1.30.1"};d.url=a.I;d.user=c;d.type="bug";d.data=b;la("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function id(a,b,c){var d,e="none";if(a.f)return null;a.f--;var f=new F(a,"1.30.1"),g=new F(a,"1.30.1","validate"),h=ka();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ia&&(c&&Eb(a.a),d=a.a.ia(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.l.Z=!1,!1===d&&(e=null)));for(var h=Ma(a.id),l=0;l<h.length;l++){var n=h[l];n.l.Z&&(n.ia&&(d=n.ia(b,c),"object"===typeof d&&f.set(n.id,
|
||||
d)),c&&(n.l.Z=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.c&&jd(a,a.c,f.toString()),gd(g)&&gd(f)||(e=null,d=h=!0)):a.b&&(d=!0,h=3==a.b),d&&f.clear(h)):e=f.toString());c&&(a.l.Z=!1,b=a.A.power)&&(b.textContent="Power");a.f=0;return e}k.reset=function(){this.j&&this.j.reset&&this.j.reset();for(var a=Ma(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.j&&c.reset&&c.reset()}};
|
||||
function id(a,b,c){var d,e="none";if(a.f)return null;a.f--;var f=new F(a,"1.30.1"),g=new F(a,"1.30.1","validate"),h=ka();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ia&&(c&&Eb(a.a),d=a.a.ia(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.l.Y=!1,!1===d&&(e=null)));for(var h=Ma(a.id),l=0;l<h.length;l++){var n=h[l];n.l.Y&&(n.ia&&(d=n.ia(b,c),"object"===typeof d&&f.set(n.id,
|
||||
d)),c&&(n.l.Y=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.c&&jd(a,a.c,f.toString()),gd(g)&&gd(f)||(e=null,d=h=!0)):a.b&&(d=!0,h=3==a.b),d&&f.clear(h)):e=f.toString());c&&(a.l.Y=!1,b=a.A.power)&&(b.textContent="Power");a.f=0;return e}k.reset=function(){this.j&&this.j.reset&&this.j.reset();for(var a=Ma(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.j&&c.reset&&c.reset()}};
|
||||
k.start=function(a,b){for(var c=Ma(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};k.stop=function(a,b){for(var c=Ma(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
||||
k.V=function(a,b,c){var d=this;switch(b){case "power":return this.A[b]=c,c.onclick=function(){d.f||(d.l.Z?id(d,!1,!0):bd(d,d.Ra))},!0;case "reset":return this.A[b]=c,c.onclick=function(){if(d.l.Z&&!d.f)if(d.b&&!d.o){var a=na("Click OK to save changes to this PC8080 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");id(d,a,!0);!a&&d.B?window&&window.location.reload():d.Ra(Yc)}else d.reset(),d.a&&d.a.Qa()},!0;case "save":if(da())c.parentNode.removeChild(c);else return this.A[b]=
|
||||
k.V=function(a,b,c){var d=this;switch(b){case "power":return this.A[b]=c,c.onclick=function(){d.f||(d.l.Y?id(d,!1,!0):bd(d,d.Ra))},!0;case "reset":return this.A[b]=c,c.onclick=function(){if(d.l.Y&&!d.f)if(d.b&&!d.o){var a=na("Click OK to save changes to this PC8080 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");id(d,a,!0);!a&&d.B?window&&window.location.reload():d.Ra(Yc)}else d.reset(),d.a&&d.a.Qa()},!0;case "save":if(da())c.parentNode.removeChild(c);else return this.A[b]=
|
||||
c,c.onclick=function(){var a=Zc(d,!0);if(a){var b=!!(d.b&&!d.o||d.B),c=id(d,b);b?jd(d,a,c):d.K("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Zc(a,b){var c=a.c;c||((c=qa("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=kd(a,c))||a.K("The user ID is invalid.")):b&&a.K("Browser local storage is not available"));return c}
|
||||
function kd(a,b){a.c=null;b=la(ea()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(ra("user",b.data),a.c=b.data)}catch(d){q(d.message+" ("+c+")")}return a.c}function ad(a){var b=null;a.c&&(b=ea()+"/api/v1/user?req=load&user="+a.c+"&state="+ld(a,"1.30.1"));return b}
|
||||
function jd(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=ld(a,"1.30.1");d.data=c;b=la(ea()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.K("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.K(c),ra("user",""),a.c=null)}}
|
||||
function Wa(a,b,c){a=Ma(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}function Ib(a,b){if(a.m.length){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a=a.m[0];a.R&&a.R.focus();!b&&window&&window.scrollTo(c,d)}}k.Da=function(a){this.a&&this.a.Da(a);this.g&&this.g.Da(a)};
|
||||
za(function(){for(var a=A(document,"pc8080-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=A(c,"pc8080","computer"),e=0;e<c.length;e++){var f=c[e],g=z(f),g=new Wc(g,d,!0);Qa(g,f);g.w&&bd(g,g.Ra)}});ua.show.push(function(){for(var a=A(document,"pc8080","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Oa("Computer",c.id))&&c.L&&!c.l.Z&&c.Ra(-1)}});
|
||||
ua.exit.push(function(){for(var a=A(document,"pc8080","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Oa("Computer",c.id))&&c.l.Z&&id(c,!(!c.b||c.o),!0)}});function F(a,b,c){this.id=a.id;this.key=ld(a,b,c);this.O=a.O;fd(this,a.Qc)}function ld(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
za(function(){for(var a=A(document,"pc8080-machine"),b=0;b<a.length;b++)for(var c=a[b],d=y(c),c=A(c,"pc8080","computer"),e=0;e<c.length;e++){var f=c[e],g=y(f),g=new Wc(g,d,!0);Qa(g,f);g.w&&bd(g,g.Ra)}});ua.show.push(function(){for(var a=A(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Oa("Computer",c.id))&&c.L&&!c.l.Y&&c.Ra(-1)}});
|
||||
ua.exit.push(function(){for(var a=A(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Oa("Computer",c.id))&&c.l.Y&&id(c,!(!c.b||c.o),!0)}});function F(a,b,c){this.id=a.id;this.key=ld(a,b,c);this.O=a.O;fd(this,a.Qc)}function ld(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
F.prototype={constructor:F,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){fd(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
||||
1);c=0}}};function fd(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function gd(a){var b=!0;if(pa()){var c=JSON.stringify(a[a.id]);ra(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function dd(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function $c(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:pa()&&(b=qa(a.key))?(a[a.id]=b,a.a=!0):!1}var md=0;
|
||||
function nd(a,b,c,d,e,f){e("Loading "+a+"...");la(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):od(h,a,b,c,d,e,f)})}
|
||||
|
|
@ -197,6 +197,6 @@ a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$2"
|
|||
null)}
|
||||
function pd(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");la(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],n,u=/( [a-z]+=)(['"])(.*?)\2/g;n=u.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,"");
|
||||
a=a.replace(d[0],g);pd(a,b,c)}})}else c(a,null)}
|
||||
function qd(a,b,c,d){function e(a){if(void 0===h){var b=g&&A(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ga(a))}function f(a){e("Error: "+a);l&&(--md||Ca(!0));l=!1}var g,h,l=!0;md++;Ka[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var u=document.head||document.getElementsByTagName("head")[0],y=document.createElement("style");y.type="text/css";y.styleSheet?y.styleSheet.cssText=n:y.appendChild(document.createTextNode(n));u.appendChild(y)}c||
|
||||
function qd(a,b,c,d){function e(a){if(void 0===h){var b=g&&A(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ga(a))}function f(a){e("Error: "+a);l&&(--md||Ca(!0));l=!1}var g,h,l=!0;md++;Ka[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var u=document.head||document.getElementsByTagName("head")[0],z=document.createElement("style");z.type="text/css";z.styleSheet?z.styleSheet.cssText=n:z.appendChild(document.createTextNode(n));u.appendChild(z)}c||
|
||||
(c="/versions/pc8080/1.30.1/components.xsl");n=function(d,h){h?nd(c,null,null,!1,e,function(d,l){l?(La(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--md||Ca(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--md||Ca(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?nd(b,a,d,!0,e,n):od(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(H){f(H.message)}return l}window.embedPC8080=function(a,b,c,d){Ca(!1);return qd(a,b,c,d)};window.enableEvents=Ca;window.sendEvent=Da;})();
|
||||
|
|
|
|||
|
|
@ -738,21 +738,32 @@
|
|||
<xsl:template match="device[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/device"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
<xsl:apply-templates select="document($componentFile)/device">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="mount" select="@automount"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="device[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:param name="mount" select="''"/>
|
||||
<xsl:variable name="type">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="autoMount">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mount != ''"><xsl:value-of select="$mount"/></xsl:when>
|
||||
<xsl:when test="@automount"><xsl:value-of select="@automount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@autoMount"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">device</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>',autoMount:'<xsl:value-of select="$autoMount"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
@ -878,10 +889,11 @@
|
|||
<xsl:template match="fdc[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:param name="mount" select="''"/>
|
||||
<xsl:variable name="automount">
|
||||
<xsl:variable name="autoMount">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mount != ''"><xsl:value-of select="$mount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@automount"/></xsl:otherwise>
|
||||
<xsl:when test="@automount"><xsl:value-of select="@automount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@autoMount"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="sortBy">
|
||||
|
|
@ -893,7 +905,7 @@
|
|||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">fdc</xsl:with-param>
|
||||
<xsl:with-param name="parms">,autoMount:'<xsl:value-of select="$automount"/>',sortBy:'<xsl:value-of select="$sortBy"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,autoMount:'<xsl:value-of select="$autoMount"/>',sortBy:'<xsl:value-of select="$sortBy"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
|
|||
|
|
@ -738,21 +738,32 @@
|
|||
<xsl:template match="device[@ref]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
|
||||
<xsl:apply-templates select="document($componentFile)/device"><xsl:with-param name="machine" select="$machine"/></xsl:apply-templates>
|
||||
<xsl:apply-templates select="document($componentFile)/device">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="mount" select="@automount"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="device[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:param name="mount" select="''"/>
|
||||
<xsl:variable name="type">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="autoMount">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mount != ''"><xsl:value-of select="$mount"/></xsl:when>
|
||||
<xsl:when test="@automount"><xsl:value-of select="@automount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@autoMount"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">device</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>',autoMount:'<xsl:value-of select="$autoMount"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
@ -878,10 +889,11 @@
|
|||
<xsl:template match="fdc[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:param name="mount" select="''"/>
|
||||
<xsl:variable name="automount">
|
||||
<xsl:variable name="autoMount">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mount != ''"><xsl:value-of select="$mount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@automount"/></xsl:otherwise>
|
||||
<xsl:when test="@automount"><xsl:value-of select="@automount"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@autoMount"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="sortBy">
|
||||
|
|
@ -893,7 +905,7 @@
|
|||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">fdc</xsl:with-param>
|
||||
<xsl:with-param name="parms">,autoMount:'<xsl:value-of select="$automount"/>',sortBy:'<xsl:value-of select="$sortBy"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,autoMount:'<xsl:value-of select="$autoMount"/>',sortBy:'<xsl:value-of select="$sortBy"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,234 +28,241 @@
|
|||
http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016
|
||||
*/
|
||||
for(var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea<da.length-1;ea++){var fa=da[ea];fa in ba||(ba[fa]={});ba=ba[fa]}var ga=da[da.length-1],la=ba[ga],ma=la?la:function(a){return Math.log(a)/Math.LN2};
|
||||
ma!=la&&null!=ma&&aa(ba,ga,{configurable:!0,writable:!0,value:ma});function na(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function k(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
|
||||
function oa(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}function pa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function qa(){var a=ra();return-1!==a.indexOf("pcjs.org",a.length-8)}var sa={"&":"&","<":"<",">":">",'"':""","'":"'"};function ta(a){return a.replace(/[&<>"']/g,function(a){return sa[a]})}function ua(a,b){return(a+" ").slice(0,b)}
|
||||
function va(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var wa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
||||
function ya(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,l;l=c(b,a[g]);0<l?d=g+1:(e=g,f=!l)}return f?d:~d}var za=Date.now||function(){return+new Date};function Aa(){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 Ba(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"==
|
||||
typeof b){var m="",p;for(p in b)b.hasOwnProperty(p)&&(m&&(m+="&"),m+=p+"="+encodeURIComponent(b[p]));m=m.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(m)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),g=[f,e]);return g}
|
||||
function Fa(a,b){var c,d={ga:null,ja:null,Lb:null,Kb:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g=eval("("+b+")");d.Lb=g.load;d.Kb=g.exec;if(e=g.bytes)d.ga=e;else if(e=g.words)for(d.ga=Array(2*e.length),f=c=0;c<e.length;c++)d.ga[f++]=e[c]&255,d.ga[f++]=e[c]>>8&255;else if(e=g.data)for(d.ga=Array(4*e.length),f=c=0;c<e.length;c++)d.ga[f++]=e[c]&255,d.ga[f++]=e[c]>>8&255,d.ga[f++]=e[c]>>16&255,d.ga[f++]=e[c]>>24&255;else d.ga=g;d.ja=g.symbols;d.ga.length?1==d.ga.length&&(n(d.ga[0]),d=null):
|
||||
(n("Empty resource: "+a),d=null)}catch(l){n("Resource data error: "+l.message),d=null}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),d.ga=Array(a.length),c=0;c<a.length;c++)d.ga[c]=parseInt(a[c],16);return d}function ra(){return"http://"+(window?window.location.host:"www.pcjs.org")}function n(a){window&&window.alert(a)}function Ga(a){var b=!1;window&&(b=window.confirm(a));return b}var Ha=null;
|
||||
function Ia(){if(null==Ha){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Ha=a}return Ha}function Ja(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Ka(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}
|
||||
function La(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Ma(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||
for(var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea<da.length-1;ea++){var fa=da[ea];fa in ba||(ba[fa]={});ba=ba[fa]}var ga=da[da.length-1],ha=ba[ga],ma=ha?ha:function(a){return Math.log(a)/Math.LN2};
|
||||
ma!=ha&&null!=ma&&aa(ba,ga,{configurable:!0,writable:!0,value:ma});function na(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function l(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
|
||||
function oa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function pa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function qa(){var a=ra();return-1!==a.indexOf("pcjs.org",a.length-8)}var sa={"&":"&","<":"<",">":">",'"':""","'":"'"};function ta(a){return a.replace(/[&<>"']/g,function(a){return sa[a]})}
|
||||
function ua(a,b){return(a+" ").slice(0,b)}function va(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var wa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
||||
function ya(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,k;k=c(b,a[g]);0<k?d=g+1:(e=g,f=!k)}return f?d:~d}var za=Date.now||function(){return+new Date};function Aa(){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 Ba(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"==
|
||||
typeof b){var m="",p;for(p in b)b.hasOwnProperty(p)&&(m&&(m+="&"),m+=p+"="+encodeURIComponent(b[p]));m=m.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(m)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g}
|
||||
function Ca(a,b){var c,d={ja:null,ka:null,Lb:null,Kb:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Lb=g.load;d.Kb=g.exec;if(e=g.bytes)d.ja=e;else if(e=g.words)for(d.ja=Array(2*e.length),f=c=0;c<e.length;c++)d.ja[f++]=e[c]&255,d.ja[f++]=e[c]>>8&255;else if(e=g.data)for(d.ja=Array(4*e.length),f=c=0;c<e.length;c++)d.ja[f++]=
|
||||
e[c]&255,d.ja[f++]=e[c]>>8&255,d.ja[f++]=e[c]>>16&255,d.ja[f++]=e[c]>>24&255;else d.ja=g;d.ka=g.symbols;d.ja.length?1==d.ja.length&&(n(d.ja[0]),d=null):(n("Empty resource: "+a),d=null)}catch(k){n("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){n("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.ja=e)}return d}
|
||||
function ra(){return"http://"+(window?window.location.host:"www.pcjs.org")}function n(a){window&&window.alert(a)}function Da(a){var b=!1;window&&(b=window.confirm(a));return b}var Ha=null;function Ia(){if(null==Ha){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Ha=a}return Ha}
|
||||
function Ja(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Ka(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function La(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Ma(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||
function Na(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Oa={init:[],show:[],exit:[]},Pa=!1,Qa=!1,Ra=!0;function Sa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ta(a){Oa.init.push(a)}
|
||||
function Ua(a){if(Ra)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){n(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Va(a){!Ra&&a?(Ra=!0,Pa&&Wa("init"),Qa&&Wa("show")):Ra=a}function Wa(a){Oa[a]&&Ua(Oa[a])}Sa("onload",function(){Pa=!0;Ua(Oa.init)});Sa("onpageshow",function(){Qa=!0;Ua(Oa.show)});Sa(La("Opera")||La("iOS")?"onunload":"onbeforeunload",function(){Ua(Oa.exit)});
|
||||
function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Yb=b.comment;this.tc=b;b=this.id.indexOf(".");0>b?this.Ua=this.id:(this.Va=this.id.substr(0,b),this.Ua=this.id.substr(b+1));this[a]=c;this.v={ready:!1,mb:!1,Ib:!1,ia:!1,error:!1};this.zb=null;this.v.error=!1;this.J={};this.i=null;this.ka=d||0;t.push(this)}var cb=void 0,db={};
|
||||
function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Yb=b.comment;this.tc=b;b=this.id.indexOf(".");0>b?this.Wa=this.id:(this.Ra=this.id.substr(0,b),this.Wa=this.id.substr(b+1));this[a]=c;this.v={ready:!1,Ia:!1,Ib:!1,ha:!1,error:!1};this.zb=null;this.v.error=!1;this.I={};this.i=null;this.la=d||0;t.push(this)}var cb=void 0,db={};
|
||||
if(window){cb||(cb=window.location.search.substr(1));for(var eb,fb=/\+/g,gb=/([^&=]+)=?([^&]*)/g;eb=gb.exec(cb);)db[decodeURIComponent(eb[1].replace(fb," "))]=decodeURIComponent(eb[2].replace(fb," "))}function hb(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
|
||||
function u(a,b){b||(b=r);a.prototype=hb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var ib=window.PCjs.Machines||(window.PCjs.Machines={}),t=window.PCjs.Components||(window.PCjs.Components=[])}else ib={},t=[];function jb(a,b,c){ib[a]&&b&&(ib[a][b]=c)}function kb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<t.length;b++){var d=t[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
||||
function lb(a){if(void 0!==a){var b;for(b=0;b<t.length;b++)if(t[b].id===a)return t[b]}return null}function mb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<t.length;d++)if(c)c==t[d]&&(c=null);else if(!(a!=t[d].type||b&&t[d].id.indexOf(b)))return t[d]}return null}function z(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){n(c.message+" ("+a+")")}return b}
|
||||
function A(a,b){b=B(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var l=g.split(" "),m=0;m<l.length;m++)switch(g=l[m],g){case "pdp11-binding":(g=z(f))&&g.binding&&a.qa(g.type,g.binding,f,g.value),m=l.length}}}}
|
||||
function A(a,b){b=B(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var k=g.split(" "),m=0;m<k.length;m++)switch(g=k[m],g){case "pdp11-binding":(g=z(f))&&g.binding&&a.qa(g.type,g.binding,f,g.value),m=k.length}}}}
|
||||
function B(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
||||
r.prototype={constructor:r,parent:null,toString:function(){return this.name?this.name:this.id||this.type},qa:function(a,b,c){switch(b){case "clear":return this.J[b]||(this.J[b]=c,c.onclick=function(a){return function(){a.J.print&&(a.J.print.value="")}}(this)),!0;case "print":return this.J[b]||(this.Ra=this.J[b]=c,c.value="",this.j=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||
this.pa=function(a){this.j(a,this.Ua)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.Ua+": "+a)},pa:function(a,b,c){c=c||this.type;b||n((c?c+": ":"")+a)},Aa:function(){return this.v.ia=!0},za:function(a,b){b&&(this.v.ia=!1);return!0}};function E(a,b,c,d){a.i&&(!0===c||G(a,c|0))&&a.i.message(b,d)}function G(a,b){if(a.i){a===a.i?b|=0:b=b||a.ka;var c=a.i.ka&b;return!!b&&c===b||!!(c&a.i.nc)}return!1}
|
||||
function nb(a,b){if(a.v.Ib)return a.v.mb=!1,a.v.Ib=!1;if(a.v.error)return a.j(a.toString()+" error"),!1;a.v.mb=b;return a.v.mb}function ob(a,b){a.v.mb&&(b?a.v.Ib=!0:void 0===b&&a.j(a.toString()+" busy"));return a.v.mb}function H(a){if(!a.v.error&&(a.v.ready=!0,a.v.ready)){var b=a.zb;a.zb=null;b&&b()}}function pb(a,b){b&&(a.v.ready?b():a.zb=b);return a.v.ready}function qb(a){return a.v.error?(a.j(a.toString()+" error"),!0):!1}function rb(a,b){a.v.error=!0;a.pa(b)}
|
||||
r.prototype={constructor:r,parent:null,toString:function(){return this.name?this.name:this.id||this.type},qa:function(a,b,c){switch(b){case "clear":return this.I[b]||(this.I[b]=c,c.onclick=function(a){return function(){a.I.print&&(a.I.print.value="")}}(this)),!0;case "print":return this.I[b]||(this.Ta=this.I[b]=c,c.value="",this.j=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||
this.ga=function(a){this.j(a,this.Wa)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.Wa+": "+a)},ga:function(a,b,c){c=c||this.type;b||n((c?c+": ":"")+a)},Aa:function(){return this.v.ha=!0},za:function(a,b){b&&(this.v.ha=!1);return!0}};function C(a,b,c,d){a.i&&(!0===c||D(a,c|0))&&a.i.message(b,d)}function D(a,b){if(a.i){a===a.i?b|=0:b=b||a.la;var c=a.i.la&b;return!!b&&c===b||!!(c&a.i.nc)}return!1}
|
||||
function nb(a,b){if(a.v.Ib)return a.v.Ia=!1,a.v.Ib=!1;if(a.v.error)return a.j(a.toString()+" error"),!1;a.v.Ia=b;return a.v.Ia}function ob(a,b){a.v.Ia&&(b?a.v.Ib=!0:void 0===b&&a.j(a.toString()+" busy"));return a.v.Ia}function H(a){if(!a.v.error&&(a.v.ready=!0,a.v.ready)){var b=a.zb;a.zb=null;b&&b()}}function pb(a,b){b&&(a.v.ready?b():a.zb=b);return a.v.ready}function qb(a){return a.v.error?(a.j(a.toString()+" error"),!0):!1}function rb(a,b){a.v.error=!0;a.ga(b)}
|
||||
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});
|
||||
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
|
||||
var sb="undefined"!==typeof ArrayBuffer,Gb={cpu:1,trap:16,bus:64,memory:128,device:256,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function Hb(a){r.call(this,"Panel",a,Hb);this.f=0;this.v.Wb=!0}u(Hb);h=Hb.prototype;
|
||||
h.qa=function(a,b,c,d){if(this.B&&this.B.qa(a,b,c,d)||this.b&&this.b.qa(a,b,c,d)||this.i&&this.i.qa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.J[b]=c,this.f++,!0;default:return"rled"==a?(this.J[b]=c,this.f++,!0):this.parent.qa.call(this,a,b,c,d)}};h.Ca=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d};h.Aa=function(a,b){b||Ib();return!0};h.za=function(){return!0};
|
||||
function Jb(a,b,c,d){if(a.J[b]){void 0===c&&(rb(a,"Value for "+b+" is invalid"),a.b.da());var e=a.i&&a.i.la||8;c=!a.b.v.ca||a.v.Wb?8==e?na(c,d):k(c,d):"--------".substr(0,d||4);a.J[b].textContent!=c&&(a.J[b].textContent=c)}}function Kb(a,b,c,d){for(var e=0;e<d;e++){var f=a.J[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}}
|
||||
h.$=function(a){if(this.f&&(a||!this.b.v.ca||this.v.Wb)){for(a=0;a<this.b.u.length;a++)Jb(this,"R"+a,this.b.u[a]);a=Lb(this.b);Jb(this,"PS",a);Jb(this,"NF",a&8?1:0,1);Jb(this,"ZF",a&4?1:0,1);Jb(this,"VF",a&2?1:0,1);Jb(this,"CF",a&1?1:0,1);Kb(this,"D",this.b.u[0],16);Kb(this,"A",this.b.u[7],22)}};function Ib(){for(var a=!1,b=B(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=z(d),f=lb(e.id);f||(a=!0,f=new Hb(e));A(f,d);a&&H(f)}}Ta(Ib);
|
||||
function Mb(a,b,c){r.call(this,"Bus",a,Mb,64);this.b=b;this.i=c;this.M=a.busWidth||16;this.g=0;this.K=[];this.G=null;this.H=Math.pow(2,this.M);this.f=this.H-1|0;this.ua=Nb;this.ha=Math.log2(this.ua);this.I=this.ua>>2;this.w=this.ua-1;this.D=this.H/this.ua|0;this.Ha=[];this.C=0;this.B=[];this.mc=[Ob,Pb,Qb,Rb];a=new I(this);Sb(a,this.i);this.W=Array(this.D);for(b=0;b<this.D;b++)this.W[b]=a;H(this)}u(Mb);var Nb=8192,Tb=Nb-1;
|
||||
function Ob(a,b){var c=-1,d=this.controller,e=d.Ha[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>8:e[2](b)&255):b&1&&(e=d.Ha[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&G(this.i,64)&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!0);this.i&&G(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c}
|
||||
function Pb(a,b,c){var d=!1,e=this.controller,f=e.Ha[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ha[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d?this.i&&G(this.i,64)&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!0,b),this.i&&G(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))}
|
||||
function Qb(a,b){var c=-1,d=this.controller;(a=d.Ha[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&G(this.i,64)&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!1);this.i&&G(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c}
|
||||
function Rb(a,b,c){var d=!1,e=this.controller;if(a=e.Ha[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.i&&G(this.i,64)&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!1,b),this.i&&G(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))}
|
||||
function Vb(a,b){if(b!=a.g){var c;a.g&&(c=(1<<a.g)-Nb,Wb(a,c,Nb,a.K),a.g=0);b&&(a.g=b,c=(1<<b)-Nb,a.K=Xb(a,c,Nb),a.G?Wb(a,c,Nb,a.G):(Yb(a,c,Nb,Zb,a),a.G=Xb(a,c,Nb)))}}h=Mb.prototype;h.reset=function(){for(var a=0;a<this.B.length;a++)this.B[a]();Vb(this,16)};function Ub(a,b,c,d){if(a.i&&G(a.i,536870912)&&(E(a.i,"warning: unknown I/O access ("+J(a.i,b)+","+J(a.i,d,c?1:2)+")",!0,!0),$b(a.i)))return 0;a.C||a.b.ea(4,b);return 0}h.Aa=function(a,b){b||this.reset();return!0};
|
||||
function Yb(a,b,c,d,e){for(var f=b,g=c,l=f>>>a.ha;0<g&&l<a.W.length;){var m=a.W[l],p=l*a.ua,q=a.ua-(f-p);q>g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.A)return m.vb+=m.A-f,m.A=f,!0;if(f>=m.A+m.vb){q=m.size-(f-p);q>g&&(q=g);m.vb=f-m.A+q;f=p+a.ua;g-=q;l++;continue}}return ac(1,f,g)}f=new I(a,f,q,a.ua,d,e);Sb(f,a.i,m);a.W[l++]=f;f=p+a.ua;g-=q}if(0>=g){c/=1024;var v;e="";v?10<v&&(v=10):v=c&-65536?10:5;if(null==c||isNaN(c))for(;0<v--;)e="?"+e;else for(;0<v--;)e=String.fromCharCode(c%10+48)+e,c/=
|
||||
10;a.status(e+"Kb "+bc[d]+" at "+na(b));return!0}return ac(2,b,c)}function Xb(a,b,c){var d=[];for(b>>>=a.ha;0<c&&b<a.W.length;)d.push(a.W[b++]),c-=a.ua;return d}function Wb(a,b,c,d){var e=0;for(b>>>=a.ha;0<c&&b<a.W.length;){var f=d[e++];if(!f)break;a.W[b++]=f;c-=a.ua}}h.ob=function(a){return this.W[(a&this.f)>>>this.ha].Eb(a&this.w,a)};h.Bb=function(a){this.C++;a=this.W[(a&this.f)>>>this.ha].Mb(a&this.w,a);this.C--;return a};h.ma=function(a){return this.W[(a&this.f)>>>this.ha].ta(a&this.w,a)};
|
||||
h.pb=function(a){var b=a&this.w,c=(a&this.f)>>>this.ha;this.C++;a=this.W[c].Nb(b,a);this.C--;return a};h.Fb=function(a,b){this.W[(a&this.f)>>>this.ha].Hb(a&this.w,b&255,a)};h.gb=function(a,b){this.C++;this.W[(a&this.f)>>>this.ha].Sb(a&this.w,b&255,a);this.C--};h.Ta=function(a,b){this.W[(a&this.f)>>>this.ha].wb(a&this.w,b&65535,a)};h.Gb=function(a,b){var c=a&this.w,d=(a&this.f)>>>this.ha;this.C++;this.W[d].Tb(c,b&65535,a);this.C--};
|
||||
function cc(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.W[d];if(e.Ia||e.pc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,l=0,m=[];g<e.length;){for(var p=e[g],q=g+1;q<e.length&&e[q]===p;)q++;m[l++]=q-g;m[l++]=p;g=q}m.length<e.length&&(e=m)}c[f]=e}}return c}function lc(a,b,c,d,e,f,g,l){for(;b<=c;b+=2){var m=b&Tb;void 0!==a.Ha[m]?n("I/O address already registered: "+k(b,8,!0)):a.Ha[m]=[d,e,f,g,l||"unknown",!1]}}
|
||||
function mc(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.b.$a)){var g=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));lc(a,e,e,g,l,m,p,f[4])}}}function nc(a,b){a.B.push(b)}
|
||||
function oc(a,b){a.C||(a.i&&G(a.i,536870912)&&E(a.i,"memory fault on address "+J(a.i,b),!0,!0),a.b.ea(4,b))}function ac(a,b,c){n("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function K(a){r.call(this,"Device",a,K,256);this.g={data:0,Sd:0,Db:20,gd:0};this.f={Td:0,Rb:-1}}u(K);h=K.prototype;
|
||||
h.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;var e=this;this.f.Rb=pc(c,function(){e.f.Ja|=128;e.f.Ja&64&&(qc(e.b,e.f.hd),rc(e.b,e.f.Rb,1E3/60))});this.f.hd=sc(64,6);mc(b,this,L);nc(b,this.reset.bind(this));H(this)};h.reset=function(){this.g.Db=this.g.Db&-120|20;this.f.Ja=0};h.Dc=function(){var a=this.f.Ja;this.f.Ja&=-129;return a};h.rd=function(a){this.f.Ja=a;a&64&&rc(this.b,this.f.Rb,1E3/60);this.f.Ja=a&-129};h.wc=function(a){return(a?this.g.gd:this.g.data)&65535};
|
||||
h.kd=function(a){this.g.data=a};h.Fc=function(){var a=this.b;return a.G&62337|a.wa<<5|a.xa<<1};h.td=function(a){var b=this.b;a&=62337;if(b.G!=a){b.G=a;b.wa=a>>5&3;b.xa=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ka!=c&&(b.Ka=c,tc(b))}uc(this)};h.Gc=function(){var a=this.b.Ma;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Hc=function(){return this.b.tb};h.Ic=function(){return this.b.Na};
|
||||
h.ud=function(a){var b=this.b;1170>b.$a&&(a&=-49);b.Na!=a&&(b.Na=a,a&16?(b.Ya=4194303,b.ya=3915776):(b.Ya=262143,b.ya=253952),tc(b));uc(this)};function uc(a){a.g.Db=a.g.Db&-8|(a.b.Ka?a.b.Na&16?1:2:4)}h.Wc=function(a){return this.b.P[1][a>>1&7]};h.Id=function(a,b){this.b.P[1][b>>1&7]=a&65295};h.Uc=function(a){return this.b.P[1][(a>>1&7)+8]};h.Gd=function(a,b){this.b.P[1][(b>>1&7)+8]=a&65295};h.Vc=function(a){return this.b.sa[1][a>>1&7]};
|
||||
var sb="undefined"!==typeof ArrayBuffer,tb={cpu:1,trap:16,bus:64,memory:128,device:256,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function ub(a){r.call(this,"Panel",a,ub);this.f=0;this.v.Wb=!0}u(ub);h=ub.prototype;
|
||||
h.qa=function(a,b,c,d){if(this.C&&this.C.qa(a,b,c,d)||this.b&&this.b.qa(a,b,c,d)||this.i&&this.i.qa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.I[b]=c,this.f++,!0;default:return"rled"==a?(this.I[b]=c,this.f++,!0):this.parent.qa.call(this,a,b,c,d)}};h.Ca=function(a,b,c,d){this.C=a;this.w=b;this.b=c;this.i=d};h.Aa=function(a,b){b||Ib();return!0};h.za=function(){return!0};
|
||||
function Jb(a,b,c,d){if(a.I[b]){void 0===c&&(rb(a,"Value for "+b+" is invalid"),a.b.da());var e=a.i&&a.i.ma||8;c=!a.b.v.ca||a.v.Wb?8==e?na(c,d):l(c,d):"--------".substr(0,d||4);a.I[b].textContent!=c&&(a.I[b].textContent=c)}}function Kb(a,b,c,d){for(var e=0;e<d;e++){var f=a.I[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}}
|
||||
h.$=function(a){if(this.f&&(a||!this.b.v.ca||this.v.Wb)){for(a=0;a<this.b.u.length;a++)Jb(this,"R"+a,this.b.u[a]);a=Lb(this.b);Jb(this,"PS",a);Jb(this,"NF",a&8?1:0,1);Jb(this,"ZF",a&4?1:0,1);Jb(this,"VF",a&2?1:0,1);Jb(this,"CF",a&1?1:0,1);Kb(this,"D",this.b.u[0],16);Kb(this,"A",this.b.u[7],22)}};function Ib(){for(var a=!1,b=B(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=z(d),f=lb(e.id);f||(a=!0,f=new ub(e));A(f,d);a&&H(f)}}Ta(Ib);
|
||||
function Mb(a,b,c){r.call(this,"Bus",a,Mb,64);this.b=b;this.i=c;this.M=a.busWidth||16;this.g=0;this.K=[];this.G=null;this.H=Math.pow(2,this.M);this.f=this.H-1|0;this.ua=Nb;this.ia=Math.log2(this.ua);this.J=this.ua>>2;this.w=this.ua-1;this.D=this.H/this.ua|0;this.Ha=[];this.A=0;this.C=[];this.mc=[Ob,Pb,Qb,Rb];a=new I(this);Sb(a,this.i);this.W=Array(this.D);for(b=0;b<this.D;b++)this.W[b]=a;H(this)}u(Mb);var Nb=8192,Tb=Nb-1;
|
||||
function Ob(a,b){var c=-1,d=this.controller,e=d.Ha[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>8:e[2](b)&255):b&1&&(e=d.Ha[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&D(this.i,64)&&C(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!0);this.i&&D(this.i,64)&&C(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c}
|
||||
function Pb(a,b,c){var d=!1,e=this.controller,f=e.Ha[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ha[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d?this.i&&D(this.i,64)&&C(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!0,b),this.i&&D(this.i,64)&&C(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))}
|
||||
function Qb(a,b){var c=-1,d=this.controller;(a=d.Ha[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&D(this.i,64)&&C(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!1);this.i&&D(this.i,64)&&C(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c}
|
||||
function Rb(a,b,c){var d=!1,e=this.controller;if(a=e.Ha[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.i&&D(this.i,64)&&C(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!1,b),this.i&&D(this.i,64)&&C(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))}
|
||||
function Vb(a,b){if(b!=a.g){var c;a.g&&(c=(1<<a.g)-Nb,Wb(a,c,Nb,a.K),a.g=0);b&&(a.g=b,c=(1<<b)-Nb,a.K=Xb(a,c,Nb),a.G?Wb(a,c,Nb,a.G):(Yb(a,c,Nb,Zb,a),a.G=Xb(a,c,Nb)))}}h=Mb.prototype;h.reset=function(){for(var a=0;a<this.C.length;a++)this.C[a]();Vb(this,16)};function Ub(a,b,c,d){if(a.i&&D(a.i,536870912)&&(C(a.i,"warning: unknown I/O access ("+J(a.i,b)+","+J(a.i,d,c?1:2)+")",!0,!0),$b(a.i)))return 0;a.A||a.b.ea(4,b);return 0}h.Aa=function(a,b){b||this.reset();return!0};
|
||||
function Yb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.ia;0<g&&k<a.W.length;){var m=a.W[k],p=k*a.ua,q=a.ua-(f-p);q>g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.B)return m.vb+=m.B-f,m.B=f,!0;if(f>=m.B+m.vb){q=m.size-(f-p);q>g&&(q=g);m.vb=f-m.B+q;f=p+a.ua;g-=q;k++;continue}}return ac(1,f,g)}f=new I(a,f,q,a.ua,d,e);Sb(f,a.i,m);a.W[k++]=f;f=p+a.ua;g-=q}if(0>=g){c/=1024;var v;e="";v?10<v&&(v=10):v=c&-65536?10:5;if(null==c||isNaN(c))for(;0<v--;)e="?"+e;else for(;0<v--;)e=String.fromCharCode(c%10+48)+e,c/=
|
||||
10;a.status(e+"Kb "+bc[d]+" at "+na(b));return!0}return ac(2,b,c)}function Xb(a,b,c){var d=[];for(b>>>=a.ia;0<c&&b<a.W.length;)d.push(a.W[b++]),c-=a.ua;return d}function Wb(a,b,c,d){var e=0;for(b>>>=a.ia;0<c&&b<a.W.length;){var f=d[e++];if(!f)break;a.W[b++]=f;c-=a.ua}}h.ob=function(a){return this.W[(a&this.f)>>>this.ia].Eb(a&this.w,a)};h.Bb=function(a){this.A++;a=this.W[(a&this.f)>>>this.ia].Mb(a&this.w,a);this.A--;return a};h.na=function(a){return this.W[(a&this.f)>>>this.ia].ta(a&this.w,a)};
|
||||
h.pb=function(a){var b=a&this.w,c=(a&this.f)>>>this.ia;this.A++;a=this.W[c].Nb(b,a);this.A--;return a};h.Fb=function(a,b){this.W[(a&this.f)>>>this.ia].Hb(a&this.w,b&255,a)};h.hb=function(a,b){this.A++;this.W[(a&this.f)>>>this.ia].Sb(a&this.w,b&255,a);this.A--};h.Va=function(a,b){this.W[(a&this.f)>>>this.ia].wb(a&this.w,b&65535,a)};h.Gb=function(a,b){var c=a&this.w,d=(a&this.f)>>>this.ia;this.A++;this.W[d].Tb(c,b&65535,a);this.A--};
|
||||
function cc(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.W[d];if(e.Ja||e.pc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,m=[];g<e.length;){for(var p=e[g],q=g+1;q<e.length&&e[q]===p;)q++;m[k++]=q-g;m[k++]=p;g=q}m.length<e.length&&(e=m)}c[f]=e}}return c}function dc(a,b,c,d,e,f,g,k){for(;b<=c;b+=2){var m=b&Tb;void 0!==a.Ha[m]?n("I/O address already registered: "+l(b,8,!0)):a.Ha[m]=[d,e,f,g,k||"unknown",!1]}}
|
||||
function mc(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.b.ab)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!k&&p&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));dc(a,e,e,g,k,m,p,f[4])}}}function nc(a,b){a.C.push(b)}
|
||||
function oc(a,b){a.A||(a.i&&D(a.i,536870912)&&C(a.i,"memory fault on address "+J(a.i,b),!0,!0),a.b.ea(4,b))}function ac(a,b,c){n("Memory block error ("+a+": "+l(b)+","+l(c)+")");return!1}function K(a){r.call(this,"Device",a,K,256);this.g={data:0,Sd:0,Db:20,gd:0};this.f={Td:0,Rb:-1}}u(K);h=K.prototype;
|
||||
h.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;var e=this;this.f.Rb=pc(c,function(){e.f.Ka|=128;e.f.Ka&64&&(qc(e.b,e.f.hd),rc(e.b,e.f.Rb,1E3/60))});this.f.hd=sc(64,6);mc(b,this,L);nc(b,this.reset.bind(this));H(this)};h.reset=function(){this.g.Db=this.g.Db&-120|20;this.f.Ka=0};h.Dc=function(){var a=this.f.Ka;this.f.Ka&=-129;return a};h.rd=function(a){this.f.Ka=a;a&64&&rc(this.b,this.f.Rb,1E3/60);this.f.Ka=a&-129};h.wc=function(a){return(a?this.g.gd:this.g.data)&65535};
|
||||
h.kd=function(a){this.g.data=a};h.Fc=function(){var a=this.b;return a.G&62337|a.wa<<5|a.xa<<1};h.td=function(a){var b=this.b;a&=62337;if(b.G!=a){b.G=a;b.wa=a>>5&3;b.xa=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.La!=c&&(b.La=c,tc(b))}uc(this)};h.Gc=function(){var a=this.b.Na;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Hc=function(){return this.b.tb};h.Ic=function(){return this.b.Oa};
|
||||
h.ud=function(a){var b=this.b;1170>b.ab&&(a&=-49);b.Oa!=a&&(b.Oa=a,a&16?(b.Za=4194303,b.ya=3915776):(b.Za=262143,b.ya=253952),tc(b));uc(this)};function uc(a){a.g.Db=a.g.Db&-8|(a.b.La?a.b.Oa&16?1:2:4)}h.Wc=function(a){return this.b.P[1][a>>1&7]};h.Id=function(a,b){this.b.P[1][b>>1&7]=a&65295};h.Uc=function(a){return this.b.P[1][(a>>1&7)+8]};h.Gd=function(a,b){this.b.P[1][(b>>1&7)+8]=a&65295};h.Vc=function(a){return this.b.sa[1][a>>1&7]};
|
||||
h.Hd=function(a,b){b=b>>1&7;this.b.sa[1][b]=a;this.b.P[1][b]&=65295};h.Tc=function(a){return this.b.sa[1][(a>>1&7)+8]};h.Fd=function(a,b){b=(b>>1&7)+8;this.b.sa[1][b]=a;this.b.P[1][b]&=65295};h.Cc=function(a){return this.b.P[0][a>>1&7]};h.qd=function(a,b){this.b.P[0][b>>1&7]=a&65295};h.Ac=function(a){return this.b.P[0][(a>>1&7)+8]};h.od=function(a,b){this.b.P[0][(b>>1&7)+8]=a&65295};h.Bc=function(a){return this.b.sa[0][a>>1&7]};h.pd=function(a,b){b=b>>1&7;this.b.sa[0][b]=a;this.b.P[0][b]&=65295};
|
||||
h.zc=function(a){return this.b.sa[0][(a>>1&7)+8]};h.nd=function(a,b){b=(b>>1&7)+8;this.b.sa[0][b]=a;this.b.P[0][b]&=65295};h.bd=function(a){return this.b.P[3][a>>1&7]};h.Od=function(a,b){this.b.P[3][b>>1&7]=a&65295};h.$c=function(a){return this.b.P[3][(a>>1&7)+8]};h.Md=function(a,b){this.b.P[3][(b>>1&7)+8]=a&65295};h.ad=function(a){return this.b.sa[3][a>>1&7]};h.Nd=function(a,b){b=b>>1&7;this.b.sa[3][b]=a;this.b.P[3][b]&=65295};h.Zc=function(a){return this.b.sa[3][(a>>1&7)+8]};
|
||||
h.Ld=function(a,b){b=(b>>1&7)+8;this.b.sa[3][b]=a;this.b.P[3][b]&=65295};h.eb=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]};h.jb=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a};h.Nc=function(){return this.b.L&49152?this.b.va[0]:this.b.u[6]};h.zd=function(a){this.b.L&49152?this.b.va[0]=a:this.b.u[6]=a};h.Qc=function(){return this.b.u[7]};h.Cd=function(a){this.b.u[7]=a};h.fb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]};
|
||||
h.kb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ea[b]=a};h.Oc=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[1]};h.Ad=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[1]=a};h.Pc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[3]};h.Bd=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[3]=a};h.yc=function(a){return this.b.gc[a-65504>>1]};h.md=function(a,b){this.b.gc[b-65504>>1]=a};h.dc=function(a){return 65520==a?61183:0};h.jc=function(){};
|
||||
h.Yc=function(){return 1};h.Kd=function(){};h.xc=function(){return this.b.Z};h.ld=function(){this.b.Z=0};h.Ec=function(){return this.b.fc};h.sd=function(a,b){b&1||(a&=255);this.b.fc=a};h.Jc=function(a){return a?this.b.Pb:0};h.vd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Pb=a;b.F|=2};h.Xc=function(a){return a?this.b.Oa&65280:0};h.Jd=function(a){this.b.Oa=a|255};h.Mc=function(){return Lb(this.b)};h.yd=function(a){vc(this.b,a&-1809|Lb(this.b)&1808);this.b.F|=128};
|
||||
h.ic=function(a,b){G(this)&&E(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)};
|
||||
h.Ld=function(a,b){b=(b>>1&7)+8;this.b.sa[3][b]=a;this.b.P[3][b]&=65295};h.fb=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]};h.kb=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a};h.Nc=function(){return this.b.L&49152?this.b.va[0]:this.b.u[6]};h.zd=function(a){this.b.L&49152?this.b.va[0]=a:this.b.u[6]=a};h.Qc=function(){return this.b.u[7]};h.Cd=function(a){this.b.u[7]=a};h.gb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]};
|
||||
h.lb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ea[b]=a};h.Oc=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[1]};h.Ad=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[1]=a};h.Pc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[3]};h.Bd=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[3]=a};h.yc=function(a){return this.b.gc[a-65504>>1]};h.md=function(a,b){this.b.gc[b-65504>>1]=a};h.dc=function(a){return 65520==a?61183:0};h.jc=function(){};
|
||||
h.Yc=function(){return 1};h.Kd=function(){};h.xc=function(){return this.b.Z};h.ld=function(){this.b.Z=0};h.Ec=function(){return this.b.fc};h.sd=function(a,b){b&1||(a&=255);this.b.fc=a};h.Jc=function(a){return a?this.b.Pb:0};h.vd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Pb=a;b.F|=2};h.Xc=function(a){return a?this.b.Pa&65280:0};h.Jd=function(a){this.b.Pa=a|255};h.Mc=function(){return Lb(this.b)};h.yd=function(a){vc(this.b,a&-1809|Lb(this.b)&1808);this.b.F|=128};
|
||||
h.ic=function(a,b){D(this)&&C(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)};
|
||||
var M={},L=(M[62592]=[null,null,K.prototype.Wc,K.prototype.Id,"SISDR",1145],M[62608]=[null,null,K.prototype.Uc,K.prototype.Gd,"SDSDR",1145],M[62624]=[null,null,K.prototype.Vc,K.prototype.Hd,"SISAR",1145],M[62640]=[null,null,K.prototype.Tc,K.prototype.Fd,"SDSAR",1145],M[62656]=[null,null,K.prototype.Cc,K.prototype.qd,"KISDR",1145],M[62672]=[null,null,K.prototype.Ac,K.prototype.od,"KDSDR",1145],M[62688]=[null,null,K.prototype.Bc,K.prototype.pd,"KISAR",1145],M[62704]=[null,null,K.prototype.zc,K.prototype.nd,
|
||||
"KDSAR",1145],M[62798]=[null,null,K.prototype.Ic,K.prototype.ud,"MMR3",1145],M[65382]=[null,null,K.prototype.Dc,K.prototype.rd,"LKS"],M[65400]=[null,null,K.prototype.wc,K.prototype.kd,"CNSL"],M[65402]=[null,null,K.prototype.Fc,K.prototype.td,"MMR0",1145],M[65404]=[null,null,K.prototype.Gc,K.prototype.ic,"MMR1",1145],M[65406]=[null,null,K.prototype.Hc,K.prototype.ic,"MMR2",1145],M[65408]=[null,null,K.prototype.bd,K.prototype.Od,"UISDR",1145],M[65424]=[null,null,K.prototype.$c,K.prototype.Md,"UDSDR",
|
||||
1145],M[65440]=[null,null,K.prototype.ad,K.prototype.Nd,"UISAR",1145],M[65456]=[null,null,K.prototype.Zc,K.prototype.Ld,"UDSAR",1145],M[65472]=[null,null,K.prototype.eb,K.prototype.jb,"R0SET0"],M[65473]=[null,null,K.prototype.eb,K.prototype.jb,"R1SET0"],M[65474]=[null,null,K.prototype.eb,K.prototype.jb,"R2SET0"],M[65475]=[null,null,K.prototype.eb,K.prototype.jb,"R3SET0"],M[65476]=[null,null,K.prototype.eb,K.prototype.jb,"R4SET0"],M[65477]=[null,null,K.prototype.eb,K.prototype.jb,"R5SET0"],M[65478]=
|
||||
[null,null,K.prototype.Nc,K.prototype.zd,"R6KERNEL"],M[65479]=[null,null,K.prototype.Qc,K.prototype.Cd,"R7KERNEL"],M[65480]=[null,null,K.prototype.fb,K.prototype.kb,"R0SET1",1145],M[65481]=[null,null,K.prototype.fb,K.prototype.kb,"R1SET1",1145],M[65482]=[null,null,K.prototype.fb,K.prototype.kb,"R2SET1",1145],M[65483]=[null,null,K.prototype.fb,K.prototype.kb,"R3SET1",1145],M[65484]=[null,null,K.prototype.fb,K.prototype.kb,"R4SET1",1145],M[65485]=[null,null,K.prototype.fb,K.prototype.kb,"R5SET1",1145],
|
||||
1145],M[65440]=[null,null,K.prototype.ad,K.prototype.Nd,"UISAR",1145],M[65456]=[null,null,K.prototype.Zc,K.prototype.Ld,"UDSAR",1145],M[65472]=[null,null,K.prototype.fb,K.prototype.kb,"R0SET0"],M[65473]=[null,null,K.prototype.fb,K.prototype.kb,"R1SET0"],M[65474]=[null,null,K.prototype.fb,K.prototype.kb,"R2SET0"],M[65475]=[null,null,K.prototype.fb,K.prototype.kb,"R3SET0"],M[65476]=[null,null,K.prototype.fb,K.prototype.kb,"R4SET0"],M[65477]=[null,null,K.prototype.fb,K.prototype.kb,"R5SET0"],M[65478]=
|
||||
[null,null,K.prototype.Nc,K.prototype.zd,"R6KERNEL"],M[65479]=[null,null,K.prototype.Qc,K.prototype.Cd,"R7KERNEL"],M[65480]=[null,null,K.prototype.gb,K.prototype.lb,"R0SET1",1145],M[65481]=[null,null,K.prototype.gb,K.prototype.lb,"R1SET1",1145],M[65482]=[null,null,K.prototype.gb,K.prototype.lb,"R2SET1",1145],M[65483]=[null,null,K.prototype.gb,K.prototype.lb,"R3SET1",1145],M[65484]=[null,null,K.prototype.gb,K.prototype.lb,"R4SET1",1145],M[65485]=[null,null,K.prototype.gb,K.prototype.lb,"R5SET1",1145],
|
||||
M[65486]=[null,null,K.prototype.Oc,K.prototype.Ad,"R6SUPER",1145],M[65487]=[null,null,K.prototype.Pc,K.prototype.Bd,"R6USER",1145],M[65504]=[null,null,K.prototype.yc,K.prototype.md,"CTRL",1170],M[65520]=[null,null,K.prototype.dc,K.prototype.jc,"LSIZE",1170],M[65522]=[null,null,K.prototype.dc,K.prototype.jc,"HSIZE",1170],M[65524]=[null,null,K.prototype.Yc,K.prototype.Kd,"SYSID",1170],M[65526]=[null,null,K.prototype.xc,K.prototype.ld,"CPUERR",1170],M[65528]=[null,null,K.prototype.Ec,K.prototype.sd,
|
||||
"MB",1170],M[65530]=[null,null,K.prototype.Jc,K.prototype.vd,"PIR"],M[65532]=[null,null,K.prototype.Xc,K.prototype.Jd,"SL"],M[65534]=[null,null,K.prototype.Mc,K.prototype.yd,"PSW"],M);L[62594]=L[62592];L[62596]=L[62592];L[62598]=L[62592];L[62600]=L[62592];L[62602]=L[62592];L[62604]=L[62592];L[62606]=L[62592];L[62610]=L[62608];L[62612]=L[62608];L[62614]=L[62608];L[62616]=L[62608];L[62618]=L[62608];L[62620]=L[62608];L[62622]=L[62608];L[62626]=L[62624];L[62628]=L[62624];L[62630]=L[62624];L[62632]=L[62624];
|
||||
L[62634]=L[62624];L[62636]=L[62624];L[62638]=L[62624];L[62642]=L[62640];L[62644]=L[62640];L[62646]=L[62640];L[62648]=L[62640];L[62650]=L[62640];L[62652]=L[62640];L[62654]=L[62640];L[62658]=L[62656];L[62660]=L[62656];L[62662]=L[62656];L[62664]=L[62656];L[62666]=L[62656];L[62668]=L[62656];L[62670]=L[62656];L[62674]=L[62672];L[62676]=L[62672];L[62678]=L[62672];L[62680]=L[62672];L[62682]=L[62672];L[62684]=L[62672];L[62686]=L[62672];L[62690]=L[62688];L[62692]=L[62688];L[62694]=L[62688];L[62696]=L[62688];
|
||||
L[62698]=L[62688];L[62700]=L[62688];L[62702]=L[62688];L[62706]=L[62704];L[62708]=L[62704];L[62710]=L[62704];L[62712]=L[62704];L[62714]=L[62704];L[62716]=L[62704];L[62718]=L[62704];L[65410]=L[65408];L[65412]=L[65408];L[65414]=L[65408];L[65416]=L[65408];L[65418]=L[65408];L[65420]=L[65408];L[65422]=L[65408];L[65426]=L[65424];L[65428]=L[65424];L[65430]=L[65424];L[65432]=L[65424];L[65434]=L[65424];L[65436]=L[65424];L[65438]=L[65424];L[65442]=L[65440];L[65444]=L[65440];L[65446]=L[65440];L[65448]=L[65440];
|
||||
L[65450]=L[65440];L[65452]=L[65440];L[65454]=L[65440];L[65458]=L[65456];L[65460]=L[65456];L[65462]=L[65456];L[65464]=L[65456];L[65466]=L[65456];L[65468]=L[65456];L[65470]=L[65456];L[65506]=L[65504];L[65508]=L[65504];L[65510]=L[65504];L[65512]=L[65504];L[65514]=L[65504];L[65516]=L[65504];L[65518]=L[65504];Ta(function(){for(var a=B(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=z(d);switch(c.type){case "default":c=new K(c);A(c,d);break;case "pc11":c=new wc(c),A(c,d)}}});var xc;
|
||||
if(sb){var yc=new ArrayBuffer(2);(new DataView(yc)).setUint16(0,256,!0);xc=256===(new Uint16Array(yc))[0]}else xc=!1;var zc=xc;
|
||||
function I(a,b,c,d,e,f){this.w=a;this.id=Ac+=2;this.b=null;this.A=b;this.vb=c;this.size=d||0;this.type=e||Bc;this.f=e==Cc;this.controller=null;Sb(this);this.Ia=this.pc=!1;if(d)if(f)this.controller=f,this.b=null,Dc(this,f.mc);else if(sb)this.C=new ArrayBuffer(d),this.G=new DataView(this.C,0,d),this.D=new Uint8Array(this.C,0,d),this.I=new Uint16Array(this.C,0,d>>1),this.b=new Int32Array(this.C,0,d>>2),Dc(this,zc?Ec:Fc);else{this.b=Array(d>>2);for(a=0;a<this.b.length;a++)this.b[a]=0;Dc(this,Gc)}else Dc(this)}
|
||||
function I(a,b,c,d,e,f){this.w=a;this.id=Ac+=2;this.b=null;this.B=b;this.vb=c;this.size=d||0;this.type=e||Bc;this.f=e==Cc;this.controller=null;Sb(this);this.Ja=this.pc=!1;if(d)if(f)this.controller=f,this.b=null,Dc(this,f.mc);else if(sb)this.A=new ArrayBuffer(d),this.G=new DataView(this.A,0,d),this.D=new Uint8Array(this.A,0,d),this.J=new Uint16Array(this.A,0,d>>1),this.b=new Int32Array(this.A,0,d>>2),Dc(this,zc?Ec:Fc);else{this.b=Array(d>>2);for(a=0;a<this.b.length;a++)this.b[a]=0;Dc(this,Gc)}else Dc(this)}
|
||||
var Bc=0,Cc=2,Zb=4,bc=["NONE","RAM","ROM","VID","H/W"],Ac=0;
|
||||
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(sb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.G.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(sb)for(b=0;b<a.length;b++)this.G.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ia=!0}return!1},Qa:function(a,b){b?this.B++||Hc(this,Ic,!1):this.g++||Jc(this,Ic,!1)},K:function(){this.i&&G(this.i,128)&&(E(this.i,"attempt to read invalid block %"+
|
||||
k(this.A),!0),this.i.da());return 255},J:function(a,b){this.i&&G(this.i,128)&&(E(this.i,"attempt to write "+k(b,4,!0)+" to invalid block %"+k(this.A),!0),this.i.da())},M:function(a,b){return this.Eb(a++,b++)|this.Eb(a,b)<<8},H:function(a,b,c){this.Hb(a++,b&255,c++);this.Hb(a,b>>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},la:function(a,b){a&1&&oc(this.w,b);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},wa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=
|
||||
this.b[c]&~(255<<a)|b<<a;this.Ia=!0},Va:function(a,b,c){a&1&&oc(this.w,c);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Ia=!0},T:function(a,b){if(this.i&&null!=this.A){var c=this.i;Kc(c,this.A+a,1,c.M)&&c.da(!0)}return this.Mb(a,b)},ba:function(a,b){if(this.i&&null!=this.A){var c=this.i;Kc(c,this.A+a,2,c.M)&&c.da(!0)}return this.Nb(a,b)},oa:function(a,b,c){if(this.i&&null!=this.A){var d=this.i;Kc(d,this.A+a,
|
||||
1,d.D)&&d.da(!0)}this.f?this.J(a,b,c):this.Sb(a,b,c)},ya:function(a,b,c){if(this.i&&null!=this.A){var d=this.i;Kc(d,this.A+a,2,d.D)&&d.da(!0)}this.f?this.J(a,b,c):this.Tb(a,b,c)},R:function(a){return this.D[a]},U:function(a,b){a=this.D[a];this.i&&G(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},aa:function(a,b){a&1&&oc(this.w,b);return this.G.getUint16(a,!0)},fa:function(a,b){a&1&&oc(this.w,b);a=this.I[a>>1];this.i&&G(this.i,128)&&E(this.i,"Memory.readWord("+
|
||||
J(this.i,b)+"): "+J(this.i,a),!0);return a},na:function(a,b){this.D[a]=b;this.Ia=!0},ra:function(a,b,c){this.D[a]=b;this.Ia=!0;this.i&&G(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},xa:function(a,b,c){a&1&&oc(this.w,c);this.G.setUint16(a,b,!0);this.Ia=!0},Ua:function(a,b,c){a&1&&oc(this.w,c);this.I[a>>1]=b;this.Ia=!0;this.i&&G(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0)}};
|
||||
function Sb(a,b,c){a.i=b;a.g=a.B=0;c&&((a.g=c.g)&&Jc(a,Ic,!1),(a.B=c.B)&&Hc(a,Ic,!1))}function Lc(a,b){b?--a.B||(a.Hb=a.f?a.J:a.Sb,a.wb=a.f?a.H:a.Tb):--a.g||(a.Eb=a.Mb,a.ta=a.Nb)}function Hc(a,b,c){c&&a.B||(a.Hb=!a.f&&b[1]||a.J,a.wb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Sb=b[1]||a.J,a.Tb=b[3]||a.H}function Jc(a,b,c){c&&a.g||(a.Eb=b[0]||a.K,a.ta=b[2]||a.M);if(c||void 0===c)a.Mb=b[0]||a.K,a.Nb=b[2]||a.M}function Dc(a,b){b||(b=Mc);Jc(a,b,void 0);Hc(a,b,void 0)}
|
||||
var Mc=[],Gc=[I.prototype.V,I.prototype.wa,I.prototype.la,I.prototype.Va],Ic=[I.prototype.T,I.prototype.oa,I.prototype.ba,I.prototype.ya];if(sb)var Fc=[I.prototype.R,I.prototype.na,I.prototype.aa,I.prototype.xa],Ec=[I.prototype.U,I.prototype.ra,I.prototype.fa,I.prototype.Ua];
|
||||
function Nc(a,b){r.call(this,"CPU",a,Nc,1);var c=a.multiplier||1;this.Ga=a.cycles||b;this.La=c;this.Xa=Math.round(this.Ga/1E4)/100;this.Sa=this.Xa*this.La;this.v.ca=!1;this.v.Qb=!1;this.v.lb=a.autoStart;this.v.Za=!1;this.qb=this.la=0;this.rb=a.csStart;this.ab=a.csInterval;this.bb=a.csStop;this.K=[];this.bc=this.fd.bind(this);H(this)}u(Nc);var Oc=["power","reset"];h=Nc.prototype;
|
||||
h.Ca=function(a,b,c,d){this.B=a;this.w=b;this.i=d;for(b=0;b<Oc.length;b++)(c=this.J[Oc[b]])&&this.B.qa(null,Oc[b],c);a=Pc(a,"autoStart");null!=a&&(this.v.lb="true"==a?!0:"false"==a?!1:!!a);H(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};
|
||||
h.Aa=function(a,b){if(!b){if(a&&this.restore){Qc(this);if(!this.restore(a))return!1;Rc(this)}else this.reset();this.i?(a=this.i,a.j("Type ? for help with PDP11 Debugger commands"),a.$(),a.Ga&&(b=a.Ga,a.Ga=null,Sc(a,b))):this.j("No debugger detected")}this.B.$();return!0};h.za=function(a){return a?this.save():!0};h.lb=function(){return this.v.lb||!this.i&&void 0===this.J.run?(this.hb(!0),!0):!1};h.Zb=function(){return 0};
|
||||
function Rc(a){void 0===a.rb&&(a.rb=0);void 0===a.ab&&(a.ab=-1);void 0===a.bb&&(a.bb=-1);a.v.Za=0<=a.rb&&0<a.ab;a.v.Za&&(a.qb=0,a.la=a.rb-a.fa)}function Tc(a,b){if(a.v.Za){var c=!1;a.qb=a.qb+a.Zb()|0;a.la-=b;0>=a.la&&(a.la+=a.ab,c=!0);0<=a.bb&&a.bb<=Uc(a)&&(a.ab=a.bb=-1,Rc(a),a.da(),c=!0);c&&a.j(Uc(a)+" cycles: checksum="+k(a.qb))}}
|
||||
h.qa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.J[b]=c,!0;case "run":return this.J[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.v.ia)a=!0;else{var b=null,c,l=kb(a.id);for(c=0;c<l.length&&(b=l[c],b===a||b.v.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.v.ia);c++);c==l.length&&(b=a);n("The "+b.type+" component ("+b.id+") is not "+(b.v.ready?"powered yet":"ready yet"+(b.zb?" (waiting for notification)":""))+".");a=!1}a&&(d.v.ca?d.da():d.hb())},
|
||||
!0;case "speed":return this.J[b]=c,!0;case "setSpeed":return this.J[b]=c,c.onclick=function(){Vc(d,d.La<<1,!0)},c.textContent=this.Sa.toFixed(2)+"Mhz",!0}return!1};h.$=function(){var a=this.J.speed;a&&(a.textContent=this.v.ca&&this.V?this.V.toFixed(2)+"Mhz":"Stopped")};function Wc(a,b,c){a.fa+=b;c&&(a.ba=a.b=0)}function Xc(a,b){var c=1;b&&1<a.La&&a.V&&(c=a.V/a.Xa);a.Ab=Math.round(1E3/30);a.Pa=Math.floor(a.Ga/30*c);b||(a.na=a.Pa);a.nb=0}function Uc(a){return a.fa+a.T+a.ba-a.b}
|
||||
function Qc(a){a.V=0;a.Cb=0;a.fa=a.T=a.ba=a.b=0;Rc(a);Vc(a,1)}function Vc(a,b,c){var d=!1;if(void 0!==b){.8>a.V/a.Sa?b=1:d=!0;a.La=b;b=a.Xa*a.La;if(a.Sa!=b){a.Sa=b;b=a.Sa.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.B&&a.B.ub()}Wc(a,a.T);a.T=0;a.R=za();a.aa=0;Xc(a);return d}function pc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function rc(a,b,c){0<=b&&b<a.K.length&&0>a.K[b][0]&&(c=a.Ga*a.La/1E3*c|0,a.K[b][0]=c+Yc(a))}
|
||||
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(sb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.G.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(sb)for(b=0;b<a.length;b++)this.G.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ja=!0}return!1},Sa:function(a,b){b?this.I++||Hc(this,Ic,!1):this.g++||Jc(this,Ic,!1)},K:function(){this.i&&D(this.i,128)&&(C(this.i,"attempt to read invalid block %"+
|
||||
l(this.B),!0),this.i.da());return 255},C:function(a,b){this.i&&D(this.i,128)&&(C(this.i,"attempt to write "+l(b,4,!0)+" to invalid block %"+l(this.B),!0),this.i.da())},M:function(a,b){return this.Eb(a++,b++)|this.Eb(a,b)<<8},H:function(a,b,c){this.Hb(a++,b&255,c++);this.Hb(a,b>>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ma:function(a,b){a&1&&oc(this.w,b);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},ra:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=
|
||||
this.b[c]&~(255<<a)|b<<a;this.Ja=!0},Wa:function(a,b,c){a&1&&oc(this.w,c);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Ja=!0},T:function(a,b){if(this.i&&null!=this.B){var c=this.i;Kc(c,this.B+a,1,c.M)&&c.da(!0)}return this.Mb(a,b)},ba:function(a,b){if(this.i&&null!=this.B){var c=this.i;Kc(c,this.B+a,2,c.M)&&c.da(!0)}return this.Nb(a,b)},pa:function(a,b,c){if(this.i&&null!=this.B){var d=this.i;Kc(d,this.B+a,
|
||||
1,d.D)&&d.da(!0)}this.f?this.C(a,b,c):this.Sb(a,b,c)},xa:function(a,b,c){if(this.i&&null!=this.B){var d=this.i;Kc(d,this.B+a,2,d.D)&&d.da(!0)}this.f?this.C(a,b,c):this.Tb(a,b,c)},R:function(a){return this.D[a]},U:function(a,b){a=this.D[a];this.i&&D(this.i,128)&&C(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},aa:function(a,b){a&1&&oc(this.w,b);return this.G.getUint16(a,!0)},fa:function(a,b){a&1&&oc(this.w,b);a=this.J[a>>1];this.i&&D(this.i,128)&&C(this.i,"Memory.readWord("+
|
||||
J(this.i,b)+"): "+J(this.i,a),!0);return a},oa:function(a,b){this.D[a]=b;this.Ja=!0},Ra:function(a,b,c){this.D[a]=b;this.Ja=!0;this.i&&D(this.i,128)&&C(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},wa:function(a,b,c){a&1&&oc(this.w,c);this.G.setUint16(a,b,!0);this.Ja=!0},ya:function(a,b,c){a&1&&oc(this.w,c);this.J[a>>1]=b;this.Ja=!0;this.i&&D(this.i,128)&&C(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0)}};
|
||||
function Sb(a,b,c){a.i=b;a.g=a.I=0;c&&((a.g=c.g)&&Jc(a,Ic,!1),(a.I=c.I)&&Hc(a,Ic,!1))}function Lc(a,b){b?--a.I||(a.Hb=a.f?a.C:a.Sb,a.wb=a.f?a.H:a.Tb):--a.g||(a.Eb=a.Mb,a.ta=a.Nb)}function Hc(a,b,c){c&&a.I||(a.Hb=!a.f&&b[1]||a.C,a.wb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Sb=b[1]||a.C,a.Tb=b[3]||a.H}function Jc(a,b,c){c&&a.g||(a.Eb=b[0]||a.K,a.ta=b[2]||a.M);if(c||void 0===c)a.Mb=b[0]||a.K,a.Nb=b[2]||a.M}function Dc(a,b){b||(b=Mc);Jc(a,b,void 0);Hc(a,b,void 0)}
|
||||
var Mc=[],Gc=[I.prototype.V,I.prototype.ra,I.prototype.ma,I.prototype.Wa],Ic=[I.prototype.T,I.prototype.pa,I.prototype.ba,I.prototype.xa];if(sb)var Fc=[I.prototype.R,I.prototype.oa,I.prototype.aa,I.prototype.wa],Ec=[I.prototype.U,I.prototype.Ra,I.prototype.fa,I.prototype.ya];
|
||||
function Nc(a,b){r.call(this,"CPU",a,Nc,1);var c=a.multiplier||1;this.Ga=a.cycles||b;this.Ma=c;this.Ya=Math.round(this.Ga/1E4)/100;this.Ua=this.Ya*this.Ma;this.v.ca=!1;this.v.Qb=!1;this.v.mb=a.autoStart;this.v.$a=!1;this.qb=this.ma=0;this.rb=a.csStart;this.bb=a.csInterval;this.cb=a.csStop;this.K=[];this.bc=this.fd.bind(this);H(this)}u(Nc);var Oc=["power","reset"];h=Nc.prototype;
|
||||
h.Ca=function(a,b,c,d){this.C=a;this.w=b;this.i=d;for(b=0;b<Oc.length;b++)(c=this.I[Oc[b]])&&this.C.qa(null,Oc[b],c);a=Pc(a,"autoStart");null!=a&&(this.v.mb="true"==a?!0:"false"==a?!1:!!a);H(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};
|
||||
h.Aa=function(a,b){if(!b){if(a&&this.restore){Qc(this);if(!this.restore(a))return!1;Rc(this)}else this.reset();this.i?(a=this.i,a.j("Type ? for help with PDP11 Debugger commands"),a.$(),a.Ga&&(b=a.Ga,a.Ga=null,Sc(a,b))):this.j("No debugger detected")}this.C.$();return!0};h.za=function(a){return a?this.save():!0};h.mb=function(){return this.v.mb||!this.i&&void 0===this.I.run?(this.ib(!0),!0):!1};h.Zb=function(){return 0};
|
||||
function Rc(a){void 0===a.rb&&(a.rb=0);void 0===a.bb&&(a.bb=-1);void 0===a.cb&&(a.cb=-1);a.v.$a=0<=a.rb&&0<a.bb;a.v.$a&&(a.qb=0,a.ma=a.rb-a.fa)}function Tc(a,b){if(a.v.$a){var c=!1;a.qb=a.qb+a.Zb()|0;a.ma-=b;0>=a.ma&&(a.ma+=a.bb,c=!0);0<=a.cb&&a.cb<=Uc(a)&&(a.bb=a.cb=-1,Rc(a),a.da(),c=!0);c&&a.j(Uc(a)+" cycles: checksum="+l(a.qb))}}
|
||||
h.qa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.I[b]=c,!0;case "run":return this.I[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.v.ha)a=!0;else{var b=null,c,k=kb(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.v.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.v.ha);c++);c==k.length&&(b=a);n("The "+b.type+" component ("+b.id+") is not "+(b.v.ready?"powered yet":"ready yet"+(b.zb?" (waiting for notification)":""))+".");a=!1}a&&(d.v.ca?d.da():d.ib())},
|
||||
!0;case "speed":return this.I[b]=c,!0;case "setSpeed":return this.I[b]=c,c.onclick=function(){Vc(d,d.Ma<<1,!0)},c.textContent=this.Ua.toFixed(2)+"Mhz",!0}return!1};h.$=function(){var a=this.I.speed;a&&(a.textContent=this.v.ca&&this.V?this.V.toFixed(2)+"Mhz":"Stopped")};function Wc(a,b,c){a.fa+=b;c&&(a.ba=a.b=0)}function Xc(a,b){var c=1;b&&1<a.Ma&&a.V&&(c=a.V/a.Ya);a.Ab=Math.round(1E3/30);a.Qa=Math.floor(a.Ga/30*c);b||(a.oa=a.Qa);a.nb=0}function Uc(a){return a.fa+a.T+a.ba-a.b}
|
||||
function Qc(a){a.V=0;a.Cb=0;a.fa=a.T=a.ba=a.b=0;Rc(a);Vc(a,1)}function Vc(a,b,c){var d=!1;if(void 0!==b){.8>a.V/a.Ua?b=1:d=!0;a.Ma=b;b=a.Ya*a.Ma;if(a.Ua!=b){a.Ua=b;b=a.Ua.toFixed(2)+"Mhz";var e=a.I.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.ub()}Wc(a,a.T);a.T=0;a.R=za();a.aa=0;Xc(a);return d}function pc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function rc(a,b,c){0<=b&&b<a.K.length&&0>a.K[b][0]&&(c=a.Ga*a.Ma/1E3*c|0,a.K[b][0]=c+Yc(a))}
|
||||
function Zc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function $c(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Yc(a,b){var c=a.ba-=a.b;a.b=0;b&&(a.ba=0);return c}
|
||||
h.fd=function(){if(this.v.ca){this.nb>=this.Ga&&Xc(this,!0);this.ra=0;this.Fa=za();if(this.aa){var a=this.Fa-this.aa;a>this.Ab&&(this.R+=a,this.R>this.Fa&&(this.R=this.Fa))}try{do{var b=Zc(this,this.v.Za?1:this.Pa);try{this.ib(b)}catch(e){if("number"!=typeof e)throw e;}b=Yc(this,!0);this.ra+=b;this.T+=b;Tc(this,b);$c(this,b);this.na-=b;if(0>=this.na){this.na+=this.Pa;15<=++this.Cb&&(this.B&&this.B.$(),this.Cb=0);break}}while(this.v.ca)}catch(e){this.da();this.B&&this.B.stop(za(),Uc(this));rb(this,
|
||||
e.stack||e.message);return}if(this.v.ca){a=setTimeout;b=this.bc;this.aa=za();var c=this.Ab;this.ra&&(c=Math.round(c*this.ra/this.Pa));var c=c-(this.aa-this.Fa),d=this.aa-this.R;d&&(this.V=Math.round(this.T/(10*d))/100,864E5<=d&&(this.fa=0,Vc(this)));if(0>c||this.V<this.Sa)-1E3>c&&(this.R-=c),c=0;this.nb+=this.ra;this.aa+=c;a(b,c)}}};
|
||||
h.hb=function(a){if(qb(this))return!1;if(this.v.ca)return this.j(this.toString()+" busy"),!1;Vc(this);this.v.ca=!0;this.v.Qb=!0;var b=this.J.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.ub(!0),this.B.start(this.R,Uc(this)));setTimeout(this.bc,0);return!0};h.ib=function(){return 0};h.da=function(a){if(this.v.ca){Yc(this);Wc(this,this.T);this.T=0;this.v.ca=!1;var b=this.J.run;b&&(b.textContent="Run");this.B&&this.B.stop(za(),Uc(this))}this.v.complete=a};
|
||||
function ad(a){this.$a=+a.model||1170;this.xb=a.addrReset||0;Nc.call(this,a,6666667);this.decode=1120==this.$a?ud.bind(this):vd.bind(this);wd(this);this.C=0;this.U=null;this.v.complete=this.v.oc=!1}u(ad,Nc);h=ad.prototype;h.reset=function(){this.status("model "+this.$a);this.v.ca&&this.da();wd(this);Qc(this);this.v.error=!1;this.parent.reset.call(this)};
|
||||
function wd(a){a.N=65536;a.O=32768;a.X=65535;a.S=32768;a.L=15;a.u=[0,0,0,0,0,0,0,a.xb];a.Ea=[0,0,0,0,0,0];a.va=[0,0,0,0];a.D=0;a.xa=0;a.sc=[4,2,0,1];a.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.sa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.uc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.gc=[0,0,0,0,0,0,0,0];a.fc=0;a.F=0;a.H=a.I=0;a.g=a.f=a.Wa=0;a.oa=-1;xd(a)}function xd(a){a.Oa=255;a.Z=0;a.Pb=0;a.G=0;a.Ma=0;a.tb=0;a.Na=0;a.Ka=0;a.wa=0;a.Ya=262143;a.ya=253952;a.F|=2;a.w&&tc(a)}function tc(a){a.Ka?(a.M=65536,a.Y=a.rc,a.ta=a.cd,a.wb=a.Pd,Vb(a.w,a.Na&16?22:18)):(a.M=0,a.Y=a.qc,a.ta=a.ec,a.wb=a.kc,Vb(a.w,16))}h.Zb=function(){return 0};
|
||||
h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.fa,this.La]);a.set(2,cc(this.w));return a.data()};h.restore=function(a){var b=a[1];this.fa=b[1];Vc(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.I){for(var f=0,g=Array(b.I),l=0;l<e.length-1;)for(var m=e[l++],p=e[l++];m--;)g[f++]=p;e=g}f=b.W[d];if(!f||!f.restore(e)){n("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function yd(a){return a.N&65536?1:0}
|
||||
function zd(a){return a.O&32768?2:0}function Ad(a){return a.X&65535?0:4}h.Da=function(){return this.S&32768?8:0};function Bd(a){var b=a.ta(a.u[7]);a.u[7]=a.u[7]+2&65535;return b}function O(a,b){a.u[7]=b&65535}function sc(a,b){return{jd:a,cb:b,next:null}}function qc(a,b){if(b!=a.U){var c=a.U;if(!c||c.cb<=b.cb)b.next=c,a.U=b;else{do{var d=c.next;if(!d||d.cb<=b.cb){b.next=d;c.next=b;break}c=d}while(c)}}a.F|=2}function Lb(a){return a.L=a.L&63728|a.Da()|Ad(a)|zd(a)|yd(a)}
|
||||
h.fd=function(){if(this.v.ca){this.nb>=this.Ga&&Xc(this,!0);this.ra=0;this.Fa=za();if(this.aa){var a=this.Fa-this.aa;a>this.Ab&&(this.R+=a,this.R>this.Fa&&(this.R=this.Fa))}try{do{var b=Zc(this,this.v.$a?1:this.Qa);try{this.jb(b)}catch(e){if("number"!=typeof e)throw e;}b=Yc(this,!0);this.ra+=b;this.T+=b;Tc(this,b);$c(this,b);this.oa-=b;if(0>=this.oa){this.oa+=this.Qa;15<=++this.Cb&&(this.C&&this.C.$(),this.Cb=0);break}}while(this.v.ca)}catch(e){this.da();this.C&&this.C.stop(za(),Uc(this));rb(this,
|
||||
e.stack||e.message);return}if(this.v.ca){a=setTimeout;b=this.bc;this.aa=za();var c=this.Ab;this.ra&&(c=Math.round(c*this.ra/this.Qa));var c=c-(this.aa-this.Fa),d=this.aa-this.R;d&&(this.V=Math.round(this.T/(10*d))/100,864E5<=d&&(this.fa=0,Vc(this)));if(0>c||this.V<this.Ua)-1E3>c&&(this.R-=c),c=0;this.nb+=this.ra;this.aa+=c;a(b,c)}}};
|
||||
h.ib=function(a){if(qb(this))return!1;if(this.v.ca)return this.j(this.toString()+" busy"),!1;Vc(this);this.v.ca=!0;this.v.Qb=!0;var b=this.I.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.ub(!0),this.C.start(this.R,Uc(this)));setTimeout(this.bc,0);return!0};h.jb=function(){return 0};h.da=function(a){if(this.v.ca){Yc(this);Wc(this,this.T);this.T=0;this.v.ca=!1;var b=this.I.run;b&&(b.textContent="Run");this.C&&this.C.stop(za(),Uc(this))}this.v.complete=a};
|
||||
function ad(a){this.ab=+a.model||1170;this.xb=a.addrReset||0;Nc.call(this,a,6666667);this.decode=1120==this.ab?bd.bind(this):cd.bind(this);dd(this);this.A=0;this.U=null;this.v.complete=this.v.oc=!1}u(ad,Nc);h=ad.prototype;h.reset=function(){this.status("model "+this.ab);this.v.ca&&this.da();dd(this);Qc(this);this.v.error=!1;this.parent.reset.call(this)};
|
||||
function dd(a){a.N=65536;a.O=32768;a.X=65535;a.S=32768;a.L=15;a.u=[0,0,0,0,0,0,0,a.xb];a.Ea=[0,0,0,0,0,0];a.va=[0,0,0,0];a.D=0;a.xa=0;a.sc=[4,2,0,1];a.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.sa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.uc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.gc=[0,0,0,0,0,0,0,0];a.fc=0;a.F=0;a.H=a.J=0;a.g=a.f=a.Xa=0;a.pa=-1;ed(a)}function ed(a){a.Pa=255;a.Z=0;a.Pb=0;a.G=0;a.Na=0;a.tb=0;a.Oa=0;a.La=0;a.wa=0;a.Za=262143;a.ya=253952;a.F|=2;a.w&&tc(a)}function tc(a){a.La?(a.M=65536,a.Y=a.rc,a.ta=a.cd,a.wb=a.Pd,Vb(a.w,a.Oa&16?22:18)):(a.M=0,a.Y=a.qc,a.ta=a.ec,a.wb=a.kc,Vb(a.w,16))}h.Zb=function(){return 0};
|
||||
h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.fa,this.Ma]);a.set(2,cc(this.w));return a.data()};h.restore=function(a){var b=a[1];this.fa=b[1];Vc(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.J){for(var f=0,g=Array(b.J),k=0;k<e.length-1;)for(var m=e[k++],p=e[k++];m--;)g[f++]=p;e=g}f=b.W[d];if(!f||!f.restore(e)){n("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function fd(a){return a.N&65536?1:0}
|
||||
function zd(a){return a.O&32768?2:0}function Ad(a){return a.X&65535?0:4}h.Da=function(){return this.S&32768?8:0};function Bd(a){var b=a.ta(a.u[7]);a.u[7]=a.u[7]+2&65535;return b}function O(a,b){a.u[7]=b&65535}function sc(a,b){return{jd:a,eb:b,next:null}}function qc(a,b){if(b!=a.U){var c=a.U;if(!c||c.eb<=b.eb)b.next=c,a.U=b;else{do{var d=c.next;if(!d||d.eb<=b.eb){b.next=d;c.next=b;break}c=d}while(c)}}a.F|=2}function Lb(a){return a.L=a.L&63728|a.Da()|Ad(a)|zd(a)|fd(a)}
|
||||
function vc(a,b){a.S=b<<12;a.X=~b&4;a.O=b<<14;a.N=b<<16;if((b^a.L)&2048)for(var c=a.Ea.length;0<=--c;){var d=a.u[c];a.u[c]=a.Ea[c];a.Ea[c]=d}a.D=b>>14&3;c=a.L>>14&3;a.D!=c&&(a.va[c]=a.u[6],a.u[6]=a.va[a.D]);a.L=b;a.F|=2}function P(a,b){a.F&128||(a.S=a.X=b,a.O=0)}function Cd(a,b,c){a.F&128||(a.S=a.X=a.N=b,a.O=c||0)}function Dd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^b)&(d^b))}function Ed(a,b){a.F&128||(a.S=a.X=a.N=b,a.O=a.S^a.N>>1)}function Fd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^d)&(d^b))}
|
||||
h.ea=function(a,b){if(!this.C){var c=!1;0>this.oa?this.oa=Lb(this):this.D||(a=4,c=!0);this.G&57344||(this.Ma=63222,this.tb=a);this.D=0;var d=this.ta(a|this.M),e=this.ta(a+2&65535|this.M);vc(this,e&-12289|this.oa>>2&12288);c&&(this.Z|=4,this.u[6]=4);Gd(this,this.oa);Gd(this,this.u[7]);O(this,d);this.F&=-113;this.oa=-1;if(26!=b)throw a;}};function Hd(a){var b=Id(a),c=Id(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);O(a,b);vc(a,c);a.F&=-17}
|
||||
function Jd(a,b,c){var d,e,f,g=0;d=b>>13;a.Na&a.sc[a.D]||(d&=7);e=a.P[a.D][d];f=(a.sa[a.D][d]<<6)+(b&8191)&a.Ya;if(f<a.ya)f&1&&!(c&1)&&(a.Z|=64,a.ea(4,10));else if(a.Na&16||253952<=f&&(f|=4186112),4186112>f){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.Na&32&&(f=a.uc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.ya&&4186112>f&&(a.Z|=32,a.ea(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?
|
||||
192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.P[a.D][d]=e;if(4194170!==f||a.D)a.wa=a.D,a.xa=d;g&&(g&57344&&(0<=a.oa&&(g|=128),a.G&57344||(a.G=a.G|g|a.wa<<5|a.xa<<1),a.ea(168,16)),a.G&61440||!(4191360>f||4194239<f)||(a.G|=4096,a.G&512&&(a.F|=32)));return f}function Kd(a,b){return a.w.ob(b)}function Ld(a,b,c){b&1&&a.b--;a.w.Fb(b,c&255)}function Id(a){var b=a.ta(a.u[6]|a.M);a.u[6]=a.u[6]+2&65535;return b}
|
||||
function Gd(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.G&57344||(a.Ma=a.Ma<<8|246);!a.D&&c<=a.Oa&&4<c&&(c<=a.Oa-32?(a.Z|=4,a.u[6]=4,a.ea(4,18)):(a.Z|=8,a.F|=4));a.wb(c,b)}
|
||||
function Md(a,b,c,d){var e,f,g=d&8?0:a.M;switch(b){case 0:return a.ea(4,20),0;case 1:return 6===c&&!a.D&&d&4&&(a.u[6]<=a.Oa||65534<=a.u[6])&&(a.u[6]<=a.Oa-32||65534<=a.u[6]?(a.Z|=4,a.u[6]=4,a.ea(4,22)):(a.Z|=8,a.F|=64)),a.b-=3,7===c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.ta(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.ta(e)|g;
|
||||
a.b-=8;break;case 6:return e=Bd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=Bd(a),e=e+a.u[c]&65535,e=a.ta(e|a.M)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.Ma=a.Ma<<8|f<<3&248|c);6==c&&!a.D&&d&4&&0>=f&&(a.u[6]<=a.Oa||65534<=a.u[6])&&(a.u[6]<=a.Oa-32?(a.Z|=4,a.u[6]=4,a.ea(4,24)):(a.Z|=8,a.F|=64));return e}h.Bb=function(a){if(!this.Ka)return this.w.Bb(a);this.C++;a=Kd(this,Jd(this,a,3));this.C--;return a};
|
||||
h.pb=function(a){if(!this.Ka)return this.w.pb(a);this.C++;a=this.ec(Jd(this,a,2));this.C--;return a};h.gb=function(a,b){this.Ka?(this.C++,Ld(this,Jd(this,a,5),b),this.C--):this.w.gb(a,b)};h.Gb=function(a,b){this.Ka?(this.C++,this.kc(Jd(this,a,4),b),this.C--):this.w.Gb(a,b)};h.qc=function(a,b,c){return Md(this,a,b,c)};h.rc=function(a,b,c){return Jd(this,Md(this,a,b,c),c)};h.ec=function(a){return this.w.ma(a)};h.cd=function(a){return this.w.ma(Jd(this,a,2))};h.kc=function(a,b){this.w.Ta(a,b&65535)};
|
||||
h.Pd=function(a,b){this.w.Ta(Jd(this,a,4),b)};function Nd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Md(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.D=a.L>>12&3,c=a.ta(d|c&a.M),a.D=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.va[a.L>>12&3];return c}function Od(a,b,c,d){a.G&57344||(a.Ma=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Md(a,b,e,4),c&65536||(e&=65535),a.D=a.L>>12&3,e=Jd(a,e|c&65536,4),a.D=a.L>>14&3,a.w.Ta(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.va[a.L>>12&3]=d}
|
||||
function Pd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?Kd(a,a.Y(b,c,3)):a.u[c]&255}function Qd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?a.w.ma(a.Y(b,c,2)):a.u[c]}function Rd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Md(a,b,c,8)}function Sd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Kd(a,a.Y(b,c,3)):a.u[c]&255}function Td(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.ma(a.Y(b,c,2)):a.u[c]}
|
||||
function Q(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Wa=a.Y(b,e,7),Ld(a,e,d.call(a,c,Kd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Y(b,e,6),a.w.Ta(e,d.call(a,c,a.w.ma(e)))):a.u[e]=d.call(a,c,a.u[e])}function Ud(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Ld(a,a.Y(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Vd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.Ta(a.Y(b,d,4),c):a.u[d]=c&65535;return c}
|
||||
h.ea=function(a,b){if(!this.A){var c=!1;0>this.pa?this.pa=Lb(this):this.D||(a=4,c=!0);this.G&57344||(this.Na=63222,this.tb=a);this.D=0;var d=this.ta(a|this.M),e=this.ta(a+2&65535|this.M);vc(this,e&-12289|this.pa>>2&12288);c&&(this.Z|=4,this.u[6]=4);Gd(this,this.pa);Gd(this,this.u[7]);O(this,d);this.F&=-113;this.pa=-1;if(26!=b)throw a;}};function Hd(a){var b=Id(a),c=Id(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);O(a,b);vc(a,c);a.F&=-17}
|
||||
function Jd(a,b,c){var d,e,f,g=0;d=b>>13;a.Oa&a.sc[a.D]||(d&=7);e=a.P[a.D][d];f=(a.sa[a.D][d]<<6)+(b&8191)&a.Za;if(f<a.ya)f&1&&!(c&1)&&(a.Z|=64,a.ea(4,10));else if(a.Oa&16||253952<=f&&(f|=4186112),4186112>f){if(3932160<=f){f&=262143;var k=f>>13&31;31>k?a.Oa&32&&(f=a.uc[k]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.ya&&4186112>f&&(a.Z|=32,a.ea(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?
|
||||
192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.P[a.D][d]=e;if(4194170!==f||a.D)a.wa=a.D,a.xa=d;g&&(g&57344&&(0<=a.pa&&(g|=128),a.G&57344||(a.G=a.G|g|a.wa<<5|a.xa<<1),a.ea(168,16)),a.G&61440||!(4191360>f||4194239<f)||(a.G|=4096,a.G&512&&(a.F|=32)));return f}function Kd(a,b){return a.w.ob(b)}function Ld(a,b,c){b&1&&a.b--;a.w.Fb(b,c&255)}function Id(a){var b=a.ta(a.u[6]|a.M);a.u[6]=a.u[6]+2&65535;return b}
|
||||
function Gd(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.G&57344||(a.Na=a.Na<<8|246);!a.D&&c<=a.Pa&&4<c&&(c<=a.Pa-32?(a.Z|=4,a.u[6]=4,a.ea(4,18)):(a.Z|=8,a.F|=4));a.wb(c,b)}
|
||||
function Md(a,b,c,d){var e,f,g=d&8?0:a.M;switch(b){case 0:return a.ea(4,20),0;case 1:return 6===c&&!a.D&&d&4&&(a.u[6]<=a.Pa||65534<=a.u[6])&&(a.u[6]<=a.Pa-32||65534<=a.u[6]?(a.Z|=4,a.u[6]=4,a.ea(4,22)):(a.Z|=8,a.F|=64)),a.b-=3,7===c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.ta(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.ta(e)|g;
|
||||
a.b-=8;break;case 6:return e=Bd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=Bd(a),e=e+a.u[c]&65535,e=a.ta(e|a.M)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.Na=a.Na<<8|f<<3&248|c);6==c&&!a.D&&d&4&&0>=f&&(a.u[6]<=a.Pa||65534<=a.u[6])&&(a.u[6]<=a.Pa-32?(a.Z|=4,a.u[6]=4,a.ea(4,24)):(a.Z|=8,a.F|=64));return e}h.Bb=function(a){if(!this.La)return this.w.Bb(a);this.A++;a=Kd(this,Jd(this,a,3));this.A--;return a};
|
||||
h.pb=function(a){if(!this.La)return this.w.pb(a);this.A++;a=this.ec(Jd(this,a,2));this.A--;return a};h.hb=function(a,b){this.La?(this.A++,Ld(this,Jd(this,a,5),b),this.A--):this.w.hb(a,b)};h.Gb=function(a,b){this.La?(this.A++,this.kc(Jd(this,a,4),b),this.A--):this.w.Gb(a,b)};h.qc=function(a,b,c){return Md(this,a,b,c)};h.rc=function(a,b,c){return Jd(this,Md(this,a,b,c),c)};h.ec=function(a){return this.w.na(a)};h.cd=function(a){return this.w.na(Jd(this,a,2))};h.kc=function(a,b){this.w.Va(a,b&65535)};
|
||||
h.Pd=function(a,b){this.w.Va(Jd(this,a,4),b)};function Nd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Md(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.D=a.L>>12&3,c=a.ta(d|c&a.M),a.D=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.va[a.L>>12&3];return c}function Od(a,b,c,d){a.G&57344||(a.Na=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Md(a,b,e,4),c&65536||(e&=65535),a.D=a.L>>12&3,e=Jd(a,e|c&65536,4),a.D=a.L>>14&3,a.w.Va(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.va[a.L>>12&3]=d}
|
||||
function Pd(a,b){b>>=6;var c=a.J=b&7;return(b=a.H=(b&56)>>3)?Kd(a,a.Y(b,c,3)):a.u[c]&255}function Qd(a,b){b>>=6;var c=a.J=b&7;return(b=a.H=(b&56)>>3)?a.w.na(a.Y(b,c,2)):a.u[c]}function Rd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Md(a,b,c,8)}function Sd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Kd(a,a.Y(b,c,3)):a.u[c]&255}function Td(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.na(a.Y(b,c,2)):a.u[c]}
|
||||
function Q(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Xa=a.Y(b,e,7),Ld(a,e,d.call(a,c,Kd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Y(b,e,6),a.w.Va(e,d.call(a,c,a.w.na(e)))):a.u[e]=d.call(a,c,a.u[e])}function Ud(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Ld(a,a.Y(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Vd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.Va(a.Y(b,d,4),c):a.u[d]=c&65535;return c}
|
||||
function S(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
|
||||
h.ib=function(a){this.v.complete=!0;var b=this.v.oc=this.i&&Wd(this.i),c=a?this.v.Qb?0:1:-1;this.v.Qb=!1;this.ba=this.b=a;do{if(b){if(Xd(this.i,this.u[7],c)){this.da();break}c=1}if(this.F&&(this.F&112&&(this.F&32?this.ea(168,28):this.F&64?this.ea(4,30):this.F&16&&this.ea(12,32),this.F&=-113),this.F&7))if(this.F&2){this.F&=-3;var d=160,e=(this.Pb&224)>>5;if(a=this.U&&this.U.cb>e?this.U:null)d=a.jd,e=a.cb;e>(this.L&224)>>5?(this.F&4&&(this.u[7]=this.u[7]+2&65535,this.F&=-5),this.ea(d,26),e=!0):e=!1;
|
||||
if(e&&a)if(e=this.U,e==a)this.U=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.F&1&&this.F++;this.G&57344||(this.Ma=0,this.tb=this.u[7]);this.F=this.F&7|this.L&16;this.decode(Bd(this))}while(0<this.b);return this.v.complete?this.ba-this.b:void 0===this.v.complete?0:-1};Ta(function(){for(var a=B(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new ad(d);A(d,c)}});function Yd(a,b){var c=b+a;Dd(this,c,a,b);return c&65535}
|
||||
h.jb=function(a){this.v.complete=!0;var b=this.v.oc=this.i&&Wd(this.i),c=a?this.v.Qb?0:1:-1;this.v.Qb=!1;this.ba=this.b=a;do{if(b){if(Xd(this.i,this.u[7],c)){this.da();break}c=1}if(this.F&&(this.F&112&&(this.F&32?this.ea(168,28):this.F&64?this.ea(4,30):this.F&16&&this.ea(12,32),this.F&=-113),this.F&7))if(this.F&2){this.F&=-3;var d=160,e=(this.Pb&224)>>5;if(a=this.U&&this.U.eb>e?this.U:null)d=a.jd,e=a.eb;e>(this.L&224)>>5?(this.F&4&&(this.u[7]=this.u[7]+2&65535,this.F&=-5),this.ea(d,26),e=!0):e=!1;
|
||||
if(e&&a)if(e=this.U,e==a)this.U=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.F&1&&this.F++;this.G&57344||(this.Na=0,this.tb=this.u[7]);this.F=this.F&7|this.L&16;this.decode(Bd(this))}while(0<this.b);return this.v.complete?this.ba-this.b:void 0===this.v.complete?0:-1};Ta(function(){for(var a=B(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new ad(d);A(d,c)}});function Yd(a,b){var c=b+a;Dd(this,c,a,b);return c&65535}
|
||||
function Zd(a,b){var c=b+a;Dd(this,c<<8,a<<8,b<<8);return c&255}function $d(a,b){a=b<<1;Ed(this,a);return a&65535}function ae(a,b){a=b<<1;Ed(this,a<<8);return a&255}function be(a,b){a=b&32768|b>>1|b<<16;Ed(this,a);return a&65535}function ce(a,b){a=b&2048|b>>1|b<<8;Ed(this,a<<8);return a&255}function de(a,b){a=b&~a;P(this,a);return a}function ee(a,b){a=b&~a;P(this,a<<8);return a}function fe(a,b){a|=b;P(this,a);return a}function ge(a,b){a|=b;P(this,a<<8);return a}
|
||||
function he(a,b){a=~b|65536;Cd(this,a);return a&65535}function ie(a,b){a=~b|256;Cd(this,a<<8);return a&255}function je(a,b){a=b-a;this.F&128||(this.S=this.X=a,this.O=b&(b^a));return a&65535}function ke(a,b){a=b-a;var c=a<<8;b<<=8;this.F&128||(this.S=this.X=c,this.O=b&(b^c));return a&255}function le(a,b){a=b+a;this.F&128||(this.S=this.X=a,this.O=a&(b^a));return a&65535}function me(a,b){a=b+a;var c=a<<8;this.F&128||(this.S=this.X=c,this.O=c&(b<<8^c));return a&255}
|
||||
function ne(a,b){a=-b;Cd(this,a,a&b&32768);return a&65535}function oe(a,b){a=-b;Cd(this,a<<8,(a&b&128)<<8);return a&255}function pe(a,b){a=b<<1|this.N>>16&1;Ed(this,a);return a&65535}function qe(a,b){a=b<<1|this.N>>16&1;Ed(this,a<<8);return a&255}function re(a,b){a=(this.N&65536|b)>>1|b<<16;Ed(this,a);return a&65535}function se(a,b){a=((this.N&65536)>>8|b)>>1|b<<8;Ed(this,a<<8);return a&255}function te(a,b){var c=b-a;Fd(this,c,a,b);return c&65535}
|
||||
function ue(a,b){var c=b-a;Fd(this,c<<8,a<<8,b<<8);return c&255}function ve(a,b){this.F&128||(this.S=this.X=b&65280,this.O=this.N=0);return(b<<8|b>>8)&65535}function we(a,b){a^=b;P(this,a);return a&65535}function xe(a){R(this,a,Qd(this,a),Yd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}
|
||||
function ue(a,b){var c=b-a;Fd(this,c<<8,a<<8,b<<8);return c&255}function ve(a,b){this.F&128||(this.S=this.X=b&65280,this.O=this.N=0);return(b<<8|b>>8)&65535}function we(a,b){a^=b;P(this,a);return a&65535}function xe(a){R(this,a,Qd(this,a),Yd);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}
|
||||
function ye(a){var b=Td(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.N=this.O=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.N=c<<17-b,c>>=b;else if(b)if(16<b)this.O=c,c=0;else{this.N=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.O=32768)}this.u[a]=c&65535;this.S=this.X=c;this.b-=(this.g?6:7)+b}
|
||||
function ze(a){var b=Td(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.N=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.N=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.O=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.S=d>>16;this.X=d>>16|d;this.b-=(this.g?6:7)+b}function Ae(a){S(this,a,!yd(this))}function Be(a){S(this,a,yd(this))}
|
||||
function Ce(a){R(this,a,Qd(this,a),de);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function De(a){Q(this,a,Pd(this,a),ee);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Ee(a){R(this,a,Qd(this,a),fe);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Fe(a){Q(this,a,Pd(this,a),ge);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}
|
||||
function Ge(a){P(this,Qd(this,a)&Td(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function He(a){P(this,(Pd(this,a)&Sd(this,a))<<8);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Ie(a){S(this,a,Ad(this))}function Je(a){S(this,a,!this.Da()==!zd(this))}function Ke(a){S(this,a,!Ad(this)&&!this.Da()==!zd(this))}function Le(a){S(this,a,!yd(this)&&!Ad(this))}function Me(a){S(this,a,Ad(this)||!this.Da()!=!zd(this))}
|
||||
function Ne(a){S(this,a,yd(this)||Ad(this))}function Oe(a){S(this,a,!this.Da()!=!zd(this))}function Pe(a){S(this,a,this.Da())}function Qe(a){S(this,a,!Ad(this))}function Re(a){S(this,a,!this.Da())}function Se(){this.ea(12,1);this.b-=5}function Te(a){S(this,a,!0)}function Ue(a){S(this,a,!zd(this))}function Ve(a){S(this,a,zd(this))}function T(a){a&1&&(this.N=0);a&2&&(this.O=0);a&4&&(this.X=1);a&8&&(this.S=0);this.b-=5}
|
||||
function We(a){var b=Qd(this,a);a=Td(this,a);Fd(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Xe(a){var b=Pd(this,a)<<8;a=Sd(this,a)<<8;Fd(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}
|
||||
function ze(a){var b=Td(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.N=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.N=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.O=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.S=d>>16;this.X=d>>16|d;this.b-=(this.g?6:7)+b}function Ae(a){S(this,a,!fd(this))}function Be(a){S(this,a,fd(this))}
|
||||
function Ce(a){R(this,a,Qd(this,a),de);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function De(a){Q(this,a,Pd(this,a),ee);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Ee(a){R(this,a,Qd(this,a),fe);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Fe(a){Q(this,a,Pd(this,a),ge);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}
|
||||
function Ge(a){P(this,Qd(this,a)&Td(this,a));this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function He(a){P(this,(Pd(this,a)&Sd(this,a))<<8);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Ie(a){S(this,a,Ad(this))}function Je(a){S(this,a,!this.Da()==!zd(this))}function Ke(a){S(this,a,!Ad(this)&&!this.Da()==!zd(this))}function Le(a){S(this,a,!fd(this)&&!Ad(this))}function Me(a){S(this,a,Ad(this)||!this.Da()!=!zd(this))}
|
||||
function Ne(a){S(this,a,fd(this)||Ad(this))}function Oe(a){S(this,a,!this.Da()!=!zd(this))}function Pe(a){S(this,a,this.Da())}function Qe(a){S(this,a,!Ad(this))}function Re(a){S(this,a,!this.Da())}function Se(){this.ea(12,1);this.b-=5}function Te(a){S(this,a,!0)}function Ue(a){S(this,a,!zd(this))}function Ve(a){S(this,a,zd(this))}function T(a){a&1&&(this.N=0);a&2&&(this.O=0);a&4&&(this.X=1);a&8&&(this.S=0);this.b-=5}
|
||||
function We(a){var b=Qd(this,a);a=Td(this,a);Fd(this,b-a,a,b);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Xe(a){var b=Pd(this,a)<<8;a=Sd(this,a)<<8;Fd(this,b-a,a,b);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}
|
||||
function Ye(a){var b=Td(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.X=d>>16|d,this.S=d>>16):(this.O=32768,this.X=d>>15|d,this.S=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.X=this.S=0,this.O=32768,this.N=65536,this.b-=7}function Ze(){this.ea(24,2);this.b-=25}function $e(){this.L&49152?(this.Z|=128,this.ea(4,3)):this.da();this.b-=7}
|
||||
function af(){this.ea(16,4);this.b-=25}var bf=[0,7,7,10,7,11,9,13];function cf(a){var b=this.b;O(this,Rd(this,a));this.b=b-bf[this.g]}var df=[0,14,14,17,14,18,16,20];function ef(a){var b=this.b,c=Rd(this,a);a=a>>6&7;Gd(this,this.u[a]);this.u[a]=this.u[7];O(this,c);this.b=b-df[this.g]}var ff=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function gf(a){var b=Qd(this,a),c=this.b;P(this,Vd(this,a,b));this.b=c-ff[(this.H?8:0)+this.g]+(7!=this.f||this.g?0:2)}
|
||||
function hf(a){var b=Pd(this,a);P(this,Ud(this,a,b,1)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}var jf=[7,13,13,17,14,18,17,21];function kf(a){var b=Td(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.F&128||(this.S=b>>16,this.X=this.S|b,this.O=0,this.N=-32768>b||32767<b?65536:0);this.b-=23}function lf(){this.b-=5}function mf(){this.L&49152||(xd(this),this.w.reset());this.b-=667}
|
||||
function nf(){Hd(this);this.F|=this.L&16;this.b-=13}function of(a){if(a&8)V.call(this,a);else{var b=Id(this);a&=7;O(this,this.u[a]);this.u[a]=b;this.b-=9}}function W(a){a&1&&(this.N=65536);a&2&&(this.O=32768);a&4&&(this.X=0);a&8&&(this.S=32768);this.b-=5}function pf(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function qf(a){R(this,a,Qd(this,a),te);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}
|
||||
function rf(a){R(this,a,0,ve);this.b-=this.g?9:3+(7==this.f?2:0)}function sf(){this.ea(28,5);this.b-=5}function tf(){this.F&4||this.B.$();this.F|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3}function uf(a){R(this,a,Qd(this,a),we);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,E(b,"undefined opcode "+J(b,a),!0,!0),b=$b(b);b||this.ea(8,6)}function ud(a){vf[a>>12].call(this,a)}function wf(a){xf[a>>6&3].call(this,a)}function yf(a){zf[a>>6&3].call(this,a)}
|
||||
function Af(a){Bf[a>>6&3].call(this,a)}function Cf(a){Df[a&15].call(this,a)}function Ef(a){Ff[a&15].call(this,a)}function Gf(a){$f[a>>6&3].call(this,a)}function ag(a){bg[a>>6&3].call(this,a)}function cg(a){dg[a>>6&3].call(this,a)}
|
||||
function hf(a){var b=Pd(this,a);P(this,Ud(this,a,b,1)<<8);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}var jf=[7,13,13,17,14,18,17,21];function kf(a){var b=Td(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.F&128||(this.S=b>>16,this.X=this.S|b,this.O=0,this.N=-32768>b||32767<b?65536:0);this.b-=23}function lf(){this.b-=5}function mf(){this.L&49152||(ed(this),this.w.reset());this.b-=667}
|
||||
function nf(){Hd(this);this.F|=this.L&16;this.b-=13}function of(a){if(a&8)V.call(this,a);else{var b=Id(this);a&=7;O(this,this.u[a]);this.u[a]=b;this.b-=9}}function W(a){a&1&&(this.N=65536);a&2&&(this.O=32768);a&4&&(this.X=0);a&8&&(this.S=32768);this.b-=5}function pf(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function qf(a){R(this,a,Qd(this,a),te);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}
|
||||
function rf(a){R(this,a,0,ve);this.b-=this.g?9:3+(7==this.f?2:0)}function sf(){this.ea(28,5);this.b-=5}function tf(){this.F&4||this.C.$();this.F|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3}function uf(a){R(this,a,Qd(this,a),we);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,C(b,"undefined opcode "+J(b,a),!0,!0),b=$b(b);b||this.ea(8,6)}function bd(a){vf[a>>12].call(this,a)}function wf(a){xf[a>>6&3].call(this,a)}function yf(a){zf[a>>6&3].call(this,a)}
|
||||
function Af(a){Bf[a>>6&3].call(this,a)}function Cf(a){Df[a&15].call(this,a)}function Ef(a){Ff[a&15].call(this,a)}function Gf(a){Hf[a>>6&3].call(this,a)}function If(a){Jf[a>>6&3].call(this,a)}function cg(a){dg[a>>6&3].call(this,a)}
|
||||
var vf=[function(a){eg[a>>8&15].call(this,a)},gf,We,Ge,Ce,Ee,xe,V,function(a){fg[a>>8&15].call(this,a)},hf,Xe,He,De,Fe,qf,V],eg=[function(a){gg[a>>4&15].call(this,a)},Te,Qe,Ie,Je,Oe,Ke,Me,ef,ef,wf,yf,Af,V,V,V],xf=[function(a){Cd(this,Vd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,he);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,je);this.b-=this.g?9:3+(7==this.f?2:0)}],zf=[function(a){R(this,a,0,
|
||||
ne);this.b-=this.g?11:6},function(a){R(this,a,yd(this)?1:0,Yd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,yd(this)?1:0,te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Td(this,a);Cd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Bf=[function(a){R(this,a,0,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,$d);this.b-=this.g?9:3+(7==this.f?2:0)}],
|
||||
gg=[function(a){hg[a&15].call(this,a)},V,V,V,cf,cf,cf,cf,of,V,Cf,Ef,rf,rf,rf,rf],hg=[$e,tf,nf,Se,af,mf,V,V,V,V,V,V,V,V,V,V],Df=[lf,function(){this.N=0;this.b-=5},function(){this.O=0;this.b-=5},T,function(){this.X=1;this.b-=5},T,T,T,function(){this.S=0;this.b-=5},T,T,T,T,T,T,T],Ff=[lf,function(){this.N=65536;this.b-=5},function(){this.O=32768;this.b-=5},W,function(){this.X=0;this.b-=5},W,W,W,function(){this.S=32768;this.b-=5},W,W,W,W,W,W,W],fg=[Re,Pe,Le,Ne,Ue,Ve,Ae,Be,Ze,sf,Gf,ag,cg,V,V,V],$f=[function(a){Cd(this,
|
||||
Ud(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,ke);this.b-=this.g?9:3+(7==this.f?2:0)}],bg=[function(a){Q(this,a,0,oe);this.b-=this.g?11:6},function(a){Q(this,a,yd(this)?1:0,Zd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,yd(this)?1:0,ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Sd(this,a);Cd(this,a<<8);this.b-=this.g?4:3+(7==
|
||||
this.f?2:0)}],dg=[function(a){Q(this,a,0,se);this.b-=this.g?9+(this.Wa&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ce);this.b-=this.g?9+(this.Wa&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,ae);this.b-=this.g?9:3+(7==this.f?2:0)}];function vd(a){ig[a>>12].call(this,a)}
|
||||
ne);this.b-=this.g?11:6},function(a){R(this,a,fd(this)?1:0,Yd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,fd(this)?1:0,te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Td(this,a);Cd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Bf=[function(a){R(this,a,0,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,$d);this.b-=this.g?9:3+(7==this.f?2:0)}],
|
||||
gg=[function(a){hg[a&15].call(this,a)},V,V,V,cf,cf,cf,cf,of,V,Cf,Ef,rf,rf,rf,rf],hg=[$e,tf,nf,Se,af,mf,V,V,V,V,V,V,V,V,V,V],Df=[lf,function(){this.N=0;this.b-=5},function(){this.O=0;this.b-=5},T,function(){this.X=1;this.b-=5},T,T,T,function(){this.S=0;this.b-=5},T,T,T,T,T,T,T],Ff=[lf,function(){this.N=65536;this.b-=5},function(){this.O=32768;this.b-=5},W,function(){this.X=0;this.b-=5},W,W,W,function(){this.S=32768;this.b-=5},W,W,W,W,W,W,W],fg=[Re,Pe,Le,Ne,Ue,Ve,Ae,Be,Ze,sf,Gf,If,cg,V,V,V],Hf=[function(a){Cd(this,
|
||||
Ud(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,ke);this.b-=this.g?9:3+(7==this.f?2:0)}],Jf=[function(a){Q(this,a,0,oe);this.b-=this.g?11:6},function(a){Q(this,a,fd(this)?1:0,Zd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,fd(this)?1:0,ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Sd(this,a);Cd(this,a<<8);this.b-=this.g?4:3+(7==
|
||||
this.f?2:0)}],dg=[function(a){Q(this,a,0,se);this.b-=this.g?9+(this.Xa&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ce);this.b-=this.g?9+(this.Xa&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,ae);this.b-=this.g?9:3+(7==this.f?2:0)}];function cd(a){ig[a>>12].call(this,a)}
|
||||
var ig=[function(a){jg[a>>8&15].call(this,a)},gf,We,Ge,Ce,Ee,xe,function(a){kg[a>>8&15].call(this,a)},function(a){lg[a>>8&15].call(this,a)},hf,Xe,He,De,Fe,qf,V],jg=[function(a){mg[a>>4&15].call(this,a)},Te,Qe,Ie,Je,Oe,Ke,Me,ef,ef,wf,yf,Af,function(a){ng[a>>6&3].call(this,a)},V,V],ng=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ta(a|this.M);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Nd(this,a,0);Gd(this,a);P(this,a);this.b-=11},function(a){var b=Id(this),c=
|
||||
this.b;Od(this,a,0,b);P(this,b);this.b=c-jf[this.g]},function(a){P(this,Vd(this,a,this.Da?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],mg=[function(a){og[a&15].call(this,a)},V,V,V,cf,cf,cf,cf,of,function(a){a&8?(this.L&49152||(this.L=this.L&-2017|(a&7)<<5,this.F|=1),this.b-=5):V.call(this,a)},Cf,Ef,rf,rf,rf,rf],og=[$e,tf,nf,Se,af,mf,function(){Hd(this);this.b-=13},V,V,V,V,V,V,V,V,V],kg=[kf,kf,Ye,Ye,ye,ye,ze,ze,uf,uf,V,V,V,V,pf,pf],lg=[Re,Pe,Le,Ne,Ue,Ve,Ae,Be,Ze,sf,Gf,ag,cg,function(a){pg[a>>6&3].call(this,
|
||||
this.b;Od(this,a,0,b);P(this,b);this.b=c-jf[this.g]},function(a){P(this,Vd(this,a,this.Da?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],mg=[function(a){og[a&15].call(this,a)},V,V,V,cf,cf,cf,cf,of,function(a){a&8?(this.L&49152||(this.L=this.L&-2017|(a&7)<<5,this.F|=1),this.b-=5):V.call(this,a)},Cf,Ef,rf,rf,rf,rf],og=[$e,tf,nf,Se,af,mf,function(){Hd(this);this.b-=13},V,V,V,V,V,V,V,V,V],kg=[kf,kf,Ye,Ye,ye,ye,ze,ze,uf,uf,V,V,V,V,pf,pf],lg=[Re,Pe,Le,Ne,Ue,Ve,Ae,Be,Ze,sf,Gf,If,cg,function(a){pg[a>>6&3].call(this,
|
||||
a)},V,V],pg=[V,function(a){a=Nd(this,a,65536);Gd(this,a);P(this,a);this.b-=11},function(a){var b=Id(this),c=this.b;Od(this,a,65536,b);P(this,b);this.b=c-jf[this.g]},V];
|
||||
function qg(a){r.call(this,"ROM",a,qg);this.ja=this.f=null;this.D=a.addr;this.g=a.size;this.C=a.alias;this.B=a.file;this.G=oa(this.B);if(this.B){a=this.B;var b=pa(this.G);"json"!=b&&"hex"!=b&&(a=ra()+"/api/v1/dump?file="+this.B+"&format=bytes&decimal=true");var c=this;Ba(a,null,!0,function(a,b,f){f?c.pa("Unable to load ROM resource (error "+f+": "+a+")"):(jb(c.Va,a,b),(a=Fa(a,b))?(c.f=a.ga,c.ja=a.ja):c.B=null,rg(c))})}}u(qg);qg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;rg(this)};
|
||||
qg.prototype.Aa=function(){if(this.ja){if(this.i){var a=this.i,b=this.id,c=this.D,d=this.g,e=this.ja,f=[],g;for(g in e){var l=e[g];"number"==typeof l&&(e[g]=l={o:l});var m=l.o,p=l.a;if(void 0!==m){var q=f,m=[m>>>0,g],v=ya(q,m,a.Vb);0>v&&q.splice(-(v+1),0,m)}p&&(l.a=p.replace(/''/g,'"'))}a.G.push({Ud:b,A:c,vc:d,ja:e,Ub:f})}delete this.ja}return!0};qg.prototype.za=function(){return!0};
|
||||
function rg(a){if(!pb(a)){if(a.B){if(!a.f||!a.w)return;a.g||(a.g=a.f.length);if(a.f.length!=a.g)rb(a,"ROM size ("+k(a.f.length,8,!0)+") does not match specified size ("+k(a.g,8,!0)+")");else{var b;b=a.D;if(Yb(a.w,b,a.g,Cc)){var c;for(c=0;c<a.f.length;c++)a.w.gb(b+c,a.f[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.C?b.push(a.C):null!=a.C&&a.C.length&&(b=a.C);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Xb(d.w,d.D,d.g);Wb(d.w,e,d.g,f)}delete a.f}}}H(a)}}
|
||||
function qg(a){r.call(this,"ROM",a,qg);this.ka=this.f=null;this.D=a.addr;this.g=a.size;this.A=a.alias;this.C=a.file;this.G=oa(this.C);if(this.C){a=this.C;var b=pa(this.G);"json"!=b&&"hex"!=b&&(a=ra()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Ba(a,null,!0,function(a,b,f){f?c.ga("Unable to load ROM resource (error "+f+": "+a+")"):(jb(c.Ra,a,b),(a=Ca(a,b))?(c.f=a.ja,c.ka=a.ka):c.C=null,rg(c))})}}u(qg);qg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;rg(this)};
|
||||
qg.prototype.Aa=function(){if(this.ka){if(this.i){var a=this.i,b=this.id,c=this.D,d=this.g,e=this.ka,f=[],g;for(g in e){var k=e[g];"number"==typeof k&&(e[g]=k={o:k});var m=k.o,p=k.a;if(void 0!==m){var q=f,m=[m>>>0,g],v=ya(q,m,a.Vb);0>v&&q.splice(-(v+1),0,m)}p&&(k.a=p.replace(/''/g,'"'))}a.G.push({Ud:b,B:c,vc:d,ka:e,Ub:f})}delete this.ka}return!0};qg.prototype.za=function(){return!0};
|
||||
function rg(a){if(!pb(a)){if(a.C){if(!a.f||!a.w)return;a.g||(a.g=a.f.length);if(a.f.length!=a.g)rb(a,"ROM size ("+l(a.f.length,8,!0)+") does not match specified size ("+l(a.g,8,!0)+")");else{var b;b=a.D;if(Yb(a.w,b,a.g,Cc)){var c;for(c=0;c<a.f.length;c++)a.w.hb(b+c,a.f[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.A?b.push(a.A):null!=a.A&&a.A.length&&(b=a.A);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Xb(d.w,d.D,d.g);Wb(d.w,e,d.g,f)}delete a.f}}}H(a)}}
|
||||
Ta(function(){for(var a=B(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new qg(d);A(d,c)}});
|
||||
function sg(a){r.call(this,"RAM",a,sg);this.ja=this.g=null;this.G=a.addr;this.H=a.size;this.C=a.load;this.B=a.exec;this.D=!1;this.f=a.file;this.I=oa(this.f);if(this.f){a=this.f;var b=pa(this.I);"json"!=b&&"hex"!=b&&(a=ra()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Ba(a,null,!0,function(a,b,f){f?c.pa("Unable to load RAM resource (error "+f+": "+a+")"):(jb(c.Va,a,b),(a=Fa(a,b))?(c.g=a.ga,c.ja=a.ja,null==c.C&&null!=a.Lb&&(c.C=a.Lb),null==c.B&&null!=a.Kb&&(c.B=a.Kb)):c.f=null,
|
||||
tg(c))})}}u(sg);sg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;tg(this)};sg.prototype.Aa=function(){return!0};sg.prototype.za=function(){return!0};function tg(a){!a.D&&a.H&&Yb(a.w,a.G,a.H,1)&&(a.D=!0);if(!pb(a)){if(!a.D)n("No RAM allocated");else if(a.f){if(!a.g||!a.w)return;var b=a.G;null!==a.C&&(b=a.C);for(var c=0;c<a.g.length;c++)a.w.gb(b+c,a.g[c]);null!==a.B&&(b=a.b,c=a.B,b.xb=c,O(b,c));delete a.g}H(a)}}sg.prototype.reset=function(){};
|
||||
Ta(function(){for(var a=B(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new sg(d);A(d,c)}});function ug(a){r.call(this,"Keyboard",a,ug,65536);H(this)}u(ug);ug.prototype.qa=function(){return!1};ug.prototype.Ca=function(a,b,c,d){this.B=a;this.b=c;this.i=d};Ta(function(){for(var a=B(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new ug(d);A(d,c)}});
|
||||
function X(a){this.C=this.G=null;this.T=a.tabSize;this.M=a.charBOL;this.H=0;r.call(this,"SerialPort",a,X,8388608);var b=a.binding;if("console"==b)this.G="";else{var c;a=vg;b&&(void 0===c&&(c="Panel"),(c=mb(c,this.id))&&(b=c.J[b])&&this.qa(null,a,b))}this.I=this.K=null;this.exports={connect:this.cc,receiveData:this.Ob}}u(X);var vg="buffer";h=X.prototype;
|
||||
h.qa=function(a,b,c){var d=this;switch(b){case vg:return this.J[b]=this.C=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.Ob(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Ob(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.Ca=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;var e=this;this.aa=sc(48,4);this.U=pc(this.b,function(){e.f&128||!e.D.length||(e.R=e.D.shift(),e.f|=128,e.f&64&&qc(e.b,e.aa))});this.ba=sc(52,4);this.V=pc(this.b,function(){e.g|=128;e.g&64&&qc(e.b,e.ba)});mc(b,this,wg);H(this)};
|
||||
h.cc=function(){if(!this.I){var a=Pc(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=va(b[0]);if(c!=this.Ua)return;b=va(b[1]);if(this.I=lb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.K=d.receiveData){this.status(this.Va+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.Aa=function(a,b){if(!b)if(this.cc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
function sg(a){r.call(this,"RAM",a,sg);this.ka=this.g=null;this.G=a.addr;this.H=a.size;this.A=a.load;this.C=a.exec;this.D=!1;this.f=a.file;this.J=oa(this.f);if(this.f){a=this.f;var b=pa(this.J);"json"!=b&&"hex"!=b&&(a=ra()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Ba(a,null,!0,function(a,b,f){f?c.ga("Unable to load RAM resource (error "+f+": "+a+")"):(jb(c.Ra,a,b),(a=Ca(a,b))?(c.g=a.ja,c.ka=a.ka,null==c.A&&null!=a.Lb&&(c.A=a.Lb),null==c.C&&null!=a.Kb&&(c.C=a.Kb)):c.f=null,
|
||||
tg(c))})}}u(sg);sg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;tg(this)};sg.prototype.Aa=function(){return!0};sg.prototype.za=function(){return!0};function tg(a){!a.D&&a.H&&Yb(a.w,a.G,a.H,1)&&(a.D=!0);if(!pb(a)){if(!a.D)n("No RAM allocated");else if(a.f){if(!a.g||!a.w)return;var b=a.G;null!==a.A&&(b=a.A);for(var c=0;c<a.g.length;c++)a.w.hb(b+c,a.g[c]);null!==a.C&&(b=a.b,c=a.C,b.xb=c,O(b,c));delete a.g}H(a)}}sg.prototype.reset=function(){};
|
||||
Ta(function(){for(var a=B(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new sg(d);A(d,c)}});function ug(a){r.call(this,"Keyboard",a,ug,65536);H(this)}u(ug);ug.prototype.qa=function(){return!1};ug.prototype.Ca=function(a,b,c,d){this.C=a;this.b=c;this.i=d};Ta(function(){for(var a=B(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new ug(d);A(d,c)}});
|
||||
function X(a){this.A=this.G=null;this.T=a.tabSize;this.M=a.charBOL;this.H=0;r.call(this,"SerialPort",a,X,8388608);var b=a.binding;if("console"==b)this.G="";else{var c;a=vg;b&&(void 0===c&&(c="Panel"),(c=mb(c,this.id))&&(b=c.I[b])&&this.qa(null,a,b))}this.J=this.K=null;this.exports={connect:this.cc,receiveData:this.Ob}}u(X);var vg="buffer";h=X.prototype;
|
||||
h.qa=function(a,b,c){var d=this;switch(b){case vg:return this.I[b]=this.A=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.Ob(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Ob(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.Ca=function(a,b,c,d){this.C=a;this.w=b;this.b=c;this.i=d;var e=this;this.aa=sc(48,4);this.U=pc(this.b,function(){e.f&128||!e.D.length||(e.R=e.D.shift(),e.f|=128,e.f&64&&qc(e.b,e.aa))});this.ba=sc(52,4);this.V=pc(this.b,function(){e.g|=128;e.g&64&&qc(e.b,e.ba)});mc(b,this,wg);H(this)};
|
||||
h.cc=function(){if(!this.J){var a=Pc(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=va(b[0]);if(c!=this.Wa)return;b=va(b[1]);if(this.J=lb(b)){var d=this.J.exports;if(d){var e=d.connect;e&&e.call(this.J);if(this.K=d.receiveData){this.status(this.Ra+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.Aa=function(a,b){if(!b)if(this.cc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
h.za=function(a){return a?this.save():!0};h.reset=function(){xg(this)};h.save=function(){var a=new N(this);a.set(0,[]);return a.data()};h.restore=function(){return xg(this)};function xg(a){a.R=0;a.f=0;a.g=128;a.D=[];return!0}h.Ob=function(a){if("number"==typeof a)this.D.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.D.push(a.charCodeAt(b));else this.D=this.D.concat(a);rc(this.b,this.U,1);return!0};h.Sc=function(){return this.f&65535};h.Ed=function(a){this.f=this.f&-112|a&111};
|
||||
h.Rc=function(){this.f&=-129;0<this.D.length&&rc(this.b,this.U,1);return this.R};h.Dd=function(){};h.ed=function(){return this.g};h.Rd=function(a){128==(this.g&192)&&a&64&&rc(this.b,this.V,1);this.g=this.g&-70|a&69};h.dd=function(){return 0};
|
||||
h.Qd=function(a){if(a&=255){E(this,"transmitByte("+k(a,2,!0)+")");this.K&&this.K.call(this.I,a);if(this.C)if(13==a)this.H=0;else if(8==a)this.C.value=this.C.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=wa[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.H%a,this.T&&(b=ua("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.C.value+=b;this.C.scrollTop=this.C.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.j(this.G),
|
||||
h.Qd=function(a){if(a&=255){C(this,"transmitByte("+l(a,2,!0)+")");this.K&&this.K.call(this.J,a);if(this.A)if(13==a)this.H=0;else if(8==a)this.A.value=this.A.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=wa[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.H%a,this.T&&(b=ua("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.A.value+=b;this.A.scrollTop=this.A.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.j(this.G),
|
||||
this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.g&=-129;rc(this.b,this.V,1)}};var yg={},wg=(yg[65392]=[null,null,X.prototype.Sc,X.prototype.Ed,"RCSR"],yg[65394]=[null,null,X.prototype.Rc,X.prototype.Dd,"RBUF"],yg[65396]=[null,null,X.prototype.ed,X.prototype.Rd,"XCSR"],yg[65398]=[null,null,X.prototype.dd,X.prototype.Qd,"XBUF"],yg);Ta(function(){for(var a=B(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new X(d);A(d,c)}});
|
||||
function wc(a){r.call(this,"PC11",a,wc);this.g=this.f=0}u(wc);h=wc.prototype;h.qa=function(){return!1};h.Ca=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;mc(b,this,zg);H(this)};h.Aa=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.za=function(a){return a?this.save():!0};h.reset=function(){this.f&=-2241;this.g=0};h.save=function(){return(new N(this)).data()};h.restore=function(){return!0};h.Lc=function(){return this.f};
|
||||
h.xd=function(a){a&1&&(this.f&32768?a&=-2:(this.f&=-129,this.f|=2048));this.f=this.f&-66|a&65};h.Kc=function(){return this.g};h.wd=function(){};var Ag={},zg=(Ag[65384]=[null,null,wc.prototype.Lc,wc.prototype.xd,"PRS"],Ag[65386]=[null,null,wc.prototype.Kc,wc.prototype.wd,"PRB"],Ag);function Bg(a){r.call(this,"Debugger",a,Bg);this.la=a.base||16;this.ya=!1;this.R=this.xa=this.H=0;this.U=!1;this.C=-1;this.g=[];this.aa={}}u(Bg);
|
||||
var Cg={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Bg.prototype.$b=function(){return-1};Bg.prototype.ac=function(){};
|
||||
function Dg(a,b,c,d){if(c)if(b){0>a.C&&a.g.length&&(a.C=0);if(0>a.C||b!=a.g[a.C])a.g.splice(0,0,b),a.C=0;a.C--}else a.U?b="end":b=a.g[a.C+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(va(b.substring(c,f))),c=f+1}}return a}
|
||||
function Eg(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<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;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?1:0;break;case "&":d=f&e;break;
|
||||
function wc(a){r.call(this,"PC11",a,wc);this.f=a.autoMount||null;this.J=this.g=0;this.v.local=!1;this.A="";this.H=!La("Mobi")&&window&&"FileReader"in window}u(wc);h=wc.prototype;
|
||||
h.qa=function(a,b,c){var d=this;switch(b){case "listTapes":return this.I[b]=c,c.onchange=function(){var a=d.I.descTape,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){n("PC11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.I[b]=c,!0;case "loadTape":return this.I[b]=c,c.onclick=function(){var a=d.I.listTapes;a&&zg(d,
|
||||
a.options[a.selectedIndex].text,a.value)},!0;case "mountTape":if(this.H)return this.I[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;zg(d,oa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.Ca=function(a,b,c,d){this.C=a;this.w=b;this.b=c;this.i=d;if((this.f=Pc(this.C,"autoMount")||this.f)&&"string"==typeof this.f)try{this.f=eval("("+this.f+")")}catch(e){n("PC11 auto-mount error: "+e.message+" ("+this.f+")"),this.f=null}mc(b,this,Ag);Bg(this,"None","",!0);this.H&&Bg(this,"Local Tape","?");Bg(this,"Remote Tape","??");Cg(this)||H(this)};h.Aa=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.za=function(a){return a?this.save():!0};
|
||||
h.reset=function(){this.g&=-2241;this.J=0};function Cg(a){a.D=0;if(a.f){var b=a.f.path,c;if(!(c=a.f.name))a:{if((c=a.I.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=oa(b,!0)}b&&c?Dg(a,c,b,!0):a.ga("Incorrect auto-mount settings for PC11 ("+JSON.stringify(a.f)+")")}return!!a.D}
|
||||
function zg(a,b,c,d){if(c)if("?"==c)a.ga('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=oa(c)}Dg(a,b,c,!1,d)}else a.A="",a.v.local=!1}function Dg(a,b,c,d,e){c&&a.A.toLowerCase()!=c.toLowerCase()&&(a.A="",a.v.local=!1,a.v.Ia?a.ga("PC11 busy"):(a.v.Ia=!0,d&&(a.G=!0,a.D++,D(a)&&C(a,"auto-loading tape: "+b)),a.v.local=!!e,Eg(a,b,c,e)))}
|
||||
function Eg(a,b,c,d){var e=c;if(d){var f=new FileReader;f.onload=function(){var a=f.result;a&&new Uint8Array(a,0,a.byteLength)};f.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(d=pa(c),e="json"==d||"gz"==d?encodeURI(c):ra()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ba(e,null,!0,function(d,e,f){a.v.Ia=!1;var g=0>f&&a.C&&!a.C.v.ha;f?a.ga('Unable to load tape "'+b+'" (error '+f+": "+d+")",g):(jb(a.Ra,d,e),Ca(d,e)&&(a.A=c));a.G&&(a.G=!1,--a.D||H(a));if((d=a.I.listTapes)&&
|
||||
d.options){e=a.v.local?"?":a.A;for(f=0;f<d.options.length;f++)if(d.options[f].value==e){d.selectedIndex!=f&&(d.selectedIndex=f);break}f==d.options.length&&(d.selectedIndex=0)}})}function Bg(a,b,c,d){if((a=a.I.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}h.save=function(){return(new N(this)).data()};h.restore=function(){return!0};
|
||||
h.Lc=function(){return this.g};h.xd=function(a){a&1&&(this.g&32768?a&=-2:(this.g&=-129,this.g|=2048));this.g=this.g&-66|a&65};h.Kc=function(){return this.J};h.wd=function(){};var Fg={},Ag=(Fg[65384]=[null,null,wc.prototype.Lc,wc.prototype.xd,"PRS"],Fg[65386]=[null,null,wc.prototype.Kc,wc.prototype.wd,"PRB"],Fg);function Gg(a){r.call(this,"Debugger",a,Gg);this.ma=a.base||16;this.ya=!1;this.R=this.xa=this.H=0;this.U=!1;this.A=-1;this.g=[];this.aa={}}u(Gg);
|
||||
var Hg={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Gg.prototype.$b=function(){return-1};Gg.prototype.ac=function(){};
|
||||
function Ig(a,b,c,d){if(c)if(b){0>a.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.U?b="end":b=a.g[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(va(b.substring(c,f))),c=f+1}}return a}
|
||||
function Jg(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<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;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?1:0;break;case "&":d=f&e;break;
|
||||
case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0}
|
||||
function Fg(a,b,c){var d;if(b){b=Gg(a,b);for(var e=0,f=!1,g=b,l=[],m=[],p=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<p.length;){var q=p[e++],v=q.length,q=va(q);if(!q){f=!0;break}q=Hg(a,q,null,!1===c);if(void 0===q){f=!0;c=!1;break}l.push(q);if(e==p.length)break;var q=p[e++],w=q.length;m.length&&Cg[q]<Cg[m[m.length-1]]&&Eg(l,m,1);m.push(q);b=b.substr(v+w)}Eg(l,m)&&1==l.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=l.pop(),c&&Ig(a,null,
|
||||
d))}return d}function Gg(a,b){for(var c,d=a.ya?"(":"{",e=a.ya?")":"}",f=new RegExp(a.ya?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Fg(a,c[1]);b=b.replace(d+c[1]+e,null!=g?J(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(;c=b.match(/\$([a-z]+)/i);){d=null;switch(c[1].toLowerCase()){case "ops":d=a.R-a.xa}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
|
||||
function Hg(a,b,c,d){var e;if(null!=b){e=a.$b(b);if(0<=e)e=a.ac(e);else if(e=a.aa[b],null==e){e=b;var f=a.la,g;if(e){f||(f=10);var l=e.charAt(0),m=0<e.indexOf(",");m&&(e=e.replace(/,/g,""));"#"==l?(f=8,l=null):"$"==l&&(f=16,l=null);null==l?e=e.substr(1):("0"==l&&(l=e.charAt(1),"b"==l&&m&&(f=2,l=null),"o"==l?(f=8,l=null):"x"==l&&(f=16,l=null)),null==l?e=e.substr(2):(l=e.charAt(e.length-1).toLowerCase(),"y"==l?(f=2,l=null):"."==l?(f=10,l=null):"h"==l&&(f=16,l=null),null==l&&(e=e.substr(0,e.length-1))));
|
||||
var p,l=e;((m=f)&&10!=m?16==m?l.match(/^[0-9a-f]+$/i):8==m?l.match(/^[0-7]+$/):2==m&&l.match(/^[01]+$/):l.match(/^[0-9]+$/))&&!isNaN(p=parseInt(e,f))&&(g=p|0)}e=g}null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)}else d||a.j("missing "+(c||"value"));return e}
|
||||
function Ig(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var l=0;l<f;l++){g&&(g=","+g);var m=d&255,p=8,q="";p?32<p&&(p=32):p=32;if(null==m||isNaN(m))for(;0<p--;)q="?"+q;else for(;0<p--;)q=(m&1?"1":"0")+q,m>>=1;g=q+g;d>>=8}d=k(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Jg(a,b){if(b)return Ig(a,b,a.aa[b]);var c=0;for(b in a.aa)Ig(a,b,a.aa[b]),c++;return 0<c}
|
||||
function J(a,b,c,d){switch(a.la){case 8:a=na(b,3*c);break;case 10:a=b.toString();break;default:a=k(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}function Kg(a){Bg.call(this,a);this.ya=!0;this.K=Z(0);this.Pa=Z(0);this.T=Z(0);this.G=[];this.f=this.M=this.D=[];Lg(this);this.oa=0;Mg(this);this.Fa={};Ng(this,a.messages);this.Ga=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return Sc(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return Sc(b,a)})}
|
||||
u(Kg,Bg);
|
||||
var Og={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},Pg=".WORD ADC ADCB ADD ASL ASLB ASR ASRB BCC BCS BEQ BGE BGT BHI BIC BICB BIS BISB BIT BITB BLE BLOS BLT BMI BNE BPL BPT BR BVC BVS CCC CLC CLCN CLCV CLCVN CLCVZ CLCZ CLCZN CLN CLR CLRB CLV CLVN CLVZ CLVZN CLZ CLZN CMP CMPB COM COMB DEC DECB INC INCB HALT JMP JSR MARK MFPD MFPI MFPS MOV MOVB MTPD MTPI MTPS NEG NEGB NOP RESET ROL ROLB ROR RORB RTI RTS SBC SBCB SCC SEC SECN SECV SECVN SECVZ SECZ SECZN SEN SEV SEVN SEVZ SEVZN SEZ SEZN SUB SWAB SXT TST TSTB WAIT MUL DIV ASH ASHC XOR SOB EMT TRAP SPL IOT RTT MFPT".split(" "),Qg=
|
||||
function Kg(a,b,c){var d;if(b){b=Lg(a,b);for(var e=0,f=!1,g=b,k=[],m=[],p=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<p.length;){var q=p[e++],v=q.length,q=va(q);if(!q){f=!0;break}q=Mg(a,q,null,!1===c);if(void 0===q){f=!0;c=!1;break}k.push(q);if(e==p.length)break;var q=p[e++],w=q.length;m.length&&Hg[q]<Hg[m[m.length-1]]&&Jg(k,m,1);m.push(q);b=b.substr(v+w)}Jg(k,m)&&1==k.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=k.pop(),c&&Ng(a,null,
|
||||
d))}return d}function Lg(a,b){for(var c,d=a.ya?"(":"{",e=a.ya?")":"}",f=new RegExp(a.ya?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Kg(a,c[1]);b=b.replace(d+c[1]+e,null!=g?J(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(;c=b.match(/\$([a-z]+)/i);){d=null;switch(c[1].toLowerCase()){case "ops":d=a.R-a.xa}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
|
||||
function Mg(a,b,c,d){var e;if(null!=b){e=a.$b(b);if(0<=e)e=a.ac(e);else if(e=a.aa[b],null==e){e=b;var f=a.ma,g;if(e){f||(f=10);var k=e.charAt(0),m=0<e.indexOf(",");m&&(e=e.replace(/,/g,""));"#"==k?(f=8,k=null):"$"==k&&(f=16,k=null);null==k?e=e.substr(1):("0"==k&&(k=e.charAt(1),"b"==k&&m&&(f=2,k=null),"o"==k?(f=8,k=null):"x"==k&&(f=16,k=null)),null==k?e=e.substr(2):(k=e.charAt(e.length-1).toLowerCase(),"y"==k?(f=2,k=null):"."==k?(f=10,k=null):"h"==k&&(f=16,k=null),null==k&&(e=e.substr(0,e.length-1))));
|
||||
var p,k=e;((m=f)&&10!=m?16==m?k.match(/^[0-9a-f]+$/i):8==m?k.match(/^[0-7]+$/):2==m&&k.match(/^[01]+$/):k.match(/^[0-9]+$/))&&!isNaN(p=parseInt(e,f))&&(g=p|0)}e=g}null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)}else d||a.j("missing "+(c||"value"));return e}
|
||||
function Ng(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var k=0;k<f;k++){g&&(g=","+g);var m=d&255,p=8,q="";p?32<p&&(p=32):p=32;if(null==m||isNaN(m))for(;0<p--;)q="?"+q;else for(;0<p--;)q=(m&1?"1":"0")+q,m>>=1;g=q+g;d>>=8}d=l(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Og(a,b){if(b)return Ng(a,b,a.aa[b]);var c=0;for(b in a.aa)Ng(a,b,a.aa[b]),c++;return 0<c}
|
||||
function J(a,b,c,d){switch(a.ma){case 8:a=na(b,3*c);break;case 10:a=b.toString();break;default:a=l(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}function Pg(a){Gg.call(this,a);this.ya=!0;this.K=Z(0);this.Qa=Z(0);this.T=Z(0);this.G=[];this.f=this.M=this.D=[];Qg(this);this.pa=0;Rg(this);this.Fa={};Sg(this,a.messages);this.Ga=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return Sc(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return Sc(b,a)})}
|
||||
u(Pg,Gg);
|
||||
var Tg={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},Ug=".WORD ADC ADCB ADD ASL ASLB ASR ASRB BCC BCS BEQ BGE BGT BHI BIC BICB BIS BISB BIT BITB BLE BLOS BLT BMI BNE BPL BPT BR BVC BVS CCC CLC CLCN CLCV CLCVN CLCVZ CLCZ CLCZN CLN CLR CLRB CLV CLVN CLVZ CLVZN CLZ CLZN CMP CMPB COM COMB DEC DECB INC INCB HALT JMP JSR MARK MFPD MFPI MFPS MOV MOVB MTPD MTPI MTPS NEG NEGB NOP RESET ROL ROLB ROR RORB RTI RTS SBC SBCB SCC SEC SECN SECV SECVN SECVZ SECZ SECZN SEN SEV SEVN SEVZ SEVZN SEZ SEZN SUB SWAB SXT TST TSTB WAIT MUL DIV ASH ASHC XOR SOB EMT TRAP SPL IOT RTT MFPT".split(" "),Vg=
|
||||
{61440:{4096:[62,4032,63],8192:[47,4032,63],12288:[18,4032,63],16384:[14,4032,63],20480:[16,4032,63],24576:[3,4032,63],36864:[63,4032,63],40960:[48,4032,63],45056:[19,4032,63],49152:[15,4032,63],53248:[17,4032,63],57344:[94,4032,63]},65024:{2048:[57,448,63],28672:[100,63,448],29184:[101,63,448],29696:[102,63,448],30208:[103,63,448],30720:[104,448,63],32256:[105,448,8192]},65280:{256:[27,4096],512:[24,4096],768:[10,4096],1024:[11,4096],1280:[22,4096],1536:[12,4096],1792:[20,4096],32768:[25,4096],33024:[23,
|
||||
4096],33280:[13,4096],33536:[21,4096],33792:[28,4096],34048:[29,4096],34304:[8,4096],34560:[9,4096],34816:[106],35072:[107]},65472:{64:[56,63],192:[95,63],2560:[39,63],2624:[49,63],2688:[53,63],2752:[51,63],2816:[67,63],2880:[1,63],2944:[77,63],3008:[97,63],3072:[73,63],3136:[71,63],3200:[6,63],3264:[4,63],3328:[58,24576],3392:[60,63],3456:[65,63],3520:[96,63],35328:[40,63],35392:[50,63],35456:[54,63],35520:[52,63],35584:[68,63],35648:[2,63],35712:[78,63],35776:[98,63],35840:[74,63],35904:[72,63],
|
||||
35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},Rg=[0],Sg=[58,60,65,96,108,
|
||||
110,100,101,102,103,104,105,59,64];h=Kg.prototype;
|
||||
h.Ca=function(a,b,c,d){this.w=b;this.b=c;this.B=a;(a=Pc(a,"messages"))&&Ng(this,a);this.Ya=Qg;this.nb=1145>this.b.$a?Sg:[];Tg(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,m=b.length;if(c){a=d.Y(Ug(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ha;m=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.j("..."):(c=q.type,p=bc[c],q&&d.j(k(q.id,8)+" %"+k(e<<d.w.ha,
|
||||
8)+" %%"+k(q.A,8)+" "+k(q.vb,4,!0)+" "+k(q.size,4,!0)+" "+p),c!=Bc&&(c=-1),p=0);a+=d.w.ua;e++}}});H(this)};
|
||||
h.qa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.na=this.J[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Sc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.C<d.g.length-1&&(b=d.g[++d.C])):40==a.keyCode&&(0<d.C?b=d.g[--d.C]:(b="",d.C=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.J[b]=c,Na(c,function(){if(d.na){var a=d.na.value;
|
||||
d.na.value="";Sc(d,a,!0);return!0}return!1}),!0;case "step":return this.J[b]=c,Na(c,function(a){var b=!1;ob(d,!0)||(nb(d,!0),b=d.ib(a?1:0),nb(d,!1));return b}),!0}return!1};h.ub=function(){this.na&&this.na.focus()};h.Y=function(a){a=a&&a.A;null==a&&(a=-1);return a};h.ob=function(a,b){var c=255,d=this.Y(a,!1,1);-1!==d&&(c=a.yb?this.w.Bb(d):this.b.Bb(d),b&&Vg(a,b));return c};h.ma=function(a,b){var c=65535,d=this.Y(a,!1,2);-1!==d&&(c=a.yb?this.w.pb(d):this.b.pb(d),b&&Vg(a,b));return c};
|
||||
h.Fb=function(a,b,c){var d=this.Y(a,!0,1);-1!==d&&(a.yb?this.w.gb(d,b):this.b.gb(d,b),c&&Vg(a,c),this.B.$(!0))};h.Ta=function(a,b,c){var d=this.Y(a,!0,2);-1!==d&&(a.yb?this.w.Gb(d,b):this.b.Gb(d,b),c&&Vg(a,c),this.B.$(!0))};function Z(a,b){return{A:a,yb:b,Ba:!1}}function Wg(a){return[a.A,a.Ba]}function Xg(a){return{A:a[0],Ba:a[1]}}
|
||||
function Ug(a,b,c){var d,e=(c?a.K:a.Pa).A;c=!1;if(void 0!==b){b=Gg(a,b);"%"==b.charAt(0)&&(c=!0,b=b.substr(1));d=b;var f;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),e=0;e<a.G.length;e++){var g=a.G[e].ja[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Z(d));break}}if(d=f)return d;e=Fg(a,b,void 0)}null!=e&&(d=Z(e,c));return d}function Yg(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.lc=Dg(a,b.hc=c[2]))}function Vg(a,b){null!=a.A&&(a.A+=b||1)}
|
||||
function Ng(a,b){a.i=a;a.ka=a.nc=536870912;a.ra=null;a.wa=[];b=Dg(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Gb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.ka|=Gb[c],a.j(c+" messages enabled"))}}function Tg(a,b){for(var c in Gb)if(64==Gb[c]){a.Fa[c]=b;break}}
|
||||
h.$b=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function Zg(a){return 6>a?"R"+a:6==a?"SP":"PC"}h.ac=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ea[a-8]:20>a?b=this.b.va[a-16]:20==a&&(b=Lb(this.b)));return b};
|
||||
h.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.tb).A));this.ka&1073741824?this.wa.push(a):this.ra&&a==this.ra||(this.ra=a,this.ka&-2147483648&&(this.da(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,Yc(a),a.na=0,a.B.$()))};
|
||||
function Mg(a){var b;if(Wd(a)){if(!a.I||!a.I.length){a.I=Array(1E3);for(b=0;b<a.I.length;b++)a.I[b]=Z();a.fa=0;a.j("instruction history buffer allocated")}if(!a.ba||!a.ba.length)for(a.ba=Array(256),b=0;b<a.ba.length;b++)a.ba[b]=[b,0]}else a.I&&a.I.length&&a.j("instruction history buffer freed"),a.fa=0,a.I=[],a.ba=[]}h.hb=function(a,b){if(!$g(this,b))return!1;this.b.hb(a);return!0};
|
||||
h.ib=function(a,b,c){if(!$g(this))return!1;this.H=0;a||Wd(this)&&Xd(this,this.b.u[7],0);try{a=Zc(this.b,a);var d=this.b.ib(a);0<d&&($c(this.b,a),this.H+=d,Wc(this.b,d,!0),Tc(this.b,d),this.R++)}catch(e){"number"!=typeof e&&(this.H=0,rb(this.b,e.stack||e.message))}!1!==c&&this.B.$();this.$(b||!1);return 0<this.H};h.da=function(a){this.b&&this.b.da(a)};h.$=function(a){void 0===a&&(a=!0);this.K=Z(this.b.u[7]);a&&1!=this.V?ah(this):bh(this)};
|
||||
function $g(a,b){var c;(c=!a.b||!pb(a.b))||(c=a.b,c.v.ia?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.v.ca?(b||a.j("cpu busy or unavailable, command ignored"),!1):!qb(a.b)}h.Aa=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};h.za=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){Mg(this);this.R=this.xa=0;this.ra=null;this.H=0;this.K=Z(this.b.u[7]);this.v.ca=!1;ch(this);a||this.$()};
|
||||
h.save=function(){var a=new N(this);a.set(0,Wg(this.K));a.set(1,Wg(this.T));a.set(2,[this.g,this.U,this.ka]);a.set(3,this.G);return a.data()};h.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Xg(a[b++]),this.T=Xg(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.U=a[b][1],this.ka|=a[b][2]);a[3]&&(this.G=a[3]);return!0};h.start=function(a,b){this.V||this.j("running");this.v.ca=!0;this.xb=a;this.Ab=b};
|
||||
h.stop=function(a,b){if(this.v.ca){this.v.ca=!1;this.H=b-this.Ab;if(!this.V){b="stopped";if(this.H){a-=this.xb;var c=0<a?Math.round(1E3*this.H/a):0;b+=" (";Wd(this)&&(b+=this.R+" opcodes, ",this.xa-=this.R,this.R=0);b+=this.H+" cycles, "+a+" ms, "+c+" hz)"}else G(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}this.$(!0);this.ub();ch(this,this.b.u[7])}};function Wd(a){return 1<a.f.length||!!a.oa}
|
||||
function Xd(a,b,c){var d=a.b;if(0<c&&(a.oa&&!--a.oa||Kc(a,b,1,a.f)))return!0;0<=c&&a.ba.length&&(a.R++,null!=a.b.pb(b)&&(b=a.I[a.fa],b.A=d.u[7],b.Ba=!1,++a.fa==a.I.length&&(a.fa=0)));return!1}function $b(a){var b=a.b;if(b.v.ca)throw O(b,a.b.tb),a.da(),-1;return!1}function Lg(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b<a.M.length;b++){c=a.M[b];var d=a.w;c=a.Y(c);Lc(d.W[c>>>d.ha],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.w,c=a.Y(c),Lc(d.W[c>>>d.ha],!0);a.D=["bw"];a.Wa=0}
|
||||
h.Qa=function(a,b,c){var d=!0;c||dh(this,a,b,!1,!0);if(a!=this.f){var e=this.Y(b);if(-1===e)this.j("invalid address: "+J(this,b.A)),d=!1;else{var f=this.w;f.W[e>>>f.ha].Qa(e&f.w,a==this.D)}}d&&(a.push(b),c?b.Ba=!0:(eh(this,a,a.length-1,"set"),Mg(this)));return d};function dh(a,b,c,d,e){var f=!1;c=a.Y(c);for(var g=1;g<b.length;g++){var l=b[g];if(c==a.Y(l)&&(!d||l.Ba)){f=!0;l.Ba||e||eh(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.w,Lc(d.W[c>>>d.ha],b==a.D));l.Ba||Mg(a);break}}return f}
|
||||
function fh(a,b){for(var c=1;c<b.length;c++)eh(a,b,c);return b.length-1}function eh(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.A)+(d?" "+d:c.hc?' "'+c.hc+'"':""))}function ch(a,b){if(void 0!==b)Kc(a,b,1,a.f,!0),a.V=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.Ba){if(!dh(a,a.f,c,!0))break;b=0}}}
|
||||
function Kc(a,b,c,d,e){var f=!1;if(!a.Wa++)for(var g=1;!f&&g<d.length;g++){var l=d[g];if(!e||l.Ba)for(var m=a.Y(l),p=0;p<c;p++)if(b+p==m){var q,f=!0;l.Ba&&(dh(a,d,l,!0),e=!0);if(q=l.lc){for(var f=!1,v=0;v<q.length;v++)if(!gh(a,q[v],!0)){if(q[v].indexOf("if")){f=!0;break}for(var w=v+1;w<q.length&&q[w].indexOf("else");w++)v++;if(w==q.length){f=!0;break}}a.b.v.ca||(f=!0)}if(f){e||eh(a,d,g,"hit");break}}}a.Wa--;return f}
|
||||
function hh(a,b,c,d){var e=Z(b.A),f=a.ma(b,2),g,l;for(l in a.Ya)if(g=a.Ya[l][f&l])break;g||(g=Rg);var m=g[0];0<=a.nb.indexOf(m)&&(g=Rg,m=g[0]);var p=l="",q=Pg[m],v=g.length-1;m||v||(l=J(a,f));for(m=1;m<=v;m++){var w=g[m];if(void 0!==w){var x;x=a;var C=w,w=b,y="",D=C&61440;if(4096==D)w=w.A+((f&255)<<24>>23)&65535,y=J(x,w);else if(8192==D)w=w.A-((f&63)<<1)&65535,y=J(x,w);else if(12288==D)y=J(x,f&7,1);else if(24576==D)y=J(x,f&63,1);else if(D=f&C,C&4032&&(D>>=6,C>>=6),C&63)switch(C=D&7,D&56){case 0:y=
|
||||
Zg(C);break;case 8:y="@"+Zg(C);break;case 16:7>C?y="("+Zg(C)+")+":(D=x.ma(w,2),y="#"+J(x,D,0,!0));break;case 24:7>C?y="@("+Zg(C)+")+":(D=x.ma(w,2),y="@#"+J(x,D,0,!0));break;case 32:y="-("+Zg(C)+")";break;case 40:y="@-("+Zg(C)+")";break;case 48:D=x.ma(w,2);y=J(x,D,0,!0)+"("+Zg(C)+")";7==C&&(y=[y,J(x,D+w.A&65535)]);break;case 56:D=x.ma(w,2),y="@"+J(x,D)+"("+Zg(C)+")",7==C&&(y=[y,J(x,D+w.A&65535)])}x=y;if(!x||!x.length){l="INVALID";break}"string"!=typeof x&&(p=x[1],x=x[0]);0<l.length&&(l+=",");l+=x||
|
||||
"???"}}f="";g=J(a,e.A)+":";if(-1!==e.A&&-1!==b.A){do if(f+=" "+J(a,a.ma(e,2)),null==e.A)break;while(e.A!=b.A)}g+=ua(f,24);g+=ua(q,5);l&&(g+=" "+l);if(c||p)g=ua(g,60)+";"+(c||""),g=a.b.v.Za?g+("cycles="+Uc(a.b).toString()+" cs="+k(a.b.qb)):g+(null!=d?"="+d.toString():""),p&&(g+=" @"+p);return g}function ih(a,b){switch(b){case "N":a=a.b.Da();break;case "Z":a=Ad(a.b);break;case "V":a=zd(a.b);break;case "C":a=yd(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||
function jh(a,b){var c="",d=a.b;8>b?(c=Zg(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ea[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.va[b-16]):20==b&&(c="PS="+J(a,Lb(d)));c&&(c+=" ");return c}function kh(a){var b,c="";for(b=0;6>b;b++)c+=jh(a,b);c=c+"\n"+(jh(a,6)+jh(a,7)+jh(a,20));return c+=ih(a,"T")+ih(a,"N")+ih(a,"Z")+ih(a,"V")+ih(a,"C")}h.Vb=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function lh(a,b,c){var d=[],e=a.Y(b)>>>0;for(b=0;b<a.G.length;b++){var f=a.G[b],g=f.A>>>0,l=f.vc;if(e>=g&&e<g+l){e=ya(f.Ub,[e-g],a.Vb);0<=e?mh(a,b,e,d):c&&(e=~e,mh(a,b,e-1,d),mh(a,b,e,d));break}}return d}function mh(a,b,c,d){var e={},f=a.G[b].Ub,g=0,l=null;0<=c&&c<f.length&&(g=f[c][0],l=f[c][1]);l&&(e=a.G[b].ja[l],l="."==l.charAt(0)?null:e.l||l);d.push(l);d.push(g);d.push(e.a);d.push(e.c)}
|
||||
function nh(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Jg(a)||a.j("no variables"),!0;if(!c[2])return Jg(a,c[1]);if(!c[3])return delete a.aa[c[1]],!0;b=Fg(a,c[3]);return void 0!==b?(a.aa[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1}
|
||||
function oh(a,b,c){var d=null;if(b=Ug(a,b,!0)){a.Y(b);var e=lh(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.A-e[1])&&(g=" + "+k(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.j(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.A)&&(g=" - "+k(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.j(f),d||(d=f))}else c&&a.j("no symbols")}return d}
|
||||
function ah(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}f=Fg(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":O(d,f);a.K=Z(d.u[7]);break;case "N":d.S=f?32768:0;break;case "Z":d.X=
|
||||
f?0:1;break;case "V":d.O=f?32768:0;break;case "C":d.N=f?65536:0;break;default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.B.$();a.j("updated registers:")}a.j(kh(a));c&&(a.K=Z(d.u[7]),bh(a,J(a,a.K.A)))}}function ph(a,b){b=va(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Ig(a,null,c[2].charCodeAt(0)):Fg(a,b,!0)}
|
||||
function qh(a,b,c){var d="t"!=b;c=Hg(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ma(c,function(){return nb(a,!0)&&a.ib(e,d,!1)},function(){a.B.$();nb(a,!1)})}
|
||||
function bh(a,b,c,d){if(b=Ug(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Hg(a,c.substr(1)),null!=c&&(d=c);else{d=Ug(a,c,!0);if(!d||d.A<b.A)return;e=d.A-b.A;if(256<e){a.j("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=ob(a,!1)||a.V?a.H:null;var g=null!=f?"cycles":null,l=lh(a,b),m=b.A;if(l[0]&&d&&(!c&&d||0>l[0].indexOf("+"))){var p=l[0]+":";l[2]&&(p+=" "+l[2]);a.j(p)}l[3]&&(g=l[3],f=null);f=hh(a,b,g,f);a.j(f);a.K=b;e-=b.A-m;c++}}}
|
||||
function gh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.U&&(a.j("ended assemble at "+J(a,a.T.A)),a.K=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ra=null;if(pb(a)&&0<b.length){a.U&&(b="a "+J(a,a.T.A)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");if(g&&g.length)for(var l=g[0],m=l.charAt(0),p=1;p<l.length;p++){var q=l.charAt(p);if("?"==m||"r"==m||"a">q||"z"<q){g[0]=l.substr(p);g.unshift(l.substr(0,p));break}}g[0]=g[0].toLowerCase();switch(g[0].charAt(0)){case "a":var v=
|
||||
Ug(a,g[1],!0);if(v)if(a.T=v,void 0===g[2])a.j("begin assemble at "+J(a,v.A)),a.U=!0,a.B.$();else{var w;a.j("not supported yet");w=[];if(w.length){for(var x=0;x<w.length;x++)a.Fb(v,w[x],1);a.j(hh(a,a.T))}}break;case "b":a:{var C=g[0],y=g[1],D=b;if("?"==y)a.j("breakpoint commands:"),a.j("\tbp [a]\tset exec breakpoint at addr [a]"),a.j("\tbr [a]\tset read breakpoint at addr [a]"),a.j("\tbw [a]\tset write breakpoint at addr [a]"),a.j("\tbc [a]\tclear breakpoint at addr [a]"),a.j("\tbl\tlist all breakpoints"),
|
||||
a.j("\tbn [n]\tbreak after [n] instruction(s)");else{var Ca=C.charAt(1);if("l"==Ca){var bd;bd=0+fh(a,a.f);bd+=fh(a,a.M);(bd+=fh(a,a.D))||a.j("no breakpoints")}else if("n"==Ca)a.oa=Hg(a,y),a.j("break after "+a.oa+" instruction(s)");else if(void 0===y)a.j("missing breakpoint address");else{var U=Z();if("*"!=y&&(U=Ug(a,y,!0),!U))break a;"c"==Ca?null==U.A?(Lg(a),a.j("all breakpoints cleared")):dh(a,a.f,U)||dh(a,a.M,U)||dh(a,a.D,U)||a.j("breakpoint missing: "+J(a,U.A)):null!=U.A&&(Yg(a,U,D),"p"==Ca?a.Qa(a.f,
|
||||
U):"r"==Ca?a.Qa(a.M,U):"w"==Ca?a.Qa(a.D,U):a.j("unknown breakpoint command: "+Ca))}}}break;case "c":a.Ra&&(a.Ra.value="");break;case "d":a:{var Xa,Ya=g[0],ha=g[1],Da=g[2],Jh=g[3];if("?"==ha){var Za="";for(Xa in Gb)a.Fa[Xa]&&(Za&&(Za+=","),Za+=Xa);Za+=",state,symbols";a.j("dump memory commands:");a.j("\tdb [a] [#] dump # bytes at address a");a.j("\tdw [a] [#] dump # words at address a");a.j("\tdd [a] [#] dump # dwords at address a");a.j("\tdh [#] [#] dump # instructions from history");
|
||||
Za.length&&a.j("dump extension commands:\n\t"+Za)}else if("state"==ha){var Hf=rh(a.B,!0);"console"==Da?console.log(Hf):(a.Ra&&(a.Ra.value=""),a.j(Hf))}else if("symbols"==ha)for(var cd=0;cd<a.G.length;cd++){var dd=a.G[cd],$a;for($a in dd.ja)if("."!=$a.charAt(0)){var If=dd.ja[$a].o;if(void 0!==If){var Jf=dd.ja[$a].l;Jf&&($a=Jf);a.j(J(a,If)+" "+$a)}}}else{if("d"==Ya){for(Xa in Gb)if(g[1]==Xa){var Kf=a.Fa[Xa];Kf?(g.shift(),g.shift(),Kf(g)):a.j("no dump registered for "+ha);break a}ha||(Ya=a.Cb||"db")}else a.Cb=
|
||||
Ya;if("dh"==Ya){var Lf=ha,Mf=Da,Nf="",Of=0,ca=a.fa,ia=a.I;if(ia.length){var Y=+Lf||a.Xa,tb=+Mf||10;isNaN(Y)?Y=tb:Nf="more ";Y>ia.length&&(a.j("note: only "+ia.length+" available"),Y=ia.length);ca-=Y;0>ca&&(null==ia[ia.length-1].A?(Y=ca+Y,ca=0):ca+=ia.length);var ed=[];"call"==Mf&&(tb=1E5,ed=["CALL"]);for(void 0!==Lf&&a.j(Y+" instructions earlier:");0<tb&&ca!=a.fa;){var Pf=ia[ca++];if(null==Pf.A)break;var ub=Z(Pf.A),Kh=Y--,Qf=hh(a,ub,"history",Kh);(!ed.length||0<=Qf.indexOf(ed[0]))&&a.j(Qf);ub.Jb&&
|
||||
(ca+=ub.Jb,tb-=ub.Jb,Y-=ub.Jb);ca>=ia.length&&(ca=0);a.Xa=Y;Of++;tb--}}Of||(a.j("no "+Nf+"history available"),a.Xa=void 0)}else{var vb=Ug(a,ha);if(vb){var dc=0;Da&&("l"==Da.charAt(0)&&(Da=Da.substr(1)||Jh),dc=Hg(a,Da)>>>0,65536<dc&&(dc=65536));for(var wb="",ab="dd"==Ya?4:"dw"==Ya?2:1,ec=ab*dc||128,Lh=ec+15>>4||1;Lh--&&0<ec;){var fc=0,xb=0,yb,fd="",Rf="",ha=J(a,vb.A);for(yb=4==ab?16:a.la;0<yb&&0<ec;yb--){var gd,gc=2==ab?a.ma(vb,gd=2):a.ob(vb,gd=1),fc=fc|gc<<(xb<<3),xb=xb+gd;xb==ab&&(fd+=J(a,fc,ab),
|
||||
fd+=1==ab?9==yb?"-":" ":" ",fc=xb=0);Rf+=32<=gc&&128>gc?String.fromCharCode(gc):".";ec--}wb&&(wb+="\n");wb+=ha+" "+fd+(0==yb?" "+Rf:"")}wb&&a.j(wb);a.Pa=vb}}}}break;case "e":if("else"==g[0])break;var bb,hd,id,jd,kd=g[0],ld=g[1];"eb"==kd?(bb=1,hd=255,id=a.ob,jd=a.Fb):"e"==kd||"ew"==kd?(bb=2,hd=65535,id=a.ma,jd=a.Ta):ld=null;if(null==ld)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var hc=Ug(a,ld);if(hc)for(var ic=2;ic<
|
||||
g.length;ic++){var zb=Fg(a,g[ic]);if(void 0===zb){a.j("unrecognized value: "+g[ic]);break}zb&~hd&&a.j("warning: "+k(zb)+" exceeds "+bb+"-byte value");var Mh=id.call(a,hc);a.j("changing "+J(a,hc.A)+" from "+J(a,Mh,bb)+" to "+J(a,zb,bb));jd.call(a,hc,zb,bb)}}break;case "g":a:{var Sf=g[1],Nh=b;if(void 0!==Sf){var md=Ug(a,Sf,!0);if(!md)break a;Yg(a,md,Nh);a.Qa(a.f,md,!0)}a.hb(!0,c)}break;case "h":a.v.ca?(c||a.j("halting"),a.da()):ob(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var nd;
|
||||
var Ab=b.substr(2),Ab=va(Ab);Fg(a,Ab)?(c||a.j("true: "+Ab),nd=!0):(c||a.j("false: "+Ab),nd=!1);nd||(d=!1);break}f=!0;break;case "k":var Oh=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var od=0,pd=Z(),Bb=Z(a.b.u[6]);for(a.j("stack trace for "+J(a,Bb.A));10>od;){for(var Ea=null,Ph=256;65536>Bb.A>>>0;){pd.A=a.ma(Bb,2);if(null==Bb.A||!Ph--)break;if(!(pd.A&1)){for(var Qh=a,jc=pd,Tf=null,Cb=jc.A,Uf=Cb,qd=1;6>=qd&&Cb;qd++){if(2<
|
||||
qd){jc.A=Cb;var kc=hh(Qh,jc);if(0<=kc.indexOf("JSR")){var Vf=kc.indexOf(" ");if(Cb+(kc.indexOf(" ",Vf+1)-Vf-1)/2==Uf){Tf=kc;break}}}Cb-=2}jc.A=Uf;if(Ea=Tf)break}}if(!Ea||null==Ea)break;var Wf=null;if("ks"==Oh){var Xf=Ea.match(/[0-9A-F]+$/);Xf&&(Wf=oh(a,Xf[0]))}Ea=ua(Ea,50)+" ;"+(Wf||"stack="+J(a,Bb.A));a.j(Ea);od++}od||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){oh(a,g[1],!0);break}f=!0;break;case "m":a:{var ja,ka=null,F=g[1];"?"==F&&(F=void 0);if(void 0!==F){var xa=0;if("all"==
|
||||
F)xa=1878917119,F=null;else if("on"==F)ka=!0,F=null;else if("off"==F)ka=!1,F=null;else{"keys"==F&&(F="key");"kbd"==F&&(F="keyboard");for(ja in Gb)if(F==ja){xa=Gb[ja];ka=!!(a.ka&xa);break}if(!xa){a.j("unknown message category: "+F);break a}}if(xa)if("on"==g[2])a.ka|=xa,ka=!0;else if("off"==g[2]&&(a.ka&=~xa,ka=!1,1073741824==xa)){for(var rd=0;rd<a.wa.length;rd++)a.j(a.wa[rd]);a.wa=[]}}var Rh=0,Db="";for(ja in Gb)if(!F||F==ja){var Sh=!!(a.ka&Gb[ja]);if(null===ka||ka==Sh)Db&&(Db+=","),++Rh%10||(Db+="\n\t"),
|
||||
"key"==ja&&(ja="keys"),Db+=ja}void 0===F&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==ka?ka?"messages on: ":"messages off: ":"message categories:\n\t")+(Db||"none"));Mg(a)}break;case "p":if("print"==g[0]){ph(a,b.substr(5));break}var Th="pr"==g[0]?1:0;if(a.V)a.j("step in progress");else{var Yf=Z(a.b.u[7]);a.ob(Yf);a.V?(a.Qa(a.f,Yf,!0),a.hb()||(a.B&&a.B.ub(),a.V=0)):qh(a,Th?"tr":"t")}break;case "r":if("reset"==b){a.B&&a.B.reset();break}ah(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Eb=
|
||||
+g[2];if(8==Eb||10==Eb||16==Eb)a.la=Eb;else{a.j("invalid base: "+Eb);break}}a.j("default base: "+a.la);break;case "cs":var Fb;void 0!==g[3]&&(Fb=+g[3]);switch(g[2]){case "int":a.b.ab=Fb;break;case "start":a.b.rb=Fb;break;case "stop":a.b.bb=Fb;break;default:a.j("unknown cs option");break a}void 0!==Fb&&Rc(a.b);a.j("checksums "+(a.b.v.Za?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Vc(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.Sa.toFixed(2)+
|
||||
"Mhz")+" ("+a.b.La+"x)");break;default:if(g[1]){a.j("unknown option: "+g[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"),a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":qh(a,g[0],g[1]);break;case "u":bh(a,g[1],g[2],8);break;case "v":if("var"==g[0]){nh(a,b.substr(3))||(d=!1);break}if("ver"==
|
||||
g[0]){a.j("PDPjs version 1.30.1 ("+a.b.$a+",RELEASE"+(sb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){ph(a,b.substr(1));break}var sd="commands:",td;for(td in Og)sd+="\n"+ua(td,9)+Og[td];Wd(a)||(sd+="\nnote: history disabled if no exec breakpoints");a.j(sd);break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Zf){a.j("debugger error: "+(Zf.stack||Zf.message)),d=!1}return d}
|
||||
function Sc(a,b,c){b=Dg(a,b,c);for(var d in b)if(!gh(a,b[+d]))return!1;return!0}Ta(function(){for(var a=B(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Kg(d);A(d,c)}});
|
||||
function sh(a,b,c){r.call(this,"Computer",a,sh,67108864);this.v.ia=!1;th(this,b);this.M=Pc(this,"autoPower",a);this.B=0;this.aa=a.busWidth||a.buswidth;this.f=uh;this.I=null;this.G=this.U=!1;this.ba=Pc(this,"url")||"";(Math.random()+.1).toString(36);this.g=vh(this);if(this.b=mb("CPU",this.id)){this.i=mb("Debugger",this.id);this.w=new Mb({id:this.Va+".bus",busWidth:this.aa},this.b,this.i);var d,e=kb(this.id);if((this.C=mb("Panel",this.id))&&this.C.Ra)for(b=0;b<e.length;b++)d=e[b],d.pa=this.C.pa,d.j=
|
||||
this.C.j,d.Ra=this.C.Ra;this.j("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ca&&d.Ca(this,this.w,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=Pc(this,"state")||(f=!0,a.state))b=this.R=a,f||(this.G=!0,this.f=uh),this.f&&
|
||||
(this.K=new N(this,"1.30.1"),wh(this.K)?b=null:delete this.K);!b&&this.f&&(b=xh(this))&&(this.G=!0);if(b){var g=this;Ba(b,null,!0,function(a,b,c){c?(g.H=null,g.G=!1,g.pa("Unable to load machine state from server (error "+c+(b?": "+va(b):"")+")")):(g.I=b,g.U=!0);H(g)})}else H(this);this.J.power||(this.M=!0);!c&&this.M&&yh(this,this.sb)}else n("Unable to find CPU component")}u(sh);var uh=0;
|
||||
function th(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){n(d.message+" ("+c+")")}}a.V=b}function Pc(a,b,c){var d=b.toLowerCase(),d=db[b]||db[d];void 0===d&&a.V&&(d=a.V[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function yh(a,b,c){for(var d=kb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!pb(f)){pb(f,function(){yh(a,b,c)});return}}b.call(a,c)}
|
||||
function zh(a,b){var c=new N(a,"1.30.1","validate");if(wh(c)&&Ah(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.pa("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=sh.prototype;
|
||||
h.sb=function(a){void 0===a&&(a=this.f||(this.I?1:uh));if(!this.B){this.B++;var b=!1,c=!1;this.T=!1;var d=this.K||new N(this,"1.30.1");if(-1==a)b=!0;else if(a>uh){if(wh(d,this.I)){this.D=new N(this,"1.30.1","failsafe");wh(this.D)&&(Bh(this,d),a=2,Ch(this.D));this.D.set("timestamp",Aa());Dh(this.D);var e=this.f&&!this.G;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ah(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?wh(d,g):("error"==
|
||||
f&&"no machine state"!=g?(this.pa("Error: "+g),"unable to verify user"==g&&(Ka("user",""),this.g=null)):this.j(f+": "+g),Ch(d),wh(d)?(c=Ah(d),e=!0):c=!1))}e&&zh(this,c?d:null)}else 2==a&&d.clear()}else zh(this);delete this.I;delete this.K}e=kb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Eh(this,g,d,b,c));b=[d,a,c];-1!=a?yh(this,this.Xb,b):this.Xb(b)}};
|
||||
function Eh(a,b,c,d,e){if(!b.v.ia){b.v.ia=!0;if(b.Aa){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Aa(f,d)&&f&&(n("Unable to restore state for "+b.type),a.R&&!a.U?(c.clear(),a.f=uh,window&&window.location.reload()):a.T=!0,b.Aa(null),e=!1)}if(!d&&b.Yb)for(a=b.Yb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.Xb=function(a){var b=a[0],c=0>a[1];a=a[2];this.fa=!0;this.v.ia=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.b&&(Eh(this,this.b,b,c,a),this.b.lb());this.T&&(Bh(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.B=0};
|
||||
function Bh(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Ba("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function rh(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),l=Aa();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.za&&(c&&a.b.da(),d=a.b.za(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ia=!1,!1===d&&(e=null)));for(var l=kb(a.id),m=0;m<l.length;m++){var p=l[m];p.v.ia&&(p.za&&(d=p.za(b,c),"object"===typeof d&&f.set(p.id,
|
||||
d)),c&&(p.v.ia=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.g&&Fh(a,a.g,f.toString()),Dh(g)&&Dh(f)||(e=null,d=l=!0)):a.f&&(d=!0,l=3==a.f),d&&f.clear(l)):e=f.toString());c&&(a.v.ia=!1,b=a.J.power)&&(b.textContent="Power");a.B=0;return e}h.reset=function(){this.w&&this.w.reset&&(E(this,"Resetting "+this.w.type),this.w.reset());for(var a=kb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.w&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}};
|
||||
35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},Wg=[0],Xg=[58,60,65,96,108,
|
||||
110,100,101,102,103,104,105,59,64];h=Pg.prototype;
|
||||
h.Ca=function(a,b,c,d){this.w=b;this.b=c;this.C=a;(a=Pc(a,"messages"))&&Sg(this,a);this.Za=Vg;this.nb=1145>this.b.ab?Xg:[];Yg(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,m=b.length;if(c){a=d.Y(Zg(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ia;m=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.j("..."):(c=q.type,p=bc[c],q&&d.j(l(q.id,8)+" %"+l(e<<d.w.ia,
|
||||
8)+" %%"+l(q.B,8)+" "+l(q.vb,4,!0)+" "+l(q.size,4,!0)+" "+p),c!=Bc&&(c=-1),p=0);a+=d.w.ua;e++}}});H(this)};
|
||||
h.qa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.oa=this.I[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Sc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.A<d.g.length-1&&(b=d.g[++d.A])):40==a.keyCode&&(0<d.A?b=d.g[--d.A]:(b="",d.A=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.I[b]=c,Na(c,function(){if(d.oa){var a=d.oa.value;
|
||||
d.oa.value="";Sc(d,a,!0);return!0}return!1}),!0;case "step":return this.I[b]=c,Na(c,function(a){var b=!1;ob(d,!0)||(nb(d,!0),b=d.jb(a?1:0),nb(d,!1));return b}),!0}return!1};h.ub=function(){this.oa&&this.oa.focus()};h.Y=function(a){a=a&&a.B;null==a&&(a=-1);return a};h.ob=function(a,b){var c=255,d=this.Y(a,!1,1);-1!==d&&(c=a.yb?this.w.Bb(d):this.b.Bb(d),b&&$g(a,b));return c};h.na=function(a,b){var c=65535,d=this.Y(a,!1,2);-1!==d&&(c=a.yb?this.w.pb(d):this.b.pb(d),b&&$g(a,b));return c};
|
||||
h.Fb=function(a,b,c){var d=this.Y(a,!0,1);-1!==d&&(a.yb?this.w.hb(d,b):this.b.hb(d,b),c&&$g(a,c),this.C.$(!0))};h.Va=function(a,b,c){var d=this.Y(a,!0,2);-1!==d&&(a.yb?this.w.Gb(d,b):this.b.Gb(d,b),c&&$g(a,c),this.C.$(!0))};function Z(a,b){return{B:a,yb:b,Ba:!1}}function ah(a){return[a.B,a.Ba]}function bh(a){return{B:a[0],Ba:a[1]}}
|
||||
function Zg(a,b,c){var d,e=(c?a.K:a.Qa).B;c=!1;if(void 0!==b){b=Lg(a,b);"%"==b.charAt(0)&&(c=!0,b=b.substr(1));d=b;var f;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),e=0;e<a.G.length;e++){var g=a.G[e].ka[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Z(d));break}}if(d=f)return d;e=Kg(a,b,void 0)}null!=e&&(d=Z(e,c));return d}function ch(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.lc=Ig(a,b.hc=c[2]))}function $g(a,b){null!=a.B&&(a.B+=b||1)}
|
||||
function Sg(a,b){a.i=a;a.la=a.nc=536870912;a.ra=null;a.wa=[];b=Ig(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in tb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.la|=tb[c],a.j(c+" messages enabled"))}}function Yg(a,b){for(var c in tb)if(64==tb[c]){a.Fa[c]=b;break}}
|
||||
h.$b=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function dh(a){return 6>a?"R"+a:6==a?"SP":"PC"}h.ac=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ea[a-8]:20>a?b=this.b.va[a-16]:20==a&&(b=Lb(this.b)));return b};
|
||||
h.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.tb).B));this.la&1073741824?this.wa.push(a):this.ra&&a==this.ra||(this.ra=a,this.la&-2147483648&&(this.da(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,Yc(a),a.oa=0,a.C.$()))};
|
||||
function Rg(a){var b;if(Wd(a)){if(!a.J||!a.J.length){a.J=Array(1E3);for(b=0;b<a.J.length;b++)a.J[b]=Z();a.fa=0;a.j("instruction history buffer allocated")}if(!a.ba||!a.ba.length)for(a.ba=Array(256),b=0;b<a.ba.length;b++)a.ba[b]=[b,0]}else a.J&&a.J.length&&a.j("instruction history buffer freed"),a.fa=0,a.J=[],a.ba=[]}h.ib=function(a,b){if(!eh(this,b))return!1;this.b.ib(a);return!0};
|
||||
h.jb=function(a,b,c){if(!eh(this))return!1;this.H=0;a||Wd(this)&&Xd(this,this.b.u[7],0);try{a=Zc(this.b,a);var d=this.b.jb(a);0<d&&($c(this.b,a),this.H+=d,Wc(this.b,d,!0),Tc(this.b,d),this.R++)}catch(e){"number"!=typeof e&&(this.H=0,rb(this.b,e.stack||e.message))}!1!==c&&this.C.$();this.$(b||!1);return 0<this.H};h.da=function(a){this.b&&this.b.da(a)};h.$=function(a){void 0===a&&(a=!0);this.K=Z(this.b.u[7]);a&&1!=this.V?fh(this):gh(this)};
|
||||
function eh(a,b){var c;(c=!a.b||!pb(a.b))||(c=a.b,c.v.ha?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.v.ca?(b||a.j("cpu busy or unavailable, command ignored"),!1):!qb(a.b)}h.Aa=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};h.za=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){Rg(this);this.R=this.xa=0;this.ra=null;this.H=0;this.K=Z(this.b.u[7]);this.v.ca=!1;hh(this);a||this.$()};
|
||||
h.save=function(){var a=new N(this);a.set(0,ah(this.K));a.set(1,ah(this.T));a.set(2,[this.g,this.U,this.la]);a.set(3,this.G);return a.data()};h.restore=function(a){var b=0;void 0!==a[2]&&(this.K=bh(a[b++]),this.T=bh(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.U=a[b][1],this.la|=a[b][2]);a[3]&&(this.G=a[3]);return!0};h.start=function(a,b){this.V||this.j("running");this.v.ca=!0;this.xb=a;this.Ab=b};
|
||||
h.stop=function(a,b){if(this.v.ca){this.v.ca=!1;this.H=b-this.Ab;if(!this.V){b="stopped";if(this.H){a-=this.xb;var c=0<a?Math.round(1E3*this.H/a):0;b+=" (";Wd(this)&&(b+=this.R+" opcodes, ",this.xa-=this.R,this.R=0);b+=this.H+" cycles, "+a+" ms, "+c+" hz)"}else D(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}this.$(!0);this.ub();hh(this,this.b.u[7])}};function Wd(a){return 1<a.f.length||!!a.pa}
|
||||
function Xd(a,b,c){var d=a.b;if(0<c&&(a.pa&&!--a.pa||Kc(a,b,1,a.f)))return!0;0<=c&&a.ba.length&&(a.R++,null!=a.b.pb(b)&&(b=a.J[a.fa],b.B=d.u[7],b.Ba=!1,++a.fa==a.J.length&&(a.fa=0)));return!1}function $b(a){var b=a.b;if(b.v.ca)throw O(b,a.b.tb),a.da(),-1;return!1}function Qg(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b<a.M.length;b++){c=a.M[b];var d=a.w;c=a.Y(c);Lc(d.W[c>>>d.ia],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.w,c=a.Y(c),Lc(d.W[c>>>d.ia],!0);a.D=["bw"];a.Xa=0}
|
||||
h.Sa=function(a,b,c){var d=!0;c||ih(this,a,b,!1,!0);if(a!=this.f){var e=this.Y(b);if(-1===e)this.j("invalid address: "+J(this,b.B)),d=!1;else{var f=this.w;f.W[e>>>f.ia].Sa(e&f.w,a==this.D)}}d&&(a.push(b),c?b.Ba=!0:(jh(this,a,a.length-1,"set"),Rg(this)));return d};function ih(a,b,c,d,e){var f=!1;c=a.Y(c);for(var g=1;g<b.length;g++){var k=b[g];if(c==a.Y(k)&&(!d||k.Ba)){f=!0;k.Ba||e||jh(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.w,Lc(d.W[c>>>d.ia],b==a.D));k.Ba||Rg(a);break}}return f}
|
||||
function kh(a,b){for(var c=1;c<b.length;c++)jh(a,b,c);return b.length-1}function jh(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.B)+(d?" "+d:c.hc?' "'+c.hc+'"':""))}function hh(a,b){if(void 0!==b)Kc(a,b,1,a.f,!0),a.V=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.Ba){if(!ih(a,a.f,c,!0))break;b=0}}}
|
||||
function Kc(a,b,c,d,e){var f=!1;if(!a.Xa++)for(var g=1;!f&&g<d.length;g++){var k=d[g];if(!e||k.Ba)for(var m=a.Y(k),p=0;p<c;p++)if(b+p==m){var q,f=!0;k.Ba&&(ih(a,d,k,!0),e=!0);if(q=k.lc){for(var f=!1,v=0;v<q.length;v++)if(!lh(a,q[v],!0)){if(q[v].indexOf("if")){f=!0;break}for(var w=v+1;w<q.length&&q[w].indexOf("else");w++)v++;if(w==q.length){f=!0;break}}a.b.v.ca||(f=!0)}if(f){e||jh(a,d,g,"hit");break}}}a.Xa--;return f}
|
||||
function mh(a,b,c,d){var e=Z(b.B),f=a.na(b,2),g,k;for(k in a.Za)if(g=a.Za[k][f&k])break;g||(g=Wg);var m=g[0];0<=a.nb.indexOf(m)&&(g=Wg,m=g[0]);var p=k="",q=Ug[m],v=g.length-1;m||v||(k=J(a,f));for(m=1;m<=v;m++){var w=g[m];if(void 0!==w){var x;x=a;var E=w,w=b,y="",F=E&61440;if(4096==F)w=w.B+((f&255)<<24>>23)&65535,y=J(x,w);else if(8192==F)w=w.B-((f&63)<<1)&65535,y=J(x,w);else if(12288==F)y=J(x,f&7,1);else if(24576==F)y=J(x,f&63,1);else if(F=f&E,E&4032&&(F>>=6,E>>=6),E&63)switch(E=F&7,F&56){case 0:y=
|
||||
dh(E);break;case 8:y="@"+dh(E);break;case 16:7>E?y="("+dh(E)+")+":(F=x.na(w,2),y="#"+J(x,F,0,!0));break;case 24:7>E?y="@("+dh(E)+")+":(F=x.na(w,2),y="@#"+J(x,F,0,!0));break;case 32:y="-("+dh(E)+")";break;case 40:y="@-("+dh(E)+")";break;case 48:F=x.na(w,2);y=J(x,F,0,!0)+"("+dh(E)+")";7==E&&(y=[y,J(x,F+w.B&65535)]);break;case 56:F=x.na(w,2),y="@"+J(x,F)+"("+dh(E)+")",7==E&&(y=[y,J(x,F+w.B&65535)])}x=y;if(!x||!x.length){k="INVALID";break}"string"!=typeof x&&(p=x[1],x=x[0]);0<k.length&&(k+=",");k+=x||
|
||||
"???"}}f="";g=J(a,e.B)+":";if(-1!==e.B&&-1!==b.B){do if(f+=" "+J(a,a.na(e,2)),null==e.B)break;while(e.B!=b.B)}g+=ua(f,24);g+=ua(q,5);k&&(g+=" "+k);if(c||p)g=ua(g,60)+";"+(c||""),g=a.b.v.$a?g+("cycles="+Uc(a.b).toString()+" cs="+l(a.b.qb)):g+(null!=d?"="+d.toString():""),p&&(g+=" @"+p);return g}function nh(a,b){switch(b){case "N":a=a.b.Da();break;case "Z":a=Ad(a.b);break;case "V":a=zd(a.b);break;case "C":a=fd(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||
function oh(a,b){var c="",d=a.b;8>b?(c=dh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ea[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.va[b-16]):20==b&&(c="PS="+J(a,Lb(d)));c&&(c+=" ");return c}function ph(a){var b,c="";for(b=0;6>b;b++)c+=oh(a,b);c=c+"\n"+(oh(a,6)+oh(a,7)+oh(a,20));return c+=nh(a,"T")+nh(a,"N")+nh(a,"Z")+nh(a,"V")+nh(a,"C")}h.Vb=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function qh(a,b,c){var d=[],e=a.Y(b)>>>0;for(b=0;b<a.G.length;b++){var f=a.G[b],g=f.B>>>0,k=f.vc;if(e>=g&&e<g+k){e=ya(f.Ub,[e-g],a.Vb);0<=e?rh(a,b,e,d):c&&(e=~e,rh(a,b,e-1,d),rh(a,b,e,d));break}}return d}function rh(a,b,c,d){var e={},f=a.G[b].Ub,g=0,k=null;0<=c&&c<f.length&&(g=f[c][0],k=f[c][1]);k&&(e=a.G[b].ka[k],k="."==k.charAt(0)?null:e.l||k);d.push(k);d.push(g);d.push(e.a);d.push(e.c)}
|
||||
function sh(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Og(a)||a.j("no variables"),!0;if(!c[2])return Og(a,c[1]);if(!c[3])return delete a.aa[c[1]],!0;b=Kg(a,c[3]);return void 0!==b?(a.aa[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1}
|
||||
function th(a,b,c){var d=null;if(b=Zg(a,b,!0)){a.Y(b);var e=qh(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.B-e[1])&&(g=" + "+l(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.j(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.B)&&(g=" - "+l(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.j(f),d||(d=f))}else c&&a.j("no symbols")}return d}
|
||||
function fh(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}f=Kg(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":O(d,f);a.K=Z(d.u[7]);break;case "N":d.S=f?32768:0;break;case "Z":d.X=
|
||||
f?0:1;break;case "V":d.O=f?32768:0;break;case "C":d.N=f?65536:0;break;default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.C.$();a.j("updated registers:")}a.j(ph(a));c&&(a.K=Z(d.u[7]),gh(a,J(a,a.K.B)))}}function uh(a,b){b=va(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Ng(a,null,c[2].charCodeAt(0)):Kg(a,b,!0)}
|
||||
function vh(a,b,c){var d="t"!=b;c=Mg(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ma(c,function(){return nb(a,!0)&&a.jb(e,d,!1)},function(){a.C.$();nb(a,!1)})}
|
||||
function gh(a,b,c,d){if(b=Zg(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Mg(a,c.substr(1)),null!=c&&(d=c);else{d=Zg(a,c,!0);if(!d||d.B<b.B)return;e=d.B-b.B;if(256<e){a.j("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=ob(a,!1)||a.V?a.H:null;var g=null!=f?"cycles":null,k=qh(a,b),m=b.B;if(k[0]&&d&&(!c&&d||0>k[0].indexOf("+"))){var p=k[0]+":";k[2]&&(p+=" "+k[2]);a.j(p)}k[3]&&(g=k[3],f=null);f=mh(a,b,g,f);a.j(f);a.K=b;e-=b.B-m;c++}}}
|
||||
function lh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.U&&(a.j("ended assemble at "+J(a,a.T.B)),a.K=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ra=null;if(pb(a)&&0<b.length){a.U&&(b="a "+J(a,a.T.B)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");if(g&&g.length)for(var k=g[0],m=k.charAt(0),p=1;p<k.length;p++){var q=k.charAt(p);if("?"==m||"r"==m||"a">q||"z"<q){g[0]=k.substr(p);g.unshift(k.substr(0,p));break}}g[0]=g[0].toLowerCase();switch(g[0].charAt(0)){case "a":var v=
|
||||
Zg(a,g[1],!0);if(v)if(a.T=v,void 0===g[2])a.j("begin assemble at "+J(a,v.B)),a.U=!0,a.C.$();else{var w;a.j("not supported yet");w=[];if(w.length){for(var x=0;x<w.length;x++)a.Fb(v,w[x],1);a.j(mh(a,a.T))}}break;case "b":a:{var E=g[0],y=g[1],F=b;if("?"==y)a.j("breakpoint commands:"),a.j("\tbp [a]\tset exec breakpoint at addr [a]"),a.j("\tbr [a]\tset read breakpoint at addr [a]"),a.j("\tbw [a]\tset write breakpoint at addr [a]"),a.j("\tbc [a]\tclear breakpoint at addr [a]"),a.j("\tbl\tlist all breakpoints"),
|
||||
a.j("\tbn [n]\tbreak after [n] instruction(s)");else{var Ea=E.charAt(1);if("l"==Ea){var gd;gd=0+kh(a,a.f);gd+=kh(a,a.M);(gd+=kh(a,a.D))||a.j("no breakpoints")}else if("n"==Ea)a.pa=Mg(a,y),a.j("break after "+a.pa+" instruction(s)");else if(void 0===y)a.j("missing breakpoint address");else{var U=Z();if("*"!=y&&(U=Zg(a,y,!0),!U))break a;"c"==Ea?null==U.B?(Qg(a),a.j("all breakpoints cleared")):ih(a,a.f,U)||ih(a,a.M,U)||ih(a,a.D,U)||a.j("breakpoint missing: "+J(a,U.B)):null!=U.B&&(ch(a,U,F),"p"==Ea?a.Sa(a.f,
|
||||
U):"r"==Ea?a.Sa(a.M,U):"w"==Ea?a.Sa(a.D,U):a.j("unknown breakpoint command: "+Ea))}}}break;case "c":a.Ta&&(a.Ta.value="");break;case "d":a:{var Xa,Ya=g[0],ia=g[1],Fa=g[2],Oh=g[3];if("?"==ia){var Za="";for(Xa in tb)a.Fa[Xa]&&(Za&&(Za+=","),Za+=Xa);Za+=",state,symbols";a.j("dump memory commands:");a.j("\tdb [a] [#] dump # bytes at address a");a.j("\tdw [a] [#] dump # words at address a");a.j("\tdd [a] [#] dump # dwords at address a");a.j("\tdh [#] [#] dump # instructions from history");
|
||||
Za.length&&a.j("dump extension commands:\n\t"+Za)}else if("state"==ia){var Kf=wh(a.C,!0);"console"==Fa?console.log(Kf):(a.Ta&&(a.Ta.value=""),a.j(Kf))}else if("symbols"==ia)for(var hd=0;hd<a.G.length;hd++){var id=a.G[hd],$a;for($a in id.ka)if("."!=$a.charAt(0)){var Lf=id.ka[$a].o;if(void 0!==Lf){var Mf=id.ka[$a].l;Mf&&($a=Mf);a.j(J(a,Lf)+" "+$a)}}}else{if("d"==Ya){for(Xa in tb)if(g[1]==Xa){var Nf=a.Fa[Xa];Nf?(g.shift(),g.shift(),Nf(g)):a.j("no dump registered for "+ia);break a}ia||(Ya=a.Cb||"db")}else a.Cb=
|
||||
Ya;if("dh"==Ya){var Of=ia,Pf=Fa,Qf="",Rf=0,ca=a.fa,ja=a.J;if(ja.length){var Y=+Of||a.Ya,vb=+Pf||10;isNaN(Y)?Y=vb:Qf="more ";Y>ja.length&&(a.j("note: only "+ja.length+" available"),Y=ja.length);ca-=Y;0>ca&&(null==ja[ja.length-1].B?(Y=ca+Y,ca=0):ca+=ja.length);var jd=[];"call"==Pf&&(vb=1E5,jd=["CALL"]);for(void 0!==Of&&a.j(Y+" instructions earlier:");0<vb&&ca!=a.fa;){var Sf=ja[ca++];if(null==Sf.B)break;var wb=Z(Sf.B),Ph=Y--,Tf=mh(a,wb,"history",Ph);(!jd.length||0<=Tf.indexOf(jd[0]))&&a.j(Tf);wb.Jb&&
|
||||
(ca+=wb.Jb,vb-=wb.Jb,Y-=wb.Jb);ca>=ja.length&&(ca=0);a.Ya=Y;Rf++;vb--}}Rf||(a.j("no "+Qf+"history available"),a.Ya=void 0)}else{var xb=Zg(a,ia);if(xb){var ec=0;Fa&&("l"==Fa.charAt(0)&&(Fa=Fa.substr(1)||Oh),ec=Mg(a,Fa)>>>0,65536<ec&&(ec=65536));for(var yb="",ab="dd"==Ya?4:"dw"==Ya?2:1,fc=ab*ec||128,Qh=fc+15>>4||1;Qh--&&0<fc;){var gc=0,zb=0,Ab,kd="",Uf="",ia=J(a,xb.B);for(Ab=4==ab?16:a.ma;0<Ab&&0<fc;Ab--){var ld,hc=2==ab?a.na(xb,ld=2):a.ob(xb,ld=1),gc=gc|hc<<(zb<<3),zb=zb+ld;zb==ab&&(kd+=J(a,gc,ab),
|
||||
kd+=1==ab?9==Ab?"-":" ":" ",gc=zb=0);Uf+=32<=hc&&128>hc?String.fromCharCode(hc):".";fc--}yb&&(yb+="\n");yb+=ia+" "+kd+(0==Ab?" "+Uf:"")}yb&&a.j(yb);a.Qa=xb}}}}break;case "e":if("else"==g[0])break;var bb,md,nd,od,pd=g[0],qd=g[1];"eb"==pd?(bb=1,md=255,nd=a.ob,od=a.Fb):"e"==pd||"ew"==pd?(bb=2,md=65535,nd=a.na,od=a.Va):qd=null;if(null==qd)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var ic=Zg(a,qd);if(ic)for(var jc=2;jc<
|
||||
g.length;jc++){var Bb=Kg(a,g[jc]);if(void 0===Bb){a.j("unrecognized value: "+g[jc]);break}Bb&~md&&a.j("warning: "+l(Bb)+" exceeds "+bb+"-byte value");var Rh=nd.call(a,ic);a.j("changing "+J(a,ic.B)+" from "+J(a,Rh,bb)+" to "+J(a,Bb,bb));od.call(a,ic,Bb,bb)}}break;case "g":a:{var Vf=g[1],Sh=b;if(void 0!==Vf){var rd=Zg(a,Vf,!0);if(!rd)break a;ch(a,rd,Sh);a.Sa(a.f,rd,!0)}a.ib(!0,c)}break;case "h":a.v.ca?(c||a.j("halting"),a.da()):ob(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var sd;
|
||||
var Cb=b.substr(2),Cb=va(Cb);Kg(a,Cb)?(c||a.j("true: "+Cb),sd=!0):(c||a.j("false: "+Cb),sd=!1);sd||(d=!1);break}f=!0;break;case "k":var Th=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var td=0,ud=Z(),Db=Z(a.b.u[6]);for(a.j("stack trace for "+J(a,Db.B));10>td;){for(var Ga=null,Uh=256;65536>Db.B>>>0;){ud.B=a.na(Db,2);if(null==Db.B||!Uh--)break;if(!(ud.B&1)){for(var Vh=a,kc=ud,Wf=null,Eb=kc.B,Xf=Eb,vd=1;6>=vd&&Eb;vd++){if(2<
|
||||
vd){kc.B=Eb;var lc=mh(Vh,kc);if(0<=lc.indexOf("JSR")){var Yf=lc.indexOf(" ");if(Eb+(lc.indexOf(" ",Yf+1)-Yf-1)/2==Xf){Wf=lc;break}}}Eb-=2}kc.B=Xf;if(Ga=Wf)break}}if(!Ga||null==Ga)break;var Zf=null;if("ks"==Th){var $f=Ga.match(/[0-9A-F]+$/);$f&&(Zf=th(a,$f[0]))}Ga=ua(Ga,50)+" ;"+(Zf||"stack="+J(a,Db.B));a.j(Ga);td++}td||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){th(a,g[1],!0);break}f=!0;break;case "m":a:{var ka,la=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var xa=0;if("all"==
|
||||
G)xa=1878917119,G=null;else if("on"==G)la=!0,G=null;else if("off"==G)la=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(ka in tb)if(G==ka){xa=tb[ka];la=!!(a.la&xa);break}if(!xa){a.j("unknown message category: "+G);break a}}if(xa)if("on"==g[2])a.la|=xa,la=!0;else if("off"==g[2]&&(a.la&=~xa,la=!1,1073741824==xa)){for(var wd=0;wd<a.wa.length;wd++)a.j(a.wa[wd]);a.wa=[]}}var Wh=0,Fb="";for(ka in tb)if(!G||G==ka){var Xh=!!(a.la&tb[ka]);if(null===la||la==Xh)Fb&&(Fb+=","),++Wh%10||(Fb+="\n\t"),
|
||||
"key"==ka&&(ka="keys"),Fb+=ka}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==la?la?"messages on: ":"messages off: ":"message categories:\n\t")+(Fb||"none"));Rg(a)}break;case "p":if("print"==g[0]){uh(a,b.substr(5));break}var Yh="pr"==g[0]?1:0;if(a.V)a.j("step in progress");else{var ag=Z(a.b.u[7]);a.ob(ag);a.V?(a.Sa(a.f,ag,!0),a.ib()||(a.C&&a.C.ub(),a.V=0)):vh(a,Yh?"tr":"t")}break;case "r":if("reset"==b){a.C&&a.C.reset();break}fh(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Gb=
|
||||
+g[2];if(8==Gb||10==Gb||16==Gb)a.ma=Gb;else{a.j("invalid base: "+Gb);break}}a.j("default base: "+a.ma);break;case "cs":var Hb;void 0!==g[3]&&(Hb=+g[3]);switch(g[2]){case "int":a.b.bb=Hb;break;case "start":a.b.rb=Hb;break;case "stop":a.b.cb=Hb;break;default:a.j("unknown cs option");break a}void 0!==Hb&&Rc(a.b);a.j("checksums "+(a.b.v.$a?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Vc(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.Ua.toFixed(2)+
|
||||
"Mhz")+" ("+a.b.Ma+"x)");break;default:if(g[1]){a.j("unknown option: "+g[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"),a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":vh(a,g[0],g[1]);break;case "u":gh(a,g[1],g[2],8);break;case "v":if("var"==g[0]){sh(a,b.substr(3))||(d=!1);break}if("ver"==
|
||||
g[0]){a.j("PDPjs version 1.30.1 ("+a.b.ab+",RELEASE"+(sb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){uh(a,b.substr(1));break}var xd="commands:",yd;for(yd in Tg)xd+="\n"+ua(yd,9)+Tg[yd];Wd(a)||(xd+="\nnote: history disabled if no exec breakpoints");a.j(xd);break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(bg){a.j("debugger error: "+(bg.stack||bg.message)),d=!1}return d}
|
||||
function Sc(a,b,c){b=Ig(a,b,c);for(var d in b)if(!lh(a,b[+d]))return!1;return!0}Ta(function(){for(var a=B(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Pg(d);A(d,c)}});
|
||||
function xh(a,b,c){r.call(this,"Computer",a,xh,67108864);this.v.ha=!1;yh(this,b);this.M=Pc(this,"autoPower",a);this.C=0;this.aa=a.busWidth||a.buswidth;this.f=zh;this.J=null;this.G=this.U=!1;this.ba=Pc(this,"url")||"";(Math.random()+.1).toString(36);this.g=Ah(this);if(this.b=mb("CPU",this.id)){this.i=mb("Debugger",this.id);this.w=new Mb({id:this.Ra+".bus",busWidth:this.aa},this.b,this.i);var d,e=kb(this.id);if((this.A=mb("Panel",this.id))&&this.A.Ta)for(b=0;b<e.length;b++)d=e[b],d.ga=this.A.ga,d.j=
|
||||
this.A.j,d.Ta=this.A.Ta;this.j("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ca&&d.Ca(this,this.w,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=Pc(this,"state")||(f=!0,a.state))b=this.R=a,f||(this.G=!0,this.f=zh),this.f&&
|
||||
(this.K=new N(this,"1.30.1"),Bh(this.K)?b=null:delete this.K);!b&&this.f&&(b=Ch(this))&&(this.G=!0);if(b){var g=this;Ba(b,null,!0,function(a,b,c){c?(g.H=null,g.G=!1,g.ga("Unable to load machine state from server (error "+c+(b?": "+va(b):"")+")")):(g.J=b,g.U=!0);H(g)})}else H(this);this.I.power||(this.M=!0);!c&&this.M&&Dh(this,this.sb)}else n("Unable to find CPU component")}u(xh);var zh=0;
|
||||
function yh(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){n(d.message+" ("+c+")")}}a.V=b}function Pc(a,b,c){var d=b.toLowerCase(),d=db[b]||db[d];void 0===d&&a.V&&(d=a.V[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Dh(a,b,c){for(var d=kb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!pb(f)){pb(f,function(){Dh(a,b,c)});return}}b.call(a,c)}
|
||||
function Eh(a,b){var c=new N(a,"1.30.1","validate");if(Bh(c)&&Fh(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.ga("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=xh.prototype;
|
||||
h.sb=function(a){void 0===a&&(a=this.f||(this.J?1:zh));if(!this.C){this.C++;var b=!1,c=!1;this.T=!1;var d=this.K||new N(this,"1.30.1");if(-1==a)b=!0;else if(a>zh){if(Bh(d,this.J)){this.D=new N(this,"1.30.1","failsafe");Bh(this.D)&&(Gh(this,d),a=2,Hh(this.D));this.D.set("timestamp",Aa());Ih(this.D);var e=this.f&&!this.G;if(1==a||Da("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Fh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Bh(d,g):("error"==
|
||||
f&&"no machine state"!=g?(this.ga("Error: "+g),"unable to verify user"==g&&(Ka("user",""),this.g=null)):this.j(f+": "+g),Hh(d),Bh(d)?(c=Fh(d),e=!0):c=!1))}e&&Eh(this,c?d:null)}else 2==a&&d.clear()}else Eh(this);delete this.J;delete this.K}e=kb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Jh(this,g,d,b,c));b=[d,a,c];-1!=a?Dh(this,this.Xb,b):this.Xb(b)}};
|
||||
function Jh(a,b,c,d,e){if(!b.v.ha){b.v.ha=!0;if(b.Aa){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Aa(f,d)&&f&&(n("Unable to restore state for "+b.type),a.R&&!a.U?(c.clear(),a.f=zh,window&&window.location.reload()):a.T=!0,b.Aa(null),e=!1)}if(!d&&b.Yb)for(a=b.Yb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.Xb=function(a){var b=a[0],c=0>a[1];a=a[2];this.fa=!0;this.v.ha=!0;var d=this.I.power;d&&(d.textContent="Shutdown");this.b&&(Jh(this,this.b,b,c,a),this.b.mb());this.T&&(Gh(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.C=0};
|
||||
function Gh(a,b){if(Da("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Ba("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function wh(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),k=Aa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.za&&(c&&a.b.da(),d=a.b.za(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ha=!1,!1===d&&(e=null)));for(var k=kb(a.id),m=0;m<k.length;m++){var p=k[m];p.v.ha&&(p.za&&(d=p.za(b,c),"object"===typeof d&&f.set(p.id,
|
||||
d)),c&&(p.v.ha=!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.g&&Kh(a,a.g,f.toString()),Ih(g)&&Ih(f)||(e=null,d=k=!0)):a.f&&(d=!0,k=3==a.f),d&&f.clear(k)):e=f.toString());c&&(a.v.ha=!1,b=a.I.power)&&(b.textContent="Power");a.C=0;return e}h.reset=function(){this.w&&this.w.reset&&(C(this,"Resetting "+this.w.type),this.w.reset());for(var a=kb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.w&&c.reset&&(C(this,"Resetting "+c.type),c.reset())}};
|
||||
h.start=function(a,b){for(var c=kb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.$(!0)};h.stop=function(a,b){for(var c=kb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.$(!0)};
|
||||
h.qa=function(a,b,c){var d=this;switch(b){case "power":return this.J[b]=c,c.onclick=function(){d.B||(d.v.ia?rh(d,!1,!0):yh(d,d.sb))},!0;case "reset":return this.J[b]=c,c.onclick=function(){if(d.v.ia&&!d.B)if(d.f&&!d.H){var a=Ga("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");rh(d,a,!0);!a&&d.R?window&&window.location.reload():d.sb(uh)}else d.reset(),d.b&&d.b.lb()},!0;case "save":if(qa())c.parentNode.removeChild(c);else return this.J[b]=
|
||||
c,c.onclick=function(){var a=vh(d,!0);if(a){var b=!!(d.f&&!d.H||d.R),c=rh(d,b);b?Fh(d,a,c):d.pa("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function vh(a,b){var c=a.g;c||((c=Ja("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Gh(a,c))||a.pa("The user ID is invalid.")):b&&a.pa("Browser local storage is not available"));return c}
|
||||
function Gh(a,b){a.g=null;b=Ba(ra()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ka("user",b.data),a.g=b.data)}catch(d){n(d.message+" ("+c+")")}return a.g}function xh(a){var b=null;a.g&&(b=ra()+"/api/v1/user?req=load&user="+a.g+"&state="+Hh(a,"1.30.1"));return b}
|
||||
function Fh(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Hh(a,"1.30.1");d.data=c;b=Ba(ra()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.pa("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.pa(c),Ka("user",""),a.g=null)}}h.ub=function(){};
|
||||
h.$=function(a){this.b&&this.b.$(a);this.C&&this.C.$(a)};Ta(function(){for(var a=B(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=B(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=z(f),g=new sh(g,d,!0);A(g,f);g.M&&yh(g,g.sb)}});Oa.show.push(function(){for(var a=B(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=mb("Computer",c.id))&&c.fa&&!c.v.ia&&c.sb(-1)}});
|
||||
Oa.exit.push(function(){for(var a=B(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=mb("Computer",c.id))&&c.v.ia&&rh(c,!(!c.f||c.H),!0)}});function N(a,b,c){this.id=a.id;this.key=Hh(a,b,c);this.i=a.i;Ch(this,a.tc)}function Hh(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
N.prototype={constructor:N,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Ch(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
||||
1);c=0}}};function Ch(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Dh(a){var b=!0;if(Ia()){var c=JSON.stringify(a[a.id]);Ka(a.key,c)||(n("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Ah(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){n(c.message||c),b=!1}return b}function wh(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ia()&&(b=Ja(a.key))?(a[a.id]=b,a.b=!0):!1}var Ih=0;
|
||||
function Uh(a,b,c,d,e,f){e("Loading "+a+"...");Ba(a,null,!0,function(g,l,m){m?(l||(l="unable to load "+a+" ("+m+")"),f(l,null)):Vh(l,a,b,c,d,e,f)})}
|
||||
function Vh(a,b,c,d,e,f,g){function l(a,f){if(f)g(f,null);else{c&&(jb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){f=null,a=q.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Wh(a,f,l):l(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function Wh(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ba(e,null,!0,function(f,g,l){if(l||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=l[0],p,q=/( [a-z]+=)(['"])(.*?)\2/g;p=q.exec(f);)m=0>m.indexOf(p[1])?m.replace(">",p[0]+">"):m.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);l[0]!=m&&(g=g.replace(l[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],g);Wh(a,b,c)}})}else c(a,null)}
|
||||
function Xh(a,b,c,d){function e(a){if(void 0===l){var b=g&&B(g,"machine-warning");l=b&&b[0]||g}l&&(l.innerHTML=ta(a))}function f(a){e("Error: "+a);m&&(--Ih||Va(!0));m=!1}var g,l,m=!0;Ih++;ib[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=p:v.appendChild(document.createTextNode(p));q.appendChild(v)}c||
|
||||
(c="/versions/pdpjs/1.30.1/components.xsl");p=function(d,l){l?Uh(c,null,null,!1,e,function(d,m){m?(jb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=l.transformNode(m))?(g.outerHTML=m,--Ih||Va(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(l,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--Ih||Va(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Uh(b,a,d,!0,e,p):Vh(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(w){f(w.message)}return m}window.embedPDP11=function(a,b,c,d){Va(!1);return Xh(a,b,c,d)};window.enableEvents=Va;window.sendEvent=Wa;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11-dbg.map
|
||||
h.qa=function(a,b,c){var d=this;switch(b){case "power":return this.I[b]=c,c.onclick=function(){d.C||(d.v.ha?wh(d,!1,!0):Dh(d,d.sb))},!0;case "reset":return this.I[b]=c,c.onclick=function(){if(d.v.ha&&!d.C)if(d.f&&!d.H){var a=Da("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");wh(d,a,!0);!a&&d.R?window&&window.location.reload():d.sb(zh)}else d.reset(),d.b&&d.b.mb()},!0;case "save":if(qa())c.parentNode.removeChild(c);else return this.I[b]=
|
||||
c,c.onclick=function(){var a=Ah(d,!0);if(a){var b=!!(d.f&&!d.H||d.R),c=wh(d,b);b?Kh(d,a,c):d.ga("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Ah(a,b){var c=a.g;c||((c=Ja("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Lh(a,c))||a.ga("The user ID is invalid.")):b&&a.ga("Browser local storage is not available"));return c}
|
||||
function Lh(a,b){a.g=null;b=Ba(ra()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ka("user",b.data),a.g=b.data)}catch(d){n(d.message+" ("+c+")")}return a.g}function Ch(a){var b=null;a.g&&(b=ra()+"/api/v1/user?req=load&user="+a.g+"&state="+Mh(a,"1.30.1"));return b}
|
||||
function Kh(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Mh(a,"1.30.1");d.data=c;b=Ba(ra()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.ga("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.ga(c),Ka("user",""),a.g=null)}}h.ub=function(){};
|
||||
h.$=function(a){this.b&&this.b.$(a);this.A&&this.A.$(a)};Ta(function(){for(var a=B(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=B(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=z(f),g=new xh(g,d,!0);A(g,f);g.M&&Dh(g,g.sb)}});Oa.show.push(function(){for(var a=B(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=mb("Computer",c.id))&&c.fa&&!c.v.ha&&c.sb(-1)}});
|
||||
Oa.exit.push(function(){for(var a=B(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=mb("Computer",c.id))&&c.v.ha&&wh(c,!(!c.f||c.H),!0)}});function N(a,b,c){this.id=a.id;this.key=Mh(a,b,c);this.i=a.i;Hh(this,a.tc)}function Mh(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
N.prototype={constructor:N,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Hh(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
||||
1);c=0}}};function Hh(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Ih(a){var b=!0;if(Ia()){var c=JSON.stringify(a[a.id]);Ka(a.key,c)||(n("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Fh(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){n(c.message||c),b=!1}return b}function Bh(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ia()&&(b=Ja(a.key))?(a[a.id]=b,a.b=!0):!1}var Nh=0;
|
||||
function Zh(a,b,c,d,e,f){e("Loading "+a+"...");Ba(a,null,!0,function(g,k,m){m?(k||(k="unable to load "+a+" ("+m+")"),f(k,null)):$h(k,a,b,c,d,e,f)})}
|
||||
function $h(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(jb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){f=null,a=q.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?ai(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function ai(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ba(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=k[0],p,q=/( [a-z]+=)(['"])(.*?)\2/g;p=q.exec(f);)m=0>m.indexOf(p[1])?m.replace(">",p[0]+">"):m.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);k[0]!=m&&(g=g.replace(k[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],g);ai(a,b,c)}})}else c(a,null)}
|
||||
function bi(a,b,c,d){function e(a){if(void 0===k){var b=g&&B(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=ta(a))}function f(a){e("Error: "+a);m&&(--Nh||Va(!0));m=!1}var g,k,m=!0;Nh++;ib[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=p:v.appendChild(document.createTextNode(p));q.appendChild(v)}c||
|
||||
(c="/versions/pdpjs/1.30.1/components.xsl");p=function(d,k){k?Zh(c,null,null,!1,e,function(d,m){m?(jb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=k.transformNode(m))?(g.outerHTML=m,--Nh||Va(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--Nh||Va(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Zh(b,a,d,!0,e,p):$h(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(w){f(w.message)}return m}window.embedPDP11=function(a,b,c,d){Va(!1);return bi(a,b,c,d)};window.enableEvents=Va;window.sendEvent=Wa;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11-dbg.map
|
||||
|
|
|
|||
|
|
@ -30,157 +30,164 @@
|
|||
*/
|
||||
for(var g,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da<ca.length-1;da++){var ea=ca[da];ea in ba||(ba[ea]={});ba=ba[ea]}var fa=ca[ca.length-1],ga=ba[fa],ha=ga?ga:function(a){return Math.log(a)/Math.LN2};
|
||||
ha!=ga&&null!=ha&&aa(ba,fa,{configurable:!0,writable:!0,value:ha});function ia(a,b){var c="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode((a&7)+48)+c,a>>=3;return""+c}function ja(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
|
||||
function ka(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}function la(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ma(){var a=na();return-1!==a.indexOf("pcjs.org",a.length-8)}var oa={"&":"&","<":"<",">":">",'"':""","'":"'"};function pa(a){return a.replace(/[&<>"']/g,function(a){return oa[a]})}function qa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
||||
var ra={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},sa=Date.now||function(){return+new Date};
|
||||
function ka(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function la(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ma(){var a=na();return-1!==a.indexOf("pcjs.org",a.length-8)}var oa={"&":"&","<":"<",">":">",'"':""","'":"'"};function pa(a){return a.replace(/[&<>"']/g,function(a){return oa[a]})}
|
||||
function qa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var ra={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},sa=Date.now||function(){return+new Date};
|
||||
function ta(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
||||
function h(a,b,c,d){var e=0,f=null,k=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),k;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"==
|
||||
typeof b){var n="",r;for(r in b)b.hasOwnProperty(r)&&(n&&(n+="&"),n+=r+"="+encodeURIComponent(b[r]));n=n.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(n)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),k=[f,e]);return k}
|
||||
function ua(a,b){var c,d={K:null,Y:null,bb:null,ab:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,k=eval("("+b+")");d.bb=k.load;d.ab=k.exec;if(e=k.bytes)d.K=e;else if(e=k.words)for(d.K=Array(2*e.length),f=c=0;c<e.length;c++)d.K[f++]=e[c]&255,d.K[f++]=e[c]>>8&255;else if(e=k.data)for(d.K=Array(4*e.length),f=c=0;c<e.length;c++)d.K[f++]=e[c]&255,d.K[f++]=e[c]>>8&255,d.K[f++]=e[c]>>16&255,d.K[f++]=e[c]>>24&255;else d.K=k;d.Y=k.symbols;d.K.length?1==d.K.length&&(m(d.K[0]),d=null):(m("Empty resource: "+
|
||||
a),d=null)}catch(l){m("Resource data error: "+l.message),d=null}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),d.K=Array(a.length),c=0;c<a.length;c++)d.K[c]=parseInt(a[c],16);return d}function na(){return"http://"+(window?window.location.host:"www.pcjs.org")}function m(a){window&&window.alert(a)}function va(a){var b=!1;window&&(b=window.confirm(a));return b}var wa=null;
|
||||
function xa(){if(null==wa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}wa=a}return wa}function ya(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function za(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}
|
||||
function Aa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var p={init:[],show:[],exit:[]},Ba=!1,Ca=!1,Da=!0;function Ea(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function q(a){p.init.push(a)}
|
||||
function Fa(a){if(Da)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){m(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ga(a){!Da&&a?(Da=!0,Ba&&Ha("init"),Ca&&Ha("show")):Da=a}function Ha(a){p[a]&&Fa(p[a])}Ea("onload",function(){Ba=!0;Fa(p.init)});Ea("onpageshow",function(){Ca=!0;Fa(p.show)});Ea(Aa("Opera")||Aa("iOS")?"onunload":"onbeforeunload",function(){Fa(p.exit)});
|
||||
function u(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.ob=b.comment;this.Gb=b;b=this.id.indexOf(".");0>b?this.Ga=this.id:(this.Ha=this.id.substr(0,b),this.Ga=this.id.substr(b+1));this[a]=c;this.i={ready:!1,fd:!1,gd:!1,M:!1,error:!1};this.Ra=null;this.i.error=!1;this.v={};this.G=null;v.push(this)}var Ia=void 0,Ja={};
|
||||
function ua(a,b){var c,d={M:null,Y:null,cb:null,bb:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,k;if("<"==b.substr(0,1))throw Error(b);k=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.cb=k.load;d.bb=k.exec;if(e=k.bytes)d.M=e;else if(e=k.words)for(d.M=Array(2*e.length),f=c=0;c<e.length;c++)d.M[f++]=e[c]&255,d.M[f++]=e[c]>>8&255;else if(e=k.data)for(d.M=Array(4*e.length),f=c=0;c<e.length;c++)d.M[f++]=e[c]&255,
|
||||
d.M[f++]=e[c]>>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=k;d.Y=k.symbols;d.M.length?1==d.M.length&&(m(d.M[0]),d=null):(m("Empty resource: "+a),d=null)}catch(l){m("Resource data error ("+a+"): "+l.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){m("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.M=e)}return d}
|
||||
function na(){return"http://"+(window?window.location.host:"www.pcjs.org")}function m(a){window&&window.alert(a)}function va(a){var b=!1;window&&(b=window.confirm(a));return b}var wa=null;function xa(){if(null==wa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}wa=a}return wa}
|
||||
function ya(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function za(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Aa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var p={init:[],show:[],exit:[]},Ba=!1,Ca=!1,Da=!0;
|
||||
function Ea(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function q(a){p.init.push(a)}function Fa(a){if(Da)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){m(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ga(a){!Da&&a?(Da=!0,Ba&&Ha("init"),Ca&&Ha("show")):Da=a}function Ha(a){p[a]&&Fa(p[a])}Ea("onload",function(){Ba=!0;Fa(p.init)});Ea("onpageshow",function(){Ca=!0;Fa(p.show)});
|
||||
Ea(Aa("Opera")||Aa("iOS")?"onunload":"onbeforeunload",function(){Fa(p.exit)});function u(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.pb=b.comment;this.Hb=b;b=this.id.indexOf(".");0>b?this.Ha=this.id:(this.ra=this.id.substr(0,b),this.Ha=this.id.substr(b+1));this[a]=c;this.h={ready:!1,Wa:!1,gd:!1,L:!1,error:!1};this.Ra=null;this.h.error=!1;this.s={};this.G=null;v.push(this)}var Ia=void 0,Ja={};
|
||||
if(window){Ia||(Ia=window.location.search.substr(1));for(var Ka,La=/\+/g,Ma=/([^&=]+)=?([^&]*)/g;Ka=Ma.exec(Ia);)Ja[decodeURIComponent(Ka[1].replace(La," "))]=decodeURIComponent(Ka[2].replace(La," "))}function Na(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
|
||||
function w(a,b){b||(b=u);a.prototype=Na(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Oa=window.PCjs.Machines||(window.PCjs.Machines={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else Oa={},v=[];function Pa(a,b,c){Oa[a]&&b&&(Oa[a][b]=c)}function x(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<v.length;b++){var d=v[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
||||
function Qa(a){if(void 0!==a){var b;for(b=0;b<v.length;b++)if(v[b].id===a)return v[b]}return null}function Ra(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<v.length;d++)if(c)c==v[d]&&(c=null);else if(!(a!=v[d].type||b&&v[d].id.indexOf(b)))return v[d]}return null}function y(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){m(c.message+" ("+a+")")}return b}
|
||||
function z(a,b){b=A(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var k=f.getAttribute("class");if(k)for(var l=k.split(" "),n=0;n<l.length;n++)switch(k=l[n],k){case "pdp11-binding":(k=y(f))&&k.binding&&a.V(k.type,k.binding,f,k.value),n=l.length}}}}
|
||||
function A(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
||||
u.prototype={constructor:u,parent:null,toString:function(){return this.name?this.name:this.id||this.type},V:function(a,b,c){switch(b){case "clear":return this.v[b]||(this.v[b]=c,c.onclick=function(a){return function(){a.v.print&&(a.v.print.value="")}}(this)),!0;case "print":return this.v[b]||(this.Wa=this.v[b]=c,c.value="",this.P=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||
this.L=function(a){this.P(a,this.Ga)}),!0;default:return!1}},log:function(){},P:function(){},status:function(a){this.P(this.Ga+": "+a)},L:function(a,b,c){c=c||this.type;b||m((c?c+": ":"")+a)},$:function(){return this.i.M=!0},Z:function(a,b){b&&(this.i.M=!1);return!0}};function B(a){if(!a.i.error&&(a.i.ready=!0,a.i.ready)){var b=a.Ra;a.Ra=null;b&&b()}}function Sa(a,b){b&&(a.i.ready?b():a.Ra=b);return a.i.ready}
|
||||
u.prototype={constructor:u,parent:null,toString:function(){return this.name?this.name:this.id||this.type},V:function(a,b,c){switch(b){case "clear":return this.s[b]||(this.s[b]=c,c.onclick=function(a){return function(){a.s.print&&(a.s.print.value="")}}(this)),!0;case "print":return this.s[b]||(this.Xa=this.s[b]=c,c.value="",this.P=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||
this.H=function(a){this.P(a,this.Ha)}),!0;default:return!1}},log:function(){},P:function(){},status:function(a){this.P(this.Ha+": "+a)},H:function(a,b,c){c=c||this.type;b||m((c?c+": ":"")+a)},$:function(){return this.h.L=!0},Z:function(a,b){b&&(this.h.L=!1);return!0}};function B(a){if(!a.h.error&&(a.h.ready=!0,a.h.ready)){var b=a.Ra;a.Ra=null;b&&b()}}function Sa(a,b){b&&(a.h.ready?b():a.Ra=b);return a.h.ready}
|
||||
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});
|
||||
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Ta="undefined"!==typeof ArrayBuffer;function Ua(a){u.call(this,"Panel",a,Ua);this.b=0;this.i.jb=!0}w(Ua);g=Ua.prototype;
|
||||
g.V=function(a,b,c,d){if(this.w&&this.w.V(a,b,c,d)||this.a&&this.a.V(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.v[b]=c,this.b++,!0;default:return"rled"==a?(this.v[b]=c,this.b++,!0):this.parent.V.call(this,a,b,c,d)}};g.ea=function(a,b,c,d){this.w=a;this.m=b;this.a=c;this.G=d};g.$=function(a,b){b||Va();return!0};g.Z=function(){return!0};
|
||||
function Wa(a,b,c,d){if(a.v[b]){void 0===c&&(a.i.error=!0,a.L("Value for "+b+" is invalid"),Xa(a.a));var e=a.G&&a.G.b||8;c=!a.a.i.U||a.i.jb?8==e?ia(c,d):ja(c,d):"--------".substr(0,d||4);a.v[b].textContent!=c&&(a.v[b].textContent=c)}}function Ya(a,b,c,d){for(var e=0;e<d;e++){var f=a.v[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}}
|
||||
g.fa=function(a){if(this.b&&(a||!this.a.i.U||this.i.jb)){for(a=0;a<this.a.f.length;a++)Wa(this,"R"+a,this.a.f[a]);a=Za(this.a);Wa(this,"PS",a);Wa(this,"NF",a&8?1:0,1);Wa(this,"ZF",a&4?1:0,1);Wa(this,"VF",a&2?1:0,1);Wa(this,"CF",a&1?1:0,1);Ya(this,"D",this.a.f[0],16);Ya(this,"A",this.a.f[7],22)}};function Va(){for(var a=!1,b=A(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=y(d),f=Qa(e.id);f||(a=!0,f=new Ua(e));z(f,d);a&&B(f)}}q(Va);
|
||||
function $a(a,b,c){u.call(this,"Bus",a,$a);this.a=b;this.G=c;this.H=a.busWidth||16;this.j=0;this.D=[];this.s=null;this.A=Math.pow(2,this.H);this.h=this.A-1|0;this.c=D;this.m=Math.log2(this.c);this.B=this.c>>2;this.g=this.c-1;this.w=this.A/this.c|0;this.ka=[];this.S=0;this.o=[];this.Ab=[ab,bb,cb,db];a=new E(this);eb(a,this.G);this.b=Array(this.w);for(b=0;b<this.w;b++)this.b[b]=a;B(this)}w($a);var D=8192,fb=D-1;
|
||||
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Ta="undefined"!==typeof ArrayBuffer;function Ua(a){u.call(this,"Panel",a,Ua);this.b=0;this.h.kb=!0}w(Ua);g=Ua.prototype;
|
||||
g.V=function(a,b,c,d){if(this.v&&this.v.V(a,b,c,d)||this.a&&this.a.V(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.s[b]=c,this.b++,!0;default:return"rled"==a?(this.s[b]=c,this.b++,!0):this.parent.V.call(this,a,b,c,d)}};g.ea=function(a,b,c,d){this.v=a;this.m=b;this.a=c;this.G=d};g.$=function(a,b){b||Va();return!0};g.Z=function(){return!0};
|
||||
function Wa(a,b,c,d){if(a.s[b]){void 0===c&&(a.h.error=!0,a.H("Value for "+b+" is invalid"),Xa(a.a));var e=a.G&&a.G.b||8;c=!a.a.h.U||a.h.kb?8==e?ia(c,d):ja(c,d):"--------".substr(0,d||4);a.s[b].textContent!=c&&(a.s[b].textContent=c)}}function Ya(a,b,c,d){for(var e=0;e<d;e++){var f=a.s[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}}
|
||||
g.fa=function(a){if(this.b&&(a||!this.a.h.U||this.h.kb)){for(a=0;a<this.a.f.length;a++)Wa(this,"R"+a,this.a.f[a]);a=Za(this.a);Wa(this,"PS",a);Wa(this,"NF",a&8?1:0,1);Wa(this,"ZF",a&4?1:0,1);Wa(this,"VF",a&2?1:0,1);Wa(this,"CF",a&1?1:0,1);Ya(this,"D",this.a.f[0],16);Ya(this,"A",this.a.f[7],22)}};function Va(){for(var a=!1,b=A(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=y(d),f=Qa(e.id);f||(a=!0,f=new Ua(e));z(f,d);a&&B(f)}}q(Va);
|
||||
function $a(a,b,c){u.call(this,"Bus",a,$a);this.a=b;this.G=c;this.I=a.busWidth||16;this.j=0;this.D=[];this.u=null;this.A=Math.pow(2,this.I);this.i=this.A-1|0;this.c=C;this.m=Math.log2(this.c);this.B=this.c>>2;this.g=this.c-1;this.v=this.A/this.c|0;this.ka=[];this.S=0;this.o=[];this.Bb=[ab,bb,cb,db];a=new E(this);eb(a,this.G);this.b=Array(this.v);for(b=0;b<this.v;b++)this.b[b]=a;B(this)}w($a);var C=8192,fb=C-1;
|
||||
function ab(a,b){var c=-1,d=this.controller,e=d.ka[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>8:e[2](b)&255):b&1&&(e=d.ka[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=gb(d,b)}function bb(a,b,c){var d=!1,e=this.controller,f=e.ka[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ka[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||gb(e,c)}
|
||||
function cb(a,b){var c=-1,d=this.controller;(a=d.ka[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=gb(d,b)}function db(a,b,c){var d=!1,e=this.controller;if(a=e.ka[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||gb(e,c)}function hb(a,b){if(b!=a.j){var c;a.j&&(c=(1<<a.j)-D,ib(a,c,D,a.D),a.j=0);b&&(a.j=b,c=(1<<b)-D,a.D=jb(a,c,D),a.s?ib(a,c,D,a.s):(kb(a,c,D,lb,a),a.s=jb(a,c,D)))}}
|
||||
function cb(a,b){var c=-1,d=this.controller;(a=d.ka[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=gb(d,b)}function db(a,b,c){var d=!1,e=this.controller;if(a=e.ka[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||gb(e,c)}function hb(a,b){if(b!=a.j){var c;a.j&&(c=(1<<a.j)-C,ib(a,c,C,a.D),a.j=0);b&&(a.j=b,c=(1<<b)-C,a.D=jb(a,c,C),a.u?ib(a,c,C,a.u):(kb(a,c,C,lb,a),a.u=jb(a,c,C)))}}
|
||||
$a.prototype.reset=function(){for(var a=0;a<this.o.length;a++)this.o[a]();hb(this,16)};function gb(a,b){a.S||F(a.a,4,b);return 0}$a.prototype.$=function(a,b){b||this.reset();return!0};
|
||||
function kb(a,b,c,d,e){for(var f=b,k=c,l=f>>>a.m;0<k&&l<a.b.length;){var n=a.b[l],r=l*a.c,t=a.c-(f-r);t>k&&(t=k);if(!e&&n&&n.size){if(n.type==d){if(f+k<=n.Ba)return n.Ua+=n.Ba-f,n.Ba=f,!0;if(f>=n.Ba+n.Ua){t=n.size-(f-r);t>k&&(t=k);n.Ua=f-n.Ba+t;f=r+a.c;k-=t;l++;continue}}return mb(1,f,k)}f=new E(a,f,t,a.c,d,e);eb(f,a.G,n);a.b[l++]=f;f=r+a.c;k-=t}if(0>=k){c/=1024;var C;e="";C?10<C&&(C=10):C=c&-65536?10:5;if(null==c||isNaN(c))for(;0<C--;)e="?"+e;else for(;0<C--;)e=String.fromCharCode(c%10+48)+e,c/=
|
||||
10;a.status(e+"Kb "+nb[d]+" at "+ia(b));return!0}return mb(2,b,c)}function jb(a,b,c){var d=[];for(b>>>=a.m;0<c&&b<a.b.length;)d.push(a.b[b++]),c-=a.c;return d}function ib(a,b,c,d){var e=0;for(b>>>=a.m;0<c&&b<a.b.length;){var f=d[e++];if(!f)break;a.b[b++]=f;c-=a.c}}function ob(a,b){return a.b[(b&a.h)>>>a.m].cb(b&a.g,b)}function pb(a,b){return a.b[(b&a.h)>>>a.m].T(b&a.g,b)}$a.prototype.Ta=function(a,b){this.S++;this.b[(a&this.h)>>>this.m].xb(a&this.g,b&255,a);this.S--};
|
||||
function qb(a,b,c){a.b[(b&a.h)>>>a.m].Va(b&a.g,c&65535,b)}function rb(a){for(var b=0,c=[],d=0;d<a.w;d++){var e=a.b[d];if(e.la||e.Cb){c[b++]=d;var f=b++;if(e=e.save()){for(var k=0,l=0,n=[];k<e.length;){for(var r=e[k],t=k+1;t<e.length&&e[t]===r;)t++;n[l++]=t-k;n[l++]=r;k=t}n.length<e.length&&(e=n)}c[f]=e}}return c}function sb(a,b,c,d,e,f,k,l){for(;b<=c;b+=2){var n=b&fb;void 0!==a.ka[n]?m("I/O address already registered: "+ja(b,8,!0)):a.ka[n]=[d,e,f,k,l||"unknown",!1]}}
|
||||
function tb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.a.Fa)){var k=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,r=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&r&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(r)));sb(a,e,e,k,l,n,r,f[4])}}}function ub(a,b){a.o.push(b)}function vb(a,b){a.S||F(a.a,4,b)}
|
||||
function mb(a,b,c){m("Memory block error ("+a+": "+ja(b)+","+ja(c)+")");return!1}function G(a){u.call(this,"Device",a,G);this.c={data:0,ed:0,Sa:20,tc:0};this.b={hd:0,hb:-1}}w(G);g=G.prototype;g.ea=function(a,b,c,d){this.m=b;this.a=c;this.G=d;var e=this;this.b.hb=wb(c,function(){e.b.na|=128;e.b.na&64&&(xb(e.a,e.b.uc),yb(e.a,e.b.hb,1E3/60))});this.b.uc=zb(64,6);tb(b,this,H);ub(b,this.reset.bind(this));B(this)};g.reset=function(){this.c.Sa=this.c.Sa&-120|20;this.b.na=0};
|
||||
g.Pb=function(){var a=this.b.na;this.b.na&=-129;return a};g.Dc=function(a){this.b.na=a;a&64&&yb(this.a,this.b.hb,1E3/60);this.b.na=a&-129};g.Ib=function(a){return(a?this.c.tc:this.c.data)&65535};g.wc=function(a){this.c.data=a};g.Rb=function(){var a=this.a;return a.A&62337|a.Ia<<5|a.Ja<<1};g.Fc=function(a){var b=this.a;a&=62337;if(b.A!=a){b.A=a;b.Ia=a>>5&3;b.Ja=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Da!=c&&(b.Da=c,Ab(b))}Bb(this)};
|
||||
g.Sb=function(){var a=this.a.oa;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Tb=function(){return this.a.fb};g.Ub=function(){return this.a.pa};g.Gc=function(a){var b=this.a;1170>b.Fa&&(a&=-49);b.pa!=a&&(b.pa=a,a&16?(b.Za=4194303,b.Ka=3915776):(b.Za=262143,b.Ka=253952),Ab(b));Bb(this)};function Bb(a){a.c.Sa=a.c.Sa&-8|(a.a.Da?a.a.pa&16?1:2:4)}g.hc=function(a){return this.a.C[1][a>>1&7]};g.Uc=function(a,b){this.a.C[1][b>>1&7]=a&65295};g.fc=function(a){return this.a.C[1][(a>>1&7)+8]};
|
||||
g.Sc=function(a,b){this.a.C[1][(b>>1&7)+8]=a&65295};g.gc=function(a){return this.a.R[1][a>>1&7]};g.Tc=function(a,b){b=b>>1&7;this.a.R[1][b]=a;this.a.C[1][b]&=65295};g.ec=function(a){return this.a.R[1][(a>>1&7)+8]};g.Rc=function(a,b){b=(b>>1&7)+8;this.a.R[1][b]=a;this.a.C[1][b]&=65295};g.Ob=function(a){return this.a.C[0][a>>1&7]};g.Cc=function(a,b){this.a.C[0][b>>1&7]=a&65295};g.Mb=function(a){return this.a.C[0][(a>>1&7)+8]};g.Ac=function(a,b){this.a.C[0][(b>>1&7)+8]=a&65295};
|
||||
g.Nb=function(a){return this.a.R[0][a>>1&7]};g.Bc=function(a,b){b=b>>1&7;this.a.R[0][b]=a;this.a.C[0][b]&=65295};g.Lb=function(a){return this.a.R[0][(a>>1&7)+8]};g.zc=function(a,b){b=(b>>1&7)+8;this.a.R[0][b]=a;this.a.C[0][b]&=65295};g.nc=function(a){return this.a.C[3][a>>1&7]};g.$c=function(a,b){this.a.C[3][b>>1&7]=a&65295};g.lc=function(a){return this.a.C[3][(a>>1&7)+8]};g.Yc=function(a,b){this.a.C[3][(b>>1&7)+8]=a&65295};g.mc=function(a){return this.a.R[3][a>>1&7]};
|
||||
g.Zc=function(a,b){b=b>>1&7;this.a.R[3][b]=a;this.a.C[3][b]&=65295};g.kc=function(a){return this.a.R[3][(a>>1&7)+8]};g.Xc=function(a,b){b=(b>>1&7)+8;this.a.R[3][b]=a;this.a.C[3][b]&=65295};g.wa=function(a){a&=7;return this.a.u&2048?this.a.ua[a]:this.a.f[a]};g.ya=function(a,b){b&=7;this.a.u&2048?this.a.ua[b]=a:this.a.f[b]=a};g.Zb=function(){return this.a.u&49152?this.a.aa[0]:this.a.f[6]};g.Lc=function(a){this.a.u&49152?this.a.aa[0]=a:this.a.f[6]=a};g.bc=function(){return this.a.f[7]};
|
||||
g.Oc=function(a){this.a.f[7]=a};g.xa=function(a){a&=7;return this.a.u&2048?this.a.f[a]:this.a.ua[a]};g.za=function(a,b){b&=7;this.a.u&2048?this.a.f[b]=a:this.a.ua[b]=a};g.$b=function(){return 1==(this.a.u&49152)>>14?this.a.f[6]:this.a.aa[1]};g.Mc=function(a){1==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.aa[1]=a};g.ac=function(){return 3==(this.a.u&49152)>>14?this.a.f[6]:this.a.aa[3]};g.Nc=function(a){3==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.aa[3]=a};g.Kb=function(a){return this.a.ub[a-65504>>1]};
|
||||
g.yc=function(a,b){this.a.ub[b-65504>>1]=a};g.sb=function(a){return 65520==a?61183:0};g.zb=function(){};g.jc=function(){return 1};g.Wc=function(){};g.Jb=function(){return this.a.F};g.xc=function(){this.a.F=0};g.Qb=function(){return this.a.tb};g.Ec=function(a,b){b&1||(a&=255);this.a.tb=a};g.Vb=function(a){return a?this.a.gb:0};g.Hc=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.gb=a;b.l|=2};g.ic=function(a){return a?this.a.qa&65280:0};g.Vc=function(a){this.a.qa=a|255};
|
||||
g.Yb=function(){return Za(this.a)};g.Kc=function(a){Cb(this.a,a&-1809|Za(this.a)&1808);this.a.l|=128};g.yb=function(){};
|
||||
var I={},H=(I[62592]=[null,null,G.prototype.hc,G.prototype.Uc,"SISDR",1145],I[62608]=[null,null,G.prototype.fc,G.prototype.Sc,"SDSDR",1145],I[62624]=[null,null,G.prototype.gc,G.prototype.Tc,"SISAR",1145],I[62640]=[null,null,G.prototype.ec,G.prototype.Rc,"SDSAR",1145],I[62656]=[null,null,G.prototype.Ob,G.prototype.Cc,"KISDR",1145],I[62672]=[null,null,G.prototype.Mb,G.prototype.Ac,"KDSDR",1145],I[62688]=[null,null,G.prototype.Nb,G.prototype.Bc,"KISAR",1145],I[62704]=[null,null,G.prototype.Lb,G.prototype.zc,
|
||||
"KDSAR",1145],I[62798]=[null,null,G.prototype.Ub,G.prototype.Gc,"MMR3",1145],I[65382]=[null,null,G.prototype.Pb,G.prototype.Dc,"LKS"],I[65400]=[null,null,G.prototype.Ib,G.prototype.wc,"CNSL"],I[65402]=[null,null,G.prototype.Rb,G.prototype.Fc,"MMR0",1145],I[65404]=[null,null,G.prototype.Sb,G.prototype.yb,"MMR1",1145],I[65406]=[null,null,G.prototype.Tb,G.prototype.yb,"MMR2",1145],I[65408]=[null,null,G.prototype.nc,G.prototype.$c,"UISDR",1145],I[65424]=[null,null,G.prototype.lc,G.prototype.Yc,"UDSDR",
|
||||
1145],I[65440]=[null,null,G.prototype.mc,G.prototype.Zc,"UISAR",1145],I[65456]=[null,null,G.prototype.kc,G.prototype.Xc,"UDSAR",1145],I[65472]=[null,null,G.prototype.wa,G.prototype.ya,"R0SET0"],I[65473]=[null,null,G.prototype.wa,G.prototype.ya,"R1SET0"],I[65474]=[null,null,G.prototype.wa,G.prototype.ya,"R2SET0"],I[65475]=[null,null,G.prototype.wa,G.prototype.ya,"R3SET0"],I[65476]=[null,null,G.prototype.wa,G.prototype.ya,"R4SET0"],I[65477]=[null,null,G.prototype.wa,G.prototype.ya,"R5SET0"],I[65478]=
|
||||
[null,null,G.prototype.Zb,G.prototype.Lc,"R6KERNEL"],I[65479]=[null,null,G.prototype.bc,G.prototype.Oc,"R7KERNEL"],I[65480]=[null,null,G.prototype.xa,G.prototype.za,"R0SET1",1145],I[65481]=[null,null,G.prototype.xa,G.prototype.za,"R1SET1",1145],I[65482]=[null,null,G.prototype.xa,G.prototype.za,"R2SET1",1145],I[65483]=[null,null,G.prototype.xa,G.prototype.za,"R3SET1",1145],I[65484]=[null,null,G.prototype.xa,G.prototype.za,"R4SET1",1145],I[65485]=[null,null,G.prototype.xa,G.prototype.za,"R5SET1",1145],
|
||||
I[65486]=[null,null,G.prototype.$b,G.prototype.Mc,"R6SUPER",1145],I[65487]=[null,null,G.prototype.ac,G.prototype.Nc,"R6USER",1145],I[65504]=[null,null,G.prototype.Kb,G.prototype.yc,"CTRL",1170],I[65520]=[null,null,G.prototype.sb,G.prototype.zb,"LSIZE",1170],I[65522]=[null,null,G.prototype.sb,G.prototype.zb,"HSIZE",1170],I[65524]=[null,null,G.prototype.jc,G.prototype.Wc,"SYSID",1170],I[65526]=[null,null,G.prototype.Jb,G.prototype.xc,"CPUERR",1170],I[65528]=[null,null,G.prototype.Qb,G.prototype.Ec,
|
||||
"MB",1170],I[65530]=[null,null,G.prototype.Vb,G.prototype.Hc,"PIR"],I[65532]=[null,null,G.prototype.ic,G.prototype.Vc,"SL"],I[65534]=[null,null,G.prototype.Yb,G.prototype.Kc,"PSW"],I);H[62594]=H[62592];H[62596]=H[62592];H[62598]=H[62592];H[62600]=H[62592];H[62602]=H[62592];H[62604]=H[62592];H[62606]=H[62592];H[62610]=H[62608];H[62612]=H[62608];H[62614]=H[62608];H[62616]=H[62608];H[62618]=H[62608];H[62620]=H[62608];H[62622]=H[62608];H[62626]=H[62624];H[62628]=H[62624];H[62630]=H[62624];H[62632]=H[62624];
|
||||
function kb(a,b,c,d,e){for(var f=b,k=c,l=f>>>a.m;0<k&&l<a.b.length;){var n=a.b[l],r=l*a.c,t=a.c-(f-r);t>k&&(t=k);if(!e&&n&&n.size){if(n.type==d){if(f+k<=n.Ca)return n.Ua+=n.Ca-f,n.Ca=f,!0;if(f>=n.Ca+n.Ua){t=n.size-(f-r);t>k&&(t=k);n.Ua=f-n.Ca+t;f=r+a.c;k-=t;l++;continue}}return mb(1,f,k)}f=new E(a,f,t,a.c,d,e);eb(f,a.G,n);a.b[l++]=f;f=r+a.c;k-=t}if(0>=k){c/=1024;var D;e="";D?10<D&&(D=10):D=c&-65536?10:5;if(null==c||isNaN(c))for(;0<D--;)e="?"+e;else for(;0<D--;)e=String.fromCharCode(c%10+48)+e,c/=
|
||||
10;a.status(e+"Kb "+nb[d]+" at "+ia(b));return!0}return mb(2,b,c)}function jb(a,b,c){var d=[];for(b>>>=a.m;0<c&&b<a.b.length;)d.push(a.b[b++]),c-=a.c;return d}function ib(a,b,c,d){var e=0;for(b>>>=a.m;0<c&&b<a.b.length;){var f=d[e++];if(!f)break;a.b[b++]=f;c-=a.c}}function ob(a,b){return a.b[(b&a.i)>>>a.m].eb(b&a.g,b)}function pb(a,b){return a.b[(b&a.i)>>>a.m].T(b&a.g,b)}$a.prototype.Ta=function(a,b){this.S++;this.b[(a&this.i)>>>this.m].yb(a&this.g,b&255,a);this.S--};
|
||||
function qb(a,b,c){a.b[(b&a.i)>>>a.m].Va(b&a.g,c&65535,b)}function rb(a){for(var b=0,c=[],d=0;d<a.v;d++){var e=a.b[d];if(e.la||e.Db){c[b++]=d;var f=b++;if(e=e.save()){for(var k=0,l=0,n=[];k<e.length;){for(var r=e[k],t=k+1;t<e.length&&e[t]===r;)t++;n[l++]=t-k;n[l++]=r;k=t}n.length<e.length&&(e=n)}c[f]=e}}return c}function sb(a,b,c,d,e,f,k,l){for(;b<=c;b+=2){var n=b&fb;void 0!==a.ka[n]?m("I/O address already registered: "+ja(b,8,!0)):a.ka[n]=[d,e,f,k,l||"unknown",!1]}}
|
||||
function tb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.a.Ga)){var k=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,r=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&r&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(r)));sb(a,e,e,k,l,n,r,f[4])}}}function ub(a,b){a.o.push(b)}function vb(a,b){a.S||F(a.a,4,b)}
|
||||
function mb(a,b,c){m("Memory block error ("+a+": "+ja(b)+","+ja(c)+")");return!1}function G(a){u.call(this,"Device",a,G);this.c={data:0,fd:0,Sa:20,uc:0};this.b={hd:0,ib:-1}}w(G);g=G.prototype;g.ea=function(a,b,c,d){this.m=b;this.a=c;this.G=d;var e=this;this.b.ib=wb(c,function(){e.b.na|=128;e.b.na&64&&(xb(e.a,e.b.vc),yb(e.a,e.b.ib,1E3/60))});this.b.vc=zb(64,6);tb(b,this,H);ub(b,this.reset.bind(this));B(this)};g.reset=function(){this.c.Sa=this.c.Sa&-120|20;this.b.na=0};
|
||||
g.Qb=function(){var a=this.b.na;this.b.na&=-129;return a};g.Ec=function(a){this.b.na=a;a&64&&yb(this.a,this.b.ib,1E3/60);this.b.na=a&-129};g.Jb=function(a){return(a?this.c.uc:this.c.data)&65535};g.xc=function(a){this.c.data=a};g.Sb=function(){var a=this.a;return a.A&62337|a.Ia<<5|a.Ja<<1};g.Gc=function(a){var b=this.a;a&=62337;if(b.A!=a){b.A=a;b.Ia=a>>5&3;b.Ja=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ea!=c&&(b.Ea=c,Ab(b))}Bb(this)};
|
||||
g.Tb=function(){var a=this.a.oa;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Ub=function(){return this.a.gb};g.Vb=function(){return this.a.pa};g.Hc=function(a){var b=this.a;1170>b.Ga&&(a&=-49);b.pa!=a&&(b.pa=a,a&16?(b.$a=4194303,b.Ka=3915776):(b.$a=262143,b.Ka=253952),Ab(b));Bb(this)};function Bb(a){a.c.Sa=a.c.Sa&-8|(a.a.Ea?a.a.pa&16?1:2:4)}g.ic=function(a){return this.a.C[1][a>>1&7]};g.Vc=function(a,b){this.a.C[1][b>>1&7]=a&65295};g.gc=function(a){return this.a.C[1][(a>>1&7)+8]};
|
||||
g.Tc=function(a,b){this.a.C[1][(b>>1&7)+8]=a&65295};g.hc=function(a){return this.a.R[1][a>>1&7]};g.Uc=function(a,b){b=b>>1&7;this.a.R[1][b]=a;this.a.C[1][b]&=65295};g.fc=function(a){return this.a.R[1][(a>>1&7)+8]};g.Sc=function(a,b){b=(b>>1&7)+8;this.a.R[1][b]=a;this.a.C[1][b]&=65295};g.Pb=function(a){return this.a.C[0][a>>1&7]};g.Dc=function(a,b){this.a.C[0][b>>1&7]=a&65295};g.Nb=function(a){return this.a.C[0][(a>>1&7)+8]};g.Bc=function(a,b){this.a.C[0][(b>>1&7)+8]=a&65295};
|
||||
g.Ob=function(a){return this.a.R[0][a>>1&7]};g.Cc=function(a,b){b=b>>1&7;this.a.R[0][b]=a;this.a.C[0][b]&=65295};g.Mb=function(a){return this.a.R[0][(a>>1&7)+8]};g.Ac=function(a,b){b=(b>>1&7)+8;this.a.R[0][b]=a;this.a.C[0][b]&=65295};g.oc=function(a){return this.a.C[3][a>>1&7]};g.ad=function(a,b){this.a.C[3][b>>1&7]=a&65295};g.mc=function(a){return this.a.C[3][(a>>1&7)+8]};g.Zc=function(a,b){this.a.C[3][(b>>1&7)+8]=a&65295};g.nc=function(a){return this.a.R[3][a>>1&7]};
|
||||
g.$c=function(a,b){b=b>>1&7;this.a.R[3][b]=a;this.a.C[3][b]&=65295};g.lc=function(a){return this.a.R[3][(a>>1&7)+8]};g.Yc=function(a,b){b=(b>>1&7)+8;this.a.R[3][b]=a;this.a.C[3][b]&=65295};g.wa=function(a){a&=7;return this.a.w&2048?this.a.ua[a]:this.a.f[a]};g.ya=function(a,b){b&=7;this.a.w&2048?this.a.ua[b]=a:this.a.f[b]=a};g.$b=function(){return this.a.w&49152?this.a.aa[0]:this.a.f[6]};g.Mc=function(a){this.a.w&49152?this.a.aa[0]=a:this.a.f[6]=a};g.cc=function(){return this.a.f[7]};
|
||||
g.Pc=function(a){this.a.f[7]=a};g.xa=function(a){a&=7;return this.a.w&2048?this.a.f[a]:this.a.ua[a]};g.za=function(a,b){b&=7;this.a.w&2048?this.a.f[b]=a:this.a.ua[b]=a};g.ac=function(){return 1==(this.a.w&49152)>>14?this.a.f[6]:this.a.aa[1]};g.Nc=function(a){1==(this.a.w&49152)>>14?this.a.f[6]=a:this.a.aa[1]=a};g.bc=function(){return 3==(this.a.w&49152)>>14?this.a.f[6]:this.a.aa[3]};g.Oc=function(a){3==(this.a.w&49152)>>14?this.a.f[6]=a:this.a.aa[3]=a};g.Lb=function(a){return this.a.vb[a-65504>>1]};
|
||||
g.zc=function(a,b){this.a.vb[b-65504>>1]=a};g.tb=function(a){return 65520==a?61183:0};g.Ab=function(){};g.kc=function(){return 1};g.Xc=function(){};g.Kb=function(){return this.a.F};g.yc=function(){this.a.F=0};g.Rb=function(){return this.a.ub};g.Fc=function(a,b){b&1||(a&=255);this.a.ub=a};g.Wb=function(a){return a?this.a.hb:0};g.Ic=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.hb=a;b.l|=2};g.jc=function(a){return a?this.a.qa&65280:0};g.Wc=function(a){this.a.qa=a|255};
|
||||
g.Zb=function(){return Za(this.a)};g.Lc=function(a){Cb(this.a,a&-1809|Za(this.a)&1808);this.a.l|=128};g.zb=function(){};
|
||||
var I={},H=(I[62592]=[null,null,G.prototype.ic,G.prototype.Vc,"SISDR",1145],I[62608]=[null,null,G.prototype.gc,G.prototype.Tc,"SDSDR",1145],I[62624]=[null,null,G.prototype.hc,G.prototype.Uc,"SISAR",1145],I[62640]=[null,null,G.prototype.fc,G.prototype.Sc,"SDSAR",1145],I[62656]=[null,null,G.prototype.Pb,G.prototype.Dc,"KISDR",1145],I[62672]=[null,null,G.prototype.Nb,G.prototype.Bc,"KDSDR",1145],I[62688]=[null,null,G.prototype.Ob,G.prototype.Cc,"KISAR",1145],I[62704]=[null,null,G.prototype.Mb,G.prototype.Ac,
|
||||
"KDSAR",1145],I[62798]=[null,null,G.prototype.Vb,G.prototype.Hc,"MMR3",1145],I[65382]=[null,null,G.prototype.Qb,G.prototype.Ec,"LKS"],I[65400]=[null,null,G.prototype.Jb,G.prototype.xc,"CNSL"],I[65402]=[null,null,G.prototype.Sb,G.prototype.Gc,"MMR0",1145],I[65404]=[null,null,G.prototype.Tb,G.prototype.zb,"MMR1",1145],I[65406]=[null,null,G.prototype.Ub,G.prototype.zb,"MMR2",1145],I[65408]=[null,null,G.prototype.oc,G.prototype.ad,"UISDR",1145],I[65424]=[null,null,G.prototype.mc,G.prototype.Zc,"UDSDR",
|
||||
1145],I[65440]=[null,null,G.prototype.nc,G.prototype.$c,"UISAR",1145],I[65456]=[null,null,G.prototype.lc,G.prototype.Yc,"UDSAR",1145],I[65472]=[null,null,G.prototype.wa,G.prototype.ya,"R0SET0"],I[65473]=[null,null,G.prototype.wa,G.prototype.ya,"R1SET0"],I[65474]=[null,null,G.prototype.wa,G.prototype.ya,"R2SET0"],I[65475]=[null,null,G.prototype.wa,G.prototype.ya,"R3SET0"],I[65476]=[null,null,G.prototype.wa,G.prototype.ya,"R4SET0"],I[65477]=[null,null,G.prototype.wa,G.prototype.ya,"R5SET0"],I[65478]=
|
||||
[null,null,G.prototype.$b,G.prototype.Mc,"R6KERNEL"],I[65479]=[null,null,G.prototype.cc,G.prototype.Pc,"R7KERNEL"],I[65480]=[null,null,G.prototype.xa,G.prototype.za,"R0SET1",1145],I[65481]=[null,null,G.prototype.xa,G.prototype.za,"R1SET1",1145],I[65482]=[null,null,G.prototype.xa,G.prototype.za,"R2SET1",1145],I[65483]=[null,null,G.prototype.xa,G.prototype.za,"R3SET1",1145],I[65484]=[null,null,G.prototype.xa,G.prototype.za,"R4SET1",1145],I[65485]=[null,null,G.prototype.xa,G.prototype.za,"R5SET1",1145],
|
||||
I[65486]=[null,null,G.prototype.ac,G.prototype.Nc,"R6SUPER",1145],I[65487]=[null,null,G.prototype.bc,G.prototype.Oc,"R6USER",1145],I[65504]=[null,null,G.prototype.Lb,G.prototype.zc,"CTRL",1170],I[65520]=[null,null,G.prototype.tb,G.prototype.Ab,"LSIZE",1170],I[65522]=[null,null,G.prototype.tb,G.prototype.Ab,"HSIZE",1170],I[65524]=[null,null,G.prototype.kc,G.prototype.Xc,"SYSID",1170],I[65526]=[null,null,G.prototype.Kb,G.prototype.yc,"CPUERR",1170],I[65528]=[null,null,G.prototype.Rb,G.prototype.Fc,
|
||||
"MB",1170],I[65530]=[null,null,G.prototype.Wb,G.prototype.Ic,"PIR"],I[65532]=[null,null,G.prototype.jc,G.prototype.Wc,"SL"],I[65534]=[null,null,G.prototype.Zb,G.prototype.Lc,"PSW"],I);H[62594]=H[62592];H[62596]=H[62592];H[62598]=H[62592];H[62600]=H[62592];H[62602]=H[62592];H[62604]=H[62592];H[62606]=H[62592];H[62610]=H[62608];H[62612]=H[62608];H[62614]=H[62608];H[62616]=H[62608];H[62618]=H[62608];H[62620]=H[62608];H[62622]=H[62608];H[62626]=H[62624];H[62628]=H[62624];H[62630]=H[62624];H[62632]=H[62624];
|
||||
H[62634]=H[62624];H[62636]=H[62624];H[62638]=H[62624];H[62642]=H[62640];H[62644]=H[62640];H[62646]=H[62640];H[62648]=H[62640];H[62650]=H[62640];H[62652]=H[62640];H[62654]=H[62640];H[62658]=H[62656];H[62660]=H[62656];H[62662]=H[62656];H[62664]=H[62656];H[62666]=H[62656];H[62668]=H[62656];H[62670]=H[62656];H[62674]=H[62672];H[62676]=H[62672];H[62678]=H[62672];H[62680]=H[62672];H[62682]=H[62672];H[62684]=H[62672];H[62686]=H[62672];H[62690]=H[62688];H[62692]=H[62688];H[62694]=H[62688];H[62696]=H[62688];
|
||||
H[62698]=H[62688];H[62700]=H[62688];H[62702]=H[62688];H[62706]=H[62704];H[62708]=H[62704];H[62710]=H[62704];H[62712]=H[62704];H[62714]=H[62704];H[62716]=H[62704];H[62718]=H[62704];H[65410]=H[65408];H[65412]=H[65408];H[65414]=H[65408];H[65416]=H[65408];H[65418]=H[65408];H[65420]=H[65408];H[65422]=H[65408];H[65426]=H[65424];H[65428]=H[65424];H[65430]=H[65424];H[65432]=H[65424];H[65434]=H[65424];H[65436]=H[65424];H[65438]=H[65424];H[65442]=H[65440];H[65444]=H[65440];H[65446]=H[65440];H[65448]=H[65440];
|
||||
H[65450]=H[65440];H[65452]=H[65440];H[65454]=H[65440];H[65458]=H[65456];H[65460]=H[65456];H[65462]=H[65456];H[65464]=H[65456];H[65466]=H[65456];H[65468]=H[65456];H[65470]=H[65456];H[65506]=H[65504];H[65508]=H[65504];H[65510]=H[65504];H[65512]=H[65504];H[65514]=H[65504];H[65516]=H[65504];H[65518]=H[65504];q(function(){for(var a=A(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=y(d);switch(c.type){case "default":c=new G(c);z(c,d);break;case "pc11":c=new J(c),z(c,d)}}});var Db;
|
||||
if(Ta){var Eb=new ArrayBuffer(2);(new DataView(Eb)).setUint16(0,256,!0);Db=256===(new Uint16Array(Eb))[0]}else Db=!1;var Fb=Db;
|
||||
function E(a,b,c,d,e,f){this.m=a;this.id=Gb+=2;this.a=null;this.Ba=b;this.Ua=c;this.size=d||0;this.type=e||Hb;this.v=e==Ib;this.controller=null;eb(this);this.la=this.Cb=!1;if(d)if(f)this.controller=f,this.a=null,Jb(this,f.Ab);else if(Ta)this.b=new ArrayBuffer(d),this.g=new DataView(this.b,0,d),this.c=new Uint8Array(this.b,0,d),this.o=new Uint16Array(this.b,0,d>>1),this.a=new Int32Array(this.b,0,d>>2),Jb(this,Fb?Kb:Lb);else{this.a=Array(d>>2);for(a=0;a<this.a.length;a++)this.a[a]=0;Jb(this,Mb)}else Jb(this)}
|
||||
function E(a,b,c,d,e,f){this.m=a;this.id=Gb+=2;this.a=null;this.Ca=b;this.Ua=c;this.size=d||0;this.type=e||Hb;this.g=e==Ib;this.controller=null;eb(this);this.la=this.Db=!1;if(d)if(f)this.controller=f,this.a=null,Jb(this,f.Bb);else if(Ta)this.b=new ArrayBuffer(d),this.s=new DataView(this.b,0,d),this.c=new Uint8Array(this.b,0,d),this.o=new Uint16Array(this.b,0,d>>1),this.a=new Int32Array(this.b,0,d>>2),Jb(this,Fb?Kb:Lb);else{this.a=Array(d>>2);for(a=0;a<this.a.length;a++)this.a[a]=0;Jb(this,Mb)}else Jb(this)}
|
||||
var Hb=0,Ib=2,lb=4,nb=["NONE","RAM","ROM","VID","H/W"],Gb=0;
|
||||
E.prototype={constructor:E,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ta)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.g.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Ta)for(b=0;b<a.length;b++)this.g.setInt32(b<<2,a[b],!0);else this.a=a;return this.la=!0}return!1},w:function(){return 255},A:function(){},s:function(a,b){return this.cb(a++,b++)|this.cb(a,b)<<8},B:function(a,b,c){this.ib(a++,
|
||||
b&255,c++);this.ib(a,b>>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ba:function(a,b){a&1&&vb(this.m,b);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ha:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.la=!0},ta:function(a,b,c){a&1&&vb(this.m,c);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|b>>8);this.la=!0},H:function(a,b){return this.I(a,b)},
|
||||
S:function(a,b){return this.W(a,b)},da:function(a,b,c){this.v||this.xb(a,b,c)},ja:function(a,b,c){this.v||this.ra(a,b,c)},D:function(a){return this.c[a]},J:function(a){return this.c[a]},O:function(a,b){a&1&&vb(this.m,b);return this.g.getUint16(a,!0)},X:function(a,b){a&1&&vb(this.m,b);return this.o[a>>1]},ca:function(a,b){this.c[a]=b;this.la=!0},ga:function(a,b){this.c[a]=b;this.la=!0},ia:function(a,b,c){a&1&&vb(this.m,c);this.g.setUint16(a,b,!0);this.la=!0},sa:function(a,b,c){a&1&&vb(this.m,c);this.o[a>>
|
||||
1]=b;this.la=!0}};function eb(a,b,c){a.G=b;a.h=a.j=0;c&&((a.h=c.h)&&Nb(a,Ob,!1),(a.j=c.j)&&Pb(a,Ob,!1))}function Pb(a,b,c){c&&a.j||(a.ib=!a.v&&b[1]||a.A,a.Va=!a.v&&b[3]||a.B);if(c||void 0===c)a.xb=b[1]||a.A,a.ra=b[3]||a.B}function Nb(a,b,c){c&&a.h||(a.cb=b[0]||a.w,a.T=b[2]||a.s);if(c||void 0===c)a.I=b[0]||a.w,a.W=b[2]||a.s}function Jb(a,b){b||(b=Qb);Nb(a,b,void 0);Pb(a,b,void 0)}
|
||||
var Qb=[],Mb=[E.prototype.N,E.prototype.ha,E.prototype.ba,E.prototype.ta],Ob=[E.prototype.H,E.prototype.da,E.prototype.S,E.prototype.ja];if(Ta)var Lb=[E.prototype.D,E.prototype.ca,E.prototype.O,E.prototype.ia],Kb=[E.prototype.J,E.prototype.ga,E.prototype.X,E.prototype.sa];
|
||||
function Rb(a,b){u.call(this,"CPU",a,Rb);var c=a.multiplier||1;this.Pa=a.cycles||b;this.da=c;this.Ya=Math.round(this.Pa/1E4)/100;this.ga=this.Ya*this.da;this.i.U=!1;this.i.vb=!1;this.i.Ca=a.autoStart;this.i.Oa=!1;this.Ma=this.ia=0;this.Na=a.csStart;this.ra=a.csInterval;this.sa=a.csStop;this.H=[];this.rb=this.sc.bind(this);B(this)}w(Rb);var Sb=["power","reset"];g=Rb.prototype;
|
||||
g.ea=function(a,b,c,d){this.w=a;this.m=b;this.G=d;for(b=0;b<Sb.length;b++)(c=this.v[Sb[b]])&&this.w.V(null,Sb[b],c);a=Tb(a,"autoStart");null!=a&&(this.i.Ca="true"==a?!0:"false"==a?!1:!!a);B(this)};g.reset=function(){};g.save=function(){return null};g.restore=function(){return!1};g.$=function(a,b){if(!b){if(a&&this.restore){Ub(this);if(!this.restore(a))return!1;Vb(this)}else this.reset();this.P("No debugger detected")}this.w.fa();return!0};g.Z=function(a){return a?this.save():!0};
|
||||
g.Ca=function(){return this.i.Ca||void 0===this.v.run?(Wb(this),!0):!1};g.lb=function(){return 0};function Vb(a){void 0===a.Na&&(a.Na=0);void 0===a.ra&&(a.ra=-1);void 0===a.sa&&(a.sa=-1);a.i.Oa=0<=a.Na&&0<a.ra;a.i.Oa&&(a.Ma=0,a.ia=a.Na-a.J)}
|
||||
g.V=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.v[b]=c,!0;case "run":return this.v[b]=c,c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.i.M)a=!0;else{var b=null,c,l=x(a.id);for(c=0;c<l.length&&(b=l[c],b===a||b.i.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.i.M);c++);c==l.length&&(b=a);m("The "+b.type+" component ("+b.id+") is not "+(b.i.ready?"powered yet":"ready yet"+(b.Ra?" (waiting for notification)":""))+".");a=!1}a&&(d.i.U?Xa(d):Wb(d))},!0;case "speed":return this.v[b]=
|
||||
c,!0;case "setSpeed":return this.v[b]=c,c.onclick=function(){Xb(d,d.da<<1)},c.textContent=this.ga.toFixed(2)+"Mhz",!0}return!1};g.fa=function(){var a=this.v.speed;a&&(a.textContent=this.i.U&&this.ba?this.ba.toFixed(2)+"Mhz":"Stopped")};function Yb(a,b){var c=1;b&&1<a.da&&a.ba&&(c=a.ba/a.Ya);a.pb=Math.round(1E3/30);a.Qa=Math.floor(a.Pa/30*c);b||(a.ta=a.Qa);a.$a=0}function Zb(a){return a.J+a.W+a.ha-a.a}function Ub(a){a.ba=0;a.qb=0;a.J=a.W=a.ha=a.a=0;Vb(a);Xb(a,1)}
|
||||
function Xb(a,b){if(void 0!==b&&(.8>a.ba/a.ga&&(b=1),a.da=b,b=a.Ya*a.da,a.ga!=b)){a.ga=b;b=a.ga.toFixed(2)+"Mhz";var c=a.v.setSpeed;c&&(c.textContent=b);a.P("target speed: "+b)}a.J+=a.W;a.W=0;a.O=sa();a.ca=0;Yb(a)}function wb(a,b){var c=a.H.length;a.H.push([-1,b]);return c}function yb(a,b,c){0<=b&&b<a.H.length&&0>a.H[b][0]&&(c=a.Pa*a.da/1E3*c|0,a.H[b][0]=c+$b(a))}function $b(a,b){var c=a.ha-=a.a;a.a=0;b&&(a.ha=0);return c}
|
||||
g.sc=function(){if(this.i.U){this.$a>=this.Pa&&Yb(this,!0);this.Aa=0;this.La=sa();if(this.ca){var a=this.La-this.ca;a>this.pb&&(this.O+=a,this.O>this.La&&(this.O=this.La))}try{do{for(var b,c=this.i.Oa?1:this.Qa,d=this.H.length-1;0<=d;d--){var e=this.H[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.wb(b)}catch(n){if("number"!=typeof n)throw n;}b=$b(this,!0);this.Aa+=b;this.W+=b;a=b;if(this.i.Oa){var f=!1;this.Ma=this.Ma+this.lb()|0;this.ia-=a;0>=this.ia&&(this.ia+=this.ra,f=!0);0<=this.sa&&this.sa<=Zb(this)&&
|
||||
(this.ra=this.sa=-1,Vb(this),Xa(this),f=!0);f&&this.P(Zb(this)+" cycles: checksum="+ja(this.Ma))}for(var a=b,k=this.H.length-1;0<=k;k--){var l=this.H[k];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.ta-=b;if(0>=this.ta){this.ta+=this.Qa;15<=++this.qb&&(this.w&&this.w.fa(),this.qb=0);break}}while(this.i.U)}catch(n){Xa(this);this.w&&this.w.stop(sa(),Zb(this));b=n.stack||n.message;this.i.error=!0;this.L(b);return}if(this.i.U){b=setTimeout;c=this.rb;this.ca=sa();d=this.pb;this.Aa&&(d=Math.round(d*
|
||||
this.Aa/this.Qa));d-=this.ca-this.La;if(e=this.ca-this.O)this.ba=Math.round(this.W/(10*e))/100,864E5<=e&&(this.J=0,Xb(this));if(0>d||this.ba<this.ga)-1E3>d&&(this.O-=d),d=0;this.$a+=this.Aa;this.ca+=d;b(c,d)}}};function Wb(a){var b;a.i.error?(a.P(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.i.U)a.P(a.toString()+" busy");else{Xb(a);a.i.U=!0;a.i.vb=!0;if(b=a.v.run)b.textContent="Halt";a.w&&a.w.start(a.O,Zb(a));setTimeout(a.rb,0)}}g.wb=function(){return 0};
|
||||
function Xa(a){if(a.i.U){$b(a);a.J+=a.W;a.W=0;a.i.U=!1;var b=a.v.run;b&&(b.textContent="Run");a.w&&a.w.stop(sa(),Zb(a))}a.i.complete=void 0}function ac(a){this.Fa=+a.model||1170;this.nb=a.addrReset||0;Rb.call(this,a,6666667);this.decode=1120==this.Fa?bc.bind(this):cc.bind(this);dc(this);this.S=0;this.X=null;this.i.complete=this.i.Bb=!1}w(ac,Rb);g=ac.prototype;g.reset=function(){this.status("model "+this.Fa);this.i.U&&Xa(this);dc(this);Ub(this);this.i.error=!1;this.parent.reset.call(this)};
|
||||
function dc(a){a.j=65536;a.g=32768;a.h=65535;a.o=32768;a.u=15;a.f=[0,0,0,0,0,0,0,a.nb];a.ua=[0,0,0,0,0,0];a.aa=[0,0,0,0];a.s=0;a.Ja=0;a.Fb=[4,2,0,1];a.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.R=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Hb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.ub=[0,0,0,0,0,0,0,0];a.tb=0;a.l=0;a.B=a.D=0;a.c=a.b=a.Xa=0;a.ja=-1;ec(a)}function ec(a){a.qa=255;a.F=0;a.gb=0;a.A=0;a.oa=0;a.fb=0;a.pa=0;a.Da=0;a.Ia=0;a.Za=262143;a.Ka=253952;a.l|=2;a.m&&Ab(a)}function Ab(a){a.Da?(a.N=65536,a.I=a.Eb,a.T=a.pc,a.Va=a.bd,hb(a.m,a.pa&16?22:18)):(a.N=0,a.I=a.Db,a.T=a.oc,a.Va=a.ad,hb(a.m,16))}g.lb=function(){return 0};
|
||||
g.save=function(){var a=new K(this);a.set(0,[]);a.set(1,[this.J,this.da]);a.set(2,rb(this.m));return a.data()};g.restore=function(a){var b=a[1];this.J=b[1];Xb(this,b[3]);a:{b=this.m;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.B){for(var f=0,k=Array(b.B),l=0;l<e.length-1;)for(var n=e[l++],r=e[l++];n--;)k[f++]=r;e=k}f=b.b[d];if(!f||!f.restore(e)){m("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function L(a){return a.j&65536?1:0}
|
||||
g.ma=function(){return this.o&32768?8:0};function fc(a){var b=a.T(a.f[7]);a.f[7]=a.f[7]+2&65535;return b}function M(a,b){a.f[7]=b&65535}function zb(a,b){return{vc:a,va:b,next:null}}function xb(a,b){if(b!=a.X){var c=a.X;if(!c||c.va<=b.va)b.next=c,a.X=b;else{do{var d=c.next;if(!d||d.va<=b.va){b.next=d;c.next=b;break}c=d}while(c)}}a.l|=2}function Za(a){return a.u=a.u&63728|a.ma()|(a.h&65535?0:4)|(a.g&32768?2:0)|L(a)}
|
||||
function Cb(a,b){a.o=b<<12;a.h=~b&4;a.g=b<<14;a.j=b<<16;if((b^a.u)&2048)for(var c=a.ua.length;0<=--c;){var d=a.f[c];a.f[c]=a.ua[c];a.ua[c]=d}a.s=b>>14&3;c=a.u>>14&3;a.s!=c&&(a.aa[c]=a.f[6],a.f[6]=a.aa[a.s]);a.u=b;a.l|=2}function N(a,b){a.l&128||(a.o=a.h=b,a.g=0)}function O(a,b,c){a.l&128||(a.o=a.h=a.j=b,a.g=c||0)}function gc(a,b,c,d){a.l&128||(a.o=a.h=a.j=b,a.g=(c^b)&(d^b))}function P(a,b){a.l&128||(a.o=a.h=a.j=b,a.g=a.o^a.j>>1)}function hc(a,b,c,d){a.l&128||(a.o=a.h=a.j=b,a.g=(c^d)&(d^b))}
|
||||
function F(a,b,c){if(!a.S){var d=!1;0>a.ja?a.ja=Za(a):a.s||(b=4,d=!0);a.A&57344||(a.oa=63222,a.fb=b);a.s=0;var e=a.T(b|a.N),f=a.T(b+2&65535|a.N);Cb(a,f&-12289|a.ja>>2&12288);d&&(a.F|=4,a.f[6]=4);ic(a,a.ja);ic(a,a.f[7]);M(a,e);a.l&=-113;a.ja=-1;if(26!=c)throw b;}}function jc(a){var b=kc(a),c=kc(a)&-1793;a.u&49152&&(c=c&-225|a.u&63712);M(a,b);Cb(a,c);a.l&=-17}
|
||||
function lc(a,b,c){var d,e,f,k=0;d=b>>13;a.pa&a.Fb[a.s]||(d&=7);e=a.C[a.s][d];f=(a.R[a.s][d]<<6)+(b&8191)&a.Za;if(f<a.Ka)f&1&&!(c&1)&&(a.F|=64,F(a,4,10));else if(a.pa&16||253952<=f&&(f|=4186112),4186112>f){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.pa&32&&(f=a.Hb[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ka&&4186112>f&&(a.F|=32,F(a,4,12))}switch(e&7){case 1:k=4096;case 2:e|=128;c&4&&(k=8192);break;case 4:k=4096;case 5:c&4&&(k=4096);case 6:e|=c&4?192:
|
||||
128;break;default:k=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(k|=16384):(b&8128)>(e>>2&8128)&&(k|=16384));a.C[a.s][d]=e;if(4194170!==f||a.s)a.Ia=a.s,a.Ja=d;k&&(k&57344&&(0<=a.ja&&(k|=128),a.A&57344||(a.A=a.A|k|a.Ia<<5|a.Ja<<1),F(a,168,16)),a.A&61440||!(4191360>f||4194239<f)||(a.A|=4096,a.A&512&&(a.l|=32)));return f}function mc(a,b,c){b&1&&a.a--;a=a.m;a.b[(b&a.h)>>>a.m].ib(b&a.g,c&255,b)}function kc(a){var b=a.T(a.f[6]|a.N);a.f[6]=a.f[6]+2&65535;return b}
|
||||
function ic(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A&57344||(a.oa=a.oa<<8|246);!a.s&&c<=a.qa&&4<c&&(c<=a.qa-32?(a.F|=4,a.f[6]=4,F(a,4,18)):(a.F|=8,a.l|=4));a.Va(c,b)}
|
||||
function nc(a,b,c,d){var e,f,k=d&8?0:a.N;switch(b){case 0:return F(a,4,20),0;case 1:return 6===c&&!a.s&&d&4&&(a.f[6]<=a.qa||65534<=a.f[6])&&(a.f[6]<=a.qa-32||65534<=a.f[6]?(a.F|=4,a.f[6]=4,F(a,4,22)):(a.F|=8,a.l|=64)),a.a-=3,7===c?a.f[c]:a.f[c]|k;case 2:f=2;e=a.f[c];7!==c&&(e|=k,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=k);e=a.T(e);e|=k;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=k);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=k);e=a.T(e)|k;a.a-=
|
||||
8;break;case 6:return e=fc(a),e=e+a.f[c]&65535|k,a.a-=6,e;case 7:return e=fc(a),e=e+a.f[c]&65535,e=a.T(e|a.N)|k,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!k||a.A&57344||(a.oa=a.oa<<8|f<<3&248|c);6==c&&!a.s&&d&4&&0>=f&&(a.f[6]<=a.qa||65534<=a.f[6])&&(a.f[6]<=a.qa-32?(a.F|=4,a.f[6]=4,F(a,4,24)):(a.F|=8,a.l|=64));return e}g.Ta=function(a,b){this.Da?(this.S++,mc(this,lc(this,a,5),b),this.S--):this.m.Ta(a,b)};g.Db=function(a,b,c){return nc(this,a,b,c)};g.Eb=function(a,b,c){return lc(this,nc(this,a,b,c),c)};
|
||||
g.oc=function(a){return pb(this.m,a)};g.pc=function(a){return pb(this.m,lc(this,a,2))};g.ad=function(a,b){qb(this.m,a,b&65535)};g.bd=function(a,b){qb(this.m,lc(this,a,4),b)};function oc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=nc(a,b,d,2),c&65536||61440!==(a.u&61440)&&(d&=65535),a.s=a.u>>12&3,c=a.T(d|c&a.N),a.s=a.u>>14&3):c=6!=d||(a.u>>2&12288)===(a.u&12288)?a.f[d]:a.aa[a.u>>12&3];return c}
|
||||
function pc(a,b,c,d){a.A&57344||(a.oa=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=nc(a,b,e,4),c&65536||(e&=65535),a.s=a.u>>12&3,e=lc(a,e|c&65536,4),a.s=a.u>>14&3,qb(a.m,e,d)):6!=e||(a.u>>2&12288)===(a.u&12288)?a.f[e]=d:a.aa[a.u>>12&3]=d}function qc(a,b){b>>=6;var c=a.D=b&7;(b=a.B=(b&56)>>3)?(c=a.I(b,c,3),a=ob(a.m,c)):a=a.f[c]&255;return a}function Q(a,b){b>>=6;var c=a.D=b&7;return(b=a.B=(b&56)>>3)?pb(a.m,a.I(b,c,2)):a.f[c]}function rc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return nc(a,b,c,8)}
|
||||
function sc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.I(b,c,3),a=ob(a.m,c)):a=a.f[c]&255;return a}function tc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?pb(a.m,a.I(b,c,2)):a.f[c]}function R(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Xa=a.I(b,e,7),mc(a,e,d.call(a,c,ob(a.m,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.I(b,e,6),qb(a.m,e,d.call(a,c,pb(a.m,e)))):a.f[e]=d.call(a,c,a.f[e])}
|
||||
function uc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?mc(a,a.I(b,e,5),c):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function vc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?qb(a.m,a.I(b,d,4),c):a.f[d]=c&65535;return c}function T(a,b,c){c&&(M(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3}
|
||||
g.wb=function(a){this.i.complete=!0;this.i.Bb=!1;this.i.vb=!1;this.ha=this.a=a;do{if(this.l&&(this.l&112&&(this.l&32?F(this,168,28):this.l&64?F(this,4,30):this.l&16&&F(this,12,32),this.l&=-113),this.l&7))if(this.l&2){this.l&=-3;var b=160,c=(this.gb&224)>>5;if(a=this.X&&this.X.va>c?this.X:null)b=a.vc,c=a.va;c>(this.u&224)>>5?(this.l&4&&(this.f[7]=this.f[7]+2&65535,this.l&=-5),F(this,b,26),c=!0):c=!1;if(c&&a)if(c=this.X,c==a)this.X=a.next;else for(;c;){b=c.next;if(b==a){c.next=b.next;break}c=b}}else this.l&
|
||||
1&&this.l++;this.A&57344||(this.oa=0,this.fb=this.f[7]);this.l=this.l&7|this.u&16;this.decode(fc(this))}while(0<this.a);return this.i.complete?this.ha-this.a:void 0===this.i.complete?0:-1};q(function(){for(var a=A(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new ac(d);z(d,c)}});function wc(a,b){var c=b+a;gc(this,c,a,b);return c&65535}function xc(a,b){var c=b+a;gc(this,c<<8,a<<8,b<<8);return c&255}function yc(a,b){a=b<<1;P(this,a);return a&65535}
|
||||
E.prototype={constructor:E,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ta)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.s.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Ta)for(b=0;b<a.length;b++)this.s.setInt32(b<<2,a[b],!0);else this.a=a;return this.la=!0}return!1},v:function(){return 255},A:function(){},u:function(a,b){return this.eb(a++,b++)|this.eb(a,b)<<8},B:function(a,b,c){this.jb(a++,
|
||||
b&255,c++);this.jb(a,b>>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ba:function(a,b){a&1&&vb(this.m,b);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ha:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.la=!0},ta:function(a,b,c){a&1&&vb(this.m,c);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|b>>8);this.la=!0},I:function(a,b){return this.J(a,b)},
|
||||
S:function(a,b){return this.W(a,b)},da:function(a,b,c){this.g||this.yb(a,b,c)},ja:function(a,b,c){this.g||this.ra(a,b,c)},D:function(a){return this.c[a]},K:function(a){return this.c[a]},O:function(a,b){a&1&&vb(this.m,b);return this.s.getUint16(a,!0)},X:function(a,b){a&1&&vb(this.m,b);return this.o[a>>1]},ca:function(a,b){this.c[a]=b;this.la=!0},ga:function(a,b){this.c[a]=b;this.la=!0},ia:function(a,b,c){a&1&&vb(this.m,c);this.s.setUint16(a,b,!0);this.la=!0},sa:function(a,b,c){a&1&&vb(this.m,c);this.o[a>>
|
||||
1]=b;this.la=!0}};function eb(a,b,c){a.G=b;a.i=a.j=0;c&&((a.i=c.i)&&Nb(a,Ob,!1),(a.j=c.j)&&Pb(a,Ob,!1))}function Pb(a,b,c){c&&a.j||(a.jb=!a.g&&b[1]||a.A,a.Va=!a.g&&b[3]||a.B);if(c||void 0===c)a.yb=b[1]||a.A,a.ra=b[3]||a.B}function Nb(a,b,c){c&&a.i||(a.eb=b[0]||a.v,a.T=b[2]||a.u);if(c||void 0===c)a.J=b[0]||a.v,a.W=b[2]||a.u}function Jb(a,b){b||(b=Qb);Nb(a,b,void 0);Pb(a,b,void 0)}
|
||||
var Qb=[],Mb=[E.prototype.N,E.prototype.ha,E.prototype.ba,E.prototype.ta],Ob=[E.prototype.I,E.prototype.da,E.prototype.S,E.prototype.ja];if(Ta)var Lb=[E.prototype.D,E.prototype.ca,E.prototype.O,E.prototype.ia],Kb=[E.prototype.K,E.prototype.ga,E.prototype.X,E.prototype.sa];
|
||||
function Rb(a,b){u.call(this,"CPU",a,Rb);var c=a.multiplier||1;this.Pa=a.cycles||b;this.da=c;this.Za=Math.round(this.Pa/1E4)/100;this.ga=this.Za*this.da;this.h.U=!1;this.h.wb=!1;this.h.Da=a.autoStart;this.h.Oa=!1;this.Ma=this.ia=0;this.Na=a.csStart;this.sa=a.csInterval;this.ta=a.csStop;this.I=[];this.sb=this.tc.bind(this);B(this)}w(Rb);var Sb=["power","reset"];g=Rb.prototype;
|
||||
g.ea=function(a,b,c,d){this.v=a;this.m=b;this.G=d;for(b=0;b<Sb.length;b++)(c=this.s[Sb[b]])&&this.v.V(null,Sb[b],c);a=Tb(a,"autoStart");null!=a&&(this.h.Da="true"==a?!0:"false"==a?!1:!!a);B(this)};g.reset=function(){};g.save=function(){return null};g.restore=function(){return!1};g.$=function(a,b){if(!b){if(a&&this.restore){Ub(this);if(!this.restore(a))return!1;Vb(this)}else this.reset();this.P("No debugger detected")}this.v.fa();return!0};g.Z=function(a){return a?this.save():!0};
|
||||
g.Da=function(){return this.h.Da||void 0===this.s.run?(Wb(this),!0):!1};g.mb=function(){return 0};function Vb(a){void 0===a.Na&&(a.Na=0);void 0===a.sa&&(a.sa=-1);void 0===a.ta&&(a.ta=-1);a.h.Oa=0<=a.Na&&0<a.sa;a.h.Oa&&(a.Ma=0,a.ia=a.Na-a.K)}
|
||||
g.V=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.s[b]=c,!0;case "run":return this.s[b]=c,c.onclick=function(){var a;if(a=d.v)if(a=d.v,a.h.L)a=!0;else{var b=null,c,l=x(a.id);for(c=0;c<l.length&&(b=l[c],b===a||b.h.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.h.L);c++);c==l.length&&(b=a);m("The "+b.type+" component ("+b.id+") is not "+(b.h.ready?"powered yet":"ready yet"+(b.Ra?" (waiting for notification)":""))+".");a=!1}a&&(d.h.U?Xa(d):Wb(d))},!0;case "speed":return this.s[b]=
|
||||
c,!0;case "setSpeed":return this.s[b]=c,c.onclick=function(){Xb(d,d.da<<1)},c.textContent=this.ga.toFixed(2)+"Mhz",!0}return!1};g.fa=function(){var a=this.s.speed;a&&(a.textContent=this.h.U&&this.ba?this.ba.toFixed(2)+"Mhz":"Stopped")};function Yb(a,b){var c=1;b&&1<a.da&&a.ba&&(c=a.ba/a.Za);a.qb=Math.round(1E3/30);a.Qa=Math.floor(a.Pa/30*c);b||(a.Aa=a.Qa);a.ab=0}function Zb(a){return a.K+a.W+a.ha-a.a}function Ub(a){a.ba=0;a.rb=0;a.K=a.W=a.ha=a.a=0;Vb(a);Xb(a,1)}
|
||||
function Xb(a,b){if(void 0!==b&&(.8>a.ba/a.ga&&(b=1),a.da=b,b=a.Za*a.da,a.ga!=b)){a.ga=b;b=a.ga.toFixed(2)+"Mhz";var c=a.s.setSpeed;c&&(c.textContent=b);a.P("target speed: "+b)}a.K+=a.W;a.W=0;a.O=sa();a.ca=0;Yb(a)}function wb(a,b){var c=a.I.length;a.I.push([-1,b]);return c}function yb(a,b,c){0<=b&&b<a.I.length&&0>a.I[b][0]&&(c=a.Pa*a.da/1E3*c|0,a.I[b][0]=c+$b(a))}function $b(a,b){var c=a.ha-=a.a;a.a=0;b&&(a.ha=0);return c}
|
||||
g.tc=function(){if(this.h.U){this.ab>=this.Pa&&Yb(this,!0);this.Ba=0;this.La=sa();if(this.ca){var a=this.La-this.ca;a>this.qb&&(this.O+=a,this.O>this.La&&(this.O=this.La))}try{do{for(var b,c=this.h.Oa?1:this.Qa,d=this.I.length-1;0<=d;d--){var e=this.I[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.xb(b)}catch(n){if("number"!=typeof n)throw n;}b=$b(this,!0);this.Ba+=b;this.W+=b;a=b;if(this.h.Oa){var f=!1;this.Ma=this.Ma+this.mb()|0;this.ia-=a;0>=this.ia&&(this.ia+=this.sa,f=!0);0<=this.ta&&this.ta<=Zb(this)&&
|
||||
(this.sa=this.ta=-1,Vb(this),Xa(this),f=!0);f&&this.P(Zb(this)+" cycles: checksum="+ja(this.Ma))}for(var a=b,k=this.I.length-1;0<=k;k--){var l=this.I[k];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.Aa-=b;if(0>=this.Aa){this.Aa+=this.Qa;15<=++this.rb&&(this.v&&this.v.fa(),this.rb=0);break}}while(this.h.U)}catch(n){Xa(this);this.v&&this.v.stop(sa(),Zb(this));b=n.stack||n.message;this.h.error=!0;this.H(b);return}if(this.h.U){b=setTimeout;c=this.sb;this.ca=sa();d=this.qb;this.Ba&&(d=Math.round(d*
|
||||
this.Ba/this.Qa));d-=this.ca-this.La;if(e=this.ca-this.O)this.ba=Math.round(this.W/(10*e))/100,864E5<=e&&(this.K=0,Xb(this));if(0>d||this.ba<this.ga)-1E3>d&&(this.O-=d),d=0;this.ab+=this.Ba;this.ca+=d;b(c,d)}}};function Wb(a){var b;a.h.error?(a.P(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.h.U)a.P(a.toString()+" busy");else{Xb(a);a.h.U=!0;a.h.wb=!0;if(b=a.s.run)b.textContent="Halt";a.v&&a.v.start(a.O,Zb(a));setTimeout(a.sb,0)}}g.xb=function(){return 0};
|
||||
function Xa(a){if(a.h.U){$b(a);a.K+=a.W;a.W=0;a.h.U=!1;var b=a.s.run;b&&(b.textContent="Run");a.v&&a.v.stop(sa(),Zb(a))}a.h.complete=void 0}function ac(a){this.Ga=+a.model||1170;this.ob=a.addrReset||0;Rb.call(this,a,6666667);this.decode=1120==this.Ga?bc.bind(this):cc.bind(this);dc(this);this.S=0;this.X=null;this.h.complete=this.h.Cb=!1}w(ac,Rb);g=ac.prototype;g.reset=function(){this.status("model "+this.Ga);this.h.U&&Xa(this);dc(this);Ub(this);this.h.error=!1;this.parent.reset.call(this)};
|
||||
function dc(a){a.j=65536;a.g=32768;a.i=65535;a.o=32768;a.w=15;a.f=[0,0,0,0,0,0,0,a.ob];a.ua=[0,0,0,0,0,0];a.aa=[0,0,0,0];a.u=0;a.Ja=0;a.Gb=[4,2,0,1];a.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.R=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Ib=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.vb=[0,0,0,0,0,0,0,0];a.ub=0;a.l=0;a.B=a.D=0;a.c=a.b=a.Ya=0;a.ja=-1;ec(a)}function ec(a){a.qa=255;a.F=0;a.hb=0;a.A=0;a.oa=0;a.gb=0;a.pa=0;a.Ea=0;a.Ia=0;a.$a=262143;a.Ka=253952;a.l|=2;a.m&&Ab(a)}function Ab(a){a.Ea?(a.N=65536,a.J=a.Fb,a.T=a.qc,a.Va=a.cd,hb(a.m,a.pa&16?22:18)):(a.N=0,a.J=a.Eb,a.T=a.pc,a.Va=a.bd,hb(a.m,16))}g.mb=function(){return 0};
|
||||
g.save=function(){var a=new K(this);a.set(0,[]);a.set(1,[this.K,this.da]);a.set(2,rb(this.m));return a.data()};g.restore=function(a){var b=a[1];this.K=b[1];Xb(this,b[3]);a:{b=this.m;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.B){for(var f=0,k=Array(b.B),l=0;l<e.length-1;)for(var n=e[l++],r=e[l++];n--;)k[f++]=r;e=k}f=b.b[d];if(!f||!f.restore(e)){m("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function L(a){return a.j&65536?1:0}
|
||||
g.ma=function(){return this.o&32768?8:0};function fc(a){var b=a.T(a.f[7]);a.f[7]=a.f[7]+2&65535;return b}function M(a,b){a.f[7]=b&65535}function zb(a,b){return{wc:a,va:b,next:null}}function xb(a,b){if(b!=a.X){var c=a.X;if(!c||c.va<=b.va)b.next=c,a.X=b;else{do{var d=c.next;if(!d||d.va<=b.va){b.next=d;c.next=b;break}c=d}while(c)}}a.l|=2}function Za(a){return a.w=a.w&63728|a.ma()|(a.i&65535?0:4)|(a.g&32768?2:0)|L(a)}
|
||||
function Cb(a,b){a.o=b<<12;a.i=~b&4;a.g=b<<14;a.j=b<<16;if((b^a.w)&2048)for(var c=a.ua.length;0<=--c;){var d=a.f[c];a.f[c]=a.ua[c];a.ua[c]=d}a.u=b>>14&3;c=a.w>>14&3;a.u!=c&&(a.aa[c]=a.f[6],a.f[6]=a.aa[a.u]);a.w=b;a.l|=2}function N(a,b){a.l&128||(a.o=a.i=b,a.g=0)}function O(a,b,c){a.l&128||(a.o=a.i=a.j=b,a.g=c||0)}function gc(a,b,c,d){a.l&128||(a.o=a.i=a.j=b,a.g=(c^b)&(d^b))}function P(a,b){a.l&128||(a.o=a.i=a.j=b,a.g=a.o^a.j>>1)}function hc(a,b,c,d){a.l&128||(a.o=a.i=a.j=b,a.g=(c^d)&(d^b))}
|
||||
function F(a,b,c){if(!a.S){var d=!1;0>a.ja?a.ja=Za(a):a.u||(b=4,d=!0);a.A&57344||(a.oa=63222,a.gb=b);a.u=0;var e=a.T(b|a.N),f=a.T(b+2&65535|a.N);Cb(a,f&-12289|a.ja>>2&12288);d&&(a.F|=4,a.f[6]=4);ic(a,a.ja);ic(a,a.f[7]);M(a,e);a.l&=-113;a.ja=-1;if(26!=c)throw b;}}function jc(a){var b=kc(a),c=kc(a)&-1793;a.w&49152&&(c=c&-225|a.w&63712);M(a,b);Cb(a,c);a.l&=-17}
|
||||
function lc(a,b,c){var d,e,f,k=0;d=b>>13;a.pa&a.Gb[a.u]||(d&=7);e=a.C[a.u][d];f=(a.R[a.u][d]<<6)+(b&8191)&a.$a;if(f<a.Ka)f&1&&!(c&1)&&(a.F|=64,F(a,4,10));else if(a.pa&16||253952<=f&&(f|=4186112),4186112>f){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.pa&32&&(f=a.Ib[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ka&&4186112>f&&(a.F|=32,F(a,4,12))}switch(e&7){case 1:k=4096;case 2:e|=128;c&4&&(k=8192);break;case 4:k=4096;case 5:c&4&&(k=4096);case 6:e|=c&4?192:
|
||||
128;break;default:k=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(k|=16384):(b&8128)>(e>>2&8128)&&(k|=16384));a.C[a.u][d]=e;if(4194170!==f||a.u)a.Ia=a.u,a.Ja=d;k&&(k&57344&&(0<=a.ja&&(k|=128),a.A&57344||(a.A=a.A|k|a.Ia<<5|a.Ja<<1),F(a,168,16)),a.A&61440||!(4191360>f||4194239<f)||(a.A|=4096,a.A&512&&(a.l|=32)));return f}function mc(a,b,c){b&1&&a.a--;a=a.m;a.b[(b&a.i)>>>a.m].jb(b&a.g,c&255,b)}function kc(a){var b=a.T(a.f[6]|a.N);a.f[6]=a.f[6]+2&65535;return b}
|
||||
function ic(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A&57344||(a.oa=a.oa<<8|246);!a.u&&c<=a.qa&&4<c&&(c<=a.qa-32?(a.F|=4,a.f[6]=4,F(a,4,18)):(a.F|=8,a.l|=4));a.Va(c,b)}
|
||||
function nc(a,b,c,d){var e,f,k=d&8?0:a.N;switch(b){case 0:return F(a,4,20),0;case 1:return 6===c&&!a.u&&d&4&&(a.f[6]<=a.qa||65534<=a.f[6])&&(a.f[6]<=a.qa-32||65534<=a.f[6]?(a.F|=4,a.f[6]=4,F(a,4,22)):(a.F|=8,a.l|=64)),a.a-=3,7===c?a.f[c]:a.f[c]|k;case 2:f=2;e=a.f[c];7!==c&&(e|=k,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=k);e=a.T(e);e|=k;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=k);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=k);e=a.T(e)|k;a.a-=
|
||||
8;break;case 6:return e=fc(a),e=e+a.f[c]&65535|k,a.a-=6,e;case 7:return e=fc(a),e=e+a.f[c]&65535,e=a.T(e|a.N)|k,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!k||a.A&57344||(a.oa=a.oa<<8|f<<3&248|c);6==c&&!a.u&&d&4&&0>=f&&(a.f[6]<=a.qa||65534<=a.f[6])&&(a.f[6]<=a.qa-32?(a.F|=4,a.f[6]=4,F(a,4,24)):(a.F|=8,a.l|=64));return e}g.Ta=function(a,b){this.Ea?(this.S++,mc(this,lc(this,a,5),b),this.S--):this.m.Ta(a,b)};g.Eb=function(a,b,c){return nc(this,a,b,c)};g.Fb=function(a,b,c){return lc(this,nc(this,a,b,c),c)};
|
||||
g.pc=function(a){return pb(this.m,a)};g.qc=function(a){return pb(this.m,lc(this,a,2))};g.bd=function(a,b){qb(this.m,a,b&65535)};g.cd=function(a,b){qb(this.m,lc(this,a,4),b)};function oc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=nc(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.u=a.w>>12&3,c=a.T(d|c&a.N),a.u=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.f[d]:a.aa[a.w>>12&3];return c}
|
||||
function pc(a,b,c,d){a.A&57344||(a.oa=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=nc(a,b,e,4),c&65536||(e&=65535),a.u=a.w>>12&3,e=lc(a,e|c&65536,4),a.u=a.w>>14&3,qb(a.m,e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.f[e]=d:a.aa[a.w>>12&3]=d}function qc(a,b){b>>=6;var c=a.D=b&7;(b=a.B=(b&56)>>3)?(c=a.J(b,c,3),a=ob(a.m,c)):a=a.f[c]&255;return a}function Q(a,b){b>>=6;var c=a.D=b&7;return(b=a.B=(b&56)>>3)?pb(a.m,a.J(b,c,2)):a.f[c]}function rc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return nc(a,b,c,8)}
|
||||
function sc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.J(b,c,3),a=ob(a.m,c)):a=a.f[c]&255;return a}function tc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?pb(a.m,a.J(b,c,2)):a.f[c]}function R(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Ya=a.J(b,e,7),mc(a,e,d.call(a,c,ob(a.m,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.J(b,e,6),qb(a.m,e,d.call(a,c,pb(a.m,e)))):a.f[e]=d.call(a,c,a.f[e])}
|
||||
function uc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?mc(a,a.J(b,e,5),c):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function vc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?qb(a.m,a.J(b,d,4),c):a.f[d]=c&65535;return c}function T(a,b,c){c&&(M(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3}
|
||||
g.xb=function(a){this.h.complete=!0;this.h.Cb=!1;this.h.wb=!1;this.ha=this.a=a;do{if(this.l&&(this.l&112&&(this.l&32?F(this,168,28):this.l&64?F(this,4,30):this.l&16&&F(this,12,32),this.l&=-113),this.l&7))if(this.l&2){this.l&=-3;var b=160,c=(this.hb&224)>>5;if(a=this.X&&this.X.va>c?this.X:null)b=a.wc,c=a.va;c>(this.w&224)>>5?(this.l&4&&(this.f[7]=this.f[7]+2&65535,this.l&=-5),F(this,b,26),c=!0):c=!1;if(c&&a)if(c=this.X,c==a)this.X=a.next;else for(;c;){b=c.next;if(b==a){c.next=b.next;break}c=b}}else this.l&
|
||||
1&&this.l++;this.A&57344||(this.oa=0,this.gb=this.f[7]);this.l=this.l&7|this.w&16;this.decode(fc(this))}while(0<this.a);return this.h.complete?this.ha-this.a:void 0===this.h.complete?0:-1};q(function(){for(var a=A(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new ac(d);z(d,c)}});function wc(a,b){var c=b+a;gc(this,c,a,b);return c&65535}function xc(a,b){var c=b+a;gc(this,c<<8,a<<8,b<<8);return c&255}function yc(a,b){a=b<<1;P(this,a);return a&65535}
|
||||
function zc(a,b){a=b<<1;P(this,a<<8);return a&255}function Ac(a,b){a=b&32768|b>>1|b<<16;P(this,a);return a&65535}function Bc(a,b){a=b&2048|b>>1|b<<8;P(this,a<<8);return a&255}function Cc(a,b){a=b&~a;N(this,a);return a}function Dc(a,b){a=b&~a;N(this,a<<8);return a}function Ec(a,b){a|=b;N(this,a);return a}function Fc(a,b){a|=b;N(this,a<<8);return a}function Gc(a,b){a=~b|65536;O(this,a);return a&65535}function Hc(a,b){a=~b|256;O(this,a<<8);return a&255}
|
||||
function Ic(a,b){a=b-a;this.l&128||(this.o=this.h=a,this.g=b&(b^a));return a&65535}function Jc(a,b){a=b-a;var c=a<<8;b<<=8;this.l&128||(this.o=this.h=c,this.g=b&(b^c));return a&255}function Kc(a,b){a=b+a;this.l&128||(this.o=this.h=a,this.g=a&(b^a));return a&65535}function Lc(a,b){a=b+a;var c=a<<8;this.l&128||(this.o=this.h=c,this.g=c&(b<<8^c));return a&255}function Mc(a,b){a=-b;O(this,a,a&b&32768);return a&65535}function Nc(a,b){a=-b;O(this,a<<8,(a&b&128)<<8);return a&255}
|
||||
function Oc(a,b){a=b<<1|this.j>>16&1;P(this,a);return a&65535}function Pc(a,b){a=b<<1|this.j>>16&1;P(this,a<<8);return a&255}function Qc(a,b){a=(this.j&65536|b)>>1|b<<16;P(this,a);return a&65535}function Rc(a,b){a=((this.j&65536)>>8|b)>>1|b<<8;P(this,a<<8);return a&255}function Sc(a,b){var c=b-a;hc(this,c,a,b);return c&65535}function Tc(a,b){var c=b-a;hc(this,c<<8,a<<8,b<<8);return c&255}function Uc(a,b){this.l&128||(this.o=this.h=b&65280,this.g=this.j=0);return(b<<8|b>>8)&65535}
|
||||
function Vc(a,b){a^=b;N(this,a);return a&65535}function Wc(a){S(this,a,Q(this,a),wc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Xc(a){var b=tc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.j=this.g=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.j=c<<17-b,c>>=b;else if(b)if(16<b)this.g=c,c=0;else{this.j=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.o=this.h=c;this.a-=(this.c?6:7)+b}
|
||||
function Yc(a){var b=tc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.j=this.g=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.j=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.j=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.g=32768)):d=c;this.f[a]=d>>16&65535;this.f[a|1]=d&65535;this.o=d>>16;this.h=d>>16|d;this.a-=(this.c?6:7)+b}function Zc(a){T(this,a,!L(this))}function $c(a){T(this,a,L(this))}
|
||||
function Ic(a,b){a=b-a;this.l&128||(this.o=this.i=a,this.g=b&(b^a));return a&65535}function Jc(a,b){a=b-a;var c=a<<8;b<<=8;this.l&128||(this.o=this.i=c,this.g=b&(b^c));return a&255}function Kc(a,b){a=b+a;this.l&128||(this.o=this.i=a,this.g=a&(b^a));return a&65535}function Lc(a,b){a=b+a;var c=a<<8;this.l&128||(this.o=this.i=c,this.g=c&(b<<8^c));return a&255}function Mc(a,b){a=-b;O(this,a,a&b&32768);return a&65535}function Nc(a,b){a=-b;O(this,a<<8,(a&b&128)<<8);return a&255}
|
||||
function Oc(a,b){a=b<<1|this.j>>16&1;P(this,a);return a&65535}function Pc(a,b){a=b<<1|this.j>>16&1;P(this,a<<8);return a&255}function Qc(a,b){a=(this.j&65536|b)>>1|b<<16;P(this,a);return a&65535}function Rc(a,b){a=((this.j&65536)>>8|b)>>1|b<<8;P(this,a<<8);return a&255}function Sc(a,b){var c=b-a;hc(this,c,a,b);return c&65535}function Tc(a,b){var c=b-a;hc(this,c<<8,a<<8,b<<8);return c&255}function Uc(a,b){this.l&128||(this.o=this.i=b&65280,this.g=this.j=0);return(b<<8|b>>8)&65535}
|
||||
function Vc(a,b){a^=b;N(this,a);return a&65535}function Wc(a){S(this,a,Q(this,a),wc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Xc(a){var b=tc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.j=this.g=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.j=c<<17-b,c>>=b;else if(b)if(16<b)this.g=c,c=0;else{this.j=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.o=this.i=c;this.a-=(this.c?6:7)+b}
|
||||
function Yc(a){var b=tc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.j=this.g=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.j=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.j=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.g=32768)):d=c;this.f[a]=d>>16&65535;this.f[a|1]=d&65535;this.o=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Zc(a){T(this,a,!L(this))}function $c(a){T(this,a,L(this))}
|
||||
function ad(a){S(this,a,Q(this,a),Cc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function bd(a){R(this,a,qc(this,a),Dc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function cd(a){S(this,a,Q(this,a),Ec);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function dd(a){R(this,a,qc(this,a),Fc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}
|
||||
function ed(a){N(this,Q(this,a)&tc(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function fd(a){N(this,(qc(this,a)&sc(this,a))<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function gd(a){T(this,a,this.h&65535?0:4)}function hd(a){T(this,a,!this.ma()==!(this.g&32768))}function id(a){T(this,a,!!(this.h&65535)&&!this.ma()==!(this.g&32768))}function jd(a){T(this,a,!L(this)&&!!(this.h&65535))}
|
||||
function kd(a){T(this,a,(this.h&65535?0:4)||!this.ma()!=!(this.g&32768))}function ld(a){T(this,a,L(this)||(this.h&65535?0:4))}function md(a){T(this,a,!this.ma()!=!(this.g&32768))}function nd(a){T(this,a,this.ma())}function od(a){T(this,a,!!(this.h&65535))}function pd(a){T(this,a,!this.ma())}function qd(){F(this,12,1);this.a-=5}function rd(a){T(this,a,!0)}function sd(a){T(this,a,!(this.g&32768))}function td(a){T(this,a,this.g&32768?2:0)}
|
||||
function U(a){a&1&&(this.j=0);a&2&&(this.g=0);a&4&&(this.h=1);a&8&&(this.o=0);this.a-=5}function ud(a){var b=Q(this,a);a=tc(this,a);hc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function vd(a){var b=qc(this,a)<<8;a=sc(this,a)<<8;hc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}
|
||||
function wd(a){var b=tc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.j=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.h=d>>16|d,this.o=d>>16):(this.g=32768,this.h=d>>15|d,this.o=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.h=this.o=0,this.g=32768,this.j=65536,this.a-=7}function xd(){F(this,24,2);this.a-=25}function yd(){this.u&49152?(this.F|=128,F(this,4,3)):Xa(this);this.a-=7}
|
||||
function ed(a){N(this,Q(this,a)&tc(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function fd(a){N(this,(qc(this,a)&sc(this,a))<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function gd(a){T(this,a,this.i&65535?0:4)}function hd(a){T(this,a,!this.ma()==!(this.g&32768))}function id(a){T(this,a,!!(this.i&65535)&&!this.ma()==!(this.g&32768))}function jd(a){T(this,a,!L(this)&&!!(this.i&65535))}
|
||||
function kd(a){T(this,a,(this.i&65535?0:4)||!this.ma()!=!(this.g&32768))}function ld(a){T(this,a,L(this)||(this.i&65535?0:4))}function md(a){T(this,a,!this.ma()!=!(this.g&32768))}function nd(a){T(this,a,this.ma())}function od(a){T(this,a,!!(this.i&65535))}function pd(a){T(this,a,!this.ma())}function qd(){F(this,12,1);this.a-=5}function rd(a){T(this,a,!0)}function sd(a){T(this,a,!(this.g&32768))}function td(a){T(this,a,this.g&32768?2:0)}
|
||||
function U(a){a&1&&(this.j=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.o=0);this.a-=5}function ud(a){var b=Q(this,a);a=tc(this,a);hc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function vd(a){var b=qc(this,a)<<8;a=sc(this,a)<<8;hc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}
|
||||
function wd(a){var b=tc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.j=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.o=d>>16):(this.g=32768,this.i=d>>15|d,this.o=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.o=0,this.g=32768,this.j=65536,this.a-=7}function xd(){F(this,24,2);this.a-=25}function yd(){this.w&49152?(this.F|=128,F(this,4,3)):Xa(this);this.a-=7}
|
||||
function zd(){F(this,16,4);this.a-=25}var Ad=[0,7,7,10,7,11,9,13];function V(a){var b=this.a;M(this,rc(this,a));this.a=b-Ad[this.c]}var Bd=[0,14,14,17,14,18,16,20];function Cd(a){var b=this.a,c=rc(this,a);a=a>>6&7;ic(this,this.f[a]);this.f[a]=this.f[7];M(this,c);this.a=b-Bd[this.c]}var Dd=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ed(a){var b=Q(this,a),c=this.a;N(this,vc(this,a,b));this.a=c-Dd[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)}
|
||||
function Fd(a){var b=qc(this,a);N(this,uc(this,a,b,1)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var Gd=[7,13,13,17,14,18,17,21];function Hd(a){var b=tc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.l&128||(this.o=b>>16,this.h=this.o|b,this.g=0,this.j=-32768>b||32767<b?65536:0);this.a-=23}function Id(){this.a-=5}function Jd(){this.u&49152||(ec(this),this.m.reset());this.a-=667}
|
||||
function Kd(){jc(this);this.l|=this.u&16;this.a-=13}function Ld(a){if(a&8)F(this,8,6);else{var b=kc(this);a&=7;M(this,this.f[a]);this.f[a]=b;this.a-=9}}function W(a){a&1&&(this.j=65536);a&2&&(this.g=32768);a&4&&(this.h=0);a&8&&(this.o=32768);this.a-=5}function Md(a){var b=(a&448)>>6;if(this.f[b]=this.f[b]-1&65535)M(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Nd(a){S(this,a,Q(this,a),Sc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}
|
||||
function X(a){S(this,a,0,Uc);this.a-=this.c?9:3+(7==this.b?2:0)}function Od(){F(this,28,5);this.a-=5}function Qd(){this.l&4||this.w.fa();this.l|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3}function Rd(a){S(this,a,Q(this,a),Vc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){F(this,8,6)}function bc(a){Sd[a>>12].call(this,a)}function Td(a){Ud[a>>6&3].call(this,a)}function Vd(a){Wd[a>>6&3].call(this,a)}function Xd(a){Yd[a>>6&3].call(this,a)}function Zd(a){$d[a&15].call(this,a)}
|
||||
function Fd(a){var b=qc(this,a);N(this,uc(this,a,b,1)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var Gd=[7,13,13,17,14,18,17,21];function Hd(a){var b=tc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.l&128||(this.o=b>>16,this.i=this.o|b,this.g=0,this.j=-32768>b||32767<b?65536:0);this.a-=23}function Id(){this.a-=5}function Jd(){this.w&49152||(ec(this),this.m.reset());this.a-=667}
|
||||
function Kd(){jc(this);this.l|=this.w&16;this.a-=13}function Ld(a){if(a&8)F(this,8,6);else{var b=kc(this);a&=7;M(this,this.f[a]);this.f[a]=b;this.a-=9}}function W(a){a&1&&(this.j=65536);a&2&&(this.g=32768);a&4&&(this.i=0);a&8&&(this.o=32768);this.a-=5}function Md(a){var b=(a&448)>>6;if(this.f[b]=this.f[b]-1&65535)M(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Nd(a){S(this,a,Q(this,a),Sc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}
|
||||
function X(a){S(this,a,0,Uc);this.a-=this.c?9:3+(7==this.b?2:0)}function Od(){F(this,28,5);this.a-=5}function Pd(){this.l&4||this.v.fa();this.l|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3}function Qd(a){S(this,a,Q(this,a),Vc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){F(this,8,6)}function bc(a){Rd[a>>12].call(this,a)}function Td(a){Ud[a>>6&3].call(this,a)}function Vd(a){Wd[a>>6&3].call(this,a)}function Xd(a){Yd[a>>6&3].call(this,a)}function Zd(a){$d[a&15].call(this,a)}
|
||||
function ae(a){be[a&15].call(this,a)}function ce(a){de[a>>6&3].call(this,a)}function ee(a){fe[a>>6&3].call(this,a)}function ge(a){he[a>>6&3].call(this,a)}
|
||||
var Sd=[function(a){ie[a>>8&15].call(this,a)},Ed,ud,ed,ad,cd,Wc,Y,function(a){je[a>>8&15].call(this,a)},Fd,vd,fd,bd,dd,Nd,Y],ie=[function(a){ke[a>>4&15].call(this,a)},rd,od,gd,hd,md,id,kd,Cd,Cd,Td,Vd,Xd,Y,Y,Y],Ud=[function(a){O(this,vc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Gc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Kc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Ic);this.a-=this.c?9:3+(7==this.b?2:0)}],Wd=[function(a){S(this,a,0,Mc);
|
||||
var Rd=[function(a){ie[a>>8&15].call(this,a)},Ed,ud,ed,ad,cd,Wc,Y,function(a){je[a>>8&15].call(this,a)},Fd,vd,fd,bd,dd,Nd,Y],ie=[function(a){ke[a>>4&15].call(this,a)},rd,od,gd,hd,md,id,kd,Cd,Cd,Td,Vd,Xd,Y,Y,Y],Ud=[function(a){O(this,vc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Gc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Kc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Ic);this.a-=this.c?9:3+(7==this.b?2:0)}],Wd=[function(a){S(this,a,0,Mc);
|
||||
this.a-=this.c?11:6},function(a){S(this,a,L(this)?1:0,wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,L(this)?1:0,Sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=tc(this,a);O(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Yd=[function(a){S(this,a,0,Qc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Oc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Ac);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,yc);this.a-=this.c?9:3+(7==this.b?2:0)}],ke=[function(a){le[a&
|
||||
15].call(this,a)},Y,Y,Y,V,V,V,V,Ld,Y,Zd,ae,X,X,X,X],le=[yd,Qd,Kd,qd,zd,Jd,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],$d=[Id,function(){this.j=0;this.a-=5},function(){this.g=0;this.a-=5},U,function(){this.h=1;this.a-=5},U,U,U,function(){this.o=0;this.a-=5},U,U,U,U,U,U,U],be=[Id,function(){this.j=65536;this.a-=5},function(){this.g=32768;this.a-=5},W,function(){this.h=0;this.a-=5},W,W,W,function(){this.o=32768;this.a-=5},W,W,W,W,W,W,W],je=[pd,nd,jd,ld,sd,td,Zc,$c,xd,Od,ce,ee,ge,Y,Y,Y],de=[function(a){O(this,uc(this,a,0));
|
||||
15].call(this,a)},Y,Y,Y,V,V,V,V,Ld,Y,Zd,ae,X,X,X,X],le=[yd,Pd,Kd,qd,zd,Jd,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],$d=[Id,function(){this.j=0;this.a-=5},function(){this.g=0;this.a-=5},U,function(){this.i=1;this.a-=5},U,U,U,function(){this.o=0;this.a-=5},U,U,U,U,U,U,U],be=[Id,function(){this.j=65536;this.a-=5},function(){this.g=32768;this.a-=5},W,function(){this.i=0;this.a-=5},W,W,W,function(){this.o=32768;this.a-=5},W,W,W,W,W,W,W],je=[pd,nd,jd,ld,sd,td,Zc,$c,xd,Od,ce,ee,ge,Y,Y,Y],de=[function(a){O(this,uc(this,a,0));
|
||||
this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,Hc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,1,Lc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,1,Jc);this.a-=this.c?9:3+(7==this.b?2:0)}],fe=[function(a){R(this,a,0,Nc);this.a-=this.c?11:6},function(a){R(this,a,L(this)?1:0,xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,L(this)?1:0,Tc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=sc(this,a);O(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],he=
|
||||
[function(a){R(this,a,0,Rc);this.a-=this.c?9+(this.Xa&1):3+(7==this.b?2:0)},function(a){R(this,a,0,Pc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,Bc);this.a-=this.c?9+(this.Xa&1):3+(7==this.b?2:0)},function(a){R(this,a,0,zc);this.a-=this.c?9:3+(7==this.b?2:0)}];function cc(a){me[a>>12].call(this,a)}
|
||||
[function(a){R(this,a,0,Rc);this.a-=this.c?9+(this.Ya&1):3+(7==this.b?2:0)},function(a){R(this,a,0,Pc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,Bc);this.a-=this.c?9+(this.Ya&1):3+(7==this.b?2:0)},function(a){R(this,a,0,zc);this.a-=this.c?9:3+(7==this.b?2:0)}];function cc(a){me[a>>12].call(this,a)}
|
||||
var me=[function(a){ne[a>>8&15].call(this,a)},Ed,ud,ed,ad,cd,Wc,function(a){oe[a>>8&15].call(this,a)},function(a){pe[a>>8&15].call(this,a)},Fd,vd,fd,bd,dd,Nd,Y],ne=[function(a){qe[a>>4&15].call(this,a)},rd,od,gd,hd,md,id,kd,Cd,Cd,Td,Vd,Xd,function(a){re[a>>6&3].call(this,a)},Y,Y],re=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.T(a|this.N);M(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=oc(this,a,0);ic(this,a);N(this,a);this.a-=11},function(a){var b=kc(this),c=this.a;
|
||||
pc(this,a,0,b);N(this,b);this.a=c-Gd[this.c]},function(a){N(this,vc(this,a,this.ma?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],qe=[function(a){se[a&15].call(this,a)},Y,Y,Y,V,V,V,V,Ld,function(a){a&8?(this.u&49152||(this.u=this.u&-2017|(a&7)<<5,this.l|=1),this.a-=5):F(this,8,6)},Zd,ae,X,X,X,X],se=[yd,Qd,Kd,qd,zd,Jd,function(){jc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],oe=[Hd,Hd,wd,wd,Xc,Xc,Yc,Yc,Rd,Rd,Y,Y,Y,Y,Md,Md],pe=[pd,nd,jd,ld,sd,td,Zc,$c,xd,Od,ce,ee,ge,function(a){te[a>>6&3].call(this,a)},Y,
|
||||
pc(this,a,0,b);N(this,b);this.a=c-Gd[this.c]},function(a){N(this,vc(this,a,this.ma?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],qe=[function(a){se[a&15].call(this,a)},Y,Y,Y,V,V,V,V,Ld,function(a){a&8?(this.w&49152||(this.w=this.w&-2017|(a&7)<<5,this.l|=1),this.a-=5):F(this,8,6)},Zd,ae,X,X,X,X],se=[yd,Pd,Kd,qd,zd,Jd,function(){jc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],oe=[Hd,Hd,wd,wd,Xc,Xc,Yc,Yc,Qd,Qd,Y,Y,Y,Y,Md,Md],pe=[pd,nd,jd,ld,sd,td,Zc,$c,xd,Od,ce,ee,ge,function(a){te[a>>6&3].call(this,a)},Y,
|
||||
Y],te=[Y,function(a){a=oc(this,a,65536);ic(this,a);N(this,a);this.a-=11},function(a){var b=kc(this),c=this.a;pc(this,a,65536,b);N(this,b);this.a=c-Gd[this.c]},Y];
|
||||
function ue(a){u.call(this,"ROM",a,ue);this.Y=this.b=null;this.j=a.addr;this.c=a.size;this.h=a.alias;this.g=a.file;this.o=ka(this.g);if(this.g){a=this.g;var b=la(this.o);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;h(a,null,!0,function(a,b,f){f?c.L("Unable to load ROM resource (error "+f+": "+a+")"):(Pa(c.Ha,a,b),(a=ua(a,b))?(c.b=a.K,c.Y=a.Y):c.g=null,ve(c))})}}w(ue);ue.prototype.ea=function(a,b,c,d){this.m=b;this.a=c;this.G=d;ve(this)};
|
||||
function ue(a){u.call(this,"ROM",a,ue);this.Y=this.b=null;this.j=a.addr;this.c=a.size;this.i=a.alias;this.g=a.file;this.o=ka(this.g);if(this.g){a=this.g;var b=la(this.o);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;h(a,null,!0,function(a,b,f){f?c.H("Unable to load ROM resource (error "+f+": "+a+")"):(Pa(c.ra,a,b),(a=ua(a,b))?(c.b=a.M,c.Y=a.Y):c.g=null,ve(c))})}}w(ue);ue.prototype.ea=function(a,b,c,d){this.m=b;this.a=c;this.G=d;ve(this)};
|
||||
ue.prototype.$=function(){this.Y&&(this.G&&this.G.a(this.id,this.j,this.c,this.Y),delete this.Y);return!0};ue.prototype.Z=function(){return!0};
|
||||
function ve(a){if(!Sa(a)){if(a.g){if(!a.b||!a.m)return;a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+ja(a.b.length,8,!0)+") does not match specified size ("+ja(a.c,8,!0)+")";a.i.error=!0;a.L(b)}else{b=a.j;if(kb(a.m,b,a.c,Ib)){var c;for(c=0;c<a.b.length;c++)a.m.Ta(b+c,a.b[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.h?b.push(a.h):null!=a.h&&a.h.length&&(b=a.h);for(c=0;c<b.length;c++){var d=a,e=b[c],f=jb(d.m,d.j,d.c);ib(d.m,e,d.c,f)}delete a.b}}}B(a)}}
|
||||
function ve(a){if(!Sa(a)){if(a.g){if(!a.b||!a.m)return;a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+ja(a.b.length,8,!0)+") does not match specified size ("+ja(a.c,8,!0)+")";a.h.error=!0;a.H(b)}else{b=a.j;if(kb(a.m,b,a.c,Ib)){var c;for(c=0;c<a.b.length;c++)a.m.Ta(b+c,a.b[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.i?b.push(a.i):null!=a.i&&a.i.length&&(b=a.i);for(c=0;c<b.length;c++){var d=a,e=b[c],f=jb(d.m,d.j,d.c);ib(d.m,e,d.c,f)}delete a.b}}}B(a)}}
|
||||
q(function(){for(var a=A(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new ue(d);z(d,c)}});
|
||||
function we(a){u.call(this,"RAM",a,we);this.Y=this.c=null;this.o=a.addr;this.w=a.size;this.h=a.load;this.g=a.exec;this.j=!1;this.b=a.file;this.s=ka(this.b);if(this.b){a=this.b;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;h(a,null,!0,function(a,b,f){f?c.L("Unable to load RAM resource (error "+f+": "+a+")"):(Pa(c.Ha,a,b),(a=ua(a,b))?(c.c=a.K,c.Y=a.Y,null==c.h&&null!=a.bb&&(c.h=a.bb),null==c.g&&null!=a.ab&&(c.g=a.ab)):c.b=null,xe(c))})}}
|
||||
w(we);we.prototype.ea=function(a,b,c,d){this.m=b;this.a=c;this.G=d;xe(this)};we.prototype.$=function(){return!0};we.prototype.Z=function(){return!0};function xe(a){!a.j&&a.w&&kb(a.m,a.o,a.w,1)&&(a.j=!0);if(!Sa(a)){if(!a.j)m("No RAM allocated");else if(a.b){if(!a.c||!a.m)return;var b=a.o;null!==a.h&&(b=a.h);for(var c=0;c<a.c.length;c++)a.m.Ta(b+c,a.c[c]);null!==a.g&&(b=a.a,c=a.g,b.nb=c,M(b,c));delete a.c}B(a)}}we.prototype.reset=function(){};
|
||||
q(function(){for(var a=A(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new we(d);z(d,c)}});function ye(a){u.call(this,"Keyboard",a,ye);B(this)}w(ye);ye.prototype.V=function(){return!1};ye.prototype.ea=function(a,b,c,d){this.w=a;this.a=c;this.G=d};q(function(){for(var a=A(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new ye(d);z(d,c)}});
|
||||
function Z(a){this.g=this.j=null;this.H=a.tabSize;this.B=a.charBOL;this.o=0;u.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.j="";else{var c;a=ze;b&&(void 0===c&&(c="Panel"),(c=Ra(c,this.id))&&(b=c.v[b])&&this.V(null,a,b))}this.s=this.A=null;this.exports={connect:this.mb,receiveData:this.eb}}w(Z);var ze="buffer";g=Z.prototype;
|
||||
g.V=function(a,b,c){var d=this;switch(b){case ze:return this.v[b]=this.g=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.eb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.eb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
g.ea=function(a,b,c,d){this.w=a;this.m=b;this.a=c;this.G=d;var e=this;this.N=zb(48,4);this.I=wb(this.a,function(){e.b&128||!e.h.length||(e.D=e.h.shift(),e.b|=128,e.b&64&&xb(e.a,e.N))});this.O=zb(52,4);this.J=wb(this.a,function(){e.c|=128;e.c&64&&xb(e.a,e.O)});tb(b,this,Ae);B(this)};
|
||||
g.mb=function(){if(!this.s){var a=Tb(this.w,"connection");if(a){var b=a.split("->");if(2==b.length){var c=qa(b[0]);if(c!=this.Ga)return;b=qa(b[1]);if(this.s=Qa(b)){var d=this.s.exports;if(d){var e=d.connect;e&&e.call(this.s);if(this.A=d.receiveData){this.status(this.Ha+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.$=function(a,b){if(!b)if(this.mb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
g.Z=function(a){return a?this.save():!0};g.reset=function(){Be(this)};g.save=function(){var a=new K(this);a.set(0,[]);return a.data()};g.restore=function(){return Be(this)};function Be(a){a.D=0;a.b=0;a.c=128;a.h=[];return!0}g.eb=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.h.push(a.charCodeAt(b));else this.h=this.h.concat(a);yb(this.a,this.I,1);return!0};g.dc=function(){return this.b&65535};g.Qc=function(a){this.b=this.b&-112|a&111};
|
||||
g.cc=function(){this.b&=-129;0<this.h.length&&yb(this.a,this.I,1);return this.D};g.Pc=function(){};g.rc=function(){return this.c};g.dd=function(a){128==(this.c&192)&&a&64&&yb(this.a,this.J,1);this.c=this.c&-70|a&69};g.qc=function(){return 0};
|
||||
g.cd=function(a){if(a&=255){this.A&&this.A.call(this.s,a);if(this.g)if(13==a)this.o=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0<this.o&&this.o--;else{var b;b=(b=ra[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.H||8,c=a-this.o%a,this.H&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.j){if(10==a||1024<=this.j.length)this.P(this.j),
|
||||
this.j="";10!=a&&(this.j+=String.fromCharCode(a))}this.c&=-129;yb(this.a,this.J,1)}};var Ce={},Ae=(Ce[65392]=[null,null,Z.prototype.dc,Z.prototype.Qc,"RCSR"],Ce[65394]=[null,null,Z.prototype.cc,Z.prototype.Pc,"RBUF"],Ce[65396]=[null,null,Z.prototype.rc,Z.prototype.dd,"XCSR"],Ce[65398]=[null,null,Z.prototype.qc,Z.prototype.cd,"XBUF"],Ce);q(function(){for(var a=A(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Z(d);z(d,c)}});
|
||||
function J(a){u.call(this,"PC11",a,J);this.c=this.b=0}w(J);g=J.prototype;g.V=function(){return!1};g.ea=function(a,b,c,d){this.w=a;this.m=b;this.a=c;this.G=d;tb(b,this,De);B(this)};g.$=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};g.Z=function(a){return a?this.save():!0};g.reset=function(){this.b&=-2241;this.c=0};g.save=function(){return(new K(this)).data()};g.restore=function(){return!0};g.Xb=function(){return this.b};
|
||||
g.Jc=function(a){a&1&&(this.b&32768?a&=-2:(this.b&=-129,this.b|=2048));this.b=this.b&-66|a&65};g.Wb=function(){return this.c};g.Ic=function(){};var Ee={},De=(Ee[65384]=[null,null,J.prototype.Xb,J.prototype.Jc,"PRS"],Ee[65386]=[null,null,J.prototype.Wb,J.prototype.Ic,"PRB"],Ee);
|
||||
function Fe(a,b,c){u.call(this,"Computer",a,Fe);this.i.M=!1;Ge(this,b);this.B=Tb(this,"autoPower",a);this.g=0;this.N=a.busWidth||a.buswidth;this.b=He;this.s=null;this.o=this.I=!1;this.O=Tb(this,"url")||"";(Math.random()+.1).toString(36);this.c=Ie(this);if(this.a=Ra("CPU",this.id)){this.G=Ra("Debugger",this.id);this.m=new $a({id:this.Ha+".bus",busWidth:this.N},this.a,this.G);var d,e=x(this.id);if((this.h=Ra("Panel",this.id))&&this.h.Wa)for(b=0;b<e.length;b++)d=e[b],d.L=this.h.L,d.P=this.h.P,d.Wa=this.h.Wa;
|
||||
this.P("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.P("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ea&&d.ea(this,this.m,this.a,this.G);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.w=d:this.b=parseInt(d,10));var f;if(a=Tb(this,"state")||(f=!0,a.state))b=this.D=a,f||(this.o=!0,this.b=He),this.b&&(this.A=new K(this,
|
||||
"1.30.1"),Je(this.A)?b=null:delete this.A);!b&&this.b&&(b=Ke(this))&&(this.o=!0);if(b){var k=this;h(b,null,!0,function(a,b,c){c?(k.w=null,k.o=!1,k.L("Unable to load machine state from server (error "+c+(b?": "+qa(b):"")+")")):(k.s=b,k.I=!0);B(k)})}else B(this);this.v.power||(this.B=!0);!c&&this.B&&Le(this,this.Ea)}else m("Unable to find CPU component")}w(Fe);var He=0;
|
||||
function Ge(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){m(d.message+" ("+c+")")}}a.J=b}function Tb(a,b,c){var d=b.toLowerCase(),d=Ja[b]||Ja[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Le(a,b,c){for(var d=x(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Sa(f)){Sa(f,function(){Le(a,b,c)});return}}b.call(a,c)}
|
||||
function Me(a,b){var c=new K(a,"1.30.1","validate");if(Je(c)&&Ne(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.L("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}g=Fe.prototype;
|
||||
g.Ea=function(a){void 0===a&&(a=this.b||(this.s?1:He));if(!this.g){this.g++;var b=!1,c=!1;this.H=!1;var d=this.A||new K(this,"1.30.1");if(-1==a)b=!0;else if(a>He){if(Je(d,this.s)){this.j=new K(this,"1.30.1","failsafe");Je(this.j)&&(Oe(this,d),a=2,Pe(this.j));this.j.set("timestamp",ta());Qe(this.j);var e=this.b&&!this.o;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ne(d)){var f=d.get("code"),k=d.get("data");f&&("ok"==f?Je(d,k):("error"==
|
||||
f&&"no machine state"!=k?(this.L("Error: "+k),"unable to verify user"==k&&(za("user",""),this.c=null)):this.P(f+": "+k),Pe(d),Je(d)?(c=Ne(d),e=!0):c=!1))}e&&Me(this,c?d:null)}else 2==a&&d.clear()}else Me(this);delete this.s;delete this.A}e=x(this.id);for(f=0;f<e.length;f++)k=e[f],k!==this&&k!=this.a&&(c=Re(this,k,d,b,c));b=[d,a,c];-1!=a?Le(this,this.kb,b):this.kb(b)}};
|
||||
function Re(a,b,c,d,e){if(!b.i.M){b.i.M=!0;if(b.$){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.$(f,d)&&f&&(m("Unable to restore state for "+b.type),a.D&&!a.I?(c.clear(),a.b=He,window&&window.location.reload()):a.H=!0,b.$(null),e=!1)}if(!d&&b.ob)for(a=b.ob.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
g.kb=function(a){var b=a[0],c=0>a[1];a=a[2];this.S=!0;this.i.M=!0;var d=this.v.power;d&&(d.textContent="Shutdown");this.a&&(Re(this,this.a,b,c,a),this.a.Ca());this.H&&(Oe(this,b),b.clear());!c&&this.j&&(this.j.clear(),delete this.j);this.g=0};
|
||||
function Oe(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.O;d.user=c;d.type="bug";d.data=b;h("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function Se(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new K(a,"1.30.1"),k=new K(a,"1.30.1","validate"),l=ta();k.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.Z&&(c&&Xa(a.a),d=a.a.Z(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.i.M=!1,!1===d&&(e=null)));for(var l=x(a.id),n=0;n<l.length;n++){var r=l[n];r.i.M&&(r.Z&&(d=r.Z(b,c),"object"===typeof d&&f.set(r.id,
|
||||
d)),c&&(r.i.M=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.c&&Te(a,a.c,f.toString()),Qe(k)&&Qe(f)||(e=null,d=l=!0)):a.b&&(d=!0,l=3==a.b),d&&f.clear(l)):e=f.toString());c&&(a.i.M=!1,b=a.v.power)&&(b.textContent="Power");a.g=0;return e}g.reset=function(){this.m&&this.m.reset&&this.m.reset();for(var a=x(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.m&&c.reset&&c.reset()}};g.start=function(a,b){for(var c=x(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.fa(!0)};
|
||||
function we(a){u.call(this,"RAM",a,we);this.Y=this.c=null;this.o=a.addr;this.v=a.size;this.i=a.load;this.g=a.exec;this.j=!1;this.b=a.file;this.u=ka(this.b);if(this.b){a=this.b;var b=la(this.u);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;h(a,null,!0,function(a,b,f){f?c.H("Unable to load RAM resource (error "+f+": "+a+")"):(Pa(c.ra,a,b),(a=ua(a,b))?(c.c=a.M,c.Y=a.Y,null==c.i&&null!=a.cb&&(c.i=a.cb),null==c.g&&null!=a.bb&&(c.g=a.bb)):c.b=null,xe(c))})}}
|
||||
w(we);we.prototype.ea=function(a,b,c,d){this.m=b;this.a=c;this.G=d;xe(this)};we.prototype.$=function(){return!0};we.prototype.Z=function(){return!0};function xe(a){!a.j&&a.v&&kb(a.m,a.o,a.v,1)&&(a.j=!0);if(!Sa(a)){if(!a.j)m("No RAM allocated");else if(a.b){if(!a.c||!a.m)return;var b=a.o;null!==a.i&&(b=a.i);for(var c=0;c<a.c.length;c++)a.m.Ta(b+c,a.c[c]);null!==a.g&&(b=a.a,c=a.g,b.ob=c,M(b,c));delete a.c}B(a)}}we.prototype.reset=function(){};
|
||||
q(function(){for(var a=A(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new we(d);z(d,c)}});function ye(a){u.call(this,"Keyboard",a,ye);B(this)}w(ye);ye.prototype.V=function(){return!1};ye.prototype.ea=function(a,b,c,d){this.v=a;this.a=c;this.G=d};q(function(){for(var a=A(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new ye(d);z(d,c)}});
|
||||
function Z(a){this.g=this.j=null;this.I=a.tabSize;this.B=a.charBOL;this.o=0;u.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.j="";else{var c;a=ze;b&&(void 0===c&&(c="Panel"),(c=Ra(c,this.id))&&(b=c.s[b])&&this.V(null,a,b))}this.u=this.A=null;this.exports={connect:this.nb,receiveData:this.fb}}w(Z);var ze="buffer";g=Z.prototype;
|
||||
g.V=function(a,b,c){var d=this;switch(b){case ze:return this.s[b]=this.g=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.fb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.fb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
g.ea=function(a,b,c,d){this.v=a;this.m=b;this.a=c;this.G=d;var e=this;this.N=zb(48,4);this.J=wb(this.a,function(){e.b&128||!e.i.length||(e.D=e.i.shift(),e.b|=128,e.b&64&&xb(e.a,e.N))});this.O=zb(52,4);this.K=wb(this.a,function(){e.c|=128;e.c&64&&xb(e.a,e.O)});tb(b,this,Ae);B(this)};
|
||||
g.nb=function(){if(!this.u){var a=Tb(this.v,"connection");if(a){var b=a.split("->");if(2==b.length){var c=qa(b[0]);if(c!=this.Ha)return;b=qa(b[1]);if(this.u=Qa(b)){var d=this.u.exports;if(d){var e=d.connect;e&&e.call(this.u);if(this.A=d.receiveData){this.status(this.ra+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.$=function(a,b){if(!b)if(this.nb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
g.Z=function(a){return a?this.save():!0};g.reset=function(){Be(this)};g.save=function(){var a=new K(this);a.set(0,[]);return a.data()};g.restore=function(){return Be(this)};function Be(a){a.D=0;a.b=0;a.c=128;a.i=[];return!0}g.fb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);yb(this.a,this.J,1);return!0};g.ec=function(){return this.b&65535};g.Rc=function(a){this.b=this.b&-112|a&111};
|
||||
g.dc=function(){this.b&=-129;0<this.i.length&&yb(this.a,this.J,1);return this.D};g.Qc=function(){};g.sc=function(){return this.c};g.ed=function(a){128==(this.c&192)&&a&64&&yb(this.a,this.K,1);this.c=this.c&-70|a&69};g.rc=function(){return 0};
|
||||
g.dd=function(a){if(a&=255){this.A&&this.A.call(this.u,a);if(this.g)if(13==a)this.o=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0<this.o&&this.o--;else{var b;b=(b=ra[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.I||8,c=a-this.o%a,this.I&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.j){if(10==a||1024<=this.j.length)this.P(this.j),
|
||||
this.j="";10!=a&&(this.j+=String.fromCharCode(a))}this.c&=-129;yb(this.a,this.K,1)}};var Ce={},Ae=(Ce[65392]=[null,null,Z.prototype.ec,Z.prototype.Rc,"RCSR"],Ce[65394]=[null,null,Z.prototype.dc,Z.prototype.Qc,"RBUF"],Ce[65396]=[null,null,Z.prototype.sc,Z.prototype.ed,"XCSR"],Ce[65398]=[null,null,Z.prototype.rc,Z.prototype.dd,"XBUF"],Ce);q(function(){for(var a=A(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Z(d);z(d,c)}});
|
||||
function J(a){u.call(this,"PC11",a,J);this.b=a.autoMount||null;this.u=this.c=0;this.h.local=!1;this.g="";this.o=!Aa("Mobi")&&window&&"FileReader"in window}w(J);g=J.prototype;
|
||||
g.V=function(a,b,c){var d=this;switch(b){case "listTapes":return this.s[b]=c,c.onchange=function(){var a=d.s.descTape,b=c.options[c.selectedIndex];if(a&&b){var k={};if(b=b.getAttribute("data-value"))try{k=eval("("+b+")")}catch(l){m("PC11 option error: "+l.message)}b=k.desc;void 0===b&&(b="");k=k.href;void 0!==k&&(b='<a href="'+k+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.s[b]=c,!0;case "loadTape":return this.s[b]=c,c.onclick=function(){var a=d.s.listTapes;a&&De(d,
|
||||
a.options[a.selectedIndex].text,a.value)},!0;case "mountTape":if(this.o)return this.s[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;De(d,ka(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
g.ea=function(a,b,c,d){this.v=a;this.m=b;this.a=c;this.G=d;if((this.b=Tb(this.v,"autoMount")||this.b)&&"string"==typeof this.b)try{this.b=eval("("+this.b+")")}catch(e){m("PC11 auto-mount error: "+e.message+" ("+this.b+")"),this.b=null}tb(b,this,Ee);Fe(this,"None","",!0);this.o&&Fe(this,"Local Tape","?");Fe(this,"Remote Tape","??");Ge(this)||B(this)};g.$=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};g.Z=function(a){return a?this.save():!0};
|
||||
g.reset=function(){this.c&=-2241;this.u=0};function Ge(a){a.i=0;if(a.b){var b=a.b.path,c;if(!(c=a.b.name))a:{if((c=a.s.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=ka(b,!0)}b&&c?He(a,c,b,!0):a.H("Incorrect auto-mount settings for PC11 ("+JSON.stringify(a.b)+")")}return!!a.i}
|
||||
function De(a,b,c,d){if(c)if("?"==c)a.H('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=ka(c)}He(a,b,c,!1,d)}else a.g="",a.h.local=!1}function He(a,b,c,d,e){c&&a.g.toLowerCase()!=c.toLowerCase()&&(a.g="",a.h.local=!1,a.h.Wa?a.H("PC11 busy"):(a.h.Wa=!0,d&&(a.j=!0,a.i++),a.h.local=!!e,Ie(a,b,c,e)))}
|
||||
function Ie(a,b,c,d){var e=c;if(d){var f=new FileReader;f.onload=function(){var a=f.result;a&&new Uint8Array(a,0,a.byteLength)};f.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(d=la(c),e="json"==d||"gz"==d?encodeURI(c):na()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!h(e,null,!0,function(d,e,f){a.h.Wa=!1;var k=0>f&&a.v&&!a.v.h.L;f?a.H('Unable to load tape "'+b+'" (error '+f+": "+d+")",k):(Pa(a.ra,d,e),ua(d,e)&&(a.g=c));a.j&&(a.j=!1,--a.i||B(a));if((d=a.s.listTapes)&&
|
||||
d.options){e=a.h.local?"?":a.g;for(f=0;f<d.options.length;f++)if(d.options[f].value==e){d.selectedIndex!=f&&(d.selectedIndex=f);break}f==d.options.length&&(d.selectedIndex=0)}})}function Fe(a,b,c,d){if((a=a.s.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}g.save=function(){return(new K(this)).data()};g.restore=function(){return!0};
|
||||
g.Yb=function(){return this.c};g.Kc=function(a){a&1&&(this.c&32768?a&=-2:(this.c&=-129,this.c|=2048));this.c=this.c&-66|a&65};g.Xb=function(){return this.u};g.Jc=function(){};var Je={},Ee=(Je[65384]=[null,null,J.prototype.Yb,J.prototype.Kc,"PRS"],Je[65386]=[null,null,J.prototype.Xb,J.prototype.Jc,"PRB"],Je);
|
||||
function Ke(a,b,c){u.call(this,"Computer",a,Ke);this.h.L=!1;Le(this,b);this.B=Tb(this,"autoPower",a);this.g=0;this.N=a.busWidth||a.buswidth;this.b=Me;this.u=null;this.o=this.J=!1;this.O=Tb(this,"url")||"";(Math.random()+.1).toString(36);this.c=Ne(this);if(this.a=Ra("CPU",this.id)){this.G=Ra("Debugger",this.id);this.m=new $a({id:this.ra+".bus",busWidth:this.N},this.a,this.G);var d,e=x(this.id);if((this.i=Ra("Panel",this.id))&&this.i.Xa)for(b=0;b<e.length;b++)d=e[b],d.H=this.i.H,d.P=this.i.P,d.Xa=this.i.Xa;
|
||||
this.P("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.P("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ea&&d.ea(this,this.m,this.a,this.G);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.v=d:this.b=parseInt(d,10));var f;if(a=Tb(this,"state")||(f=!0,a.state))b=this.D=a,f||(this.o=!0,this.b=Me),this.b&&(this.A=new K(this,
|
||||
"1.30.1"),Oe(this.A)?b=null:delete this.A);!b&&this.b&&(b=Pe(this))&&(this.o=!0);if(b){var k=this;h(b,null,!0,function(a,b,c){c?(k.v=null,k.o=!1,k.H("Unable to load machine state from server (error "+c+(b?": "+qa(b):"")+")")):(k.u=b,k.J=!0);B(k)})}else B(this);this.s.power||(this.B=!0);!c&&this.B&&Qe(this,this.Fa)}else m("Unable to find CPU component")}w(Ke);var Me=0;
|
||||
function Le(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){m(d.message+" ("+c+")")}}a.K=b}function Tb(a,b,c){var d=b.toLowerCase(),d=Ja[b]||Ja[d];void 0===d&&a.K&&(d=a.K[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Qe(a,b,c){for(var d=x(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Sa(f)){Sa(f,function(){Qe(a,b,c)});return}}b.call(a,c)}
|
||||
function Re(a,b){var c=new K(a,"1.30.1","validate");if(Oe(c)&&Se(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.H("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}g=Ke.prototype;
|
||||
g.Fa=function(a){void 0===a&&(a=this.b||(this.u?1:Me));if(!this.g){this.g++;var b=!1,c=!1;this.I=!1;var d=this.A||new K(this,"1.30.1");if(-1==a)b=!0;else if(a>Me){if(Oe(d,this.u)){this.j=new K(this,"1.30.1","failsafe");Oe(this.j)&&(Te(this,d),a=2,Ue(this.j));this.j.set("timestamp",ta());Ve(this.j);var e=this.b&&!this.o;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Se(d)){var f=d.get("code"),k=d.get("data");f&&("ok"==f?Oe(d,k):("error"==
|
||||
f&&"no machine state"!=k?(this.H("Error: "+k),"unable to verify user"==k&&(za("user",""),this.c=null)):this.P(f+": "+k),Ue(d),Oe(d)?(c=Se(d),e=!0):c=!1))}e&&Re(this,c?d:null)}else 2==a&&d.clear()}else Re(this);delete this.u;delete this.A}e=x(this.id);for(f=0;f<e.length;f++)k=e[f],k!==this&&k!=this.a&&(c=We(this,k,d,b,c));b=[d,a,c];-1!=a?Qe(this,this.lb,b):this.lb(b)}};
|
||||
function We(a,b,c,d,e){if(!b.h.L){b.h.L=!0;if(b.$){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.$(f,d)&&f&&(m("Unable to restore state for "+b.type),a.D&&!a.J?(c.clear(),a.b=Me,window&&window.location.reload()):a.I=!0,b.$(null),e=!1)}if(!d&&b.pb)for(a=b.pb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
g.lb=function(a){var b=a[0],c=0>a[1];a=a[2];this.S=!0;this.h.L=!0;var d=this.s.power;d&&(d.textContent="Shutdown");this.a&&(We(this,this.a,b,c,a),this.a.Da());this.I&&(Te(this,b),b.clear());!c&&this.j&&(this.j.clear(),delete this.j);this.g=0};
|
||||
function Te(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.O;d.user=c;d.type="bug";d.data=b;h("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function Xe(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new K(a,"1.30.1"),k=new K(a,"1.30.1","validate"),l=ta();k.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.Z&&(c&&Xa(a.a),d=a.a.Z(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.h.L=!1,!1===d&&(e=null)));for(var l=x(a.id),n=0;n<l.length;n++){var r=l[n];r.h.L&&(r.Z&&(d=r.Z(b,c),"object"===typeof d&&f.set(r.id,
|
||||
d)),c&&(r.h.L=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.c&&Ye(a,a.c,f.toString()),Ve(k)&&Ve(f)||(e=null,d=l=!0)):a.b&&(d=!0,l=3==a.b),d&&f.clear(l)):e=f.toString());c&&(a.h.L=!1,b=a.s.power)&&(b.textContent="Power");a.g=0;return e}g.reset=function(){this.m&&this.m.reset&&this.m.reset();for(var a=x(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.m&&c.reset&&c.reset()}};g.start=function(a,b){for(var c=x(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.fa(!0)};
|
||||
g.stop=function(a,b){for(var c=x(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.fa(!0)};
|
||||
g.V=function(a,b,c){var d=this;switch(b){case "power":return this.v[b]=c,c.onclick=function(){d.g||(d.i.M?Se(d,!1,!0):Le(d,d.Ea))},!0;case "reset":return this.v[b]=c,c.onclick=function(){if(d.i.M&&!d.g)if(d.b&&!d.w){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Se(d,a,!0);!a&&d.D?window&&window.location.reload():d.Ea(He)}else d.reset(),d.a&&d.a.Ca()},!0;case "save":if(ma())c.parentNode.removeChild(c);else return this.v[b]=
|
||||
c,c.onclick=function(){var a=Ie(d,!0);if(a){var b=!!(d.b&&!d.w||d.D),c=Se(d,b);b?Te(d,a,c):d.L("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Ie(a,b){var c=a.c;c||((c=ya("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Ue(a,c))||a.L("The user ID is invalid.")):b&&a.L("Browser local storage is not available"));return c}
|
||||
function Ue(a,b){a.c=null;b=h(na()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(za("user",b.data),a.c=b.data)}catch(d){m(d.message+" ("+c+")")}return a.c}function Ke(a){var b=null;a.c&&(b=na()+"/api/v1/user?req=load&user="+a.c+"&state="+Ve(a,"1.30.1"));return b}
|
||||
function Te(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Ve(a,"1.30.1");d.data=c;b=h(na()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.L("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.L(c),za("user",""),a.c=null)}}
|
||||
g.fa=function(a){this.a&&this.a.fa(a);this.h&&this.h.fa(a)};q(function(){for(var a=A(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=y(c),c=A(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],k=y(f),k=new Fe(k,d,!0);z(k,f);k.B&&Le(k,k.Ea)}});p.show.push(function(){for(var a=A(document,"pdp11","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Ra("Computer",c.id))&&c.S&&!c.i.M&&c.Ea(-1)}});
|
||||
p.exit.push(function(){for(var a=A(document,"pdp11","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Ra("Computer",c.id))&&c.i.M&&Se(c,!(!c.b||c.w),!0)}});function K(a,b,c){this.id=a.id;this.key=Ve(a,b,c);this.G=a.G;Pe(this,a.Gb)}function Ve(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
K.prototype={constructor:K,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Pe(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
||||
1);c=0}}};function Pe(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function Qe(a){var b=!0;if(xa()){var c=JSON.stringify(a[a.id]);za(a.key,c)||(m("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Ne(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){m(c.message||c),b=!1}return b}function Je(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:xa()&&(b=ya(a.key))?(a[a.id]=b,a.a=!0):!1}var We=0;
|
||||
function Xe(a,b,c,d,e,f){e("Loading "+a+"...");h(a,null,!0,function(k,l,n){n?(l||(l="unable to load "+a+" ("+n+")"),f(l,null)):Ye(l,a,b,c,d,e,f)})}
|
||||
function Ye(a,b,c,d,e,f,k){function l(a,f){if(f)k(f,null);else{c&&(Pa(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);k(a,f)}}a?e?Ze(a,f,l):l(a,null):k("no data"+(b?" for file: "+b:""),null)}
|
||||
function Ze(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");h(e,null,!0,function(f,k,l){if(l||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],r,t=/( [a-z]+=)(['"])(.*?)\2/g;r=t.exec(f);)n=0>n.indexOf(r[1])?n.replace(">",r[0]+">"):n.replace(new RegExp(r[1]+"(['\"])(.*?)\\1"),r[0]);l[0]!=n&&(k=k.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],k);Ze(a,b,c)}})}else c(a,null)}
|
||||
function $e(a,b,c,d){function e(a){if(void 0===l){var b=k&&A(k,"machine-warning");l=b&&b[0]||k}l&&(l.innerHTML=pa(a))}function f(a){e("Error: "+a);n&&(--We||Ga(!0));n=!1}var k,l,n=!0;We++;Oa[a]={};try{if(k=document.getElementById(a)){var r;if("object"==typeof resources&&(r=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],C=document.createElement("style");C.type="text/css";C.styleSheet?C.styleSheet.cssText=r:C.appendChild(document.createTextNode(r));t.appendChild(C)}c||
|
||||
(c="/versions/pdpjs/1.30.1/components.xsl");r=function(d,l){l?Xe(c,null,null,!1,e,function(d,n){n?(Pa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(k.outerHTML=n,--We||Ga(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?k.parentNode?(k.parentNode.replaceChild(n,k),--We||Ga(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Xe(b,a,d,!0,e,r):Ye(b,null,a,d,!1,e,r)}else f("missing machine element: "+a)}catch(Pd){f(Pd.message)}return n}window.embedPDP11=function(a,b,c,d){Ga(!1);return $e(a,b,c,d)};window.enableEvents=Ga;window.sendEvent=Ha;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11.map
|
||||
g.V=function(a,b,c){var d=this;switch(b){case "power":return this.s[b]=c,c.onclick=function(){d.g||(d.h.L?Xe(d,!1,!0):Qe(d,d.Fa))},!0;case "reset":return this.s[b]=c,c.onclick=function(){if(d.h.L&&!d.g)if(d.b&&!d.v){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Xe(d,a,!0);!a&&d.D?window&&window.location.reload():d.Fa(Me)}else d.reset(),d.a&&d.a.Da()},!0;case "save":if(ma())c.parentNode.removeChild(c);else return this.s[b]=
|
||||
c,c.onclick=function(){var a=Ne(d,!0);if(a){var b=!!(d.b&&!d.v||d.D),c=Xe(d,b);b?Ye(d,a,c):d.H("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Ne(a,b){var c=a.c;c||((c=ya("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Ze(a,c))||a.H("The user ID is invalid.")):b&&a.H("Browser local storage is not available"));return c}
|
||||
function Ze(a,b){a.c=null;b=h(na()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(za("user",b.data),a.c=b.data)}catch(d){m(d.message+" ("+c+")")}return a.c}function Pe(a){var b=null;a.c&&(b=na()+"/api/v1/user?req=load&user="+a.c+"&state="+$e(a,"1.30.1"));return b}
|
||||
function Ye(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=$e(a,"1.30.1");d.data=c;b=h(na()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.H("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.H(c),za("user",""),a.c=null)}}
|
||||
g.fa=function(a){this.a&&this.a.fa(a);this.i&&this.i.fa(a)};q(function(){for(var a=A(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=y(c),c=A(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],k=y(f),k=new Ke(k,d,!0);z(k,f);k.B&&Qe(k,k.Fa)}});p.show.push(function(){for(var a=A(document,"pdp11","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Ra("Computer",c.id))&&c.S&&!c.h.L&&c.Fa(-1)}});
|
||||
p.exit.push(function(){for(var a=A(document,"pdp11","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Ra("Computer",c.id))&&c.h.L&&Xe(c,!(!c.b||c.v),!0)}});function K(a,b,c){this.id=a.id;this.key=$e(a,b,c);this.G=a.G;Ue(this,a.Hb)}function $e(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
K.prototype={constructor:K,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Ue(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
||||
1);c=0}}};function Ue(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function Ve(a){var b=!0;if(xa()){var c=JSON.stringify(a[a.id]);za(a.key,c)||(m("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Se(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){m(c.message||c),b=!1}return b}function Oe(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:xa()&&(b=ya(a.key))?(a[a.id]=b,a.a=!0):!1}var af=0;
|
||||
function bf(a,b,c,d,e,f){e("Loading "+a+"...");h(a,null,!0,function(k,l,n){n?(l||(l="unable to load "+a+" ("+n+")"),f(l,null)):cf(l,a,b,c,d,e,f)})}
|
||||
function cf(a,b,c,d,e,f,k){function l(a,f){if(f)k(f,null);else{c&&(Pa(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);k(a,f)}}a?e?df(a,f,l):l(a,null):k("no data"+(b?" for file: "+b:""),null)}
|
||||
function df(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");h(e,null,!0,function(f,k,l){if(l||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],r,t=/( [a-z]+=)(['"])(.*?)\2/g;r=t.exec(f);)n=0>n.indexOf(r[1])?n.replace(">",r[0]+">"):n.replace(new RegExp(r[1]+"(['\"])(.*?)\\1"),r[0]);l[0]!=n&&(k=k.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],k);df(a,b,c)}})}else c(a,null)}
|
||||
function ef(a,b,c,d){function e(a){if(void 0===l){var b=k&&A(k,"machine-warning");l=b&&b[0]||k}l&&(l.innerHTML=pa(a))}function f(a){e("Error: "+a);n&&(--af||Ga(!0));n=!1}var k,l,n=!0;af++;Oa[a]={};try{if(k=document.getElementById(a)){var r;if("object"==typeof resources&&(r=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],D=document.createElement("style");D.type="text/css";D.styleSheet?D.styleSheet.cssText=r:D.appendChild(document.createTextNode(r));t.appendChild(D)}c||
|
||||
(c="/versions/pdpjs/1.30.1/components.xsl");r=function(d,l){l?bf(c,null,null,!1,e,function(d,n){n?(Pa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(k.outerHTML=n,--af||Ga(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?k.parentNode?(k.parentNode.replaceChild(n,k),--af||Ga(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?bf(b,a,d,!0,e,r):cf(b,null,a,d,!1,e,r)}else f("missing machine element: "+a)}catch(Sd){f(Sd.message)}return n}window.embedPDP11=function(a,b,c,d){Ga(!1);return ef(a,b,c,d)};window.enableEvents=Ga;window.sendEvent=Ha;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11.map
|
||||
|
|
|
|||
Loading…
Reference in a new issue