Converted PC8080 to ES6
This commit is contained in:
parent
d930b31c53
commit
0f680839f7
27 changed files with 11054 additions and 10896 deletions
16
Gruntfile.js
16
Gruntfile.js
|
|
@ -201,8 +201,8 @@ module.exports = function(grunt) {
|
||||||
return "/**\n * @copyright " + filepath.replace(/^\./, "http://pcjs.org") + " (C) Jeff Parsons 2012-2016\n */\n\n" +
|
return "/**\n * @copyright " + filepath.replace(/^\./, "http://pcjs.org") + " (C) Jeff Parsons 2012-2016\n */\n\n" +
|
||||||
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?/g, '')
|
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?/g, '')
|
||||||
.replace(/^(import|export)[ \t]+[^\n]*\n/gm, '')
|
.replace(/^(import|export)[ \t]+[^\n]*\n/gm, '')
|
||||||
.replace(/^[ \t]*var\s+\S+\s+=\s+require\((['"]).*?\1\);/gm, '')
|
.replace(/^[ \t]*var\s+\S+\s*=\s*require\((['"]).*?\1\);/gm, '')
|
||||||
.replace(/^[ \t]*(if\s+\(NODE\)\s*|)module\.exports\s+=\s+\S+;/gm, '')
|
.replace(/^[ \t]*(if\s+\(NODE\)\s*|)module\.exports\s*=\s*\S+;/gm, '')
|
||||||
.replace(/\/\*\*\s*\*\s*@fileoverview[\s\S]*?\*\/\s*/g, '')
|
.replace(/\/\*\*\s*\*\s*@fileoverview[\s\S]*?\*\/\s*/g, '')
|
||||||
.replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
.replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
||||||
.replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
.replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
||||||
|
|
@ -219,8 +219,8 @@ module.exports = function(grunt) {
|
||||||
return "/**\n * @copyright " + filepath.replace(/^\./, "http://pcjs.org") + " (C) Jeff Parsons 2012-2016\n */\n\n" +
|
return "/**\n * @copyright " + filepath.replace(/^\./, "http://pcjs.org") + " (C) Jeff Parsons 2012-2016\n */\n\n" +
|
||||||
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?/g, '')
|
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?/g, '')
|
||||||
.replace(/^(import|export)[ \t]+[^\n]*\n/gm, '')
|
.replace(/^(import|export)[ \t]+[^\n]*\n/gm, '')
|
||||||
.replace(/^[ \t]*var\s+\S+\s+=\s+require\((['"]).*?\1\);/gm, '')
|
.replace(/^[ \t]*var\s+\S+\s*=\s*require\((['"]).*?\1\);/gm, '')
|
||||||
.replace(/^[ \t]*(if\s+\(NODE\)\s*|)module\.exports\s+=\s+\S+;/gm, '')
|
.replace(/^[ \t]*(if\s+\(NODE\)\s*|)module\.exports\s*=\s*\S+;/gm, '')
|
||||||
.replace(/\/\*\*\s*\*\s*@fileoverview[\s\S]*?\*\/\s*/g, '')
|
.replace(/\/\*\*\s*\*\s*@fileoverview[\s\S]*?\*\/\s*/g, '')
|
||||||
.replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
.replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
||||||
.replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
.replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
||||||
|
|
@ -237,8 +237,8 @@ module.exports = function(grunt) {
|
||||||
return "/**\n * @copyright " + filepath.replace(/^\./, "http://pcjs.org") + " (C) Jeff Parsons 2012-2016\n */\n\n" +
|
return "/**\n * @copyright " + filepath.replace(/^\./, "http://pcjs.org") + " (C) Jeff Parsons 2012-2016\n */\n\n" +
|
||||||
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?/g, '')
|
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?/g, '')
|
||||||
.replace(/^(import|export)[ \t]+[^\n]*\n/gm, '')
|
.replace(/^(import|export)[ \t]+[^\n]*\n/gm, '')
|
||||||
.replace(/^[ \t]*var\s+\S+\s+=\s+require\((['"]).*?\1\);/gm, '')
|
.replace(/^[ \t]*var\s+\S+\s*=\s*require\((['"]).*?\1\);/gm, '')
|
||||||
.replace(/^[ \t]*(if\s+\(NODE\)\s*|)module\.exports\s+=\s+\S+;/gm, '')
|
.replace(/^[ \t]*(if\s+\(NODE\)\s*|)module\.exports\s*=\s*\S+;/gm, '')
|
||||||
.replace(/\/\*\*\s*\*\s*@fileoverview[\s\S]*?\*\/\s*/g, '')
|
.replace(/\/\*\*\s*\*\s*@fileoverview[\s\S]*?\*\/\s*/g, '')
|
||||||
.replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
.replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
||||||
.replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
.replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
||||||
|
|
@ -255,8 +255,8 @@ module.exports = function(grunt) {
|
||||||
return "/**\n * @copyright " + filepath.replace(/^\./, "http://pcjs.org") + " (C) Jeff Parsons 2012-2016\n */\n\n" +
|
return "/**\n * @copyright " + filepath.replace(/^\./, "http://pcjs.org") + " (C) Jeff Parsons 2012-2016\n */\n\n" +
|
||||||
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?/g, '')
|
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?/g, '')
|
||||||
.replace(/^(import|export)[ \t]+[^\n]*\n/gm, '')
|
.replace(/^(import|export)[ \t]+[^\n]*\n/gm, '')
|
||||||
.replace(/^[ \t]*var\s+\S+\s+=\s+require\((['"]).*?\1\);/gm, '')
|
.replace(/^[ \t]*var\s+\S+\s*=\s*require\((['"]).*?\1\);/gm, '')
|
||||||
.replace(/^[ \t]*(if\s+\(NODE\)\s*|)module\.exports\s+=\s+\S+;/gm, '')
|
.replace(/^[ \t]*(if\s+\(NODE\)\s*|)module\.exports\s*=\s*\S+;/gm, '')
|
||||||
.replace(/\/\*\*\s*\*\s*@fileoverview[\s\S]*?\*\/\s*/g, '')
|
.replace(/\/\*\*\s*\*\s*@fileoverview[\s\S]*?\*\/\s*/g, '')
|
||||||
.replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
.replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
||||||
.replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
.replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,8 @@ gulp.task('mktmp', function() {
|
||||||
.pipe(header('/**\n * @copyright ' + file.path.replace(/.*\/(modules\/.*)/, "http://pcjs.org/$1") + ' (C) Jeff Parsons 2012-2016\n */\n\n'))
|
.pipe(header('/**\n * @copyright ' + file.path.replace(/.*\/(modules\/.*)/, "http://pcjs.org/$1") + ' (C) Jeff Parsons 2012-2016\n */\n\n'))
|
||||||
.pipe(replace(/(^|\n)[ \t]*(['"])use strict\2;?/g, ""))
|
.pipe(replace(/(^|\n)[ \t]*(['"])use strict\2;?/g, ""))
|
||||||
.pipe(replace(/^(import|export)[ \t]+[^\n]*\n/gm, ""))
|
.pipe(replace(/^(import|export)[ \t]+[^\n]*\n/gm, ""))
|
||||||
.pipe(replace(/^[ \t]*var\s+\S+\s+=\s+require\((['"]).*?\1\);/gm, ""))
|
.pipe(replace(/^[ \t]*var\s+\S+\s*=\s*require\((['"]).*?\1\);/gm, ""))
|
||||||
.pipe(replace(/^[ \t]*(if\s+\(NODE\)\s*|)module\.exports\s+=\s+\S+;/gm, ""))
|
.pipe(replace(/^[ \t]*(if\s+\(NODE\)\s*|)module\.exports\s*=\s*\S+;/gm, ""))
|
||||||
.pipe(replace(/\/\*\*\s*\*\s*@fileoverview[\s\S]*?\*\/\s*/g, ""))
|
.pipe(replace(/\/\*\*\s*\*\s*@fileoverview[\s\S]*?\*\/\s*/g, ""))
|
||||||
.pipe(replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, ""))
|
.pipe(replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, ""))
|
||||||
.pipe(replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, ""))
|
.pipe(replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, ""))
|
||||||
|
|
|
||||||
|
|
@ -514,8 +514,8 @@ HTMLOut.filter = function(req, res, next)
|
||||||
} else {
|
} else {
|
||||||
sData = sData.replace(/^([ \t]*import\s+\S+\s+from\s+(['"]).*?\1;)/gm, "// $1");
|
sData = sData.replace(/^([ \t]*import\s+\S+\s+from\s+(['"]).*?\1;)/gm, "// $1");
|
||||||
sData = sData.replace(/^([ \t]*export\s+default\s+\S+;)/gm, "// $1");
|
sData = sData.replace(/^([ \t]*export\s+default\s+\S+;)/gm, "// $1");
|
||||||
sData = sData.replace(/^([ \t]*var\s+\S+\s+=\s+require\((['"]).*?\1\);)/gm, "// $1");
|
sData = sData.replace(/^([ \t]*var\s+\S+\s*=\s*require\((['"]).*?\1\);)/gm, "// $1");
|
||||||
sData = sData.replace(/^([ \t]*(if\s+\(NODE\)\s*|)module\.exports\s+=\s+\S+;)/gm, "// $1");
|
sData = sData.replace(/^([ \t]*(if\s+\(NODE\)\s*|)module\.exports\s*=\s*\S+;)/gm, "// $1");
|
||||||
res.set("Content-Type", "application/javascript");
|
res.set("Content-Type", "application/javascript");
|
||||||
res.status(200).send(sData);
|
res.status(200).send(sData);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -124,4 +124,4 @@ CPUDef8080.PS.RESULT = (CPUDef8080.PS.CF | CPUDef8080.PS.PF | CPUDef8080.PS
|
||||||
*/
|
*/
|
||||||
CPUDef8080.PS.SET = (CPUDef8080.PS.BIT1);
|
CPUDef8080.PS.SET = (CPUDef8080.PS.BIT1);
|
||||||
|
|
||||||
if (NODE) module.exports = CPUDef8080;
|
module.exports = CPUDef8080;
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,8 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if (NODE) {
|
var CPUDef8080 = require("./CPUDef");
|
||||||
var str = require("../../shared/lib/strlib");
|
var Messages8080 = require("./messages");
|
||||||
var CPUDef8080 = require("./CPUDef");
|
|
||||||
var Messages8080= require("./messages");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* op=0x00 (NOP)
|
* op=0x00 (NOP)
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -98,6 +98,5 @@ if (NODE) {
|
||||||
global.BYTEARRAYS = BYTEARRAYS;
|
global.BYTEARRAYS = BYTEARRAYS;
|
||||||
global.TYPEDARRAYS = TYPEDARRAYS;
|
global.TYPEDARRAYS = TYPEDARRAYS;
|
||||||
global.PC8080 = PC8080;
|
global.PC8080 = PC8080;
|
||||||
|
module.exports = PC8080;
|
||||||
module.exports = PC8080;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -91,4 +91,4 @@ Messages8080.CATEGORIES = {
|
||||||
"halt": Messages8080.HALT
|
"halt": Messages8080.HALT
|
||||||
};
|
};
|
||||||
|
|
||||||
if (NODE) module.exports = Messages8080;
|
module.exports = Messages8080;
|
||||||
|
|
|
||||||
|
|
@ -28,155 +28,157 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if (NODE) {
|
var Web = require("../../shared/es6/weblib");
|
||||||
var str = require("../../shared/lib/strlib");
|
var Component = require("../../shared/es6/component");
|
||||||
var usr = require("../../shared/lib/usrlib");
|
var PC8080 = require("./defines");
|
||||||
var web = require("../../shared/lib/weblib");
|
var Bus8080 = require("./bus");
|
||||||
var Component = require("../../shared/lib/component");
|
var CPUDef8080 = require("./cpudef");
|
||||||
var PC8080 = require("./defines");
|
var Memory8080 = require("./memory");
|
||||||
var Bus8080 = require("./bus");
|
|
||||||
var CPUDef8080 = require("./cpudef");
|
|
||||||
var Memory8080 = require("./memory");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Panel8080(parmsPanel)
|
* TODO: The Closure Compiler treats ES6 classes as 'struct' rather than 'dict' by default,
|
||||||
|
* which would force us to declare all class properties in the constructor, as well as prevent
|
||||||
|
* us from defining any named properties. So, for now, we mark all our classes as 'unrestricted'.
|
||||||
*
|
*
|
||||||
* The Panel8080 component has no required (parmsPanel) properties.
|
* @unrestricted
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
* @extends Component
|
|
||||||
* @param {Object} parmsPanel
|
|
||||||
*/
|
*/
|
||||||
function Panel8080(parmsPanel)
|
class Panel8080 extends Component {
|
||||||
{
|
/**
|
||||||
Component.call(this, "Panel", parmsPanel, Panel8080);
|
* Panel8080(parmsPanel)
|
||||||
}
|
*
|
||||||
|
* The Panel8080 component has no required (parmsPanel) properties.
|
||||||
Component.subclass(Panel8080);
|
*
|
||||||
|
* @this {Panel8080}
|
||||||
/**
|
* @param {Object} parmsPanel
|
||||||
* setBinding(sHTMLType, sBinding, control, sValue)
|
*/
|
||||||
*
|
constructor(parmsPanel)
|
||||||
* Most panel layouts don't have bindings of their own, so we pass along all binding requests to the
|
{
|
||||||
* Computer, CPU, Keyboard and Debugger components first. The order shouldn't matter, since any component
|
super("Panel", parmsPanel, Panel8080);
|
||||||
* that doesn't recognize the specified binding should simply ignore it.
|
|
||||||
*
|
|
||||||
* @this {Panel8080}
|
|
||||||
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas")
|
|
||||||
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "reset")
|
|
||||||
* @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
|
|
||||||
*/
|
|
||||||
Panel8080.prototype.setBinding = function(sHTMLType, sBinding, control, sValue)
|
|
||||||
{
|
|
||||||
if (this.cmp && this.cmp.setBinding(sHTMLType, sBinding, control, sValue)) return true;
|
|
||||||
if (this.cpu && this.cpu.setBinding(sHTMLType, sBinding, control, sValue)) return true;
|
|
||||||
if (this.kbd && this.kbd.setBinding(sHTMLType, sBinding, control, sValue)) return true;
|
|
||||||
if (DEBUGGER && this.dbg && this.dbg.setBinding(sHTMLType, sBinding, control, sValue)) return true;
|
|
||||||
return this.parent.setBinding.call(this, sHTMLType, sBinding, control, sValue);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* initBus(cmp, bus, cpu, dbg)
|
|
||||||
*
|
|
||||||
* @this {Panel8080}
|
|
||||||
* @param {Computer8080} cmp
|
|
||||||
* @param {Bus8080} bus
|
|
||||||
* @param {CPUState8080} cpu
|
|
||||||
* @param {Debugger8080} dbg
|
|
||||||
*/
|
|
||||||
Panel8080.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|
||||||
{
|
|
||||||
this.cmp = cmp;
|
|
||||||
this.bus = bus;
|
|
||||||
this.cpu = cpu;
|
|
||||||
this.dbg = dbg;
|
|
||||||
this.kbd = /** @type {Keyboard8080} */ (cmp.getMachineComponent("Keyboard"));
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* powerUp(data, fRepower)
|
|
||||||
*
|
|
||||||
* @this {Panel8080}
|
|
||||||
* @param {Object|null} data
|
|
||||||
* @param {boolean} [fRepower]
|
|
||||||
* @return {boolean} true if successful, false if failure
|
|
||||||
*/
|
|
||||||
Panel8080.prototype.powerUp = function(data, fRepower)
|
|
||||||
{
|
|
||||||
if (!fRepower) Panel8080.init();
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* powerDown(fSave, fShutdown)
|
|
||||||
*
|
|
||||||
* @this {Panel8080}
|
|
||||||
* @param {boolean} [fSave]
|
|
||||||
* @param {boolean} [fShutdown]
|
|
||||||
* @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure
|
|
||||||
*/
|
|
||||||
Panel8080.prototype.powerDown = function(fSave, fShutdown)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* updateStatus(fForce)
|
|
||||||
*
|
|
||||||
* Update function for Panels containing elements with high-frequency display requirements.
|
|
||||||
*
|
|
||||||
* For older (and slower) DOM-based display elements, those are sill being managed by the CPUState component,
|
|
||||||
* so it has its own updateStatus() handler.
|
|
||||||
*
|
|
||||||
* The Computer's updateStatus() handler is currently responsible for calling both our handler and the CPU's handler.
|
|
||||||
*
|
|
||||||
* @this {Panel8080}
|
|
||||||
* @param {boolean} [fForce] (true will display registers even if the CPU is running and "live" registers are not enabled)
|
|
||||||
*/
|
|
||||||
Panel8080.prototype.updateStatus = function(fForce)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Panel8080.init()
|
|
||||||
*
|
|
||||||
* This function operates on every HTML element of class "panel", extracting the
|
|
||||||
* JSON-encoded parameters for the Panel8080 constructor from the element's "data-value"
|
|
||||||
* attribute, invoking the constructor to create a Panel8080 component, and then binding
|
|
||||||
* any associated HTML controls to the new component.
|
|
||||||
*
|
|
||||||
* NOTE: Unlike most other component init() functions, this one is designed to be
|
|
||||||
* called multiple times: once at load time, so that we can bind our print()
|
|
||||||
* function to the panel's output control ASAP, and again when the Computer component
|
|
||||||
* is verifying that all components are ready and invoking their powerUp() functions.
|
|
||||||
*
|
|
||||||
* Our powerUp() method gives us a second opportunity to notify any components that
|
|
||||||
* that might care (eg, CPU, Keyboard, and Debugger) that we have some controls they
|
|
||||||
* might want to use.
|
|
||||||
*/
|
|
||||||
Panel8080.init = function()
|
|
||||||
{
|
|
||||||
var fReady = false;
|
|
||||||
var aePanels = Component.getElementsByClass(document, PC8080.APPCLASS, "panel");
|
|
||||||
for (var iPanel=0; iPanel < aePanels.length; iPanel++) {
|
|
||||||
var ePanel = aePanels[iPanel];
|
|
||||||
var parmsPanel = Component.getComponentParms(ePanel);
|
|
||||||
var panel = Component.getComponentByID(parmsPanel['id']);
|
|
||||||
if (!panel) {
|
|
||||||
fReady = true;
|
|
||||||
panel = new Panel8080(parmsPanel);
|
|
||||||
}
|
|
||||||
Component.bindComponentControls(panel, ePanel, PC8080.APPCLASS);
|
|
||||||
if (fReady) panel.setReady();
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
/**
|
||||||
|
* setBinding(sHTMLType, sBinding, control, sValue)
|
||||||
|
*
|
||||||
|
* Most panel layouts don't have bindings of their own, so we pass along all binding requests to the
|
||||||
|
* Computer, CPU, Keyboard and Debugger components first. The order shouldn't matter, since any component
|
||||||
|
* that doesn't recognize the specified binding should simply ignore it.
|
||||||
|
*
|
||||||
|
* @this {Panel8080}
|
||||||
|
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas")
|
||||||
|
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "reset")
|
||||||
|
* @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||||
|
* @param {string} [sValue] optional data value
|
||||||
|
* @return {boolean} true if binding was successful, false if unrecognized binding request
|
||||||
|
*/
|
||||||
|
setBinding(sHTMLType, sBinding, control, sValue)
|
||||||
|
{
|
||||||
|
if (this.cmp && this.cmp.setBinding(sHTMLType, sBinding, control, sValue)) return true;
|
||||||
|
if (this.cpu && this.cpu.setBinding(sHTMLType, sBinding, control, sValue)) return true;
|
||||||
|
if (this.kbd && this.kbd.setBinding(sHTMLType, sBinding, control, sValue)) return true;
|
||||||
|
if (DEBUGGER && this.dbg && this.dbg.setBinding(sHTMLType, sBinding, control, sValue)) return true;
|
||||||
|
return super.setBinding(sHTMLType, sBinding, control, sValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* initBus(cmp, bus, cpu, dbg)
|
||||||
|
*
|
||||||
|
* @this {Panel8080}
|
||||||
|
* @param {Computer8080} cmp
|
||||||
|
* @param {Bus8080} bus
|
||||||
|
* @param {CPUState8080} cpu
|
||||||
|
* @param {Debugger8080} dbg
|
||||||
|
*/
|
||||||
|
initBus(cmp, bus, cpu, dbg)
|
||||||
|
{
|
||||||
|
this.cmp = cmp;
|
||||||
|
this.bus = bus;
|
||||||
|
this.cpu = cpu;
|
||||||
|
this.dbg = dbg;
|
||||||
|
this.kbd = /** @type {Keyboard8080} */ (cmp.getMachineComponent("Keyboard"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* powerUp(data, fRepower)
|
||||||
|
*
|
||||||
|
* @this {Panel8080}
|
||||||
|
* @param {Object|null} data
|
||||||
|
* @param {boolean} [fRepower]
|
||||||
|
* @return {boolean} true if successful, false if failure
|
||||||
|
*/
|
||||||
|
powerUp(data, fRepower)
|
||||||
|
{
|
||||||
|
if (!fRepower) Panel8080.init();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* powerDown(fSave, fShutdown)
|
||||||
|
*
|
||||||
|
* @this {Panel8080}
|
||||||
|
* @param {boolean} [fSave]
|
||||||
|
* @param {boolean} [fShutdown]
|
||||||
|
* @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure
|
||||||
|
*/
|
||||||
|
powerDown(fSave, fShutdown)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* updateStatus(fForce)
|
||||||
|
*
|
||||||
|
* Update function for Panels containing elements with high-frequency display requirements.
|
||||||
|
*
|
||||||
|
* For older (and slower) DOM-based display elements, those are sill being managed by the CPUState component,
|
||||||
|
* so it has its own updateStatus() handler.
|
||||||
|
*
|
||||||
|
* The Computer's updateStatus() handler is currently responsible for calling both our handler and the CPU's handler.
|
||||||
|
*
|
||||||
|
* @this {Panel8080}
|
||||||
|
* @param {boolean} [fForce] (true will display registers even if the CPU is running and "live" registers are not enabled)
|
||||||
|
*/
|
||||||
|
updateStatus(fForce)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Panel8080.init()
|
||||||
|
*
|
||||||
|
* This function operates on every HTML element of class "panel", extracting the
|
||||||
|
* JSON-encoded parameters for the Panel8080 constructor from the element's "data-value"
|
||||||
|
* attribute, invoking the constructor to create a Panel8080 component, and then binding
|
||||||
|
* any associated HTML controls to the new component.
|
||||||
|
*
|
||||||
|
* NOTE: Unlike most other component init() functions, this one is designed to be
|
||||||
|
* called multiple times: once at load time, so that we can bind our print()
|
||||||
|
* function to the panel's output control ASAP, and again when the Computer component
|
||||||
|
* is verifying that all components are ready and invoking their powerUp() functions.
|
||||||
|
*
|
||||||
|
* Our powerUp() method gives us a second opportunity to notify any components that
|
||||||
|
* that might care (eg, CPU, Keyboard, and Debugger) that we have some controls they
|
||||||
|
* might want to use.
|
||||||
|
*/
|
||||||
|
static init()
|
||||||
|
{
|
||||||
|
var fReady = false;
|
||||||
|
var aePanels = Component.getElementsByClass(document, PC8080.APPCLASS, "panel");
|
||||||
|
for (var iPanel=0; iPanel < aePanels.length; iPanel++) {
|
||||||
|
var ePanel = aePanels[iPanel];
|
||||||
|
var parmsPanel = Component.getComponentParms(ePanel);
|
||||||
|
var panel = Component.getComponentByID(parmsPanel['id']);
|
||||||
|
if (!panel) {
|
||||||
|
fReady = true;
|
||||||
|
panel = new Panel8080(parmsPanel);
|
||||||
|
}
|
||||||
|
Component.bindComponentControls(panel, ePanel, PC8080.APPCLASS);
|
||||||
|
if (fReady) panel.setReady();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize every Panel module on the page.
|
* Initialize every Panel module on the page.
|
||||||
*/
|
*/
|
||||||
web.onInit(Panel8080.init);
|
Web.onInit(Panel8080.init);
|
||||||
|
|
||||||
if (NODE) module.exports = Panel8080;
|
module.exports = Panel8080;
|
||||||
|
|
|
||||||
|
|
@ -28,74 +28,344 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if (NODE) {
|
var Str = require("../../shared/es6/strlib");
|
||||||
var str = require("../../shared/lib/strlib");
|
var Web = require("../../shared/es6/weblib");
|
||||||
var web = require("../../shared/lib/weblib");
|
var DumpAPI = require("../../shared/es6/dumpapi");
|
||||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
var Component = require("../../shared/es6/component");
|
||||||
var Component = require("../../shared/lib/component");
|
var State = require("../../shared/es6/state");
|
||||||
var State = require("../../shared/lib/state");
|
var PC8080 = require("./defines");
|
||||||
var PC8080 = require("./defines");
|
var CPUDef8080 = require("./cpudef");
|
||||||
var CPUDef8080 = require("./cpudef");
|
var Memory8080 = require("./memory");
|
||||||
var Memory8080 = require("./memory");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RAM8080(parmsRAM)
|
* TODO: The Closure Compiler treats ES6 classes as 'struct' rather than 'dict' by default,
|
||||||
|
* which would force us to declare all class properties in the constructor, as well as prevent
|
||||||
|
* us from defining any named properties. So, for now, we mark all our classes as 'unrestricted'.
|
||||||
*
|
*
|
||||||
* The RAM8080 component expects the following (parmsRAM) properties:
|
* @unrestricted
|
||||||
*
|
|
||||||
* addr: starting physical address of RAM (default is 0)
|
|
||||||
* size: amount of RAM, in bytes (default is 0, which means defer to motherboard switch settings)
|
|
||||||
* file: name of optional data file to load into RAM (default is "")
|
|
||||||
* load: optional file load address (overrides any load address specified in the data file; default is null)
|
|
||||||
* exec: optional file exec address (overrides any exec address specified in the data file; default is null)
|
|
||||||
*
|
|
||||||
* NOTE: We make a note of the specified size, but no memory is initially allocated for the RAM until the
|
|
||||||
* Computer component calls powerUp().
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
* @extends Component
|
|
||||||
* @param {Object} parmsRAM
|
|
||||||
*/
|
*/
|
||||||
function RAM8080(parmsRAM)
|
class RAM8080 extends Component {
|
||||||
{
|
/**
|
||||||
Component.call(this, "RAM", parmsRAM, RAM8080);
|
* RAM8080(parmsRAM)
|
||||||
|
*
|
||||||
|
* The RAM8080 component expects the following (parmsRAM) properties:
|
||||||
|
*
|
||||||
|
* addr: starting physical address of RAM (default is 0)
|
||||||
|
* size: amount of RAM, in bytes (default is 0, which means defer to motherboard switch settings)
|
||||||
|
* file: name of optional data file to load into RAM (default is "")
|
||||||
|
* load: optional file load address (overrides any load address specified in the data file; default is null)
|
||||||
|
* exec: optional file exec address (overrides any exec address specified in the data file; default is null)
|
||||||
|
*
|
||||||
|
* NOTE: We make a note of the specified size, but no memory is initially allocated for the RAM until the
|
||||||
|
* Computer component calls powerUp().
|
||||||
|
*
|
||||||
|
* @this {RAM8080}
|
||||||
|
* @param {Object} parmsRAM
|
||||||
|
*/
|
||||||
|
constructor(parmsRAM)
|
||||||
|
{
|
||||||
|
super("RAM", parmsRAM, RAM8080);
|
||||||
|
|
||||||
this.abInit = null;
|
this.abInit = null;
|
||||||
this.aSymbols = null;
|
this.aSymbols = null;
|
||||||
|
|
||||||
this.addrRAM = parmsRAM['addr'];
|
this.addrRAM = parmsRAM['addr'];
|
||||||
this.sizeRAM = parmsRAM['size'];
|
this.sizeRAM = parmsRAM['size'];
|
||||||
this.addrLoad = parmsRAM['load'];
|
this.addrLoad = parmsRAM['load'];
|
||||||
this.addrExec = parmsRAM['exec'];
|
this.addrExec = parmsRAM['exec'];
|
||||||
|
|
||||||
this.fInstalled = (!!this.sizeRAM); // 0 is the default value for 'size' when none is specified
|
this.fInstalled = (!!this.sizeRAM); // 0 is the default value for 'size' when none is specified
|
||||||
this.fAllocated = false;
|
this.fAllocated = false;
|
||||||
|
|
||||||
this.sFilePath = parmsRAM['file'];
|
this.sFilePath = parmsRAM['file'];
|
||||||
this.sFileName = str.getBaseName(this.sFilePath);
|
this.sFileName = Str.getBaseName(this.sFilePath);
|
||||||
|
|
||||||
if (this.sFilePath) {
|
if (this.sFilePath) {
|
||||||
var sFileURL = this.sFilePath;
|
var sFileURL = this.sFilePath;
|
||||||
if (DEBUG) this.log('load("' + sFileURL + '")');
|
if (DEBUG) this.log('load("' + sFileURL + '")');
|
||||||
/*
|
/*
|
||||||
* If the selected data file has a ".json" extension, then we assume it's pre-converted
|
* If the selected data file has a ".json" extension, then we assume it's pre-converted
|
||||||
* JSON-encoded data, so we load it as-is; ditto for ROM files with a ".hex" extension.
|
* JSON-encoded data, so we load it as-is; ditto for ROM files with a ".hex" extension.
|
||||||
* Otherwise, we ask our server-side converter to return the file in a JSON-compatible format.
|
* Otherwise, we ask our server-side converter to return the file in a JSON-compatible format.
|
||||||
*/
|
*/
|
||||||
var sFileExt = str.getExtension(this.sFileName);
|
var sFileExt = Str.getExtension(this.sFileName);
|
||||||
if (sFileExt != DumpAPI.FORMAT.JSON && sFileExt != DumpAPI.FORMAT.HEX) {
|
if (sFileExt != DumpAPI.FORMAT.JSON && sFileExt != DumpAPI.FORMAT.HEX) {
|
||||||
sFileURL = web.getHost() + DumpAPI.ENDPOINT + '?' + DumpAPI.QUERY.FILE + '=' + this.sFilePath + '&' + DumpAPI.QUERY.FORMAT + '=' + DumpAPI.FORMAT.BYTES + '&' + DumpAPI.QUERY.DECIMAL + '=true';
|
sFileURL = Web.getHost() + DumpAPI.ENDPOINT + '?' + DumpAPI.QUERY.FILE + '=' + this.sFilePath + '&' + DumpAPI.QUERY.FORMAT + '=' + DumpAPI.FORMAT.BYTES + '&' + DumpAPI.QUERY.DECIMAL + '=true';
|
||||||
|
}
|
||||||
|
var ram = this;
|
||||||
|
Web.getResource(sFileURL, null, true, function(sURL, sResponse, nErrorCode) {
|
||||||
|
ram.doneLoad(sURL, sResponse, nErrorCode);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* initBus(cmp, bus, cpu, dbg)
|
||||||
|
*
|
||||||
|
* @this {RAM8080}
|
||||||
|
* @param {Computer8080} cmp
|
||||||
|
* @param {Bus8080} bus
|
||||||
|
* @param {CPUState8080} cpu
|
||||||
|
* @param {Debugger8080} dbg
|
||||||
|
*/
|
||||||
|
initBus(cmp, bus, cpu, dbg)
|
||||||
|
{
|
||||||
|
this.bus = bus;
|
||||||
|
this.cpu = cpu;
|
||||||
|
this.dbg = dbg;
|
||||||
|
this.initRAM();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* powerUp(data, fRepower)
|
||||||
|
*
|
||||||
|
* @this {RAM8080}
|
||||||
|
* @param {Object|null} data
|
||||||
|
* @param {boolean} [fRepower]
|
||||||
|
* @return {boolean} true if successful, false if failure
|
||||||
|
*/
|
||||||
|
powerUp(data, fRepower)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* The Computer powers up the CPU last, at which point CPUState state is restored,
|
||||||
|
* which includes the Bus state, and since we use the Bus to allocate all our memory,
|
||||||
|
* memory contents are already restored for us, so we don't need the usual restore
|
||||||
|
* logic.
|
||||||
|
*/
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* powerDown(fSave, fShutdown)
|
||||||
|
*
|
||||||
|
* @this {RAM8080}
|
||||||
|
* @param {boolean} [fSave]
|
||||||
|
* @param {boolean} [fShutdown]
|
||||||
|
* @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure
|
||||||
|
*/
|
||||||
|
powerDown(fSave, fShutdown)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* The Computer powers down the CPU first, at which point CPUState state is saved,
|
||||||
|
* which includes the Bus state, and since we use the Bus component to allocate all
|
||||||
|
* our memory, memory contents are already saved for us, so we don't need the usual
|
||||||
|
* save logic.
|
||||||
|
*/
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* doneLoad(sURL, sData, nErrorCode)
|
||||||
|
*
|
||||||
|
* @this {RAM8080}
|
||||||
|
* @param {string} sURL
|
||||||
|
* @param {string} sData
|
||||||
|
* @param {number} nErrorCode (response from server if anything other than 200)
|
||||||
|
*/
|
||||||
|
doneLoad(sURL, sData, nErrorCode)
|
||||||
|
{
|
||||||
|
if (nErrorCode) {
|
||||||
|
this.notice("Unable to load RAM resource (error " + nErrorCode + ": " + sURL + ")");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.addMachineResource(this.idMachine, sURL, sData);
|
||||||
|
|
||||||
|
var resource = Web.parseMemoryResource(sURL, sData);
|
||||||
|
if (resource) {
|
||||||
|
this.abInit = resource.aBytes;
|
||||||
|
this.aSymbols = resource.aSymbols;
|
||||||
|
if (this.addrLoad == null) this.addrLoad = resource.addrLoad;
|
||||||
|
if (this.addrExec == null) this.addrExec = resource.addrExec;
|
||||||
|
} else {
|
||||||
|
this.sFilePath = null;
|
||||||
|
}
|
||||||
|
this.initRAM();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* initRAM()
|
||||||
|
*
|
||||||
|
* This function is called by both initBus() and doneLoad(), but it cannot copy the initial data into place
|
||||||
|
* until after initBus() has received the Bus component AND doneLoad() has received the data. When both those
|
||||||
|
* criteria are satisfied, the component becomes "ready".
|
||||||
|
*
|
||||||
|
* @this {RAM8080}
|
||||||
|
*/
|
||||||
|
initRAM()
|
||||||
|
{
|
||||||
|
if (!this.fAllocated && this.sizeRAM) {
|
||||||
|
if (this.bus.addMemory(this.addrRAM, this.sizeRAM, Memory8080.TYPE.RAM)) {
|
||||||
|
this.fAllocated = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!this.isReady()) {
|
||||||
|
if (!this.fAllocated) {
|
||||||
|
Component.error("No RAM allocated");
|
||||||
|
}
|
||||||
|
else if (this.sFilePath) {
|
||||||
|
/*
|
||||||
|
* Too early...
|
||||||
|
*/
|
||||||
|
if (!this.abInit || !this.bus) return;
|
||||||
|
|
||||||
|
var addr = this.addrRAM;
|
||||||
|
if (this.addrLoad !== null) addr = this.addrLoad;
|
||||||
|
for (var i = 0; i < this.abInit.length; i++) {
|
||||||
|
this.bus.setByteDirect(addr + i, this.abInit[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.addrExec !== null) {
|
||||||
|
/*
|
||||||
|
* Here's where we enable our "Fake CP/M" support, triggered by the user loading a "writable" ROM image
|
||||||
|
* at offset 0x100. Fake CP/M support works by installing HLT opcodes at well-known CP/M addresses
|
||||||
|
* (namely, 0x0000, which is the CP/M reset vector, and 0x0005, which is the CP/M system call vector) and
|
||||||
|
* then telling the CPU to call us whenever a HLT occurs, so we can check PC for one of these addresses.
|
||||||
|
*/
|
||||||
|
if (this.addrExec == RAM8080.CPM.INIT) {
|
||||||
|
for (i = 0; i < RAM8080.CPM.VECTORS.length; i++) {
|
||||||
|
this.bus.setByteDirect(RAM8080.CPM.VECTORS[i], CPUDef8080.OPCODE.HLT);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.cpu.addHaltCheck(function(rom) {
|
||||||
|
return function(addr) {
|
||||||
|
return rom.checkCPMVector(addr)
|
||||||
|
};
|
||||||
|
}(this));
|
||||||
|
}
|
||||||
|
this.cpu.setReset(this.addrExec);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO: Consider an option to retain this data and give the user a way of restoring the initial contents.
|
||||||
|
*/
|
||||||
|
delete this.abInit;
|
||||||
|
}
|
||||||
|
this.setReady();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* reset()
|
||||||
|
*
|
||||||
|
* @this {RAM8080}
|
||||||
|
*/
|
||||||
|
reset()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* If you want to zero RAM on reset, then this would be a good place to do it.
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* checkCPMVector(addr)
|
||||||
|
*
|
||||||
|
* @this {RAM8080}
|
||||||
|
* @param {number} addr (of the HLT opcode)
|
||||||
|
* @return {boolean} true if special processing performed, false if not
|
||||||
|
*/
|
||||||
|
checkCPMVector(addr)
|
||||||
|
{
|
||||||
|
var i = RAM8080.CPM.VECTORS.indexOf(addr);
|
||||||
|
if (i >= 0) {
|
||||||
|
var fCPM = false;
|
||||||
|
var cpu = this.cpu;
|
||||||
|
var dbg = this.dbg;
|
||||||
|
if (addr == RAM8080.CPM.BDOS.VECTOR) {
|
||||||
|
fCPM = true;
|
||||||
|
switch(cpu.regC) {
|
||||||
|
case RAM8080.CPM.BDOS.FUNC.CON_WRITE:
|
||||||
|
this.writeCPMString(this.getCPMChar(cpu.regE));
|
||||||
|
break;
|
||||||
|
case RAM8080.CPM.BDOS.FUNC.STR_WRITE:
|
||||||
|
this.writeCPMString(this.getCPMString(cpu.getDE(), '$'));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fCPM = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fCPM) {
|
||||||
|
CPUDef8080.opRET.call(cpu); // for recognized calls, automatically return
|
||||||
|
}
|
||||||
|
else if (dbg) {
|
||||||
|
this.println("\nCP/M vector " + Str.toHexWord(addr));
|
||||||
|
cpu.setPC(addr); // this is purely for the Debugger's benefit, to show the HLT
|
||||||
|
dbg.stopCPU();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getCPMChar(ch)
|
||||||
|
*
|
||||||
|
* @this {RAM8080}
|
||||||
|
* @param {number} ch
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
getCPMChar(ch)
|
||||||
|
{
|
||||||
|
return String.fromCharCode(ch);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getCPMString(addr, chEnd)
|
||||||
|
*
|
||||||
|
* @this {RAM8080}
|
||||||
|
* @param {number} addr (of a string)
|
||||||
|
* @param {string|number} [chEnd] (terminating character, default is 0)
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
getCPMString(addr, chEnd)
|
||||||
|
{
|
||||||
|
var s = "";
|
||||||
|
var cchMax = 255;
|
||||||
|
var bEnd = chEnd && chEnd.length && chEnd.charCodeAt(0) || chEnd || 0;
|
||||||
|
while (cchMax--) {
|
||||||
|
var b = this.cpu.getByte(addr++);
|
||||||
|
if (b == bEnd) break;
|
||||||
|
s += String.fromCharCode(b);
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* writeCPMString(s)
|
||||||
|
*
|
||||||
|
* @this {RAM8080}
|
||||||
|
* @param {string} s
|
||||||
|
*/
|
||||||
|
writeCPMString(s)
|
||||||
|
{
|
||||||
|
s = s.replace(/\r/g, '');
|
||||||
|
if (this.controlPrint) {
|
||||||
|
this.controlPrint.value += s;
|
||||||
|
this.controlPrint.scrollTop = this.controlPrint.scrollHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RAM8080.init()
|
||||||
|
*
|
||||||
|
* This function operates on every HTML element of class "ram", extracting the
|
||||||
|
* JSON-encoded parameters for the RAM8080 constructor from the element's "data-value"
|
||||||
|
* attribute, invoking the constructor to create a RAM8080 component, and then binding
|
||||||
|
* any associated HTML controls to the new component.
|
||||||
|
*/
|
||||||
|
static init()
|
||||||
|
{
|
||||||
|
var aeRAM = Component.getElementsByClass(document, PC8080.APPCLASS, "ram");
|
||||||
|
for (var iRAM = 0; iRAM < aeRAM.length; iRAM++) {
|
||||||
|
var eRAM = aeRAM[iRAM];
|
||||||
|
var parmsRAM = Component.getComponentParms(eRAM);
|
||||||
|
var ram = new RAM8080(parmsRAM);
|
||||||
|
Component.bindComponentControls(ram, eRAM, PC8080.APPCLASS);
|
||||||
}
|
}
|
||||||
var ram = this;
|
|
||||||
web.getResource(sFileURL, null, true, function(sURL, sResponse, nErrorCode) {
|
|
||||||
ram.doneLoad(sURL, sResponse, nErrorCode);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.subclass(RAM8080);
|
|
||||||
|
|
||||||
RAM8080.CPM = {
|
RAM8080.CPM = {
|
||||||
BIOS: {
|
BIOS: {
|
||||||
VECTOR: 0x0000
|
VECTOR: 0x0000
|
||||||
|
|
@ -121,276 +391,9 @@ RAM8080.CPM = {
|
||||||
|
|
||||||
RAM8080.CPM.VECTORS = [RAM8080.CPM.BIOS.VECTOR, RAM8080.CPM.BDOS.VECTOR];
|
RAM8080.CPM.VECTORS = [RAM8080.CPM.BIOS.VECTOR, RAM8080.CPM.BDOS.VECTOR];
|
||||||
|
|
||||||
/**
|
|
||||||
* initBus(cmp, bus, cpu, dbg)
|
|
||||||
*
|
|
||||||
* @this {RAM8080}
|
|
||||||
* @param {Computer8080} cmp
|
|
||||||
* @param {Bus8080} bus
|
|
||||||
* @param {CPUState8080} cpu
|
|
||||||
* @param {Debugger8080} dbg
|
|
||||||
*/
|
|
||||||
RAM8080.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|
||||||
{
|
|
||||||
this.bus = bus;
|
|
||||||
this.cpu = cpu;
|
|
||||||
this.dbg = dbg;
|
|
||||||
this.initRAM();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* powerUp(data, fRepower)
|
|
||||||
*
|
|
||||||
* @this {RAM8080}
|
|
||||||
* @param {Object|null} data
|
|
||||||
* @param {boolean} [fRepower]
|
|
||||||
* @return {boolean} true if successful, false if failure
|
|
||||||
*/
|
|
||||||
RAM8080.prototype.powerUp = function(data, fRepower)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* The Computer powers up the CPU last, at which point CPUState state is restored,
|
|
||||||
* which includes the Bus state, and since we use the Bus to allocate all our memory,
|
|
||||||
* memory contents are already restored for us, so we don't need the usual restore
|
|
||||||
* logic.
|
|
||||||
*/
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* powerDown(fSave, fShutdown)
|
|
||||||
*
|
|
||||||
* @this {RAM8080}
|
|
||||||
* @param {boolean} [fSave]
|
|
||||||
* @param {boolean} [fShutdown]
|
|
||||||
* @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure
|
|
||||||
*/
|
|
||||||
RAM8080.prototype.powerDown = function(fSave, fShutdown)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* The Computer powers down the CPU first, at which point CPUState state is saved,
|
|
||||||
* which includes the Bus state, and since we use the Bus component to allocate all
|
|
||||||
* our memory, memory contents are already saved for us, so we don't need the usual
|
|
||||||
* save logic.
|
|
||||||
*/
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* doneLoad(sURL, sData, nErrorCode)
|
|
||||||
*
|
|
||||||
* @this {RAM8080}
|
|
||||||
* @param {string} sURL
|
|
||||||
* @param {string} sData
|
|
||||||
* @param {number} nErrorCode (response from server if anything other than 200)
|
|
||||||
*/
|
|
||||||
RAM8080.prototype.doneLoad = function(sURL, sData, nErrorCode)
|
|
||||||
{
|
|
||||||
if (nErrorCode) {
|
|
||||||
this.notice("Unable to load RAM resource (error " + nErrorCode + ": " + sURL + ")");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.addMachineResource(this.idMachine, sURL, sData);
|
|
||||||
|
|
||||||
var resource = web.parseMemoryResource(sURL, sData);
|
|
||||||
if (resource) {
|
|
||||||
this.abInit = resource.aBytes;
|
|
||||||
this.aSymbols = resource.aSymbols;
|
|
||||||
if (this.addrLoad == null) this.addrLoad = resource.addrLoad;
|
|
||||||
if (this.addrExec == null) this.addrExec = resource.addrExec;
|
|
||||||
} else {
|
|
||||||
this.sFilePath = null;
|
|
||||||
}
|
|
||||||
this.initRAM();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* initRAM()
|
|
||||||
*
|
|
||||||
* This function is called by both initBus() and doneLoad(), but it cannot copy the initial data into place
|
|
||||||
* until after initBus() has received the Bus component AND doneLoad() has received the data. When both those
|
|
||||||
* criteria are satisfied, the component becomes "ready".
|
|
||||||
*
|
|
||||||
* @this {RAM8080}
|
|
||||||
*/
|
|
||||||
RAM8080.prototype.initRAM = function()
|
|
||||||
{
|
|
||||||
if (!this.fAllocated && this.sizeRAM) {
|
|
||||||
if (this.bus.addMemory(this.addrRAM, this.sizeRAM, Memory8080.TYPE.RAM)) {
|
|
||||||
this.fAllocated = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!this.isReady()) {
|
|
||||||
if (!this.fAllocated) {
|
|
||||||
Component.error("No RAM allocated");
|
|
||||||
}
|
|
||||||
else if (this.sFilePath) {
|
|
||||||
/*
|
|
||||||
* Too early...
|
|
||||||
*/
|
|
||||||
if (!this.abInit || !this.bus) return;
|
|
||||||
|
|
||||||
var addr = this.addrRAM;
|
|
||||||
if (this.addrLoad !== null) addr = this.addrLoad;
|
|
||||||
for (var i = 0; i < this.abInit.length; i++) {
|
|
||||||
this.bus.setByteDirect(addr + i, this.abInit[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.addrExec !== null) {
|
|
||||||
/*
|
|
||||||
* Here's where we enable our "Fake CP/M" support, triggered by the user loading a "writable" ROM image
|
|
||||||
* at offset 0x100. Fake CP/M support works by installing HLT opcodes at well-known CP/M addresses
|
|
||||||
* (namely, 0x0000, which is the CP/M reset vector, and 0x0005, which is the CP/M system call vector) and
|
|
||||||
* then telling the CPU to call us whenever a HLT occurs, so we can check PC for one of these addresses.
|
|
||||||
*/
|
|
||||||
if (this.addrExec == RAM8080.CPM.INIT) {
|
|
||||||
for (i = 0; i < RAM8080.CPM.VECTORS.length; i++) {
|
|
||||||
this.bus.setByteDirect(RAM8080.CPM.VECTORS[i], CPUDef8080.OPCODE.HLT);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.cpu.addHaltCheck(function(rom) {
|
|
||||||
return function(addr) {
|
|
||||||
return rom.checkCPMVector(addr)
|
|
||||||
};
|
|
||||||
}(this));
|
|
||||||
}
|
|
||||||
this.cpu.setReset(this.addrExec);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* TODO: Consider an option to retain this data and give the user a way of restoring the initial contents.
|
|
||||||
*/
|
|
||||||
delete this.abInit;
|
|
||||||
}
|
|
||||||
this.setReady();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* reset()
|
|
||||||
*
|
|
||||||
* @this {RAM8080}
|
|
||||||
*/
|
|
||||||
RAM8080.prototype.reset = function()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* If you want to zero RAM on reset, then this would be a good place to do it.
|
|
||||||
*/
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* checkCPMVector(addr)
|
|
||||||
*
|
|
||||||
* @this {RAM8080}
|
|
||||||
* @param {number} addr (of the HLT opcode)
|
|
||||||
* @return {boolean} true if special processing performed, false if not
|
|
||||||
*/
|
|
||||||
RAM8080.prototype.checkCPMVector = function(addr)
|
|
||||||
{
|
|
||||||
var i = RAM8080.CPM.VECTORS.indexOf(addr);
|
|
||||||
if (i >= 0) {
|
|
||||||
var fCPM = false;
|
|
||||||
var cpu = this.cpu;
|
|
||||||
var dbg = this.dbg;
|
|
||||||
if (addr == RAM8080.CPM.BDOS.VECTOR) {
|
|
||||||
fCPM = true;
|
|
||||||
switch(cpu.regC) {
|
|
||||||
case RAM8080.CPM.BDOS.FUNC.CON_WRITE:
|
|
||||||
this.writeCPMString(this.getCPMChar(cpu.regE));
|
|
||||||
break;
|
|
||||||
case RAM8080.CPM.BDOS.FUNC.STR_WRITE:
|
|
||||||
this.writeCPMString(this.getCPMString(cpu.getDE(), '$'));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
fCPM = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (fCPM) {
|
|
||||||
CPUDef8080.opRET.call(cpu); // for recognized calls, automatically return
|
|
||||||
}
|
|
||||||
else if (dbg) {
|
|
||||||
this.println("\nCP/M vector " + str.toHexWord(addr));
|
|
||||||
cpu.setPC(addr); // this is purely for the Debugger's benefit, to show the HLT
|
|
||||||
dbg.stopCPU();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getCPMChar(ch)
|
|
||||||
*
|
|
||||||
* @this {RAM8080}
|
|
||||||
* @param {number} ch
|
|
||||||
* @return {string}
|
|
||||||
*/
|
|
||||||
RAM8080.prototype.getCPMChar = function(ch)
|
|
||||||
{
|
|
||||||
return String.fromCharCode(ch);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getCPMString(addr, chEnd)
|
|
||||||
*
|
|
||||||
* @this {RAM8080}
|
|
||||||
* @param {number} addr (of a string)
|
|
||||||
* @param {string|number} [chEnd] (terminating character, default is 0)
|
|
||||||
* @return {string}
|
|
||||||
*/
|
|
||||||
RAM8080.prototype.getCPMString = function(addr, chEnd)
|
|
||||||
{
|
|
||||||
var s = "";
|
|
||||||
var cchMax = 255;
|
|
||||||
var bEnd = chEnd && chEnd.length && chEnd.charCodeAt(0) || chEnd || 0;
|
|
||||||
while (cchMax--) {
|
|
||||||
var b = this.cpu.getByte(addr++);
|
|
||||||
if (b == bEnd) break;
|
|
||||||
s += String.fromCharCode(b);
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* writeCPMString(s)
|
|
||||||
*
|
|
||||||
* @this {RAM8080}
|
|
||||||
* @param {string} s
|
|
||||||
*/
|
|
||||||
RAM8080.prototype.writeCPMString = function(s)
|
|
||||||
{
|
|
||||||
s = s.replace(/\r/g, '');
|
|
||||||
if (this.controlPrint) {
|
|
||||||
this.controlPrint.value += s;
|
|
||||||
this.controlPrint.scrollTop = this.controlPrint.scrollHeight;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* RAM8080.init()
|
|
||||||
*
|
|
||||||
* This function operates on every HTML element of class "ram", extracting the
|
|
||||||
* JSON-encoded parameters for the RAM8080 constructor from the element's "data-value"
|
|
||||||
* attribute, invoking the constructor to create a RAM8080 component, and then binding
|
|
||||||
* any associated HTML controls to the new component.
|
|
||||||
*/
|
|
||||||
RAM8080.init = function()
|
|
||||||
{
|
|
||||||
var aeRAM = Component.getElementsByClass(document, PC8080.APPCLASS, "ram");
|
|
||||||
for (var iRAM = 0; iRAM < aeRAM.length; iRAM++) {
|
|
||||||
var eRAM = aeRAM[iRAM];
|
|
||||||
var parmsRAM = Component.getComponentParms(eRAM);
|
|
||||||
var ram = new RAM8080(parmsRAM);
|
|
||||||
Component.bindComponentControls(ram, eRAM, PC8080.APPCLASS);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize all the RAM8080 modules on the page.
|
* Initialize all the RAM8080 modules on the page.
|
||||||
*/
|
*/
|
||||||
web.onInit(RAM8080.init);
|
Web.onInit(RAM8080.init);
|
||||||
|
|
||||||
if (NODE) module.exports = RAM8080;
|
module.exports = RAM8080;
|
||||||
|
|
|
||||||
|
|
@ -28,80 +28,337 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if (NODE) {
|
var Str = require("../../shared/es6/strlib");
|
||||||
var str = require("../../shared/lib/strlib");
|
var Web = require("../../shared/es6/weblib");
|
||||||
var web = require("../../shared/lib/weblib");
|
var DumpAPI = require("../../shared/es6/dumpapi");
|
||||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
var Component = require("../../shared/es6/component");
|
||||||
var Component = require("../../shared/lib/component");
|
var PC8080 = require("./defines");
|
||||||
var PC8080 = require("./defines");
|
var Memory8080 = require("./memory");
|
||||||
var Memory8080 = require("./memory");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ROM8080(parmsROM)
|
* TODO: The Closure Compiler treats ES6 classes as 'struct' rather than 'dict' by default,
|
||||||
|
* which would force us to declare all class properties in the constructor, as well as prevent
|
||||||
|
* us from defining any named properties. So, for now, we mark all our classes as 'unrestricted'.
|
||||||
*
|
*
|
||||||
* The ROM8080 component expects the following (parmsROM) properties:
|
* @unrestricted
|
||||||
*
|
|
||||||
* addr: physical address of ROM
|
|
||||||
* size: amount of ROM, in bytes
|
|
||||||
* alias: physical alias address (null if none)
|
|
||||||
* file: name of ROM data file
|
|
||||||
*
|
|
||||||
* NOTE: The ROM data will not be copied into place until the Bus is ready (see initBus()) AND the
|
|
||||||
* ROM data file has finished loading (see doneLoad()).
|
|
||||||
*
|
|
||||||
* Also, while the size parameter may seem redundant, I consider it useful to confirm that the ROM you received
|
|
||||||
* is the ROM you expected.
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
* @extends Component
|
|
||||||
* @param {Object} parmsROM
|
|
||||||
*/
|
*/
|
||||||
function ROM8080(parmsROM)
|
class ROM8080 extends Component {
|
||||||
{
|
/**
|
||||||
Component.call(this, "ROM", parmsROM, ROM8080);
|
* ROM8080(parmsROM)
|
||||||
|
|
||||||
this.abROM = null;
|
|
||||||
this.addrROM = parmsROM['addr'];
|
|
||||||
this.sizeROM = parmsROM['size'];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The new 'alias' property can now be EITHER a single physical address (like 'addr') OR an array of
|
|
||||||
* physical addresses; eg:
|
|
||||||
*
|
*
|
||||||
* [0xf0000,0xffff0000,0xffff8000]
|
* The ROM8080 component expects the following (parmsROM) properties:
|
||||||
*
|
*
|
||||||
* We could have overloaded 'addr' to accomplish the same thing, but I think it's better to have any
|
* addr: physical address of ROM
|
||||||
* aliased locations listed under a separate property.
|
* size: amount of ROM, in bytes
|
||||||
|
* alias: physical alias address (null if none)
|
||||||
|
* file: name of ROM data file
|
||||||
*
|
*
|
||||||
* Most ROMs are not aliased, in which case the 'alias' property should have the default value of null.
|
* NOTE: The ROM data will not be copied into place until the Bus is ready (see initBus()) AND the
|
||||||
|
* ROM data file has finished loading (see doneLoad()).
|
||||||
|
*
|
||||||
|
* Also, while the size parameter may seem redundant, I consider it useful to confirm that the ROM you received
|
||||||
|
* is the ROM you expected.
|
||||||
|
*
|
||||||
|
* @this {ROM8080}
|
||||||
|
* @param {Object} parmsROM
|
||||||
*/
|
*/
|
||||||
this.addrAlias = parmsROM['alias'];
|
constructor(parmsROM)
|
||||||
|
{
|
||||||
|
super("ROM", parmsROM, ROM8080);
|
||||||
|
|
||||||
this.sFilePath = parmsROM['file'];
|
this.abROM = null;
|
||||||
this.sFileName = str.getBaseName(this.sFilePath);
|
this.addrROM = parmsROM['addr'];
|
||||||
|
this.sizeROM = parmsROM['size'];
|
||||||
|
|
||||||
if (this.sFilePath) {
|
|
||||||
var sFileURL = this.sFilePath;
|
|
||||||
if (DEBUG) this.log('load("' + sFileURL + '")');
|
|
||||||
/*
|
/*
|
||||||
* If the selected ROM file has a ".json" extension, then we assume it's pre-converted
|
* The new 'alias' property can now be EITHER a single physical address (like 'addr') OR an array of
|
||||||
* JSON-encoded ROM data, so we load it as-is; ditto for ROM files with a ".hex" extension.
|
* physical addresses; eg:
|
||||||
* Otherwise, we ask our server-side ROM converter to return the file in a JSON-compatible format.
|
*
|
||||||
|
* [0xf0000,0xffff0000,0xffff8000]
|
||||||
|
*
|
||||||
|
* We could have overloaded 'addr' to accomplish the same thing, but I think it's better to have any
|
||||||
|
* aliased locations listed under a separate property.
|
||||||
|
*
|
||||||
|
* Most ROMs are not aliased, in which case the 'alias' property should have the default value of null.
|
||||||
*/
|
*/
|
||||||
var sFileExt = str.getExtension(this.sFileName);
|
this.addrAlias = parmsROM['alias'];
|
||||||
if (sFileExt != DumpAPI.FORMAT.JSON && sFileExt != DumpAPI.FORMAT.HEX) {
|
|
||||||
sFileURL = web.getHost() + DumpAPI.ENDPOINT + '?' + DumpAPI.QUERY.FILE + '=' + this.sFilePath + '&' + DumpAPI.QUERY.FORMAT + '=' + DumpAPI.FORMAT.BYTES + '&' + DumpAPI.QUERY.DECIMAL + '=true';
|
this.sFilePath = parmsROM['file'];
|
||||||
|
this.sFileName = Str.getBaseName(this.sFilePath);
|
||||||
|
|
||||||
|
if (this.sFilePath) {
|
||||||
|
var sFileURL = this.sFilePath;
|
||||||
|
if (DEBUG) this.log('load("' + sFileURL + '")');
|
||||||
|
/*
|
||||||
|
* If the selected ROM file has a ".json" extension, then we assume it's pre-converted
|
||||||
|
* JSON-encoded ROM data, so we load it as-is; ditto for ROM files with a ".hex" extension.
|
||||||
|
* Otherwise, we ask our server-side ROM converter to return the file in a JSON-compatible format.
|
||||||
|
*/
|
||||||
|
var sFileExt = Str.getExtension(this.sFileName);
|
||||||
|
if (sFileExt != DumpAPI.FORMAT.JSON && sFileExt != DumpAPI.FORMAT.HEX) {
|
||||||
|
sFileURL = Web.getHost() + DumpAPI.ENDPOINT + '?' + DumpAPI.QUERY.FILE + '=' + this.sFilePath + '&' + DumpAPI.QUERY.FORMAT + '=' + DumpAPI.FORMAT.BYTES + '&' + DumpAPI.QUERY.DECIMAL + '=true';
|
||||||
|
}
|
||||||
|
var rom = this;
|
||||||
|
Web.getResource(sFileURL, null, true, function(sURL, sResponse, nErrorCode) {
|
||||||
|
rom.doneLoad(sURL, sResponse, nErrorCode);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* initBus(cmp, bus, cpu, dbg)
|
||||||
|
*
|
||||||
|
* @this {ROM8080}
|
||||||
|
* @param {Computer8080} cmp
|
||||||
|
* @param {Bus8080} bus
|
||||||
|
* @param {CPUState8080} cpu
|
||||||
|
* @param {Debugger8080} dbg
|
||||||
|
*/
|
||||||
|
initBus(cmp, bus, cpu, dbg)
|
||||||
|
{
|
||||||
|
this.bus = bus;
|
||||||
|
this.cpu = cpu;
|
||||||
|
this.dbg = dbg;
|
||||||
|
this.copyROM();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* powerUp(data, fRepower)
|
||||||
|
*
|
||||||
|
* @this {ROM8080}
|
||||||
|
* @param {Object|null} data
|
||||||
|
* @param {boolean} [fRepower]
|
||||||
|
* @return {boolean} true if successful, false if failure
|
||||||
|
*/
|
||||||
|
powerUp(data, fRepower)
|
||||||
|
{
|
||||||
|
if (this.aSymbols) {
|
||||||
|
if (this.dbg) {
|
||||||
|
this.dbg.addSymbols(this.id, this.addrROM, this.sizeROM, this.aSymbols);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Our only role in the handling of symbols is to hand them off to the Debugger at our
|
||||||
|
* first opportunity. Now that we've done that, our copy of the symbols, if any, are toast.
|
||||||
|
*/
|
||||||
|
delete this.aSymbols;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* powerDown(fSave, fShutdown)
|
||||||
|
*
|
||||||
|
* Since we have nothing to do on powerDown(), and no state to return, we could simply omit
|
||||||
|
* this function. But it doesn't hurt anything, and maybe we'll use our state to save something
|
||||||
|
* useful down the road, like user-defined symbols (ie, symbols that the Debugger may have
|
||||||
|
* created, above and beyond those symbols we automatically loaded, if any, along with the ROM).
|
||||||
|
*
|
||||||
|
* @this {ROM8080}
|
||||||
|
* @param {boolean} [fSave]
|
||||||
|
* @param {boolean} [fShutdown]
|
||||||
|
* @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure
|
||||||
|
*/
|
||||||
|
powerDown(fSave, fShutdown)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* doneLoad(sURL, sROMData, nErrorCode)
|
||||||
|
*
|
||||||
|
* @this {ROM8080}
|
||||||
|
* @param {string} sURL
|
||||||
|
* @param {string} sROMData
|
||||||
|
* @param {number} nErrorCode (response from server if anything other than 200)
|
||||||
|
*/
|
||||||
|
doneLoad(sURL, sROMData, nErrorCode)
|
||||||
|
{
|
||||||
|
if (nErrorCode) {
|
||||||
|
this.notice("Unable to load system ROM (error " + nErrorCode + ": " + sURL + ")");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.addMachineResource(this.idMachine, sURL, sROMData);
|
||||||
|
|
||||||
|
if (sROMData.charAt(0) == "[" || sROMData.charAt(0) == "{") {
|
||||||
|
try {
|
||||||
|
/*
|
||||||
|
* The most likely source of any exception will be here: parsing the JSON-encoded ROM data.
|
||||||
|
*/
|
||||||
|
var rom = eval("(" + sROMData + ")");
|
||||||
|
var ab = rom['bytes'];
|
||||||
|
var adw = rom['data'];
|
||||||
|
|
||||||
|
if (ab) {
|
||||||
|
this.abROM = ab;
|
||||||
|
}
|
||||||
|
else if (adw) {
|
||||||
|
/*
|
||||||
|
* Convert all the DWORDs into BYTEs, so that subsequent code only has to deal with abROM.
|
||||||
|
*/
|
||||||
|
this.abROM = new Array(adw.length * 4);
|
||||||
|
for (var idw = 0, ib = 0; idw < adw.length; idw++) {
|
||||||
|
this.abROM[ib++] = adw[idw] & 0xff;
|
||||||
|
this.abROM[ib++] = (adw[idw] >> 8) & 0xff;
|
||||||
|
this.abROM[ib++] = (adw[idw] >> 16) & 0xff;
|
||||||
|
this.abROM[ib++] = (adw[idw] >> 24) & 0xff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.abROM = rom;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.aSymbols = rom['symbols'];
|
||||||
|
|
||||||
|
if (!this.abROM.length) {
|
||||||
|
Component.error("Empty ROM: " + sURL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (this.abROM.length == 1) {
|
||||||
|
Component.error(this.abROM[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.notice("ROM data error: " + e.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/*
|
||||||
|
* Parse the ROM data manually; we assume it's in "simplified" hex form (a series of hex byte-values
|
||||||
|
* separated by whitespace).
|
||||||
|
*/
|
||||||
|
var sHexData = sROMData.replace(/\n/gm, " ").replace(/ +$/, "");
|
||||||
|
var asHexData = sHexData.split(" ");
|
||||||
|
this.abROM = new Array(asHexData.length);
|
||||||
|
for (var i = 0; i < asHexData.length; i++) {
|
||||||
|
this.abROM[i] = Str.parseInt(asHexData[i], 16);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.copyROM();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* copyROM()
|
||||||
|
*
|
||||||
|
* This function is called by both initBus() and doneLoad(), but it cannot copy the the ROM data into place
|
||||||
|
* until after initBus() has received the Bus component AND doneLoad() has received the abROM data. When both
|
||||||
|
* those criteria are satisfied, the component becomes "ready".
|
||||||
|
*
|
||||||
|
* @this {ROM8080}
|
||||||
|
*/
|
||||||
|
copyROM()
|
||||||
|
{
|
||||||
|
if (!this.isReady()) {
|
||||||
|
if (!this.sFilePath) {
|
||||||
|
this.setReady();
|
||||||
|
}
|
||||||
|
else if (this.abROM && this.bus) {
|
||||||
|
/*
|
||||||
|
* If no explicit size was specified, then use whatever the actual size is.
|
||||||
|
*/
|
||||||
|
if (!this.sizeROM) {
|
||||||
|
this.sizeROM = this.abROM.length;
|
||||||
|
}
|
||||||
|
if (this.abROM.length != this.sizeROM) {
|
||||||
|
/*
|
||||||
|
* Note that setError() sets the component's fError flag, which in turn prevents setReady() from
|
||||||
|
* marking the component ready. TODO: Revisit this decision. On the one hand, it sounds like a
|
||||||
|
* good idea to stop the machine in its tracks whenever a setError() occurs, but there may also be
|
||||||
|
* times when we'd like to forge ahead anyway.
|
||||||
|
*/
|
||||||
|
this.setError("ROM size (" + Str.toHexLong(this.abROM.length) + ") does not match specified size (" + Str.toHexLong(this.sizeROM) + ")");
|
||||||
|
}
|
||||||
|
else if (this.addROM(this.addrROM)) {
|
||||||
|
|
||||||
|
var aliases = [];
|
||||||
|
if (typeof this.addrAlias == "number") {
|
||||||
|
aliases.push(this.addrAlias);
|
||||||
|
} else if (this.addrAlias != null && this.addrAlias.length) {
|
||||||
|
aliases = this.addrAlias;
|
||||||
|
}
|
||||||
|
for (var i = 0; i < aliases.length; i++) {
|
||||||
|
this.cloneROM(aliases[i]);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* We used to hang onto the original ROM data so that we could restore any bytes the CPU overwrote,
|
||||||
|
* using memory write-notification handlers, but with the introduction of read-only memory blocks, that's
|
||||||
|
* no longer necessary.
|
||||||
|
*
|
||||||
|
* TODO: Consider an option to retain the ROM data, and give the user some way of restoring ROMs.
|
||||||
|
* That may be useful for "resumable" machines that save/restore all dirty block of memory, regardless
|
||||||
|
* whether they're ROM or RAM. However, the only way to modify a machine's ROM is with the Debugger,
|
||||||
|
* and Debugger users should know better.
|
||||||
|
*/
|
||||||
|
delete this.abROM;
|
||||||
|
}
|
||||||
|
this.setReady();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* addROM(addr)
|
||||||
|
*
|
||||||
|
* @this {ROM8080}
|
||||||
|
* @param {number} addr
|
||||||
|
* @return {boolean}
|
||||||
|
*/
|
||||||
|
addROM(addr)
|
||||||
|
{
|
||||||
|
if (this.bus.addMemory(addr, this.sizeROM, Memory8080.TYPE.ROM)) {
|
||||||
|
if (DEBUG) this.log("addROM(): copying ROM to " + Str.toHexLong(addr) + " (" + Str.toHexLong(this.abROM.length) + " bytes)");
|
||||||
|
var i;
|
||||||
|
for (i = 0; i < this.abROM.length; i++) {
|
||||||
|
this.bus.setByteDirect(addr + i, this.abROM[i]);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* We don't need to report an error here, because addMemory() already takes care of that.
|
||||||
|
*/
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cloneROM(addr)
|
||||||
|
*
|
||||||
|
* For ROMs with one or more alias addresses, we used to call addROM() for each address. However,
|
||||||
|
* that obviously wasted memory, since each alias was an independent copy, and if you used the
|
||||||
|
* Debugger to edit the ROM in one location, the changes would not appear in the other location(s).
|
||||||
|
*
|
||||||
|
* Now that the Bus component provides low-level getMemoryBlocks() and setMemoryBlocks() methods
|
||||||
|
* to manually get and set the blocks of any memory range, it is now possible to create true aliases.
|
||||||
|
*
|
||||||
|
* @this {ROM8080}
|
||||||
|
* @param {number} addr
|
||||||
|
*/
|
||||||
|
cloneROM(addr)
|
||||||
|
{
|
||||||
|
var aBlocks = this.bus.getMemoryBlocks(this.addrROM, this.sizeROM);
|
||||||
|
this.bus.setMemoryBlocks(addr, this.sizeROM, aBlocks);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ROM8080.init()
|
||||||
|
*
|
||||||
|
* This function operates on every HTML element of class "rom", extracting the
|
||||||
|
* JSON-encoded parameters for the ROM8080 constructor from the element's "data-value"
|
||||||
|
* attribute, invoking the constructor to create a ROM8080 component, and then binding
|
||||||
|
* any associated HTML controls to the new component.
|
||||||
|
*/
|
||||||
|
static init()
|
||||||
|
{
|
||||||
|
var aeROM = Component.getElementsByClass(document, PC8080.APPCLASS, "rom");
|
||||||
|
for (var iROM = 0; iROM < aeROM.length; iROM++) {
|
||||||
|
var eROM = aeROM[iROM];
|
||||||
|
var parmsROM = Component.getComponentParms(eROM);
|
||||||
|
var rom = new ROM8080(parmsROM);
|
||||||
|
Component.bindComponentControls(rom, eROM, PC8080.APPCLASS);
|
||||||
}
|
}
|
||||||
var rom = this;
|
|
||||||
web.getResource(sFileURL, null, true, function(sURL, sResponse, nErrorCode) {
|
|
||||||
rom.doneLoad(sURL, sResponse, nErrorCode);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.subclass(ROM8080);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NOTE: There's currently no need for this component to have a reset() function, since
|
* NOTE: There's currently no need for this component to have a reset() function, since
|
||||||
* once the ROM data is loaded, it can't be changed, so there's nothing to reinitialize.
|
* once the ROM data is loaded, it can't be changed, so there's nothing to reinitialize.
|
||||||
|
|
@ -115,262 +372,9 @@ Component.subclass(ROM8080);
|
||||||
* via bus.addMemory().
|
* via bus.addMemory().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* initBus(cmp, bus, cpu, dbg)
|
|
||||||
*
|
|
||||||
* @this {ROM8080}
|
|
||||||
* @param {Computer8080} cmp
|
|
||||||
* @param {Bus8080} bus
|
|
||||||
* @param {CPUState8080} cpu
|
|
||||||
* @param {Debugger8080} dbg
|
|
||||||
*/
|
|
||||||
ROM8080.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|
||||||
{
|
|
||||||
this.bus = bus;
|
|
||||||
this.cpu = cpu;
|
|
||||||
this.dbg = dbg;
|
|
||||||
this.copyROM();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* powerUp(data, fRepower)
|
|
||||||
*
|
|
||||||
* @this {ROM8080}
|
|
||||||
* @param {Object|null} data
|
|
||||||
* @param {boolean} [fRepower]
|
|
||||||
* @return {boolean} true if successful, false if failure
|
|
||||||
*/
|
|
||||||
ROM8080.prototype.powerUp = function(data, fRepower)
|
|
||||||
{
|
|
||||||
if (this.aSymbols) {
|
|
||||||
if (this.dbg) {
|
|
||||||
this.dbg.addSymbols(this.id, this.addrROM, this.sizeROM, this.aSymbols);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Our only role in the handling of symbols is to hand them off to the Debugger at our
|
|
||||||
* first opportunity. Now that we've done that, our copy of the symbols, if any, are toast.
|
|
||||||
*/
|
|
||||||
delete this.aSymbols;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* powerDown(fSave, fShutdown)
|
|
||||||
*
|
|
||||||
* Since we have nothing to do on powerDown(), and no state to return, we could simply omit
|
|
||||||
* this function. But it doesn't hurt anything, and maybe we'll use our state to save something
|
|
||||||
* useful down the road, like user-defined symbols (ie, symbols that the Debugger may have
|
|
||||||
* created, above and beyond those symbols we automatically loaded, if any, along with the ROM).
|
|
||||||
*
|
|
||||||
* @this {ROM8080}
|
|
||||||
* @param {boolean} [fSave]
|
|
||||||
* @param {boolean} [fShutdown]
|
|
||||||
* @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure
|
|
||||||
*/
|
|
||||||
ROM8080.prototype.powerDown = function(fSave, fShutdown)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* doneLoad(sURL, sROMData, nErrorCode)
|
|
||||||
*
|
|
||||||
* @this {ROM8080}
|
|
||||||
* @param {string} sURL
|
|
||||||
* @param {string} sROMData
|
|
||||||
* @param {number} nErrorCode (response from server if anything other than 200)
|
|
||||||
*/
|
|
||||||
ROM8080.prototype.doneLoad = function(sURL, sROMData, nErrorCode)
|
|
||||||
{
|
|
||||||
if (nErrorCode) {
|
|
||||||
this.notice("Unable to load system ROM (error " + nErrorCode + ": " + sURL + ")");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.addMachineResource(this.idMachine, sURL, sROMData);
|
|
||||||
|
|
||||||
if (sROMData.charAt(0) == "[" || sROMData.charAt(0) == "{") {
|
|
||||||
try {
|
|
||||||
/*
|
|
||||||
* The most likely source of any exception will be here: parsing the JSON-encoded ROM data.
|
|
||||||
*/
|
|
||||||
var rom = eval("(" + sROMData + ")");
|
|
||||||
var ab = rom['bytes'];
|
|
||||||
var adw = rom['data'];
|
|
||||||
|
|
||||||
if (ab) {
|
|
||||||
this.abROM = ab;
|
|
||||||
}
|
|
||||||
else if (adw) {
|
|
||||||
/*
|
|
||||||
* Convert all the DWORDs into BYTEs, so that subsequent code only has to deal with abROM.
|
|
||||||
*/
|
|
||||||
this.abROM = new Array(adw.length * 4);
|
|
||||||
for (var idw = 0, ib = 0; idw < adw.length; idw++) {
|
|
||||||
this.abROM[ib++] = adw[idw] & 0xff;
|
|
||||||
this.abROM[ib++] = (adw[idw] >> 8) & 0xff;
|
|
||||||
this.abROM[ib++] = (adw[idw] >> 16) & 0xff;
|
|
||||||
this.abROM[ib++] = (adw[idw] >> 24) & 0xff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.abROM = rom;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.aSymbols = rom['symbols'];
|
|
||||||
|
|
||||||
if (!this.abROM.length) {
|
|
||||||
Component.error("Empty ROM: " + sURL);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (this.abROM.length == 1) {
|
|
||||||
Component.error(this.abROM[0]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
this.notice("ROM data error: " + e.message);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/*
|
|
||||||
* Parse the ROM data manually; we assume it's in "simplified" hex form (a series of hex byte-values
|
|
||||||
* separated by whitespace).
|
|
||||||
*/
|
|
||||||
var sHexData = sROMData.replace(/\n/gm, " ").replace(/ +$/, "");
|
|
||||||
var asHexData = sHexData.split(" ");
|
|
||||||
this.abROM = new Array(asHexData.length);
|
|
||||||
for (var i = 0; i < asHexData.length; i++) {
|
|
||||||
this.abROM[i] = str.parseInt(asHexData[i], 16);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.copyROM();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* copyROM()
|
|
||||||
*
|
|
||||||
* This function is called by both initBus() and doneLoad(), but it cannot copy the the ROM data into place
|
|
||||||
* until after initBus() has received the Bus component AND doneLoad() has received the abROM data. When both
|
|
||||||
* those criteria are satisfied, the component becomes "ready".
|
|
||||||
*
|
|
||||||
* @this {ROM8080}
|
|
||||||
*/
|
|
||||||
ROM8080.prototype.copyROM = function()
|
|
||||||
{
|
|
||||||
if (!this.isReady()) {
|
|
||||||
if (!this.sFilePath) {
|
|
||||||
this.setReady();
|
|
||||||
}
|
|
||||||
else if (this.abROM && this.bus) {
|
|
||||||
/*
|
|
||||||
* If no explicit size was specified, then use whatever the actual size is.
|
|
||||||
*/
|
|
||||||
if (!this.sizeROM) {
|
|
||||||
this.sizeROM = this.abROM.length;
|
|
||||||
}
|
|
||||||
if (this.abROM.length != this.sizeROM) {
|
|
||||||
/*
|
|
||||||
* Note that setError() sets the component's fError flag, which in turn prevents setReady() from
|
|
||||||
* marking the component ready. TODO: Revisit this decision. On the one hand, it sounds like a
|
|
||||||
* good idea to stop the machine in its tracks whenever a setError() occurs, but there may also be
|
|
||||||
* times when we'd like to forge ahead anyway.
|
|
||||||
*/
|
|
||||||
this.setError("ROM size (" + str.toHexLong(this.abROM.length) + ") does not match specified size (" + str.toHexLong(this.sizeROM) + ")");
|
|
||||||
}
|
|
||||||
else if (this.addROM(this.addrROM)) {
|
|
||||||
|
|
||||||
var aliases = [];
|
|
||||||
if (typeof this.addrAlias == "number") {
|
|
||||||
aliases.push(this.addrAlias);
|
|
||||||
} else if (this.addrAlias != null && this.addrAlias.length) {
|
|
||||||
aliases = this.addrAlias;
|
|
||||||
}
|
|
||||||
for (var i = 0; i < aliases.length; i++) {
|
|
||||||
this.cloneROM(aliases[i]);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* We used to hang onto the original ROM data so that we could restore any bytes the CPU overwrote,
|
|
||||||
* using memory write-notification handlers, but with the introduction of read-only memory blocks, that's
|
|
||||||
* no longer necessary.
|
|
||||||
*
|
|
||||||
* TODO: Consider an option to retain the ROM data, and give the user some way of restoring ROMs.
|
|
||||||
* That may be useful for "resumable" machines that save/restore all dirty block of memory, regardless
|
|
||||||
* whether they're ROM or RAM. However, the only way to modify a machine's ROM is with the Debugger,
|
|
||||||
* and Debugger users should know better.
|
|
||||||
*/
|
|
||||||
delete this.abROM;
|
|
||||||
}
|
|
||||||
this.setReady();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* addROM(addr)
|
|
||||||
*
|
|
||||||
* @this {ROM8080}
|
|
||||||
* @param {number} addr
|
|
||||||
* @return {boolean}
|
|
||||||
*/
|
|
||||||
ROM8080.prototype.addROM = function(addr)
|
|
||||||
{
|
|
||||||
if (this.bus.addMemory(addr, this.sizeROM, Memory8080.TYPE.ROM)) {
|
|
||||||
if (DEBUG) this.log("addROM(): copying ROM to " + str.toHexLong(addr) + " (" + str.toHexLong(this.abROM.length) + " bytes)");
|
|
||||||
var i;
|
|
||||||
for (i = 0; i < this.abROM.length; i++) {
|
|
||||||
this.bus.setByteDirect(addr + i, this.abROM[i]);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* We don't need to report an error here, because addMemory() already takes care of that.
|
|
||||||
*/
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* cloneROM(addr)
|
|
||||||
*
|
|
||||||
* For ROMs with one or more alias addresses, we used to call addROM() for each address. However,
|
|
||||||
* that obviously wasted memory, since each alias was an independent copy, and if you used the
|
|
||||||
* Debugger to edit the ROM in one location, the changes would not appear in the other location(s).
|
|
||||||
*
|
|
||||||
* Now that the Bus component provides low-level getMemoryBlocks() and setMemoryBlocks() methods
|
|
||||||
* to manually get and set the blocks of any memory range, it is now possible to create true aliases.
|
|
||||||
*
|
|
||||||
* @this {ROM8080}
|
|
||||||
* @param {number} addr
|
|
||||||
*/
|
|
||||||
ROM8080.prototype.cloneROM = function(addr)
|
|
||||||
{
|
|
||||||
var aBlocks = this.bus.getMemoryBlocks(this.addrROM, this.sizeROM);
|
|
||||||
this.bus.setMemoryBlocks(addr, this.sizeROM, aBlocks);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ROM8080.init()
|
|
||||||
*
|
|
||||||
* This function operates on every HTML element of class "rom", extracting the
|
|
||||||
* JSON-encoded parameters for the ROM8080 constructor from the element's "data-value"
|
|
||||||
* attribute, invoking the constructor to create a ROM8080 component, and then binding
|
|
||||||
* any associated HTML controls to the new component.
|
|
||||||
*/
|
|
||||||
ROM8080.init = function()
|
|
||||||
{
|
|
||||||
var aeROM = Component.getElementsByClass(document, PC8080.APPCLASS, "rom");
|
|
||||||
for (var iROM = 0; iROM < aeROM.length; iROM++) {
|
|
||||||
var eROM = aeROM[iROM];
|
|
||||||
var parmsROM = Component.getComponentParms(eROM);
|
|
||||||
var rom = new ROM8080(parmsROM);
|
|
||||||
Component.bindComponentControls(rom, eROM, PC8080.APPCLASS);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize all the ROM8080 modules on the page.
|
* Initialize all the ROM8080 modules on the page.
|
||||||
*/
|
*/
|
||||||
web.onInit(ROM8080.init);
|
Web.onInit(ROM8080.init);
|
||||||
|
|
||||||
if (NODE) module.exports = ROM8080;
|
module.exports = ROM8080;
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -138,16 +138,9 @@ class Component {
|
||||||
/** @type {Object|null} controlPrint is the HTML control, if any, that we can print to */
|
/** @type {Object|null} controlPrint is the HTML control, if any, that we can print to */
|
||||||
this.controlPrint = null;
|
this.controlPrint = null;
|
||||||
|
|
||||||
/** @type {ComputerPDP11|null} */
|
|
||||||
this.cmp = null;
|
this.cmp = null;
|
||||||
|
|
||||||
/** @type {BusPDP11|null} */
|
|
||||||
this.bus = null;
|
this.bus = null;
|
||||||
|
|
||||||
/** @type {CPUStatePDP11|null} */
|
|
||||||
this.cpu = null;
|
this.cpu = null;
|
||||||
|
|
||||||
/** @type {DebuggerPDP11|null} */
|
|
||||||
this.dbg = null;
|
this.dbg = null;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -969,6 +962,31 @@ class Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* printMessageIO(port, bOut, addrFrom, name, bIn, bitsMessage)
|
||||||
|
*
|
||||||
|
* If bitsMessage is not specified, the component's MESSAGE category is used.
|
||||||
|
* If bitsMessage is true, the message is displayed as long as MESSAGE.PORT is enabled.
|
||||||
|
*
|
||||||
|
* @this {Component}
|
||||||
|
* @param {number} port
|
||||||
|
* @param {number|null} bOut if an output operation
|
||||||
|
* @param {number|null} [addrFrom]
|
||||||
|
* @param {string|null} [name] of the port, if any
|
||||||
|
* @param {number|null} [bIn] is the input value, if known, on an input operation
|
||||||
|
* @param {number|boolean} [bitsMessage] is zero or more MESSAGE_* category flag(s)
|
||||||
|
*/
|
||||||
|
printMessageIO(port, bOut, addrFrom, name, bIn, bitsMessage) {
|
||||||
|
if (DEBUGGER && this.dbg) {
|
||||||
|
if (bitsMessage === true) {
|
||||||
|
bitsMessage = 0;
|
||||||
|
} else if (bitsMessage == null) {
|
||||||
|
bitsMessage = this.bitsMessage;
|
||||||
|
}
|
||||||
|
this.dbg.messageIO(this, port, bOut, addrFrom, name, bIn, bitsMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,31 @@ var Component = require("../../shared/es6/component");
|
||||||
*/
|
*/
|
||||||
var DbgAddr;
|
var DbgAddr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Since the Closure Compiler treats ES6 classes as @struct rather than @dict by default,
|
||||||
|
* it deters us from defining named properties on our components; eg:
|
||||||
|
*
|
||||||
|
* this['exports'] = {...}
|
||||||
|
*
|
||||||
|
* results in an error:
|
||||||
|
*
|
||||||
|
* Cannot do '[]' access on a struct
|
||||||
|
*
|
||||||
|
* So, in order to define 'exports', we must override the @struct assumption by annotating
|
||||||
|
* the class as @unrestricted (or @dict). Note that this must be done both here and in the
|
||||||
|
* subclass (eg, SerialPort), because otherwise the Compiler won't allow us to *reference*
|
||||||
|
* the named property either.
|
||||||
|
*
|
||||||
|
* TODO: Consider marking ALL our classes unrestricted, because otherwise it forces us to
|
||||||
|
* define every single property the class uses in its constructor, which results in a fair
|
||||||
|
* bit of redundant initialization, since many properties aren't (and don't need to be) fully
|
||||||
|
* initialized until the appropriate init(), reset(), restore(), etc. function is called.
|
||||||
|
*
|
||||||
|
* The upside, however, may be that since the structure of the class is completely defined by
|
||||||
|
* the constructor, JavaScript engines may be able to optimize and run more efficiently.
|
||||||
|
*
|
||||||
|
* @unrestricted
|
||||||
|
*/
|
||||||
class Debugger extends Component {
|
class Debugger extends Component {
|
||||||
/**
|
/**
|
||||||
* Debugger(parmsDbg)
|
* Debugger(parmsDbg)
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ var Keys = {
|
||||||
/*
|
/*
|
||||||
* Keys and/or key combinations that generate common ASCII codes.
|
* Keys and/or key combinations that generate common ASCII codes.
|
||||||
*
|
*
|
||||||
* NOTE: If you're looking for a general-purpose ASCII code table, see str.ASCII in strlib.js;
|
* NOTE: If you're looking for a general-purpose ASCII code table, see Str.ASCII in strlib.js;
|
||||||
* if something's missing, that's probably the more appropriate table to add it to.
|
* if something's missing, that's probably the more appropriate table to add it to.
|
||||||
*
|
*
|
||||||
* TODO: The Closure Compiler doesn't inline all references to these values, at least those with
|
* TODO: The Closure Compiler doesn't inline all references to these values, at least those with
|
||||||
|
|
|
||||||
24
package.json
24
package.json
|
|
@ -144,15 +144,15 @@
|
||||||
"./modules/shared/lib/save.js"
|
"./modules/shared/lib/save.js"
|
||||||
],
|
],
|
||||||
"pc8080Files": [
|
"pc8080Files": [
|
||||||
"./modules/shared/lib/defines.js",
|
"./modules/shared/es6/defines.js",
|
||||||
"./modules/shared/lib/dumpapi.js",
|
"./modules/shared/es6/dumpapi.js",
|
||||||
"./modules/shared/lib/reportapi.js",
|
"./modules/shared/es6/reportapi.js",
|
||||||
"./modules/shared/lib/userapi.js",
|
"./modules/shared/es6/userapi.js",
|
||||||
"./modules/shared/lib/keys.js",
|
"./modules/shared/es6/keys.js",
|
||||||
"./modules/shared/lib/strlib.js",
|
"./modules/shared/es6/strlib.js",
|
||||||
"./modules/shared/lib/usrlib.js",
|
"./modules/shared/es6/usrlib.js",
|
||||||
"./modules/shared/lib/weblib.js",
|
"./modules/shared/es6/weblib.js",
|
||||||
"./modules/shared/lib/component.js",
|
"./modules/shared/es6/component.js",
|
||||||
"./modules/pc8080/lib/defines.js",
|
"./modules/pc8080/lib/defines.js",
|
||||||
"./modules/pc8080/lib/cpudef.js",
|
"./modules/pc8080/lib/cpudef.js",
|
||||||
"./modules/pc8080/lib/messages.js",
|
"./modules/pc8080/lib/messages.js",
|
||||||
|
|
@ -168,11 +168,11 @@
|
||||||
"./modules/pc8080/lib/keyboard.js",
|
"./modules/pc8080/lib/keyboard.js",
|
||||||
"./modules/pc8080/lib/video.js",
|
"./modules/pc8080/lib/video.js",
|
||||||
"./modules/pc8080/lib/serialport.js",
|
"./modules/pc8080/lib/serialport.js",
|
||||||
"./modules/shared/lib/debugger.js",
|
"./modules/shared/es6/debugger.js",
|
||||||
"./modules/pc8080/lib/debugger.js",
|
"./modules/pc8080/lib/debugger.js",
|
||||||
"./modules/pc8080/lib/computer.js",
|
"./modules/pc8080/lib/computer.js",
|
||||||
"./modules/shared/lib/state.js",
|
"./modules/shared/es6/state.js",
|
||||||
"./modules/shared/lib/embed.js"
|
"./modules/shared/es6/embed.js"
|
||||||
],
|
],
|
||||||
"pdp11Files": [
|
"pdp11Files": [
|
||||||
"./modules/shared/es6/defines.js",
|
"./modules/shared/es6/defines.js",
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,17 @@
|
||||||
(function(){/*
|
(function(){/*
|
||||||
http://pcjs.org/modules/shared/lib/dumpapi.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/dumpapi.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/reportapi.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/reportapi.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/userapi.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/userapi.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/keys.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/keys.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/strlib.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/strlib.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/usrlib.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/weblib.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/weblib.js (C) Jeff Parsons 2012-2016
|
|
||||||
http://pcjs.org/modules/pc8080/lib/cpudef.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/cpudef.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/messages.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/messages.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/debugger.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/state.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/debugger.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/embed.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/embed.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/defines.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/defines.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/usrlib.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/component.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/component.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/defines.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/defines.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/panel.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/panel.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/bus.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/bus.js (C) Jeff Parsons 2012-2016
|
||||||
|
|
@ -26,265 +25,265 @@
|
||||||
http://pcjs.org/modules/pc8080/lib/keyboard.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/keyboard.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/video.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/video.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/serialport.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/serialport.js (C) Jeff Parsons 2012-2016
|
||||||
|
http://pcjs.org/modules/shared/es6/debugger.js (C) Jeff Parsons 2012-2016
|
||||||
|
http://pcjs.org/modules/pc8080/lib/debugger.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/computer.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/computer.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016
|
|
||||||
*/
|
*/
|
||||||
var l,n={qe:0,te:1,ue:2,ve:3,we:4,xe:5,ye:6,ze:7,Ae:8,Be:9,Ce:10,De:11,Ee:12,Fe:13,Ge:14,He:15,Ie:16,Je:17,Ke:18,Le:19,Me:20,Ne:21,Oe:22,Pe:23,Qe:24,Re:25,Se:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Eb:65,Mc:66,Oc:67,bc:68,E:69,Rc:70,Sc:71,Tc:72,Uc:73,ad:74,bd:75,dc:76,jd:77,kd:78,md:79,nd:80,Q:81,td:82,wd:83,Cd:84,Dd:85,Ed:86,Fd:87,
|
var k;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}
|
||||||
Hd:88,Id:89,Pb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Jd:97,Bf:98,Cf:99,d:100,e:101,Df:102,Ef:103,Ff:104,Gf:105,Hf:106,k:107,If:108,Jf:109,n:110,Kf:111,p:112,q:113,r:114,Lf:115,t:116,Nf:117,Of:118,Pf:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Te:127};
|
var m={le:0,oe:1,pe:2,qe:3,re:4,se:5,te:6,ue:7,ve:8,we:9,xe:10,ye:11,ze:12,Ae:13,Be:14,Ce:15,De:16,Ee:17,Fe:18,Ge:19,He:20,Ie:21,Je:22,Ke:23,Le:24,Me:25,Ne:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,pb:65,rc:66,tc:67,Rb:68,E:69,xc:70,yc:71,zc:72,Ac:73,Hc:74,Ic:75,Ub:76,Pc:77,Qc:78,Sc:79,Tc:80,Q:81,Zc:82,bd:83,hd:84,jd:85,kd:86,ld:87,
|
||||||
function aa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
nd:88,od:89,Db:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,pd:97,wf:98,xf:99,d:100,e:101,yf:102,zf:103,Af:104,Bf:105,Cf:106,k:107,Df:108,Ef:109,n:110,Ff:111,p:112,q:113,r:114,Gf:115,t:116,If:117,Jf:118,Kf:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Oe:127};
|
||||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ba(a,b,c){var d="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8: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 t(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 ca(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||||
function ca(a){return t(a,2,!0)}function v(a){return t(a,4,!0)}function da(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 fa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ga(){var a=ia();return-1!==a.indexOf("pcjs.org",a.length-8)}var ka={"&":"&","<":"<",">":">",'"':""","'":"'"};function la(a){return a.replace(/[&<>"']/g,function(a){return ka[a]})}
|
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function da(a,b,c){var d="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8: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 n(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 ma(a,b){return(a+" ").slice(0,b)}function na(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var oa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
function ea(a){return n(a,2,!0)}function q(a){return n(a,4,!0)}function fa(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 ga(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ha(){var a=ja();return-1!==a.indexOf("pcjs.org",a.length-8)}function ka(a){return a.replace(/[&<>"']/g,function(a){return la[a]})}function na(a,b){return(a+" ").slice(0,b)}
|
||||||
function pa(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,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var qa=Date.now||function(){return+new Date};function ra(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var la={"&":"&","<":"<",">":">",'"':""","'":"'"},pa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
||||||
function 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 qa(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,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}function ra(){return Date.now()||+new Date}function sa(){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 ta(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"==
|
function ua(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}
|
||||||
typeof b){var k="",m;for(m in b)b.hasOwnProperty(m)&&(k&&(k+="&"),k+=m+"="+encodeURIComponent(b[m]));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 va(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var 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,
|
||||||
function ua(a,b){var c,d={Ba:null,Fa:null,$a:null,Sa: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.$a=g.load;d.Sa=g.exec;if(e=g.bytes)d.Ba=e;else if(e=g.words)for(d.Ba=Array(2*e.length),f=c=0;c<e.length;c++)d.Ba[f++]=e[c]&255,d.Ba[f++]=e[c]>>8&255;else if(e=g.data)for(d.Ba=Array(4*e.length),f=c=0;c<e.length;c++)d.Ba[f++]=
|
f,e))});if(b&&"object"==typeof b){var l="",p;for(p in b)b.hasOwnProperty(p)&&(l&&(l+="&"),l+=p+"="+encodeURIComponent(b[p]));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}
|
||||||
e[c]&255,d.Ba[f++]=e[c]>>8&255,d.Ba[f++]=e[c]>>16&255,d.Ba[f++]=e[c]>>24&255;else d.Ba=g;d.Fa=g.symbols;d.Ba.length?1==d.Ba.length&&(w(d.Ba[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.Ba=e)}return d}
|
function wa(a,b){var c,d={ma:null,ra:null,Qa:null,Ia: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.Qa=g.load;d.Ia=g.exec;if(e=g.bytes)d.ma=e;else if(e=g.words)for(d.ma=Array(2*e.length),f=c=0;c<e.length;c++)d.ma[f++]=e[c]&255,d.ma[f++]=e[c]>>8&255;else if(e=g.data)for(d.ma=Array(4*e.length),f=c=0;c<e.length;c++)d.ma[f++]=
|
||||||
function ia(){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;
|
e[c]&255,d.ma[f++]=e[c]>>8&255,d.ma[f++]=e[c]>>16&255,d.ma[f++]=e[c]>>24&255;else d.ma=g;d.ra=g.symbols;d.ma.length?1==d.ma.length&&(v(d.ma[0]),d=null):(v("Empty resource: "+a),d=null)}catch(h){v("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)){v("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.ma=e)}return d}
|
||||||
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 ja(){return"http://"+(window?window.location.host:"www.pcjs.org")}function xa(){return window?window.navigator.userAgent:""}function v(a){window&&window.alert(a)}function za(a){var b=!1;window&&(b=window.confirm(a));return b}
|
||||||
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){if(!Fa){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}Fa=c}return Fa[a]}function Ga(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
function Ba(){if(null==Ca){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}Ca=a}return Ca}function Da(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Ea(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}
|
||||||
function Ka(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 Fa=null,La={init:[],show:[],exit:[]},Ma=!1,Na=!1,Oa=!0;function Pa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}
|
function Fa(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)}return!1}function Ga(a){if(!Ha){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}Ha=c}return Ha[a]}function Ia(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||||
function Qa(a){La.init.push(a)}function Ra(a){if(Oa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){Ta("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks.",void 0,void 0)}}function Ua(a){!Oa&&a?(Oa=!0,Ma&&Va("init"),Na&&Va("show")):Oa=a}function Va(a){La[a]&&Ra(La[a])}Pa("onload",function(){Ma=!0;Ra(La.init)});Pa("onpageshow",function(){Na=!0;Ra(La.show)});Pa(Da("Opera")||Da("iOS")?"onunload":"onbeforeunload",function(){Ra(La.exit)});
|
function Ja(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}}function Ka(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Na(a){Oa.init.push(a)}
|
||||||
function x(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.jc=b.comment;this.Qd=b;b=this.id.indexOf(".");0>b?this.fb=this.id:(this.gb=this.id.substr(0,b),this.fb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,wb:!1,Qb:!1,xa:!1,error:!1};this.Ib=null;this.C.error=!1;this.M={};this.H=null;this.sa=d||0;Wa.push(this)}
|
function Pa(a){if(Qa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){Ra("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks.",void 0,void 0)}}function Sa(a){!Qa&&a?(Qa=!0,Ta&&Ua("init"),Va&&Ua("show")):Qa=a}function Ua(a){Oa[a]&&Pa(Oa[a])}var Ha=null,Oa={init:[],show:[],exit:[]},Ta=!1,Va=!1,Qa=!0,Ca=null;Ka("onload",function(){Ta=!0;Pa(Oa.init)});Ka("onpageshow",function(){Va=!0;Pa(Oa.show)});
|
||||||
function Xa(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 A(a,b){b||(b=x);a.prototype=Xa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ya=window.PCjs.Machines||(window.PCjs.Machines={}),Wa=window.PCjs.Components||(window.PCjs.Components=[])}else Ya={},Wa=[];
|
Ka(Fa("Opera")||Fa("iOS")?"onunload":"onbeforeunload",function(){Pa(Oa.exit)});function x(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.bc=b.comment;this.wd=b;this.exports={};a=this.id.indexOf(".");0>a?this.$a=this.id:(this.ab=this.id.substr(0,a),this.$a=this.id.substr(a+1));this.G={ready:!1,jb:!1,Eb:!1,ja:!1,error:!1};this.vb=null;this.G.error=!1;this.P={};this.ha=d||0;this.K=this.u=this.H=this.S=this.ta=null;Wa.push(this)}
|
||||||
function Za(a,b,c){Ya[a]&&b&&(Ya[a][b]=c)}function Ta(a,b,c){b||w((c?c+": ":"")+a)}function ab(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<Wa.length;b++){var d=Wa[b];a&&d.id.indexOf(a)||c.push(d)}return c}function bb(a){if(void 0!==a){var b;for(b=0;b<Wa.length;b++)if(Wa[b].id===a)return Wa[b]}return null}
|
function $a(a,b,c){ab[a]&&b&&(ab[a][b]=c)}function Ra(a,b,c){b||v((c?c+": ":"")+a)}function bb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<Wa.length;b++){var d=Wa[b];a&&d.id.indexOf(a)||c.push(d)}return c}function cb(a){if(void 0!==a){var b;for(b=0;b<Wa.length;b++)if(Wa[b].id===a)return Wa[b]}return null}
|
||||||
function cb(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<Wa.length;d++)if(c)c==Wa[d]&&(c=null);else if(!(a!=Wa[d].type||b&&Wa[d].id.indexOf(b)))return Wa[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){w(c.message+" ("+a+")")}return b}
|
function db(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<Wa.length;d++)if(c)c==Wa[d]&&(c=null);else if(!(a!=Wa[d].type||b&&Wa[d].id.indexOf(b)))return Wa[d]}return null}function eb(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){v(c.message+" ("+a+")")}return b}
|
||||||
function db(a,b){b=D(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(" "),k=0;k<h.length;k++)switch(g=h[k],g){case "pc8080-binding":(g=B(f))&&g.binding&&a.pa(g.type,g.binding,f,g.value),k=h.length}}}}
|
function fb(a,b){b=gb(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=eb(f))&&g.binding&&a.ca(g.type,g.binding,f,g.value),l=h.length}}}}
|
||||||
function D(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}
|
function gb(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}k=x.prototype;k.toString=function(){return this.name?this.name:this.id||this.type};
|
||||||
x.prototype={constructor:x,parent:null,toString:function(){return this.name?this.name:this.id||this.type},pa:function(a,b,c){switch(b){case "clear":return this.M[b]||(this.M[b]=c,c.onclick=function(a){return function(){a.M.print&&(a.M.print.value="")}}(this)),!0;case "print":return this.M[b]||(this.Ia=this.M[b]=c,c.value="",this.g=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),
|
k.ca=function(a,b,c){switch(b){case "clear":return this.P[b]||(this.P[b]=c,c.onclick=function(a){return function(){a.P.print&&(a.P.print.value="")}}(this)),!0;case "print":return this.P[b]||(this.ta=this.P[b]=c,c.value="",this.i=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.aa=function(a){this.i(a,this.$a)}),!0;default:return!1}};k.log=function(){};k.i=function(){};
|
||||||
this.ja=function(a){this.g(a,this.fb)}),!0;default:return!1}},log:function(){},g:function(){},status:function(a){this.g(this.fb+": "+a)},ja:function(a,b,c){Ta(a,b,c||this.type)},Ga:function(){return this.C.xa=!0},Ka:function(a,b){b&&(this.C.xa=!1);return!0}};function E(a,b,c,d,e,f,g){a.H&&(!0===g?g=0:null==g&&(g=a.sa),eb(a.H,a,b,c,d,e,f,g))}function fb(a,b){a.H&&gb(a,0)&&a.H.message(b,void 0)}function gb(a,b){if(a.H){a===a.H?b|=0:b=b||a.sa;var c=a.H.sa&b;return!!b&&c===b||!!(c&a.H.Nd)}return!1}
|
k.status=function(a){this.i(this.$a+": "+a)};k.aa=function(a,b,c){Ra(a,b,c||this.type)};function hb(a,b){a.G.error=!0;a.aa(b)}function ib(a,b){b&&(a.G.ready?b():a.vb=b);return a.G.ready}function kb(a){if(!a.G.error&&(a.G.ready=!0,a.G.ready)){var b=a.vb;a.vb=null;b&&b()}}function lb(a,b){a.G.jb&&(b?a.G.Eb=!0:void 0===b&&a.i(a.toString()+" busy"));return a.G.jb}function mb(a,b){if(a.G.Eb)return a.G.jb=!1,a.G.Eb=!1;if(a.G.error)return a.i(a.toString()+" error"),!1;a.G.jb=b;return a.G.jb}
|
||||||
function hb(a,b){if(a.C.Qb)return a.C.wb=!1,a.C.Qb=!1;if(a.C.error)return a.g(a.toString()+" error"),!1;a.C.wb=b;return a.C.wb}function ib(a,b){a.C.wb&&(b?a.C.Qb=!0:void 0===b&&a.g(a.toString()+" busy"));return a.C.wb}function F(a){if(!a.C.error&&(a.C.ready=!0,a.C.ready)){var b=a.Ib;a.Ib=null;b&&b()}}function jb(a,b){b&&(a.C.ready?b():a.Ib=b);return a.C.ready}function kb(a,b){a.C.error=!0;a.ja(b)}
|
k.ua=function(){return this.G.ja=!0};k.wa=function(a,b){b&&(this.G.ja=!1);return!0};function nb(a,b){if(a.K){a===a.K?b|=0:b=b||a.ha;var c=a.K.ha&b;return!!b&&c===b||!!(c&a.K.td)}return!1}function ob(a,b){a.K&&nb(a,0)&&a.K.message(b,void 0)}function y(a,b,c,d,e,f,g){a.K&&(!0===g?g=0:null==g&&(g=a.ha),pb(a.K,a,b,c,d,e,f,g))}window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));
|
||||||
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});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
var ab=window?window.PCjs.Machines:{},Wa=window?window.PCjs.Components:[];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});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
||||||
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});
|
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 lb="undefined"!==typeof ArrayBuffer,mb=[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,
|
var rb="undefined"!==typeof ArrayBuffer,sb=[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],nb={cpu:1,bus:64,mem:128,port:256,nvr:16384,chipset:32768,keyboard:65536,key:131072,video:262144,fdc:524288,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function ob(a){x.call(this,"Panel",a,ob)}A(ob);l=ob.prototype;
|
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],tb={cpu:1,bus:64,mem:128,port:256,nvr:16384,chipset:32768,keyboard:65536,key:131072,video:262144,fdc:524288,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function ub(a){x.call(this,"Panel",a)}ba(ub,x);
|
||||||
l.pa=function(a,b,c,d){return this.A&&this.A.pa(a,b,c,d)||this.b&&this.b.pa(a,b,c,d)||this.I&&this.I.pa(a,b,c,d)||this.H&&this.H.pa(a,b,c,d)?!0:this.parent.pa.call(this,a,b,c,d)};l.Qa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.H=d;this.I=rb(a,"Keyboard")};l.Ga=function(a,b){b||sb();return!0};l.Ka=function(){return!0};l.Aa=function(){};function sb(){for(var a=!1,b=D(document,"pc8080","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=bb(e.id);f||(a=!0,f=new ob(e));db(f,d);a&&F(f)}}Qa(sb);
|
ub.prototype.ca=function(a,b,c,d){return this.S&&this.S.ca(a,b,c,d)||this.u&&this.u.ca(a,b,c,d)||this.B&&this.B.ca(a,b,c,d)||this.K&&this.K.ca(a,b,c,d)?!0:x.prototype.ca.call(this,a,b,c,d)};ub.prototype.Ea=function(a,b,c,d){this.S=a;this.H=b;this.u=c;this.K=d;this.B=vb(a,"Keyboard")};ub.prototype.ua=function(a,b){b||wb();return!0};ub.prototype.wa=function(){return!0};
|
||||||
function tb(a,b,c){x.call(this,"Bus",a,tb);this.b=b;this.H=c;this.J=a.busWidth||16;this.K=Math.pow(2,this.J);this.u=this.K-1|0;this.ha=(this.J>>1)+2;10>this.ha&&(this.ha=10);15<this.ha&&(this.ha=15);this.Ja=1<<this.ha;this.L=this.Ja>>2;this.w=this.Ja-1;this.I=this.K/this.Ja|0;this.D=this.I-1;this.A=[];this.j=[];this.F=this.B=!1;this.N=[];this.O=[];a=new G;ub(a,this.H);this.W=Array(this.I);for(b=0;b<this.I;b++)this.W[b]=a;F(this)}A(tb);l=tb.prototype;l.reset=function(){};
|
function wb(){for(var a=!1,b=gb(document,"pc8080","panel"),c=0;c<b.length;c++){var d=b[c],e=eb(d),f=cb(e.id);f||(a=!0,f=new ub(e));fb(f,d);a&&kb(f)}}Na(wb);
|
||||||
l.Ga=function(a,b){b||this.reset();return!0};function vb(a,b,c,d){for(var e=b,f=c,g=e>>>a.ha;0<f&&g<a.W.length;){var h=a.W[g],k=g*a.Ja,m=a.Ja-(e-k);m>f&&(m=f);if(h&&h.size){if(h.type==d){if(e+f<=h.G)return h.Cb+=h.G-e,h.G=e,!0;if(e>=h.G+h.Cb){m=h.size-(e-k);m>f&&(m=f);h.Cb=e-h.G+m;e=k+a.Ja;f-=m;g++;continue}}return wb(1,e,f)}e=new G(e,m,a.Ja,d);ub(e,a.H,h);a.W[g++]=e;e=k+a.Ja;f-=m}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+xb[d]+" at "+v(b)),!0):wb(2,b,c)}
|
function xb(a,b,c){x.call(this,"Bus",a);this.u=b;this.K=c;this.M=a.busWidth||16;this.N=Math.pow(2,this.M);this.C=this.N-1|0;this.g=(this.M>>1)+2;10>this.g&&(this.g=10);15<this.g&&(this.g=15);this.w=1<<this.g;this.O=this.w>>2;this.j=this.w-1;this.L=this.N/this.w|0;this.I=this.L-1;this.A=[];this.B=[];this.D=this.F=!1;this.R=[];this.T=[];a=new z;yb(a,this.K);this.b=Array(this.L);for(b=0;b<this.L;b++)this.b[b]=a;kb(this)}ba(xb,x);xb.prototype.reset=function(){};
|
||||||
l.Z=function(a){return this.W[(a&this.u)>>>this.ha].nb(a&this.w,a)};function yb(a,b){return a.W[(b&a.u)>>>a.ha].Ab(b&a.w,b)}l.ab=function(a){var b=a&this.w,c=(a&this.u)>>>this.ha;return b!=this.w?this.W[c].Fc(b,a):this.W[c++].nb(b,a)|this.W[c&this.D].nb(0,a+1)<<8};function zb(a,b){var c=b&a.w,d=(b&a.u)>>>a.ha;return c!=a.w?a.W[d].Vb(c,b):a.W[d++].Ab(c,b)|a.W[d&a.D].Ab(0,b+1)<<8}l.ua=function(a,b){this.W[(a&this.u)>>>this.ha].pb(a&this.w,b&255,a)};
|
xb.prototype.ua=function(a,b){b||this.reset();return!0};function zb(a,b,c,d){for(var e=b,f=c,g=e>>>a.g;0<f&&g<a.b.length;){var h=a.b[g],l=g*a.w,p=a.w-(e-l);p>f&&(p=f);if(h&&h.size){if(h.type==d){if(e+f<=h.J)return h.mb+=h.J-e,h.J=e,!0;if(e>=h.J+h.mb){p=h.size-(e-l);p>f&&(p=f);h.mb=e-h.J+p;e=l+a.w;f-=p;g++;continue}}return Ab(Bb,e,f)}e=new z(e,p,a.w,d);yb(e,a.K,h);a.b[g++]=e;e=l+a.w;f-=p}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+Cb[d]+" at "+q(b)),!0):Ab(Db,b,c)}
|
||||||
function Ab(a,b,c){a.W[(b&a.u)>>>a.ha].Db(b&a.w,c&255,b)}l.Mb=function(a,b){var c=a&this.w,d=(a&this.u)>>>this.ha;c!=this.w?this.W[d].Hc(c,b&65535,a):(this.W[d++].pb(c,b&255,a),this.W[d&this.D].pb(0,b>>8&255,a+1))};function Bb(a){for(var b=0,c=[],d=0;d<a.I;d++){var e=a.W[d];if(e.Oa||e.Cc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,k=[];g<e.length;){for(var m=e[g],p=g+1;p<e.length&&e[p]===m;)p++;k[h++]=p-g;k[h++]=m;g=p}k.length<e.length&&(e=k)}c[f]=e}}return c}
|
function Eb(a,b){return a.b[(b&a.C)>>>a.g].lb(b&a.j,b)}function Fb(a,b){var c=b&a.j,d=(b&a.C)>>>a.g;return c!=a.j?a.b[d].kc(c,b):a.b[d++].Xa(c,b)|a.b[d&a.I].Xa(0,b+1)<<8}function Gb(a,b){var c=b&a.j,d=(b&a.C)>>>a.g;return c!=a.j?a.b[d].Jb(c,b):a.b[d++].lb(c,b)|a.b[d&a.I].lb(0,b+1)<<8}function Hb(a,b,c){a.b[(b&a.C)>>>a.g].nb(b&a.j,c&255,b)}function Ib(a,b,c){var d=b&a.j,e=(b&a.C)>>>a.g;d!=a.j?a.b[e].nc(d,c&65535,b):(a.b[e++].Ya(d,c&255,b),a.b[e&a.I].Ya(0,c>>8&255,b+1))}
|
||||||
function Cb(a,b){if(void 0===b)return a.F=!a.F,a.F;void 0===a.A[b]&&(a.A[b]=[null,!1]);a.A[b][1]=!a.A[b][1];return a.A[b][1]}function Db(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 k=+e+d;k<=g;k++)void 0!==f.A[k]?w("Input port "+v(k)+" already registered"):f.A[k]=[h,!1]}}
|
function Jb(a){for(var b=0,c=[],d=0;d<a.L;d++){var e=a.b[d];if(e.Ca||e.gc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var p=e[g],r=g+1;r<e.length&&e[r]===p;)r++;l[h++]=r-g;l[h++]=p;g=r}l.length<e.length&&(e=l)}c[f]=e}}return c}function Kb(a,b){if(void 0===b)return a.D=!a.D,a.D;void 0===a.A[b]&&(a.A[b]=[null,!1]);a.A[b][1]=!a.A[b][1];return a.A[b][1]}
|
||||||
function Eb(a,b,c){for(var d=1,e=0,f=0;0<d;){var g=a.A[b],h=a.N[b]||1,k=1==h?255:2==h?65535:-1,m=k;void 0!==g?(g[0]&&(m=g[0](b,c),void 0===m?m=k:m&=k),a.H&&a.F!=g[1]&&Fb(a.H,b,m)):a.H&&(eb(a.H,a,b,null,c),a.F&&Fb(a.H,b,m));e|=m<<f;f+=h<<3;b+=h;d-=h}return e}function Hb(a,b){if(void 0===b)return a.B=!a.B,a.B;void 0===a.j[b]&&(a.j[b]=[null,!1]);a.j[b][1]=!a.j[b][1];return a.j[b][1]}
|
function Nb(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.A[l]?v("Input port "+q(l)+" already registered"):f.A[l]=[h,!1]}}function Ob(a,b,c){for(var d=1,e=0,f=0;0<d;){var g=a.A[b],h=a.R[b]||1,l=1==h?255:2==h?65535:-1,p=l;void 0!==g?(g[0]&&(p=g[0](b,c),void 0===p?p=l:p&=l),a.K&&a.D!=g[1]&&Pb(a.K,b,p)):a.K&&(pb(a.K,a,b,null,c),a.D&&Pb(a.K,b,p));e|=p<<f;f+=h<<3;b+=h;d-=h}return e}
|
||||||
function Ib(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 k=+e+d;k<=g;k++)void 0!==f.j[k]?w("Output port "+v(k)+" already registered"):f.j[k]=[h,!1]}}function Jb(a,b,c,d){for(var e=1,f=0;0<e;){var g=a.j[b],h=a.O[b]||1,k=1==h?255:2==h?65535:-1,k=(c>>>=f)&k;if(void 0!==g){if(g[0])g[0](b,k,d);a.H&&a.B!=g[1]&&Tb(a.H,b,k)}else a.H&&(eb(a.H,a,b,k,d),a.B&&Tb(a.H,b,k));f+=h<<3;b+=h;e-=h}}
|
function Qb(a,b){if(void 0===b)return a.F=!a.F,a.F;void 0===a.B[b]&&(a.B[b]=[null,!1]);a.B[b][1]=!a.B[b][1];return a.B[b][1]}function Rb(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.B[l]?v("Output port "+q(l)+" already registered"):f.B[l]=[h,!1]}}
|
||||||
function wb(a,b,c){w("Memory block error ("+a+": "+t(b)+","+t(c)+")");return!1}var Ub;if(lb){var Vb=new ArrayBuffer(2);(new DataView(Vb)).setUint16(0,256,!0);Ub=256===(new Uint16Array(Vb))[0]}else Ub=!1;var Wb=Ub;
|
function Sb(a,b,c,d){for(var e=1,f=0;0<e;){var g=a.B[b],h=a.T[b]||1,l=1==h?255:2==h?65535:-1,l=(c>>>=f)&l;if(void 0!==g){if(g[0])g[0](b,l,d);a.K&&a.F!=g[1]&&Tb(a.K,b,l)}else a.K&&(pb(a.K,a,b,l,d),a.F&&Tb(a.K,b,l));f+=h<<3;b+=h;e-=h}}function Ab(a,b,c){v("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1}var Bb=1,Db=2,Ub;if(rb){var Vb=new ArrayBuffer(2);(new DataView(Vb)).setUint16(0,256,!0);Ub=256===(new Uint16Array(Vb))[0]}else Ub=!1;var Wb=Ub;
|
||||||
function G(a,b,c,d){this.id=Xb+=2;this.b=null;this.G=a;this.Cb=b;this.size=c||0;this.type=d||Yb;this.M=d==Zb;ub(this);this.Oa=this.Cc=!1;if(c)if(lb)this.F=new ArrayBuffer(c),this.B=new DataView(this.F,0,c),this.w=new Uint8Array(this.F,0,c),this.I=new Uint16Array(this.F,0,c>>1),this.b=new Int32Array(this.F,0,c>>2),$b(this,Wb?ac:bc);else{this.b=Array(c>>2);for(a=0;a<this.b.length;a++)this.b[a]=0;$b(this,cc)}else $b(this)}var Yb=0,Zb=2,xb=["NONE","RAM","ROM","VID","H/W"],Xb=0;
|
function z(a,b,c,d){this.id=Xb+=2;this.b=null;this.J=a;this.mb=b;this.size=c||0;this.type=d||Yb;this.u=d==Zb;yb(this);this.Ca=this.gc=!1;if(c)if(rb)this.j=new ArrayBuffer(c),this.w=new DataView(this.j,0,c),this.g=new Uint8Array(this.j,0,c),this.A=new Uint16Array(this.j,0,c>>1),this.b=new Int32Array(this.j,0,c>>2),$b(this,Wb?ac:bc);else{this.b=Array(c>>2);for(a=0;a<this.b.length;a++)this.b[a]=0;$b(this,cc)}else $b(this)}k=z.prototype;
|
||||||
G.prototype={constructor:G,parent:null,save:function(){var a,b;if(lb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.B.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(a&&this.size==a.length<<2){var b;if(lb)for(b=0;b<a.length;b++)this.B.setInt32(b<<2,a[b],!0);else this.b=a;return this.Oa=!0}return!1},Za:function(a,b){b?this.j++||dc(this,ec,!1):this.A++||fc(this,ec,!1)},J:function(){this.H&&gb(this.H,129)&&this.H.message("attempt to read invalid block %"+t(this.G),!0);return 255},
|
k.save=function(){var a,b;if(rb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.w.getInt32(b<<2,!0);else a=this.b;return a};k.restore=function(a){if(a&&this.size==a.length<<2){var b;if(rb)for(b=0;b<a.length;b++)this.w.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ca=!0}return!1};function $b(a,b){b||(b=ec);fc(a,b,void 0);gc(a,b,void 0)}function fc(a,b,c){c&&a.H||(a.Xa=b[0]||a.jc,a.kc=b[2]||a.lc);if(c||void 0===c)a.lb=b[0]||a.jc,a.Jb=b[2]||a.lc}
|
||||||
u:function(a,b){this.H&&gb(this.H,129)&&this.H.message("attempt to write "+v(b)+" to invalid block %"+t(this.G),!0)},K:function(a,b){return this.nb(a++,b++)|this.nb(a,b)<<8},D:function(a,b,c){this.pb(a++,b&255,c++);this.pb(a,b>>8,c)},X:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ea:function(a){var b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},gb:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Oa=!0},va:function(a,b){var c=a>>
|
function gc(a,b,c){c&&a.P||(a.Ya=!a.u&&b[1]||a.ob,a.nc=!a.u&&b[3]||a.Nb);if(c||void 0===c)a.nb=b[1]||a.ob,a.Ob=b[3]||a.Nb}k.Pa=function(a,b){b?this.P++||gc(this,hc,!1):this.H++||fc(this,hc,!1)};function rc(a,b){b?--a.P||(a.Ya=a.u?a.ob:a.nb,a.nc=a.u?a.Nb:a.Ob):--a.H||(a.Xa=a.lb,a.kc=a.Jb)}function yb(a,b,c){a.K=b;a.H=a.P=0;c&&((a.H=c.H)&&fc(a,hc,!1),(a.P=c.P)&&gc(a,hc,!1))}k.jc=function(){this.K&&nb(this.K,129)&&this.K.message("attempt to read invalid block %"+n(this.J),!0);return 255};
|
||||||
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.Oa=!0},N:function(a,b){if(this.H&&null!=this.G){var c=this.H;gc(c,this.G+a,1,c.N)&&c.qa(!0)}return this.Ab(a,b)},ba:function(a,b){if(this.H&&null!=this.G){var c=this.H;gc(c,this.G+a,2,c.N)&&c.qa(!0)}return this.Vb(a,b)},ia:function(a,b,c){if(this.H&&null!=this.G){var d=this.H;gc(d,this.G+a,1,d.B)&&d.qa(!0)}this.M?this.u(a,b,c):this.Db(a,b,c)},la:function(a,b,c){if(this.H&&
|
k.ob=function(a,b){this.K&&nb(this.K,129)&&this.K.message("attempt to write "+q(b)+" to invalid block %"+n(this.J),!0)};k.lc=function(a,b){return this.Xa(a++,b++)|this.Xa(a,b)<<8};k.Nb=function(a,b,c){this.Ya(a++,b&255,c++);this.Ya(a,b>>8,c)};k.Xd=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};k.ae=function(a){var b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8};k.fe=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Ca=!0};
|
||||||
null!=this.G){var d=this.H;gc(d,this.G+a,2,d.B)&&d.qa(!0)}this.M?this.u(a,b,c):this.Zb(a,b,c)},L:function(a){return this.w[a]},O:function(a){return this.w[a]},aa:function(a){return this.B.getUint16(a,!0)},da:function(a){return a&1?this.w[a]|this.w[a+1]<<8:this.I[a>>1]},ga:function(a,b){this.w[a]=b;this.Oa=!0},fb:function(a,b){this.w[a]=b;this.Oa=!0},ka:function(a,b){this.B.setUint16(a,b,!0);this.Oa=!0},ma:function(a,b){a&1?(this.w[a]=b,this.w[a+1]=b>>8):this.I[a>>1]=b;this.Oa=!0}};
|
k.je=function(a,b){var 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.Ca=!0};k.Vd=function(a,b){if(this.K&&null!=this.J){var c=this.K;sc(c,this.J+a,1,c.I)&&c.da(!0)}return this.lb(a,b)};k.Zd=function(a,b){if(this.K&&null!=this.J){var c=this.K;sc(c,this.J+a,2,c.I)&&c.da(!0)}return this.Jb(a,b)};
|
||||||
function ub(a,b,c){a.H=b;a.A=a.j=0;c&&((a.A=c.A)&&fc(a,ec,!1),(a.j=c.j)&&dc(a,ec,!1))}function hc(a,b){b?--a.j||(a.pb=a.M?a.u:a.Db,a.Hc=a.M?a.D:a.Zb):--a.A||(a.nb=a.Ab,a.Fc=a.Vb)}function dc(a,b,c){c&&a.j||(a.pb=!a.M&&b[1]||a.u,a.Hc=!a.M&&b[3]||a.D);if(c||void 0===c)a.Db=b[1]||a.u,a.Zb=b[3]||a.D}function fc(a,b,c){c&&a.A||(a.nb=b[0]||a.J,a.Fc=b[2]||a.K);if(c||void 0===c)a.Ab=b[0]||a.J,a.Vb=b[2]||a.K}function $b(a,b){b||(b=ic);fc(a,b,void 0);dc(a,b,void 0)}
|
k.de=function(a,b,c){if(this.K&&null!=this.J){var d=this.K;sc(d,this.J+a,1,d.w)&&d.da(!0)}this.u?this.ob(0,b):this.nb(a,b,c)};k.he=function(a,b,c){if(this.K&&null!=this.J){var d=this.K;sc(d,this.J+a,2,d.w)&&d.da(!0)}this.u?this.ob(0,b):this.Ob(a,b,c)};k.Ud=function(a){return this.g[a]};k.Wd=function(a){return this.g[a]};k.Yd=function(a){return this.w.getUint16(a,!0)};k.$d=function(a){return a&1?this.g[a]|this.g[a+1]<<8:this.A[a>>1]};k.ce=function(a,b){this.g[a]=b;this.Ca=!0};
|
||||||
var ic=[],cc=[G.prototype.X,G.prototype.gb,G.prototype.ea,G.prototype.va],ec=[G.prototype.N,G.prototype.ia,G.prototype.ba,G.prototype.la];if(lb)var bc=[G.prototype.L,G.prototype.ga,G.prototype.aa,G.prototype.ka],ac=[G.prototype.O,G.prototype.fb,G.prototype.da,G.prototype.ma];
|
k.ee=function(a,b){this.g[a]=b;this.Ca=!0};k.ge=function(a,b){this.w.setUint16(a,b,!0);this.Ca=!0};k.ie=function(a,b){a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.A[a>>1]=b;this.Ca=!0};var Yb=0,Zb=2,Cb=["NONE","RAM","ROM","VID","H/W"],Xb=0,ec=[],cc=[z.prototype.Xd,z.prototype.fe,z.prototype.ae,z.prototype.je],hc=[z.prototype.Vd,z.prototype.de,z.prototype.Zd,z.prototype.he];if(rb)var bc=[z.prototype.Ud,z.prototype.ce,z.prototype.Yd,z.prototype.ge],ac=[z.prototype.Wd,z.prototype.ee,z.prototype.$d,z.prototype.ie];
|
||||||
function jc(a,b){x.call(this,"CPU",a,jc,1);var c=a.multiplier||1;this.X=a.cycles||b;this.Ra=c;this.ga=Math.round(this.X/1E4)/100;this.bb=this.ga*this.Ra;this.C.za=!1;this.C.Yb=!1;this.C.vb=a.autoStart;this.C.Ac=!1;this.C.jb=!1;this.xb=this.N=0;this.yb=a.csStart;this.lb=a.csInterval;this.mb=a.csStop;this.u=[];this.Ha=this.cb.bind(this);F(this)}A(jc);var kc=["power","reset"];l=jc.prototype;
|
function tc(a,b){x.call(this,"CPU",a,0,1);var c=a.multiplier||1;this.Fa=a.cycles||b;this.U=c;this.Sa=Math.round(this.Fa/1E4)/100;this.Z=this.Sa*this.U;this.G.ka=!1;this.G.Mb=!1;this.G.ib=a.autoStart;this.G.ec=!1;this.G.Va=!1;this.ya=this.oa=0;this.za=a.csStart;this.na=a.csInterval;this.sa=a.csStop;this.T=[];this.zb=this.qb.bind(this);kb(this)}ba(tc,x);k=tc.prototype;
|
||||||
l.Qa=function(a,b,c,d){this.A=a;this.w=b;this.H=d;for(b=0;b<kc.length;b++)(c=this.M[kc[b]])&&this.A.pa(null,kc[b],c);this.F=rb(a,"ChipSet");a=lc(a,"autoStart");null!=a&&(this.C.vb="true"==a?!0:"false"==a?!1:!!a);F(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};
|
k.Ea=function(a,b,c,d){this.S=a;this.H=b;this.K=d;for(b=0;b<uc.length;b++)(c=this.P[uc[b]])&&this.S.ca(null,uc[b],c);this.W=vb(a,"ChipSet");a=vc(a,"autoStart");null!=a&&(this.G.ib="true"==a?!0:"false"==a?!1:!!a);kb(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
|
||||||
l.Ga=function(a,b){if(!b){if(a&&this.restore){mc(this);if(!this.restore(a))return!1;nc(this)}else this.reset();this.H?(a=this.H,a.g("Type ? for help with PC8080 Debugger commands"),a.Aa(),a.Ca&&(b=a.Ca,a.Ca=null,oc(a,b))):this.g("No debugger detected")}pc(this);return!0};l.Ka=function(a){return a?this.save():!0};l.vb=function(){return this.C.vb||!this.H&&void 0===this.M.run?(this.cb(),!0):!1};l.Dc=function(){return 0};
|
k.ua=function(a,b){if(!b){if(a&&this.restore){wc(this);if(!this.restore(a))return!1;xc(this)}else this.reset();this.K?(a=this.K,a.i("Type ? for help with PC8080 Debugger commands"),yc(a),a.ea&&(b=a.ea,a.ea=null,zc(a,b))):this.i("No debugger detected")}Ac(this);return!0};k.wa=function(a){return a?this.save():!0};k.ib=function(){return this.G.ib||!this.K&&void 0===this.P.run?(this.qb(),!0):!1};k.hc=function(){return 0};
|
||||||
function nc(a){void 0===a.yb&&(a.yb=0);void 0===a.lb&&(a.lb=-1);void 0===a.mb&&(a.mb=-1);a.C.jb=0<=a.yb&&0<a.lb;a.C.jb&&(a.xb=0,a.N=a.yb-a.L)}function qc(a,b){if(a.C.jb){var c=!1;a.xb=a.xb+a.Dc()|0;a.N-=b;0>=a.N&&(a.N+=a.lb,c=!0);0<=a.mb&&a.mb<=Dc(a)&&(a.lb=a.mb=-1,nc(a),a.qa(),c=!0);c&&a.g(Dc(a)+" cycles: checksum="+t(a.xb))}}
|
function xc(a){void 0===a.za&&(a.za=0);void 0===a.na&&(a.na=-1);void 0===a.sa&&(a.sa=-1);a.G.Va=0<=a.za&&0<a.na;a.G.Va&&(a.ya=0,a.oa=a.za-a.la)}function Bc(a,b){if(a.G.Va){var c=!1;a.ya=a.ya+a.hc()|0;a.oa-=b;0>=a.oa&&(a.oa+=a.na,c=!0);0<=a.sa&&a.sa<=Cc(a)&&(a.na=a.sa=-1,xc(a),a.da(),c=!0);c&&a.i(Cc(a)+" cycles: checksum="+n(a.ya))}}
|
||||||
l.pa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.M[b]=c;a=!0;break;case "run":this.M[b]=c;c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.C.xa)a=!0;else{var b=null,c,h=ab(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.C.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.C.xa);c++);c==h.length&&(b=a);w("The "+b.type+" component ("+b.id+") is not "+(b.C.ready?"powered yet":"ready yet"+(b.Ib?" (waiting for notification)":""))+".");a=!1}a&&(d.C.za?d.qa():d.cb())};
|
k.ca=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.P[b]=c;a=!0;break;case "run":this.P[b]=c;c.onclick=function(){var a;if(a=d.S)if(a=d.S,a.G.ja)a=!0;else{var b=null,c,h=bb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.G.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.G.ja);c++);c==h.length&&(b=a);v("The "+b.type+" component ("+b.id+") is not "+(b.G.ready?"powered yet":"ready yet"+(b.vb?" (waiting for notification)":""))+".");a=!1}a&&(d.G.ka?d.da():d.qb())};
|
||||||
a=!0;break;case "speed":this.M[b]=c;a=!0;break;case "setSpeed":this.M[b]=c,c.onclick=function(){Ec(d,d.Ra<<1,!0)},c.textContent=this.bb.toFixed(2)+"Mhz",a=!0}return a};function Fc(a,b,c){a.L+=b;c&&(a.K=a.b=0)}function Gc(a,b){var c=1;b&&1<a.Ra&&a.I&&(c=a.I/a.ga);a.va=Math.round(1E3/30);a.ea=Math.floor(a.X/30*c);b||(a.O=a.ea);a.ia=0}function Dc(a){return a.L+a.D+a.K-a.b}function mc(a){a.I=0;a.Ca=0;a.L=a.D=a.K=a.b=0;nc(a);Ec(a,1)}
|
a=!0;break;case "speed":this.P[b]=c;a=!0;break;case "setSpeed":this.P[b]=c,c.onclick=function(){Dc(d,d.U<<1,!0)},c.textContent=this.Z.toFixed(2)+"Mhz",a=!0}return a};function Ec(a,b,c){a.la+=b;c&&(a.ga=a.b=0)}function Fc(a,b){var c=1;b&&1<a.U&&a.Y&&(c=a.Y/a.Sa);a.gb=Math.round(1E3/Gc);a.Na=Math.floor(a.Fa/Gc*c);b||(a.va=a.Na);a.Ua=0}function Cc(a){return a.la+a.X+a.ga-a.b}function wc(a){a.Y=0;a.hb=0;a.la=a.X=a.ga=a.b=0;xc(a);Dc(a,1)}
|
||||||
function Ec(a,b,c){var d=!1;if(void 0!==b){.8>a.I/a.bb?b=1:d=!0;a.Ra=b;b=a.ga*a.Ra;if(a.bb!=b){a.bb=b;b=a.bb.toFixed(2)+"Mhz";var e=a.M.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.A&&a.A.Bb()}Fc(a,a.D);a.D=0;a.B=qa();a.J=0;Gc(a);return d}function Hc(a,b){var c=a.u.length;a.u.push([-1,b]);return c}function Ic(a,b,c){0<=b&&b<a.u.length&&0>a.u[b][0]&&(c*=a.X*a.Ra/1E3,a.u[b][0]=c+Jc(a))}function Jc(a,b){var c=a.K-=a.b;a.b=0;b&&(a.K=0);return c}
|
function Dc(a,b,c){var d=!1;if(void 0!==b){.8>a.Y/a.Z?b=1:d=!0;a.U=b;b=a.Sa*a.U;if(a.Z!=b){a.Z=b;b=a.Z.toFixed(2)+"Mhz";var e=a.P.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.S&&Hc(a.S)}Ec(a,a.X);a.X=0;a.V=ra();a.ea=0;Fc(a);return d}function Ic(a,b){var c=a.T.length;a.T.push([-1,b]);return c}function Jc(a,b,c){0<=b&&b<a.T.length&&0>a.T[b][0]&&(c*=a.Fa*a.U/1E3,a.T[b][0]=c+Kc(a))}function Kc(a,b){var c=a.ga-=a.b;a.b=0;b&&(a.ga=0);return c}
|
||||||
l.cb=function(a){if(hb(this,!0)){if(!this.C.za){Ec(this);this.A&&this.A.start(this.B,Dc(this));this.C.za=!0;this.C.Yb=!0;this.F&&this.F.start();var b=this.M.run;b&&(b.textContent="Halt");this.A&&(this.A.Aa(!0),a&&this.A.Bb(!0))}this.ia>=this.X&&Gc(this,!0);this.aa=0;this.da=qa();this.J&&(a=this.da-this.J,a>this.va&&(this.B+=a,this.B>this.da&&(this.B=this.da)));try{do{for(var c,d=this.C.jb?1:this.ea,e=this.u.length-1;0<=e;e--){var f=this.u[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.ob(c);c=Jc(this,!0);this.aa+=
|
k.qb=function(a){if(mb(this,!0)){if(!this.G.ka){Dc(this);this.S&&this.S.start(this.V,Cc(this));this.G.ka=!0;this.G.Mb=!0;this.W&&this.W.start();var b=this.P.run;b&&(b.textContent="Halt");this.S&&(Lc(this.S,!0),a&&Hc(this.S,!0))}this.Ua>=this.Fa&&Fc(this,!0);this.Ha=0;this.Ma=ra();this.ea&&(a=this.Ma-this.ea,a>this.gb&&(this.V+=a,this.V>this.Ma&&(this.V=this.Ma)));try{do{for(var c,d=this.G.Va?1:this.Na,e=this.T.length-1;0<=e;e--){var f=this.T[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.Ab(c);c=Kc(this,!0);
|
||||||
c;this.D+=c;qc(this,c);a=c;for(var g=this.u.length-1;0<=g;g--){var h=this.u[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.O-=c;if(0>=this.O){this.O+=this.ea;15<=++this.Ca&&(this.A&&this.A.Aa(),this.Ca=0);break}}while(this.C.za)}catch(k){this.qa();pc(this);this.A&&this.A.stop(qa(),Dc(this));hb(this,!1);kb(this,k.stack||k.message);return}c=setTimeout;d=this.Ha;this.J=qa();e=this.va;this.aa&&(e=Math.round(e*this.aa/this.ea));e-=this.J-this.da;if(f=this.J-this.B)this.I=Math.round(this.D/(10*f))/
|
this.Ha+=c;this.X+=c;Bc(this,c);a=c;for(var g=this.T.length-1;0<=g;g--){var h=this.T[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.va-=c;if(0>=this.va){this.va+=this.Na;++this.hb>=Mc&&(this.S&&Lc(this.S),this.hb=0);break}}while(this.G.ka)}catch(l){this.da();Ac(this);this.S&&this.S.stop(ra(),Cc(this));mb(this,!1);hb(this,l.stack||l.message);return}c=setTimeout;d=this.zb;this.ea=ra();e=this.gb;this.Ha&&(e=Math.round(e*this.Ha/this.Na));e-=this.ea-this.Ma;if(f=this.ea-this.V)this.Y=Math.round(this.X/
|
||||||
100,864E5<=f&&(this.L=0,Ec(this));if(0>e||this.I<this.bb)-1E3>e&&(this.B-=e),e=0;this.ia+=this.aa;this.J+=e;c(d,e)}else pc(this),this.A&&this.A.stop(qa(),Dc(this))};l.ob=function(){return 0};l.qa=function(a){ib(this,!0);Jc(this);Fc(this,this.D);this.D=0;if(this.C.za){this.C.za=!1;this.F&&this.F.stop();var b=this.M.run;b&&(b.textContent="Run")}this.C.complete=a};function pc(a,b){if(a.A){for(var c=a.A,d=0;d<c.D.length;d++)Kc(c.D[d],b);a.A.Aa(b)}}
|
(10*f))/100,864E5<=f&&(this.la=0,Dc(this));if(0>e||this.Y<this.Z)-1E3>e&&(this.V-=e),e=0;this.Ua+=this.Ha;this.ea+=e;c(d,e)}else Ac(this),this.S&&this.S.stop(ra(),Cc(this))};k.Ab=function(){return 0};k.da=function(a){lb(this,!0);Kc(this);Ec(this,this.X);this.X=0;if(this.G.ka){this.G.ka=!1;this.W&&this.W.stop();var b=this.P.run;b&&(b.textContent="Run")}this.G.complete=a};function Ac(a,b){if(a.S){for(var c=a.S,d=0;d<c.A.length;d++)Nc(c.A[d],b);Lc(a.S,b)}}var Gc=30,Mc=15,uc=["power","reset"];
|
||||||
function Lc(a){this.ae=+a.model||8080;jc.call(this,a,1E6);this.ka=Mc;mc(this);this.C.complete=this.C.Pd=!1;this.ma=0;this.ba=[];this.la=0;Nc(this)}A(Lc,jc);function Oc(a,b){a.ba.push(b)}l=Lc.prototype;l.reset=function(){this.C.za&&this.qa();Nc(this);mc(this);this.C.error=!1;this.parent.reset.call(this)};function Nc(a){a.i=0;a.R=0;a.S=0;a.T=0;a.U=0;a.V=0;a.Y=0;a.oa=0;I(a,a.la);Pc(a,0);a.j=0}function Qc(a,b){a.la=b;I(a,b)}
|
function Oc(a){var b=+a.model||8080;tc.call(this,a,1E6);this.tb=b;this.cb=Pc;wc(this);this.G.complete=this.G.vd=!1;this.fb=0;this.La=[];this.eb=0;Qc(this)}ba(Oc,tc);function Rc(a,b){a.La.push(b)}k=Oc.prototype;k.reset=function(){this.G.ka&&this.da();Qc(this);wc(this);this.G.error=!1;tc.prototype.reset.call(this)};function Qc(a){a.g=0;a.w=0;a.A=0;a.B=0;a.C=0;a.D=0;a.F=0;a.M=0;C(a,a.eb);Sc(a,0);a.R=0}function Tc(a,b){a.eb=b;C(a,b)}
|
||||||
l.Dc=function(){var a=this.i+this.R+this.S+this.T+this.U+this.V+this.Y|0;return a=a+this.oa+this.P+Rc(this)|0};l.save=function(){var a=new Sc(this);a.set(0,[this.i,this.R,this.S,this.T,this.U,this.V,this.Y,this.oa,this.P,Rc(this)]);a.set(1,[this.j,this.L,this.Ra]);a.set(2,Bb(this.w));return a.data()};
|
k.hc=function(){var a=this.g+this.w+this.A+this.B+this.C+this.D+this.F|0;return a=a+this.M+this.j+Uc(this)|0};k.save=function(){var a=new Vc(this);a.set(0,[this.g,this.w,this.A,this.B,this.C,this.D,this.F,this.M,this.j,Uc(this)]);a.set(1,[this.R,this.la,this.U]);a.set(2,Jb(this.H));return a.data()};
|
||||||
l.restore=function(a){var b=a[0];this.i=b[0];this.R=b[1];this.S=b[2];this.T=b[3];this.U=b[4];this.V=b[5];this.Y=b[6];this.oa=b[7]&65535;I(this,b[8]);Pc(this,b[9]);b=a[1];this.j=b[0];this.L=b[1];Ec(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.L){for(var f=0,g=Array(b.L),h=0;h<e.length-1;)for(var k=e[h++],m=e[h++];k--;)g[f++]=m;e=g}f=b.W[d];if(!f||!f.restore(e)){w("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
k.restore=function(a){var b=a[0];this.g=b[0];this.w=b[1];this.A=b[2];this.B=b[3];this.C=b[4];this.D=b[5];this.F=b[6];this.M=b[7]&65535;C(this,b[8]);Sc(this,b[9]);b=a[1];this.R=b[0];this.la=b[1];Dc(this,b[3]);a:{b=this.H;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.O){for(var f=0,g=Array(b.O),h=0;h<e.length-1;)for(var l=e[h++],p=e[h++];l--;)g[f++]=p;e=g}f=b.b[d];if(!f||!f.restore(e)){v("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
||||||
l.pa=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.M[b]=c;this.ma++;a=!0;break;default:a=this.parent.pa.call(this,a,b,c)}return a};function Tc(a){return a.R<<8|a.S}function Uc(a,b){a.R=b>>8&255;a.S=b&255}function Vc(a){return a.T<<8|a.U}function Wc(a,b){a.T=b>>8&255;a.U=b&255}function J(a){return a.V<<8|a.Y}
|
k.ca=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.P[b]=c;this.fb++;a=!0;break;default:a=tc.prototype.ca.call(this,a,b,c)}return a};function Wc(a){return a.w<<8|a.A}function id(a,b){a.w=b>>8&255;a.A=b&255}function jd(a){return a.B<<8|a.C}function kd(a,b){a.B=b>>8&255;a.C=b&255}function D(a){return a.D<<8|a.F}
|
||||||
function Xc(a,b){a.V=b>>8&255;a.Y=b&255}function I(a,b){a.P=b&65535}function Yc(a){return a.ca&256?1:0}function Zc(a,b){a.ca=a.ca&255|b}function $c(a){return mb[a.fa&255]?4:0}function ad(a){return(a.fa^a.ya)&16?16:0}function bd(a){return a.ca&255?0:64}function cd(a){return a.fa&128?128:0}function Rc(a){return a.ta&-214|cd(a)|bd(a)|ad(a)|$c(a)|Yc(a)}function Pc(a,b){a.ca=a.fa=a.ya=0;b&1&&(a.ca|=256);b&4||(a.fa|=1);b&16&&(a.ya|=16);b&64||(a.ca|=255);b&128&&(a.fa^=192);a.ta=a.ta&-726|b&512|2}
|
function ld(a,b){a.D=b>>8&255;a.F=b&255}function C(a,b){a.j=b&65535}function md(a){return a.I&256?1:0}function nd(a,b){a.I=a.I&255|b}function od(a){return sb[a.L&255]?4:0}function pd(a){return(a.L^a.O)&16?16:0}function qd(a){return a.I&255?0:64}function rd(a){return a.L&128?128:0}function Uc(a){return a.N&-214|rd(a)|qd(a)|pd(a)|od(a)|md(a)}function Sc(a,b){a.I=a.L=a.O=0;b&1&&(a.I|=256);b&4||(a.L|=1);b&16&&(a.O|=16);b&64||(a.I|=255);b&128&&(a.L^=192);a.N=a.N&-726|b&512|2}
|
||||||
function dd(a,b){a.ya=a.i^b;return a.fa=(a.ca=a.i+b)&255}function ed(a,b){a.ya=a.i^b;return a.fa=(a.ca=a.i+b+(a.ca&256?1:0))&255}function fd(a,b){a.ca=a.fa=a.ya=a.i&b;(a.i|b)&8&&(a.ya^=16);return a.ca}function gd(a,b){a.ya=b^255;b=a.fa=b+255&255;a.ca=a.ca&-256|b;return b}function hd(a,b){a.ya=b;b=a.fa=b+1&255;a.ca=a.ca&-256|b;return b}function id(a,b){return a.fa=a.ca=a.ya=a.i|b}function K(a,b){b^=255;a.ya=a.i^b;return a.fa=(a.ca=a.i+b+1^256)&255}
|
function sd(a,b){a.O=a.g^b;return a.L=(a.I=a.g+b)&255}function td(a,b){a.O=a.g^b;return a.L=(a.I=a.g+b+(a.I&256?1:0))&255}function ud(a,b){a.I=a.L=a.O=a.g&b;(a.g|b)&8&&(a.O^=16);return a.I}function vd(a,b){a.O=b^255;b=a.L=b+255&255;a.I=a.I&-256|b;return b}function wd(a,b){a.O=b;b=a.L=b+1&255;a.I=a.I&-256|b;return b}function xd(a,b){return a.L=a.I=a.O=a.g|b}function E(a,b){b^=255;a.O=a.g^b;return a.L=(a.I=a.g+b+1^256)&255}
|
||||||
function jd(a,b){b^=255;a.ya=a.i^b;return a.fa=(a.ca=a.i+b+(a.ca&256?0:1)^256)&255}function kd(a,b){return a.fa=a.ca=a.ya=a.i^b}l.Z=function(a){return this.w.Z(a)};l.ua=function(a,b){this.w.ua(a,b)};function L(a){var b=a.Z(a.P);I(a,a.P+1);return b}function M(a){var b=a.w.ab(a.P);I(a,a.P+2);return b}function N(a){var b=a.w.ab(a.oa);a.oa=a.oa+2&65535;return b}function P(a,b){a.oa=a.oa-2&65535;a.w.Mb(a.oa,b)}
|
function yd(a,b){b^=255;a.O=a.g^b;return a.L=(a.I=a.g+b+(a.I&256?0:1)^256)&255}function zd(a,b){return a.L=a.I=a.O=a.g^b}function F(a,b){a=a.H;return a.b[(b&a.C)>>>a.g].Xa(b&a.j,b)}function Ad(a,b,c){a=a.H;a.b[(b&a.C)>>>a.g].Ya(b&a.j,c&255,b)}function G(a){var b=F(a,a.j);C(a,a.j+1);return b}function H(a){var b=Fb(a.H,a.j);C(a,a.j+2);return b}function Bd(a){var b=Fb(a.H,a.M);a.M=a.M+2&65535;return b}function I(a,b){a.M=a.M-2&65535;Ib(a.H,a.M,b)}
|
||||||
function ld(a){if(a.b&&a.j&255&&a.ta&512){for(var b=0;8>b&&!(a.j&1<<b);b++);a.j&=~(0>b?255:1<<b);a.ta&=-513;a.j&=-257;a.ka[199|b<<3].call(a)}return a.j&256?(Jc(a),!1):!0}function Gd(a,b){a.j|=1<<b;a.ta&512&&Jc(a)}function Q(a,b,c,d){d=d||2;a.M[b]&&(void 0===c&&(kb(a,"Value for "+b+" is invalid"),a.qa()),c=!a.C.za||a.C.Ac?t(c,d):"--------".substr(0,d),a.M[b].textContent!=c&&(a.M[b].textContent=c))}
|
function Cd(a){if(a.b&&a.R&255&&a.N&512){for(var b=0;8>b&&!(a.R&1<<b);b++);a.R&=~(0>b?255:1<<b);a.N&=-513;a.R&=-257;a.cb[199|b<<3].call(a)}return a.R&256?(Kc(a),!1):!0}function Dd(a,b){a.R|=1<<b;a.N&512&&Kc(a)}function J(a,b,c,d){d=d||2;a.P[b]&&(void 0===c&&(hb(a,"Value for "+b+" is invalid"),a.da()),c=!a.G.ka||a.G.ec?n(c,d):"--------".substr(0,d),a.P[b].textContent!=c&&(a.P[b].textContent=c))}
|
||||||
l.Aa=function(a){this.ma&&(a||!this.C.za||this.C.Ac)&&(Q(this,"A",this.i),Q(this,"B",this.R),Q(this,"C",this.S),Q(this,"BC",Tc(this),4),Q(this,"D",this.T),Q(this,"E",this.U),Q(this,"DE",Vc(this),4),Q(this,"H",this.V),Q(this,"L",this.Y),Q(this,"HL",J(this),4),Q(this,"SP",this.oa,4),Q(this,"PC",this.P,4),a=Rc(this),Q(this,"PS",a,4),Q(this,"IF",a&512?1:0,1),Q(this,"SF",a&128?1:0,1),Q(this,"ZF",a&64?1:0,1),Q(this,"AF",a&16?1:0,1),Q(this,"PF",a&4?1:0,1),Q(this,"CF",a&1?1:0,1));if(a=this.M.speed)a.textContent=
|
k.Ab=function(a){this.G.complete=!0;var b=this.G.vd=this.K&&Ed(this.K),c=a?this.G.Mb?0:1:-1;this.G.Mb=!1;this.ga=this.b=a;if(Cd(this)){do{if(b){if(Fd(this.K,this.j,c)){this.da();break}c=1}this.cb[G(this)].call(this)}while(0<this.b)}return this.G.complete?this.ga-this.b:void 0===this.G.complete?0:-1};Na(function(){for(var a=gb(document,"pc8080","cpu"),b=0;b<a.length;b++){var c=a[b],d=eb(c),d=new Oc(d);fb(d,c)}});function Gd(){this.b-=4}function Hd(){C(this,H(this));this.b-=10}
|
||||||
this.C.za&&this.I?this.I.toFixed(2)+"Mhz":"Stopped"};l.ob=function(a){this.C.complete=!0;var b=this.C.Pd=this.H&&Hd(this.H),c=a?this.C.Yb?0:1:-1;this.C.Yb=!1;this.K=this.b=a;if(ld(this)){do{if(b){if(Id(this.H,this.P,c)){this.qa();break}c=1}this.ka[L(this)].call(this)}while(0<this.b)}return this.C.complete?this.K-this.b:void 0===this.C.complete?0:-1};Qa(function(){for(var a=D(document,"pc8080","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Lc(d);db(d,c)}});function Jd(){this.b-=4}
|
function Id(){C(this,Bd(this));this.b-=10}function Jd(){var a=H(this);I(this,this.j);C(this,a);this.b-=17}
|
||||||
function Kd(){I(this,M(this));this.b-=10}function Ld(){I(this,N(this));this.b-=10}function Md(){var a=M(this);P(this,this.P);I(this,a);this.b-=17}
|
var Pc=[Gd,function(){id(this,H(this));this.b-=10},function(){Ad(this,Wc(this),this.g);this.b-=7},function(){id(this,Wc(this)+1);this.b-=5},function(){this.w=wd(this,this.w);this.b-=5},function(){this.w=vd(this,this.w);this.b-=5},function(){this.w=G(this);this.b-=7},function(){var a=this.g<<1;this.g=a&255|a>>8;nd(this,a&256);this.b-=4},Gd,function(){var a;ld(this,a=D(this)+Wc(this));nd(this,a>>8&256);this.b-=10},function(){this.g=F(this,Wc(this));this.b-=7},function(){id(this,Wc(this)-1);this.b-=
|
||||||
var Mc=[Jd,function(){Uc(this,M(this));this.b-=10},function(){this.ua(Tc(this),this.i);this.b-=7},function(){Uc(this,Tc(this)+1);this.b-=5},function(){this.R=hd(this,this.R);this.b-=5},function(){this.R=gd(this,this.R);this.b-=5},function(){this.R=L(this);this.b-=7},function(){var a=this.i<<1;this.i=a&255|a>>8;Zc(this,a&256);this.b-=4},Jd,function(){var a;Xc(this,a=J(this)+Tc(this));Zc(this,a>>8&256);this.b-=10},function(){this.i=this.Z(Tc(this));this.b-=7},function(){Uc(this,Tc(this)-1);this.b-=
|
5},function(){this.A=wd(this,this.A);this.b-=5},function(){this.A=vd(this,this.A);this.b-=5},function(){this.A=G(this);this.b-=7},function(){var a=this.g<<8&256;this.g=(a|this.g)>>1;nd(this,a);this.b-=4},Gd,function(){kd(this,H(this));this.b-=10},function(){Ad(this,jd(this),this.g);this.b-=7},function(){kd(this,jd(this)+1);this.b-=5},function(){this.B=wd(this,this.B);this.b-=5},function(){this.B=vd(this,this.B);this.b-=5},function(){this.B=G(this);this.b-=7},function(){var a=this.g<<1;this.g=a&255|
|
||||||
5},function(){this.S=hd(this,this.S);this.b-=5},function(){this.S=gd(this,this.S);this.b-=5},function(){this.S=L(this);this.b-=7},function(){var a=this.i<<8&256;this.i=(a|this.i)>>1;Zc(this,a);this.b-=4},Jd,function(){Wc(this,M(this));this.b-=10},function(){this.ua(Vc(this),this.i);this.b-=7},function(){Wc(this,Vc(this)+1);this.b-=5},function(){this.T=hd(this,this.T);this.b-=5},function(){this.T=gd(this,this.T);this.b-=5},function(){this.T=L(this);this.b-=7},function(){var a=this.i<<1;this.i=a&255|
|
md(this);nd(this,a&256);this.b-=4},Gd,function(){var a;ld(this,a=D(this)+jd(this));nd(this,a>>8&256);this.b-=10},function(){this.g=F(this,jd(this));this.b-=7},function(){kd(this,jd(this)-1);this.b-=5},function(){this.C=wd(this,this.C);this.b-=5},function(){this.C=vd(this,this.C);this.b-=5},function(){this.C=G(this);this.b-=7},function(){var a=this.g<<8;this.g=(md(this)<<8|this.g)>>1;nd(this,a&256);this.b-=4},Gd,function(){ld(this,H(this));this.b-=10},function(){var a=H(this);Ib(this.H,a,D(this));
|
||||||
Yc(this);Zc(this,a&256);this.b-=4},Jd,function(){var a;Xc(this,a=J(this)+Vc(this));Zc(this,a>>8&256);this.b-=10},function(){this.i=this.Z(Vc(this));this.b-=7},function(){Wc(this,Vc(this)-1);this.b-=5},function(){this.U=hd(this,this.U);this.b-=5},function(){this.U=gd(this,this.U);this.b-=5},function(){this.U=L(this);this.b-=7},function(){var a=this.i<<8;this.i=(Yc(this)<<8|this.i)>>1;Zc(this,a&256);this.b-=4},Jd,function(){Xc(this,M(this));this.b-=10},function(){var a=M(this);this.w.Mb(a,J(this));
|
this.b-=16},function(){ld(this,D(this)+1);this.b-=5},function(){this.D=wd(this,this.D);this.b-=5},function(){this.D=vd(this,this.D);this.b-=5},function(){this.D=G(this);this.b-=7},function(){var a=0,b=md(this);if(pd(this)||9<(this.g&15))a|=6;if(b||154<=this.g)a|=96,b=1;this.g=sd(this,a);nd(this,b?256:0);this.b-=4},Gd,function(){var a;ld(this,a=D(this)+D(this));nd(this,a>>8&256);this.b-=10},function(){var a;a=H(this);a=Fb(this.H,a);ld(this,a);this.b-=16},function(){ld(this,D(this)-1);this.b-=5},function(){this.F=
|
||||||
this.b-=16},function(){Xc(this,J(this)+1);this.b-=5},function(){this.V=hd(this,this.V);this.b-=5},function(){this.V=gd(this,this.V);this.b-=5},function(){this.V=L(this);this.b-=7},function(){var a=0,b=Yc(this);if(ad(this)||9<(this.i&15))a|=6;if(b||154<=this.i)a|=96,b=1;this.i=dd(this,a);Zc(this,b?256:0);this.b-=4},Jd,function(){var a;Xc(this,a=J(this)+J(this));Zc(this,a>>8&256);this.b-=10},function(){var a;a=M(this);a=this.w.ab(a);Xc(this,a);this.b-=16},function(){Xc(this,J(this)-1);this.b-=5},function(){this.Y=
|
wd(this,this.F);this.b-=5},function(){this.F=vd(this,this.F);this.b-=5},function(){this.F=G(this);this.b-=7},function(){this.g=~this.g&255;this.b-=4},Gd,function(){this.M=H(this)&65535;this.b-=10},function(){Ad(this,H(this),this.g);this.b-=13},function(){this.M=this.M+1&65535;this.b-=5},function(){var a=D(this);Ad(this,a,wd(this,F(this,a)));this.b-=10},function(){var a=D(this);Ad(this,a,vd(this,F(this,a)));this.b-=10},function(){Ad(this,D(this),G(this));this.b-=10},function(){this.I|=256;this.b-=
|
||||||
hd(this,this.Y);this.b-=5},function(){this.Y=gd(this,this.Y);this.b-=5},function(){this.Y=L(this);this.b-=7},function(){this.i=~this.i&255;this.b-=4},Jd,function(){this.oa=M(this)&65535;this.b-=10},function(){this.ua(M(this),this.i);this.b-=13},function(){this.oa=this.oa+1&65535;this.b-=5},function(){var a=J(this);this.ua(a,hd(this,this.Z(a)));this.b-=10},function(){var a=J(this);this.ua(a,gd(this,this.Z(a)));this.b-=10},function(){this.ua(J(this),L(this));this.b-=10},function(){this.ca|=256;this.b-=
|
4},Gd,function(){var a;ld(this,a=D(this)+this.M);nd(this,a>>8&256);this.b-=10},function(){this.g=F(this,H(this));this.b-=13},function(){this.M=this.M-1&65535;this.b-=5},function(){this.g=wd(this,this.g);this.b-=5},function(){this.g=vd(this,this.g);this.b-=5},function(){this.g=G(this);this.b-=7},function(){nd(this,md(this)?0:256);this.b-=4},function(){this.b-=5},function(){this.w=this.A;this.b-=5},function(){this.w=this.B;this.b-=5},function(){this.w=this.C;this.b-=5},function(){this.w=this.D;this.b-=
|
||||||
4},Jd,function(){var a;Xc(this,a=J(this)+this.oa);Zc(this,a>>8&256);this.b-=10},function(){this.i=this.Z(M(this));this.b-=13},function(){this.oa=this.oa-1&65535;this.b-=5},function(){this.i=hd(this,this.i);this.b-=5},function(){this.i=gd(this,this.i);this.b-=5},function(){this.i=L(this);this.b-=7},function(){Zc(this,Yc(this)?0:256);this.b-=4},function(){this.b-=5},function(){this.R=this.S;this.b-=5},function(){this.R=this.T;this.b-=5},function(){this.R=this.U;this.b-=5},function(){this.R=this.V;this.b-=
|
5},function(){this.w=this.F;this.b-=5},function(){this.w=F(this,D(this));this.b-=7},function(){this.w=this.g;this.b-=5},function(){this.A=this.w;this.b-=5},function(){this.b-=5},function(){this.A=this.B;this.b-=5},function(){this.A=this.C;this.b-=5},function(){this.A=this.D;this.b-=5},function(){this.A=this.F;this.b-=5},function(){this.A=F(this,D(this));this.b-=7},function(){this.A=this.g;this.b-=5},function(){this.B=this.w;this.b-=5},function(){this.B=this.A;this.b-=5},function(){this.b-=5},function(){this.B=
|
||||||
5},function(){this.R=this.Y;this.b-=5},function(){this.R=this.Z(J(this));this.b-=7},function(){this.R=this.i;this.b-=5},function(){this.S=this.R;this.b-=5},function(){this.b-=5},function(){this.S=this.T;this.b-=5},function(){this.S=this.U;this.b-=5},function(){this.S=this.V;this.b-=5},function(){this.S=this.Y;this.b-=5},function(){this.S=this.Z(J(this));this.b-=7},function(){this.S=this.i;this.b-=5},function(){this.T=this.R;this.b-=5},function(){this.T=this.S;this.b-=5},function(){this.b-=5},function(){this.T=
|
this.C;this.b-=5},function(){this.B=this.D;this.b-=5},function(){this.B=this.F;this.b-=5},function(){this.B=F(this,D(this));this.b-=7},function(){this.B=this.g;this.b-=5},function(){this.C=this.w;this.b-=5},function(){this.C=this.A;this.b-=5},function(){this.C=this.B;this.b-=5},function(){this.b-=5},function(){this.C=this.D;this.b-=5},function(){this.C=this.F;this.b-=5},function(){this.C=F(this,D(this));this.b-=7},function(){this.C=this.g;this.b-=5},function(){this.D=this.w;this.b-=5},function(){this.D=
|
||||||
this.U;this.b-=5},function(){this.T=this.V;this.b-=5},function(){this.T=this.Y;this.b-=5},function(){this.T=this.Z(J(this));this.b-=7},function(){this.T=this.i;this.b-=5},function(){this.U=this.R;this.b-=5},function(){this.U=this.S;this.b-=5},function(){this.U=this.T;this.b-=5},function(){this.b-=5},function(){this.U=this.V;this.b-=5},function(){this.U=this.Y;this.b-=5},function(){this.U=this.Z(J(this));this.b-=7},function(){this.U=this.i;this.b-=5},function(){this.V=this.R;this.b-=5},function(){this.V=
|
this.A;this.b-=5},function(){this.D=this.B;this.b-=5},function(){this.D=this.C;this.b-=5},function(){this.b-=5},function(){this.D=this.F;this.b-=5},function(){this.D=F(this,D(this));this.b-=7},function(){this.D=this.g;this.b-=5},function(){this.F=this.w;this.b-=5},function(){this.F=this.A;this.b-=5},function(){this.F=this.B;this.b-=5},function(){this.F=this.C;this.b-=5},function(){this.F=this.D;this.b-=5},function(){this.b-=5},function(){this.F=F(this,D(this));this.b-=7},function(){this.F=this.g;
|
||||||
this.S;this.b-=5},function(){this.V=this.T;this.b-=5},function(){this.V=this.U;this.b-=5},function(){this.b-=5},function(){this.V=this.Y;this.b-=5},function(){this.V=this.Z(J(this));this.b-=7},function(){this.V=this.i;this.b-=5},function(){this.Y=this.R;this.b-=5},function(){this.Y=this.S;this.b-=5},function(){this.Y=this.T;this.b-=5},function(){this.Y=this.U;this.b-=5},function(){this.Y=this.V;this.b-=5},function(){this.b-=5},function(){this.Y=this.Z(J(this));this.b-=7},function(){this.Y=this.i;
|
this.b-=5},function(){Ad(this,D(this),this.w);this.b-=7},function(){Ad(this,D(this),this.A);this.b-=7},function(){Ad(this,D(this),this.B);this.b-=7},function(){Ad(this,D(this),this.C);this.b-=7},function(){Ad(this,D(this),this.D);this.b-=7},function(){Ad(this,D(this),this.F);this.b-=7},function(){var a=this.j-1;if(this.La.length)for(var b=0;b<this.La.length;b++)if(this.La[b](a))return;this.b-=7;this.R|=256;Kc(this);this.K&&nb(this,-2147483648)?(C(this,a),this.K.da()):this.N&512||(this.K&&C(this,a),
|
||||||
this.b-=5},function(){this.ua(J(this),this.R);this.b-=7},function(){this.ua(J(this),this.S);this.b-=7},function(){this.ua(J(this),this.T);this.b-=7},function(){this.ua(J(this),this.U);this.b-=7},function(){this.ua(J(this),this.V);this.b-=7},function(){this.ua(J(this),this.Y);this.b-=7},function(){var a=this.P-1;if(this.ba.length)for(var b=0;b<this.ba.length;b++)if(this.ba[b](a))return;this.b-=7;this.j|=256;Jc(this);this.H&&gb(this,-2147483648)?(I(this,a),this.H.qa()):this.ta&512||(this.H&&I(this,
|
this.da())},function(){Ad(this,D(this),this.g);this.b-=7},function(){this.g=this.w;this.b-=5},function(){this.g=this.A;this.b-=5},function(){this.g=this.B;this.b-=5},function(){this.g=this.C;this.b-=5},function(){this.g=this.D;this.b-=5},function(){this.g=this.F;this.b-=5},function(){this.g=F(this,D(this));this.b-=7},function(){this.b-=5},function(){this.g=sd(this,this.w);this.b-=4},function(){this.g=sd(this,this.A);this.b-=4},function(){this.g=sd(this,this.B);this.b-=4},function(){this.g=sd(this,
|
||||||
a),this.qa())},function(){this.ua(J(this),this.i);this.b-=7},function(){this.i=this.R;this.b-=5},function(){this.i=this.S;this.b-=5},function(){this.i=this.T;this.b-=5},function(){this.i=this.U;this.b-=5},function(){this.i=this.V;this.b-=5},function(){this.i=this.Y;this.b-=5},function(){this.i=this.Z(J(this));this.b-=7},function(){this.b-=5},function(){this.i=dd(this,this.R);this.b-=4},function(){this.i=dd(this,this.S);this.b-=4},function(){this.i=dd(this,this.T);this.b-=4},function(){this.i=dd(this,
|
this.C);this.b-=4},function(){this.g=sd(this,this.D);this.b-=4},function(){this.g=sd(this,this.F);this.b-=4},function(){this.g=sd(this,F(this,D(this)));this.b-=7},function(){this.g=sd(this,this.g);this.b-=4},function(){this.g=td(this,this.w);this.b-=4},function(){this.g=td(this,this.A);this.b-=4},function(){this.g=td(this,this.B);this.b-=4},function(){this.g=td(this,this.C);this.b-=4},function(){this.g=td(this,this.D);this.b-=4},function(){this.g=td(this,this.F);this.b-=4},function(){this.g=td(this,
|
||||||
this.U);this.b-=4},function(){this.i=dd(this,this.V);this.b-=4},function(){this.i=dd(this,this.Y);this.b-=4},function(){this.i=dd(this,this.Z(J(this)));this.b-=7},function(){this.i=dd(this,this.i);this.b-=4},function(){this.i=ed(this,this.R);this.b-=4},function(){this.i=ed(this,this.S);this.b-=4},function(){this.i=ed(this,this.T);this.b-=4},function(){this.i=ed(this,this.U);this.b-=4},function(){this.i=ed(this,this.V);this.b-=4},function(){this.i=ed(this,this.Y);this.b-=4},function(){this.i=ed(this,
|
F(this,D(this)));this.b-=7},function(){this.g=td(this,this.g);this.b-=4},function(){this.g=E(this,this.w);this.b-=4},function(){this.g=E(this,this.A);this.b-=4},function(){this.g=E(this,this.B);this.b-=4},function(){this.g=E(this,this.C);this.b-=4},function(){this.g=E(this,this.D);this.b-=4},function(){this.g=E(this,this.F);this.b-=4},function(){this.g=E(this,F(this,D(this)));this.b-=7},function(){this.g=E(this,this.g);this.b-=4},function(){this.g=yd(this,this.w);this.b-=4},function(){this.g=yd(this,
|
||||||
this.Z(J(this)));this.b-=7},function(){this.i=ed(this,this.i);this.b-=4},function(){this.i=K(this,this.R);this.b-=4},function(){this.i=K(this,this.S);this.b-=4},function(){this.i=K(this,this.T);this.b-=4},function(){this.i=K(this,this.U);this.b-=4},function(){this.i=K(this,this.V);this.b-=4},function(){this.i=K(this,this.Y);this.b-=4},function(){this.i=K(this,this.Z(J(this)));this.b-=7},function(){this.i=K(this,this.i);this.b-=4},function(){this.i=jd(this,this.R);this.b-=4},function(){this.i=jd(this,
|
this.A);this.b-=4},function(){this.g=yd(this,this.B);this.b-=4},function(){this.g=yd(this,this.C);this.b-=4},function(){this.g=yd(this,this.D);this.b-=4},function(){this.g=yd(this,this.F);this.b-=4},function(){this.g=yd(this,F(this,D(this)));this.b-=7},function(){this.g=yd(this,this.g);this.b-=4},function(){this.g=ud(this,this.w);this.b-=4},function(){this.g=ud(this,this.A);this.b-=4},function(){this.g=ud(this,this.B);this.b-=4},function(){this.g=ud(this,this.C);this.b-=4},function(){this.g=ud(this,
|
||||||
this.S);this.b-=4},function(){this.i=jd(this,this.T);this.b-=4},function(){this.i=jd(this,this.U);this.b-=4},function(){this.i=jd(this,this.V);this.b-=4},function(){this.i=jd(this,this.Y);this.b-=4},function(){this.i=jd(this,this.Z(J(this)));this.b-=7},function(){this.i=jd(this,this.i);this.b-=4},function(){this.i=fd(this,this.R);this.b-=4},function(){this.i=fd(this,this.S);this.b-=4},function(){this.i=fd(this,this.T);this.b-=4},function(){this.i=fd(this,this.U);this.b-=4},function(){this.i=fd(this,
|
this.D);this.b-=4},function(){this.g=ud(this,this.F);this.b-=4},function(){this.g=ud(this,F(this,D(this)));this.b-=7},function(){this.g=ud(this,this.g);this.b-=4},function(){this.g=zd(this,this.w);this.b-=4},function(){this.g=zd(this,this.A);this.b-=4},function(){this.g=zd(this,this.B);this.b-=4},function(){this.g=zd(this,this.C);this.b-=4},function(){this.g=zd(this,this.D);this.b-=4},function(){this.g=zd(this,this.F);this.b-=4},function(){this.g=zd(this,F(this,D(this)));this.b-=7},function(){this.g=
|
||||||
this.V);this.b-=4},function(){this.i=fd(this,this.Y);this.b-=4},function(){this.i=fd(this,this.Z(J(this)));this.b-=7},function(){this.i=fd(this,this.i);this.b-=4},function(){this.i=kd(this,this.R);this.b-=4},function(){this.i=kd(this,this.S);this.b-=4},function(){this.i=kd(this,this.T);this.b-=4},function(){this.i=kd(this,this.U);this.b-=4},function(){this.i=kd(this,this.V);this.b-=4},function(){this.i=kd(this,this.Y);this.b-=4},function(){this.i=kd(this,this.Z(J(this)));this.b-=7},function(){this.i=
|
zd(this,this.g);this.b-=4},function(){this.g=xd(this,this.w);this.b-=4},function(){this.g=xd(this,this.A);this.b-=4},function(){this.g=xd(this,this.B);this.b-=4},function(){this.g=xd(this,this.C);this.b-=4},function(){this.g=xd(this,this.D);this.b-=4},function(){this.g=xd(this,this.F);this.b-=4},function(){this.g=xd(this,F(this,D(this)));this.b-=7},function(){this.g=xd(this,this.g);this.b-=4},function(){E(this,this.w);this.b-=4},function(){E(this,this.A);this.b-=4},function(){E(this,this.B);this.b-=
|
||||||
kd(this,this.i);this.b-=4},function(){this.i=id(this,this.R);this.b-=4},function(){this.i=id(this,this.S);this.b-=4},function(){this.i=id(this,this.T);this.b-=4},function(){this.i=id(this,this.U);this.b-=4},function(){this.i=id(this,this.V);this.b-=4},function(){this.i=id(this,this.Y);this.b-=4},function(){this.i=id(this,this.Z(J(this)));this.b-=7},function(){this.i=id(this,this.i);this.b-=4},function(){K(this,this.R);this.b-=4},function(){K(this,this.S);this.b-=4},function(){K(this,this.T);this.b-=
|
4},function(){E(this,this.C);this.b-=4},function(){E(this,this.D);this.b-=4},function(){E(this,this.F);this.b-=4},function(){E(this,F(this,D(this)));this.b-=7},function(){E(this,this.g);this.b-=4},function(){qd(this)||(C(this,Bd(this)),this.b-=6);this.b-=5},function(){id(this,Bd(this));this.b-=10},function(){var a=H(this);qd(this)||C(this,a);this.b-=10},Hd,function(){var a=H(this);qd(this)||(I(this,this.j),C(this,a),this.b-=6);this.b-=11},function(){I(this,Wc(this));this.b-=11},function(){this.g=
|
||||||
4},function(){K(this,this.U);this.b-=4},function(){K(this,this.V);this.b-=4},function(){K(this,this.Y);this.b-=4},function(){K(this,this.Z(J(this)));this.b-=7},function(){K(this,this.i);this.b-=4},function(){bd(this)||(I(this,N(this)),this.b-=6);this.b-=5},function(){Uc(this,N(this));this.b-=10},function(){var a=M(this);bd(this)||I(this,a);this.b-=10},Kd,function(){var a=M(this);bd(this)||(P(this,this.P),I(this,a),this.b-=6);this.b-=11},function(){P(this,Tc(this));this.b-=11},function(){this.i=dd(this,
|
sd(this,G(this));this.b-=7},function(){I(this,this.j);C(this,0);this.b-=11},function(){qd(this)&&(C(this,Bd(this)),this.b-=6);this.b-=5},Id,function(){var a=H(this);qd(this)&&C(this,a);this.b-=10},Hd,function(){var a=H(this);qd(this)&&(I(this,this.j),C(this,a),this.b-=6);this.b-=11},Jd,function(){this.g=td(this,G(this));this.b-=7},function(){I(this,this.j);C(this,8);this.b-=11},function(){md(this)||(C(this,Bd(this)),this.b-=6);this.b-=5},function(){kd(this,Bd(this));this.b-=10},function(){var a=H(this);
|
||||||
L(this));this.b-=7},function(){P(this,this.P);I(this,0);this.b-=11},function(){bd(this)&&(I(this,N(this)),this.b-=6);this.b-=5},Ld,function(){var a=M(this);bd(this)&&I(this,a);this.b-=10},Kd,function(){var a=M(this);bd(this)&&(P(this,this.P),I(this,a),this.b-=6);this.b-=11},Md,function(){this.i=ed(this,L(this));this.b-=7},function(){P(this,this.P);I(this,8);this.b-=11},function(){Yc(this)||(I(this,N(this)),this.b-=6);this.b-=5},function(){Wc(this,N(this));this.b-=10},function(){var a=M(this);Yc(this)||
|
md(this)||C(this,a);this.b-=10},function(){var a=G(this);Sb(this.H,a,this.g,this.j+-2&65535);this.b-=10},function(){var a=H(this);md(this)||(I(this,this.j),C(this,a),this.b-=6);this.b-=11},function(){I(this,jd(this));this.b-=11},function(){this.g=E(this,G(this));this.b-=7},function(){I(this,this.j);C(this,16);this.b-=11},function(){md(this)&&(C(this,Bd(this)),this.b-=6);this.b-=5},Id,function(){var a=H(this);md(this)&&C(this,a);this.b-=10},function(){var a=G(this);this.g=Ob(this.H,a,this.j+-2&65535)&
|
||||||
I(this,a);this.b-=10},function(){var a=L(this);Jb(this.w,a,this.i,this.P+-2&65535);this.b-=10},function(){var a=M(this);Yc(this)||(P(this,this.P),I(this,a),this.b-=6);this.b-=11},function(){P(this,Vc(this));this.b-=11},function(){this.i=K(this,L(this));this.b-=7},function(){P(this,this.P);I(this,16);this.b-=11},function(){Yc(this)&&(I(this,N(this)),this.b-=6);this.b-=5},Ld,function(){var a=M(this);Yc(this)&&I(this,a);this.b-=10},function(){var a=L(this);this.i=Eb(this.w,a,this.P+-2&65535)&255;this.b-=
|
255;this.b-=10},function(){var a=H(this);md(this)&&(I(this,this.j),C(this,a),this.b-=6);this.b-=11},Jd,function(){this.g=yd(this,G(this));this.b-=7},function(){I(this,this.j);C(this,24);this.b-=11},function(){od(this)||(C(this,Bd(this)),this.b-=6);this.b-=5},function(){ld(this,Bd(this));this.b-=10},function(){var a=H(this);od(this)||C(this,a);this.b-=10},function(){var a=Bd(this);I(this,D(this));ld(this,a);this.b-=18},function(){var a=H(this);od(this)||(I(this,this.j),C(this,a),this.b-=6);this.b-=
|
||||||
10},function(){var a=M(this);Yc(this)&&(P(this,this.P),I(this,a),this.b-=6);this.b-=11},Md,function(){this.i=jd(this,L(this));this.b-=7},function(){P(this,this.P);I(this,24);this.b-=11},function(){$c(this)||(I(this,N(this)),this.b-=6);this.b-=5},function(){Xc(this,N(this));this.b-=10},function(){var a=M(this);$c(this)||I(this,a);this.b-=10},function(){var a=N(this);P(this,J(this));Xc(this,a);this.b-=18},function(){var a=M(this);$c(this)||(P(this,this.P),I(this,a),this.b-=6);this.b-=11},function(){P(this,
|
11},function(){I(this,D(this));this.b-=11},function(){this.g=ud(this,G(this));this.b-=7},function(){I(this,this.j);C(this,32);this.b-=11},function(){od(this)&&(C(this,Bd(this)),this.b-=6);this.b-=5},function(){C(this,D(this));this.b-=5},function(){var a=H(this);od(this)&&C(this,a);this.b-=10},function(){var a=D(this);ld(this,jd(this));kd(this,a);this.b-=5},function(){var a=H(this);od(this)&&(I(this,this.j),C(this,a),this.b-=6);this.b-=11},Jd,function(){this.g=zd(this,G(this));this.b-=7},function(){I(this,
|
||||||
J(this));this.b-=11},function(){this.i=fd(this,L(this));this.b-=7},function(){P(this,this.P);I(this,32);this.b-=11},function(){$c(this)&&(I(this,N(this)),this.b-=6);this.b-=5},function(){I(this,J(this));this.b-=5},function(){var a=M(this);$c(this)&&I(this,a);this.b-=10},function(){var a=J(this);Xc(this,Vc(this));Wc(this,a);this.b-=5},function(){var a=M(this);$c(this)&&(P(this,this.P),I(this,a),this.b-=6);this.b-=11},Md,function(){this.i=kd(this,L(this));this.b-=7},function(){P(this,this.P);I(this,
|
this.j);C(this,40);this.b-=11},function(){rd(this)||(C(this,Bd(this)),this.b-=6);this.b-=5},function(){var a=Bd(this);Sc(this,a&255|this.N&-256);this.g=a>>8;this.b-=10},function(){var a=H(this);rd(this)||C(this,a);this.b-=10},function(){this.N&=-513;this.b-=4},function(){var a=H(this);rd(this)||(I(this,this.j),C(this,a),this.b-=6);this.b-=11},function(){I(this,Uc(this)&255|this.g<<8);this.b-=11},function(){this.g=xd(this,G(this));this.b-=7},function(){I(this,this.j);C(this,48);this.b-=11},function(){rd(this)&&
|
||||||
40);this.b-=11},function(){cd(this)||(I(this,N(this)),this.b-=6);this.b-=5},function(){var a=N(this);Pc(this,a&255|this.ta&-256);this.i=a>>8;this.b-=10},function(){var a=M(this);cd(this)||I(this,a);this.b-=10},function(){this.ta&=-513;this.b-=4},function(){var a=M(this);cd(this)||(P(this,this.P),I(this,a),this.b-=6);this.b-=11},function(){P(this,Rc(this)&255|this.i<<8);this.b-=11},function(){this.i=id(this,L(this));this.b-=7},function(){P(this,this.P);I(this,48);this.b-=11},function(){cd(this)&&(I(this,
|
(C(this,Bd(this)),this.b-=6);this.b-=5},function(){this.M=D(this)&65535;this.b-=5},function(){var a=H(this);rd(this)&&C(this,a);this.b-=10},function(){this.N|=512;this.b-=4;Cd(this)},function(){var a=H(this);rd(this)&&(I(this,this.j),C(this,a),this.b-=6);this.b-=11},Jd,function(){E(this,G(this));this.b-=7},function(){I(this,this.j);C(this,56);this.b-=11}];
|
||||||
N(this)),this.b-=6);this.b-=5},function(){this.oa=J(this)&65535;this.b-=5},function(){var a=M(this);cd(this)&&I(this,a);this.b-=10},function(){this.ta|=512;this.b-=4;ld(this)},function(){var a=M(this);cd(this)&&(P(this,this.P),I(this,a),this.b-=6);this.b-=11},Md,function(){K(this,L(this));this.b-=7},function(){P(this,this.P);I(this,56);this.b-=11}];
|
function Kd(a){x.call(this,"ChipSet",a,0,32768);var b=a.model;b&&!Ld[b]&&Ra("Unrecognized ChipSet model: "+b);this.g=Ld[b]||{};a.sound&&(this.U=null,window&&(this.U=window.AudioContext||window.webkitAudioContext),this.U&&new this.U);kb(this)}ba(Kd,x);k=Kd.prototype;k.ca=function(){return!1};
|
||||||
function R(a){x.call(this,"ChipSet",a,R,32768);var b=a.model;b&&!Nd[b]&&Ta("Unrecognized ChipSet model: "+b);this.u=Nd[b]||{};a.sound&&(this.ga=null,window&&(this.ga=window.AudioContext||window.webkitAudioContext),this.ga&&new this.ga);F(this)}A(R);
|
k.Ea=function(a,b,c,d){this.H=b;this.u=c;this.K=d;this.S=a;this.B=vb(a,"Keyboard");this.C=vb(a,"SerialPort");this.video=vb(a,"Video");Nb(b,this,this.g.xb);Rb(b,this,this.g.yb);if(d){var e=this;Md(d,16384,function(){for(var a="",b=0;b<e.j.length;b++)a&&(a+=b&&b%10?", ":",\n"),a+=q(e.j[b]);e.K.i(a)})}};k.ua=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.wa=function(a){return a?this.save():!0};k.reset=function(){this.g.INIT&&!this.restore(this.g.INIT)&&this.aa("reset error")};
|
||||||
var S={Da:1978.1,Ad:{Ea:0,Ve:1,Ze:16,ff:32,qf:64,pf:128,qb:14},Ya:{Ea:1,Pc:1,sd:2,od:4,pd:16,qd:32,rd:64,qb:8},Bd:{Ea:2,Ue:3,yf:4,We:8,kf:16,lf:32,mf:64,Xe:128,qb:0},uf:{Ea:3},sf:{Ea:2,gf:7},wf:{Ea:3,zf:1,vf:2,nf:4,df:8,Ye:16,pe:32},tf:{Ea:4},xf:{Ea:5,$e:1,af:2,bf:4,cf:8,Af:16}},T={Da:100,La:{Ea:66,rc:1,gc:2,ld:4,jf:8,hf:16,ic:32,hc:64,cc:128},Nc:{Ea:66,INIT:0},Ua:{Ea:194,se:0,ac:16,ud:32,nc:48,Xc:0,Yc:32},Fb:{Ea:162,rf:0,$c:0,Wc:0,Zc:0,Vc:0},Ma:{ef:{Ea:98},Ta:{Kc:0,Jc:1,xd:2,Gd:4,Qc:5,vd:6,yd:7},
|
k.save=function(){var a=new Vc(this);switch(this.g.pa){case Nd.pa:a.set(0,[this.ea,this.A,this.ga,this.N,this.T,this.Y,this.Z]);break;case L.pa:a.set(0,[this.W,this.D]),a.set(1,[this.F,this.I]),a.set(2,[this.w,this.O,this.X,this.V]),a.set(3,[this.M,this.b,this.L,this.R,this.j])}return a.data()};
|
||||||
Gb:16383}},Nd={SI1978:S,VT100:T};R.prototype.pa=function(){return!1};R.prototype.Qa=function(a,b,c,d){this.w=b;this.b=c;this.H=d;this.A=a;this.I=rb(a,"Keyboard");this.J=rb(a,"SerialPort");this.video=rb(a,"Video");Db(b,this,this.u.Kb);Ib(b,this,this.u.Lb);if(d){var e=this;Od(d,16384,function(){for(var a="",b=0;b<e.F.length;b++)a&&(a+=b&&b%10?", ":",\n"),a+=v(e.F[b]);e.H.g(a)})}};R.prototype.Ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};
|
k.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.g.pa){case Nd.pa:return this.ea=b[0],this.A=b[1],this.ga=b[2],this.N=b[3],this.T=b[4],this.Y=b[5],this.Z=b[6],!0;case L.pa:return this.W=b[0],this.D=b[1],b=a[1],this.F=b[0],this.I=b[1],b=a[2],this.w=b[0],this.O=b[1],this.X=b[2],this.V=b[3],b=a[3],this.M=b[0],this.b=b[1],this.L=b[2],this.R=b[3],this.j=b[4],!0}return!1};k.start=function(){};k.stop=function(){};k.Bd=function(a,b){var c=this.ea;y(this,a,null,b,"STATUS0",c,!0);return c};
|
||||||
R.prototype.Ka=function(a){return a?this.save():!0};S.INIT=[[S.Ad.qb,S.Ya.qb,S.Bd.qb,0,0,0,0]];
|
k.Cd=function(a,b){var c=this.A;y(this,a,null,b,"STATUS1",c,!0);return c};k.Dd=function(a,b){var c=this.ga;y(this,a,null,b,"STATUS2",c,!0);return c};k.Ad=function(a,b){var c=this.N>>8-this.T&255;y(this,a,null,b,"SHIFT.RESULT",c,!0);return c};k.Kd=function(a,b,c){y(this,a,b,c,"SHIFT.COUNT",null,!0);this.T=b};k.Md=function(a,b,c){y(this,a,b,c,"SOUND1",null,!0);this.Y=b};k.Ld=function(a,b,c){y(this,a,b,c,"SHIFT.DATA",null,!0);this.N=b<<8|this.N>>8};
|
||||||
T.INIT=[[T.Nc.INIT,T.La.gc|T.La.ld],[T.Ua.Xc,T.Ua.Yc],[T.Fb.$c,T.Fb.Wc,T.Fb.Zc,T.Fb.Vc],[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],
|
k.Nd=function(a,b,c){y(this,a,b,c,"SOUND2",null,!0);this.Z=b};k.Od=function(a,b,c){y(this,a,b,c,"WATCHDOG",null,!0)};function Od(a){var b=0,c=0,d=~a.M;for(a=0;10>a;a++)d&1&&(b=9-a),d>>=1;for(a=0;10>a;a++)d&1&&(c=9-a),d>>=1;return 10*b+c}
|
||||||
[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]]];l=R.prototype;l.reset=function(){this.u.INIT&&!this.restore(this.u.INIT)&&this.ja("reset error")};
|
k.Ed=function(a,b){var c=this.D,c=c&~L.xa.Yb;if((Cc(this.u)&64)<<1&&(c|=L.xa.Yb,c!=this.D)){var d,e;d=this.L&1;e=this.L>>1&7;switch(e){case L.Aa.Ja.dd:break;case L.Aa.Ja.oc:this.M=this.M<<1|d;break;case L.Aa.Ja.wc:d=Od(this);this.j[d]=L.Aa.sb;ob(this,"doNVRCommand(): erase data at addr "+q(d));break;case L.Aa.Ja.pc:this.b=this.b<<1|d;break;case L.Aa.Ja.md:d=Od(this);e=this.b&L.Aa.sb;this.j[d]=e;ob(this,"doNVRCommand(): write data "+q(e)+" to addr "+q(d));break;case L.Aa.Ja.ad:d=Od(this);e=this.j[d];
|
||||||
l.save=function(){var a=new Sc(this);switch(this.u.Da){case S.Da:a.set(0,[this.Ca,this.D,this.Ha,this.aa,this.ea,this.ma,this.va]);break;case T.Da:a.set(0,[this.ia,this.K]),a.set(1,[this.L,this.N]),a.set(2,[this.B,this.ba,this.la,this.ka]),a.set(3,[this.X,this.j,this.O,this.da,this.F])}return a.data()};
|
null==e&&(e=L.Aa.sb);this.b=e;ob(this,"doNVRCommand(): read data "+q(e)+" from addr "+q(d));break;case L.Aa.Ja.cd:this.b<<=1;this.R=this.b&L.Aa.sb+1;break;default:ob(this,"doNVRCommand(): unrecognized command "+ea(e))}}c&=~L.xa.Zb;this.R&&(c|=L.xa.Zb);c&=~L.xa.Tb;if(d=this.B){d=this.B;if(e=d.A)e=d.u,e=Cc(d.u)>=d.F+e.Fa*e.U/1E3*1.2731488;e&&(d.A=!1);d=!d.A}d&&(c|=L.xa.Tb);c&=~L.xa.ac;this.C&&this.C.ia&Pd&&(c|=L.xa.ac);this.D=c;y(this,a,null,b,"FLAGS",c);return c};
|
||||||
l.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.u.Da){case S.Da:return this.Ca=b[0],this.D=b[1],this.Ha=b[2],this.aa=b[3],this.ea=b[4],this.ma=b[5],this.va=b[6],!0;case T.Da:return this.ia=b[0],this.K=b[1],b=a[1],this.L=b[0],this.N=b[1],b=a[2],this.B=b[0],this.ba=b[1],this.la=b[2],this.ka=b[3],b=a[3],this.X=b[0],this.j=b[1],this.O=b[2],this.da=b[3],this.F=b[4],!0}return!1};l.start=function(){};l.stop=function(){};l.Vd=function(a,b){var c=this.Ca;E(this,a,null,b,"STATUS0",c,!0);return c};
|
k.Pd=function(a,b,c){y(this,a,b,c,"BRIGHTNESS");this.W=b};k.Sd=function(a,b,c){y(this,a,b,c,"NVR.LATCH");this.L=b};k.Rd=function(a,b,c){y(this,a,b,c,"DC012");a=b&3;switch(b>>2&3){case 0:this.w=this.w&-4|a;break;case 1:this.w=this.w&-13|a<<2;this.video&&(b=this.video,a=this.w,ob(b,"updateScrollOffset("+a+")"),b.sa!==a&&((b.sa=a)?Nc(b,!0):b.ya=!0));break;case 2:switch(a){case 0:this.O=~this.O;break;case 2:case 3:this.X=3-a}break;case 3:this.V=a}};
|
||||||
l.Wd=function(a,b){var c=this.D;E(this,a,null,b,"STATUS1",c,!0);return c};l.Xd=function(a,b){var c=this.Ha;E(this,a,null,b,"STATUS2",c,!0);return c};l.Ud=function(a,b){var c=this.aa>>8-this.ea&255;E(this,a,null,b,"SHIFT.RESULT",c,!0);return c};l.ee=function(a,b,c){E(this,a,b,c,"SHIFT.COUNT",null,!0);this.ea=b};l.ge=function(a,b,c){E(this,a,b,c,"SOUND1",null,!0);this.ma=b};l.fe=function(a,b,c){E(this,a,b,c,"SHIFT.DATA",null,!0);this.aa=b<<8|this.aa>>8};
|
k.Qd=function(a,b,c){y(this,a,b,c,"DC011");b&L.Ka.$c?(b&=L.Ka.$b,this.I!=b&&(this.I=b,this.video&&(a=this.video,b=this.I==L.Ka.$b?50:60,ob(a,"updateRate("+b+")"),a.gb=b))):(b&=L.Ka.Qb,this.F!=b&&(this.F=b,this.video&&(a=this.F==L.Ka.Qb?132:80,b=this.video,ob(b,"updateDimensions("+a+","+(80<a&&this.D&L.xa.Xb?14:24)+")"),b.O=a,b.fa=b.Ha,80<a&&b.fa--,Qd(b)&&Rd(b))))};
|
||||||
l.he=function(a,b,c){E(this,a,b,c,"SOUND2",null,!0);this.va=b};l.ie=function(a,b,c){E(this,a,b,c,"WATCHDOG",null,!0)};function Pd(a){var b=0,c=0,d=~a.X;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}
|
var Nd={pa:1978.1,fd:{qa:0,Qe:1,Ue:16,af:32,kf:64,jf:128,Za:14},Oa:{qa:1,uc:1,Yc:2,Uc:4,Vc:16,Wc:32,Xc:64,Za:8},gd:{qa:2,Pe:3,tf:4,Re:8,ef:16,ff:32,gf:64,Se:128,Za:0},pf:{qa:3},mf:{qa:2,bf:7},rf:{qa:3,uf:1,qf:2,hf:4,Ze:8,Te:16,ke:32},nf:{qa:4},sf:{qa:5,Ve:1,We:2,Xe:4,Ye:8,vf:16}},L={pa:100,xa:{qa:66,ac:1,Xb:2,Rc:4,df:8,cf:16,Zb:32,Yb:64,Tb:128},sc:{qa:66,INIT:0},Ka:{qa:194,ne:0,Qb:16,$c:32,$b:48,Dc:0,Ec:32},rb:{qa:162,lf:0,Gc:0,Cc:0,Fc:0,Bc:0},Aa:{$e:{qa:98},Ja:{pc:0,oc:1,cd:2,md:4,wc:5,ad:6,dd:7},
|
||||||
l.Yd=function(a,b){var c=this.K,c=c&~T.La.hc;if((Dc(this.b)&64)<<1&&(c|=T.La.hc,c!=this.K)){var d,e;d=this.O&1;e=this.O>>1&7;switch(e){case T.Ma.Ta.yd:break;case T.Ma.Ta.Jc:this.X=this.X<<1|d;break;case T.Ma.Ta.Qc:d=Pd(this);this.F[d]=T.Ma.Gb;fb(this,"doNVRCommand(): erase data at addr "+v(d));break;case T.Ma.Ta.Kc:this.j=this.j<<1|d;break;case T.Ma.Ta.Gd:d=Pd(this);e=this.j&T.Ma.Gb;this.F[d]=e;fb(this,"doNVRCommand(): write data "+v(e)+" to addr "+v(d));break;case T.Ma.Ta.vd:d=Pd(this);e=this.F[d];
|
sb:16383}},Ld={SI1978:Nd,VT100:L};Nd.INIT=[[Nd.fd.Za,Nd.Oa.Za,Nd.gd.Za,0,0,0,0]];
|
||||||
null==e&&(e=T.Ma.Gb);this.j=e;fb(this,"doNVRCommand(): read data "+v(e)+" from addr "+v(d));break;case T.Ma.Ta.xd:this.j<<=1;this.da=this.j&T.Ma.Gb+1;break;default:fb(this,"doNVRCommand(): unrecognized command "+ca(e))}}c&=~T.La.ic;this.da&&(c|=T.La.ic);c&=~T.La.cc;if(d=this.I){d=this.I;if(e=d.D)e=d.b,e=Dc(d.b)>=d.L+e.X*e.Ra/1E3*1.2731488;e&&(d.D=!1);d=!d.D}d&&(c|=T.La.cc);c&=~T.La.rc;this.J&&this.J.wa&1&&(c|=T.La.rc);this.K=c;E(this,a,null,b,"FLAGS",c);return c};
|
L.INIT=[[L.sc.INIT,L.xa.Xb|L.xa.Rc],[L.Ka.Dc,L.Ka.Ec],[L.rb.Gc,L.rb.Cc,L.rb.Fc,L.rb.Bc],[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],
|
||||||
l.je=function(a,b,c){E(this,a,b,c,"BRIGHTNESS");this.ia=b};l.me=function(a,b,c){E(this,a,b,c,"NVR.LATCH");this.O=b};l.le=function(a,b,c){E(this,a,b,c,"DC012");a=b&3;switch(b>>2&3){case 0:this.B=this.B&-4|a;break;case 1:this.B=this.B&-13|a<<2;this.video&&(b=this.video,a=this.B,fb(b,"updateScrollOffset("+a+")"),b.hb!==a&&((b.hb=a)?Kc(b,!0):b.sb=!0));break;case 2:switch(a){case 0:this.ba=~this.ba;break;case 2:case 3:this.la=3-a}break;case 3:this.ka=a}};
|
[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]]];Nd.xb={0:Kd.prototype.Bd,1:Kd.prototype.Cd,2:Kd.prototype.Dd,3:Kd.prototype.Ad};
|
||||||
l.ke=function(a,b,c){E(this,a,b,c,"DC011");b&T.Ua.ud?(b&=T.Ua.nc,this.N!=b&&(this.N=b,this.video&&(a=this.video,b=this.N==T.Ua.nc?50:60,fb(a,"updateRate("+b+")"),a.vc=b))):(b&=T.Ua.ac,this.L!=b&&(this.L=b,this.video&&(a=this.L==T.Ua.ac?132:80,b=this.video,fb(b,"updateDimensions("+a+","+(80<a&&this.K&T.La.gc?14:24)+")"),b.ba=a,b.ra=b.kc,80<a&&b.ra--,Qd(b)&&Rd(b))))};S.Kb={0:R.prototype.Vd,1:R.prototype.Wd,2:R.prototype.Xd,3:R.prototype.Ud};
|
Nd.yb={2:Kd.prototype.Kd,3:Kd.prototype.Md,4:Kd.prototype.Ld,5:Kd.prototype.Nd,6:Kd.prototype.Od};L.xb={66:Kd.prototype.Ed};L.yb={66:Kd.prototype.Pd,98:Kd.prototype.Sd,162:Kd.prototype.Rd,194:Kd.prototype.Qd};Na(function(){for(var a=gb(document,"pc8080","chipset"),b=0;b<a.length;b++){var c=a[b],d=eb(c),d=new Kd(d);fb(d,c)}});
|
||||||
S.Lb={2:R.prototype.ee,3:R.prototype.ge,4:R.prototype.fe,5:R.prototype.he,6:R.prototype.ie};T.Kb={66:R.prototype.Yd};T.Lb={66:R.prototype.je,98:R.prototype.me,162:R.prototype.le,194:R.prototype.ke};Qa(function(){for(var a=D(document,"pc8080","chipset"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new R(d);db(d,c)}});
|
function Sd(a){x.call(this,"ROM",a);this.b=null;this.A=a.addr;this.g=a.size;this.w=a.alias;this.j=a.file;this.B=fa(this.j);if(this.j){a=this.j;var b=ga(this.B);"json"!=b&&"hex"!=b&&(a=ja()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;va(a,null,!0,function(a,b,f){Td(c,a,b,f)})}}ba(Sd,x);Sd.prototype.Ea=function(a,b,c,d){this.H=b;this.u=c;this.K=d;Ud(this)};
|
||||||
function Sd(a){x.call(this,"ROM",a,Sd);this.A=null;this.B=a.addr;this.j=a.size;this.F=a.alias;this.u=a.file;this.D=da(this.u);if(this.u){a=this.u;var b=fa(this.D);"json"!=b&&"hex"!=b&&(a=ia()+"/api/v1/dump?file="+this.u+"&format=bytes&decimal=true");var c=this;ta(a,null,!0,function(a,b,f){Td(c,a,b,f)})}}A(Sd);Sd.prototype.Qa=function(a,b,c,d){this.w=b;this.b=c;this.H=d;Ud(this)};
|
Sd.prototype.ua=function(){if(this.ra){if(this.K){var a=this.K,b=this.id,c=this.A,d=this.g,e=this.ra,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,p=h.a;if(void 0!==l){var r=f,l=[l>>>0,g],t=qa(r,l,a.dc);0>t&&r.splice(-(t+1),0,l)}p&&(h.a=p.replace(/''/g,'"'))}a.A.push({Hf:b,J:c,Gd:d,ra:e,cc:f})}delete this.ra}return!0};Sd.prototype.wa=function(){return!0};
|
||||||
Sd.prototype.Ga=function(){if(this.Fa){if(this.H){var a=this.H,b=this.id,c=this.B,d=this.j,e=this.Fa,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var k=h.o,m=h.a;if(void 0!==k){var p=f,k=[k>>>0,g],q=pa(p,k,a.zc);0>q&&p.splice(-(q+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.D.push({Mf:b,G:c,$d:d,Fa:e,yc:f})}delete this.Fa}return!0};Sd.prototype.Ka=function(){return!0};
|
function Td(a,b,c,d){if(d)a.aa("Unable to load system ROM (error "+d+": "+b+")");else{$a(a.ab,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.ra=e.symbols;if(!a.b.length){v("Empty ROM: "+b);return}if(1==a.b.length){v(a.b[0]);return}}catch(h){a.aa("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm,
|
||||||
function Td(a,b,c,d){if(d)a.ja("Unable to load system ROM (error "+d+": "+b+")");else{Za(a.gb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,g=e.data;if(f)a.A=f;else if(g)for(a.A=Array(4*g.length),d=c=0;c<g.length;c++)a.A[d++]=g[c]&255,a.A[d++]=g[c]>>8&255,a.A[d++]=g[c]>>16&255,a.A[d++]=g[c]>>24&255;else a.A=e;a.Fa=e.symbols;if(!a.A.length){w("Empty ROM: "+b);return}if(1==a.A.length){w(a.A[0]);return}}catch(h){a.ja("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]=ca(b[e],16);Ud(a)}}
|
||||||
" ").replace(/ +$/,"").split(" "),a.A=Array(b.length),e=0;e<b.length;e++)a.A[e]=aa(b[e],16);Ud(a)}}
|
function Ud(a){if(!ib(a))if(!a.j)kb(a);else if(a.b&&a.H){a.g||(a.g=a.b.length);if(a.b.length!=a.g)hb(a,"ROM size ("+n(a.b.length,8,!0)+") does not match specified size ("+n(a.g,8,!0)+")");else{var b;b=a.A;if(zb(a.H,b,a.g,Zb)){var c;for(c=0;c<a.b.length;c++)Hb(a.H,b+c,a.b[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.w?b.push(a.w):null!=a.w&&a.w.length&&(b=a.w);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.H,g=d.g,h=[],l=d.A>>>f.g;0<g&&l<f.b.length;)h.push(f.b[l++]),g-=f.w;f=d.H;d=d.g;g=0;for(e>>>=
|
||||||
function Ud(a){if(!jb(a))if(!a.u)F(a);else if(a.A&&a.w){a.j||(a.j=a.A.length);if(a.A.length!=a.j)kb(a,"ROM size ("+t(a.A.length,8,!0)+") does not match specified size ("+t(a.j,8,!0)+")");else{var b;b=a.B;if(vb(a.w,b,a.j,Zb)){var c;for(c=0;c<a.A.length;c++)Ab(a.w,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.w,g=d.j,h=[],k=d.B>>>f.ha;0<g&&k<f.W.length;)h.push(f.W[k++]),g-=f.Ja;f=d.w;d=d.j;g=0;for(e>>>=
|
f.g;0<d&&e<f.b.length;){l=h[g++];if(!l)break;f.b[e++]=l;d-=f.w}}delete a.b}}kb(a)}}Na(function(){for(var a=gb(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=eb(c),d=new Sd(d);fb(d,c)}});
|
||||||
f.ha;0<d&&e<f.W.length;){k=h[g++];if(!k)break;f.W[e++]=k;d-=f.Ja}}delete a.A}}F(a)}}Qa(function(){for(var a=D(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Sd(d);db(d,c)}});
|
function Vd(a){x.call(this,"RAM",a);this.ra=this.g=null;this.w=a.addr;this.A=a.size;this.Qa=a.load;this.Ia=a.exec;this.j=!1;this.b=a.file;this.B=fa(this.b);if(this.b){a=this.b;var b=ga(this.B);"json"!=b&&"hex"!=b&&(a=ja()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;va(a,null,!0,function(a,b,f){f?c.aa("Unable to load RAM resource (error "+f+": "+a+")"):($a(c.ab,a,b),(a=wa(a,b))?(c.g=a.ma,c.ra=a.ra,null==c.Qa&&(c.Qa=a.Qa),null==c.Ia&&(c.Ia=a.Ia)):c.b=null,Wd(c))})}}ba(Vd,x);
|
||||||
function Vd(a){x.call(this,"RAM",a,Vd);this.Fa=this.j=null;this.F=a.addr;this.B=a.size;this.$a=a.load;this.Sa=a.exec;this.u=!1;this.A=a.file;this.D=da(this.A);if(this.A){a=this.A;var b=fa(this.D);"json"!=b&&"hex"!=b&&(a=ia()+"/api/v1/dump?file="+this.A+"&format=bytes&decimal=true");var c=this;ta(a,null,!0,function(a,b,f){f?c.ja("Unable to load RAM resource (error "+f+": "+a+")"):(Za(c.gb,a,b),(a=ua(a,b))?(c.j=a.Ba,c.Fa=a.Fa,null==c.$a&&(c.$a=a.$a),null==c.Sa&&(c.Sa=a.Sa)):c.A=null,Wd(c))})}}A(Vd);
|
Vd.prototype.Ea=function(a,b,c,d){this.H=b;this.u=c;this.K=d;Wd(this)};Vd.prototype.ua=function(){return!0};Vd.prototype.wa=function(){return!0};
|
||||||
var Xd=[0,5];Vd.prototype.Qa=function(a,b,c,d){this.w=b;this.b=c;this.H=d;Wd(this)};Vd.prototype.Ga=function(){return!0};Vd.prototype.Ka=function(){return!0};
|
function Wd(a){!a.j&&a.A&&zb(a.H,a.w,a.A,1)&&(a.j=!0);if(!ib(a)){if(!a.j)v("No RAM allocated");else if(a.b){if(!a.g||!a.H)return;var b=a.w;null!==a.Qa&&(b=a.Qa);for(var c=0;c<a.g.length;c++)Hb(a.H,b+c,a.g[c]);if(null!==a.Ia){if(a.Ia==Xd){for(c=0;c<Yd.length;c++)Hb(a.H,Yd[c],118);Rc(a.u,function(a){return function(b){if(0<=Yd.indexOf(b)){var c=!1,d=a.u,e=a.K;if(b==Zd)switch(c=!0,d.A){case $d:ae(a,String.fromCharCode(d.C));break;case be:for(var l=jd(d),p="",r=255;r--;){var t=F(a.u,l++);if(36==t)break;
|
||||||
function Wd(a){!a.u&&a.B&&vb(a.w,a.F,a.B,1)&&(a.u=!0);if(!jb(a)){if(!a.u)w("No RAM allocated");else if(a.A){if(!a.j||!a.w)return;var b=a.F;null!==a.$a&&(b=a.$a);for(var c=0;c<a.j.length;c++)Ab(a.w,b+c,a.j[c]);if(null!==a.Sa){if(256==a.Sa){for(c=0;c<Xd.length;c++)Ab(a.w,Xd[c],118);Oc(a.b,function(a){return function(b){if(0<=Xd.indexOf(b)){var c=!1,d=a.b,e=a.H;if(5==b)switch(c=!0,d.S){case 2:Yd(a,String.fromCharCode(d.U));break;case 9:for(var k=Vc(d),m="",p=255;p--;){var q=a.b.Z(k++);if(36==q)break;
|
p+=String.fromCharCode(t)}ae(a,p);break;default:c=!1}c?Id.call(d):e&&(a.i("\nCP/M vector "+q(b)),C(d,b),e.da());b=!0}else b=!1;return b}}(a))}Tc(a.u,a.Ia)}delete a.g}kb(a)}}Vd.prototype.reset=function(){};function ae(a,b){b=b.replace(/\r/g,"");a.ta&&(a.ta.value+=b,a.ta.scrollTop=a.ta.scrollHeight)}var Zd=5,$d=2,be=9,Xd=256,Yd=[0,Zd];Na(function(){for(var a=gb(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=eb(c),d=new Vd(d);fb(d,c)}});
|
||||||
m+=String.fromCharCode(q)}Yd(a,m);break;default:c=!1}c?Ld.call(d):e&&(a.g("\nCP/M vector "+v(b)),I(d,b),e.qa());b=!0}else b=!1;return b}}(a))}Qc(a.b,a.Sa)}delete a.j}F(a)}}Vd.prototype.reset=function(){};function Yd(a,b){b=b.replace(/\r/g,"");a.Ia&&(a.Ia.value+=b,a.Ia.scrollTop=a.Ia.scrollHeight)}Qa(function(){for(var a=D(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Vd(d);db(d,c)}});
|
function ce(a){x.call(this,"Keyboard",a,0,65536);(a=a.model)&&!de[a]&&Ra("Unrecognized Keyboard8080 model: "+a);this.b=de[a]||{};this.reset();kb(this)}ba(ce,x);k=ce.prototype;
|
||||||
function Zd(a){x.call(this,"Keyboard",a,Zd,65536);(a=a.model)&&!$d[a]&&Ta("Unrecognized Keyboard8080 model: "+a);this.w=$d[a]||{};this.reset();F(this)}A(Zd);var ae={};ae[n.Eb]=37;ae[n.bc]=39;ae[n.dc]=32;
|
k.ca=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.P[e]){if("led"==a&&this.b.bb[b])return this.P[e]=c,!0;switch(b){case "kbd":case "screen":return c.onkeydown=function(a){return ee(d,a,!0)},c.onkeyup=function(a){return ee(d,a,!1)},c.onkeypress=function(a){a=a.keyCode;a>=m.pb&&a<=m.Db?d.j&(fe|ge)||(d.j|=ge,he(d,20,!0),De(d)):a>=m.pd&&a<=m.z&&d.j&ge&&(d.j&=~ge,he(d,20,!1),De(d));return!0},c.onpaste=function(a){a:{if(d.C&&d.C.Ra&&(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),
|
||||||
var be={Da:1978.1,Nb:{},$b:ae,tb:{},ib:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},V={},W={Da:100,Nb:(V[8]=3,V[n.nd]=5,V[n.md]=6,V[n.Id]=7,V[n.Cd]=8,V[n.Fd]=9,V[n.Q]=10,V[39]=16,V[221]=20,V[219]=21,V[n.Uc]=22,V[n.Dd]=23,V[n.td]=24,V[n.E]=25,V[49]=26,V[37]=32,V[40]=34,V[117]=35,V[19]=35,V[192]=36,V[189]=37,V[57]=38,V[55]=39,V[52]=40,V[51]=41,V[27]=42,V[38]=48,V[114]=49,V[112]=50,V[46]=51,V[187]=52,V[48]=53,V[56]=54,V[54]=55,V[53]=56,V[50]=57,V[9]=58,V[103]=64,V[115]=65,V[113]=66,V[96]=67,V[118]=
|
a=a.clipboardData||window.clipboardData)){Ee(d.C,a.getData("Text"));a=!1;break a}a=!0}return a},!0;default:if(this.b.Ta&&void 0!==this.b.Ta[b])return this.P[e]=c,c.onclick=function(a,b){return function(c){c.preventDefault&&c.preventDefault();he(a,b,!0,!0)}}(this,this.b.Ta[b]),!0}}return!1};k.Ea=function(a,b,c,d){this.S=a;this.u=c;this.K=d;var e=this;this.L=Ic(this.u,function(){Fe(e)});this.W=vb(a,"ChipSet");this.C=vb(a,"SerialPort");Nb(b,this,this.b.xb);Rb(b,this,this.b.yb)};
|
||||||
68,V[220]=69,V[n.dc]=70,V[n.bd]=71,V[n.Sc]=72,V[n.Rc]=73,V[n.Eb]=74,V[104]=80,V[2013]=81,V[98]=82,V[97]=83,V[222]=85,V[186]=86,V[n.ad]=87,V[n.Tc]=88,V[n.bc]=89,V[n.wd]=90,V[110]=96,V[116]=97,V[101]=98,V[100]=99,V[13]=100,V[190]=101,V[188]=102,V[n.kd]=103,V[n.Mc]=104,V[n.Hd]=105,V[119]=106,V[105]=112,V[99]=113,V[102]=114,V[109]=115,V[191]=117,V[n.jd]=118,V[n[" "]]=119,V[n.Ed]=120,V[n.Oc]=121,V[n.Pb]=122,V[120]=123,V[17]=124,V[16]=125,V[20]=126,V),$b:{},tb:{},ib:{"num-comma":116,"break":117,"line-feed":118,
|
k.ua=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.wa=function(a){return a?this.save():!0};k.reset=function(){this.g=[];this.j=0;this.b.INIT&&!this.restore(this.b.INIT)&&this.aa("reset error")};k.save=function(){var a=new Vc(this);switch(this.b.pa){case M.pa:a.set(0,[this.D,this.B,this.A,this.F,-1])}return a.data()};
|
||||||
"no-scroll":119,setup:120},Lc:{Ea:130,INIT:127},Na:{Ea:130,gd:1,fd:2,ed:4,dd:8,hd:16,fc:32,ec:63,zd:64,re:128,INIT:0},cd:127};W.tb={l4:W.Na.gd,l3:W.Na.fd,l2:W.Na.ed,l1:W.Na.dd,locked:W.Na.hd,local:W.Na.fc,online:~W.Na.fc,"caps-lock":512};var $d={SI1978:be,VT100:W};
|
k.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.b.pa){case Ge.pa:return!0;case M.pa:return this.D=b[0],De(this,this.D&M.Ba.Vb),this.B=b[1],this.A=b[2],this.F=b[3],this.w=b[4],!0}return!1};function De(a,b){var c;null!=b?a.I=b:b=a.I;for(var d in a.b.bb)if(c="led-"+d,c=a.P[c]){var e=a.b.bb[d],f=!!(b&e);e&e-1&&(f=!(b&~e));c.style.backgroundColor=f?"#"+n(16711680,6):"#000000"}if(c=a.P["led-caps-lock"])c.style.backgroundColor=a.j&ge?"#"+n(65280,6):"#000000"}
|
||||||
Zd.prototype.pa=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.M[e]){if("led"==a&&this.w.tb[b])return this.M[e]=c,!0;switch(b){case "kbd":case "screen":return c.onkeydown=function(a){return ce(d,a,!0)},c.onkeyup=function(a){return ce(d,a,!1)},c.onkeypress=function(a){a=a.keyCode;a>=n.Eb&&a<=n.Pb?d.u&515||(d.u|=512,de(d,20,!0),ee(d)):a>=n.Jd&&a<=n.z&&d.u&512&&(d.u&=-513,de(d,20,!1),ee(d));return!0},c.onpaste=function(a){a:{if(d.J&&d.J.eb&&(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&
|
function ee(a,b,c){var d=!0,e=b.keyCode,f=2==b.location,g=0;switch(e){case 16:g=f?He:Ie;break;case 17:g=f?Je:Ke;break;case 18:g=f?Le:Me;break;case 91:g=f?Ne:Oe;break;case 20:g=ge}g&&(a.j=c?a.j|g:a.j&~g);var h;a:if(e=a.b.Pb[e]||e,a.b.Cb[e])h=e;else{for(h in a.b.Ta)if(a.b.Ta[h]===e)break a;h=null}h&&!b.metaKey&&(d=!1,a.j&(Pe|Qe)&&(13==h?(h=118,d=!0):8==h&&(h=46,d=!0),d&&(a.j=c?a.j|Qe:a.j&~Qe)),d=he(a,h,c),(!(h>=m.pb&&h<=m.Db)||a.j|Re)&&b.preventDefault&&b.preventDefault());return d}
|
||||||
a.preventDefault(),a=a.clipboardData||window.clipboardData)){fe(d.J,a.getData("Text"));a=!1;break a}a=!0}return a},!0;default:if(this.w.ib&&void 0!==this.w.ib[b])return this.M[e]=c,c.onclick=function(a,b){return function(c){c.preventDefault&&c.preventDefault();de(a,b,!0,!0)}}(this,this.w.ib[b]),!0}}return!1};Zd.prototype.Qa=function(a,b,c,d){this.A=a;this.b=c;this.H=d;var e=this;this.O=Hc(this.b,function(){ge(e)});this.F=rb(a,"ChipSet");this.J=rb(a,"SerialPort");Db(b,this,this.w.Kb);Ib(b,this,this.w.Lb)};
|
function he(a,b,c,d){var e;a:{for(e=0;e<a.g.length;e++)if(a.g[e].Lb==b)break a;e=-1}if(c)0>e?a.g.push({Lb:b,Ib:Date.now(),ub:d||!1}):(a.g[e].Ib=Date.now(),a.g[e].ub=d||!1),d&&Fe(a);else if(0<=e){if(!a.g[e].ub&&(d=a.g[e].Ib)&&Date.now()-d<Se)return a.g[e].ub=!0,Fe(a),!0;a.g.splice(e,1)}if(a.W){d=0;switch(b){case "1p":d=Nd.Oa.Uc;break;case "2p":d=Nd.Oa.Yc;break;case "coin":d=Nd.Oa.uc;break;case "left":d=Nd.Oa.Wc;break;case "right":d=Nd.Oa.Xc;break;case "fire":d=Nd.Oa.Vc}d&&(a=a.W,b=d,a.A&=~b,c&&(a.A|=
|
||||||
Zd.prototype.Ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};Zd.prototype.Ka=function(a){return a?this.save():!0};W.INIT=[[W.Na.INIT,W.Lc.INIT,!1,0,-1]];l=Zd.prototype;l.reset=function(){this.j=[];this.u=0;this.w.INIT&&!this.restore(this.w.INIT)&&this.ja("reset error")};l.save=function(){var a=new Sc(this);switch(this.w.Da){case W.Da:a.set(0,[this.K,this.I,this.D,this.L,-1])}return a.data()};
|
b))}return!0}function Fe(a){for(var b=0,c=-1;b<a.g.length;){if(a.g[b].ub){var d=a.g[b].Lb,e=Se-(Date.now()-a.g[b].Ib);if(0<e){if(0>c||c>e)c=e}else{he(a,d,!1);b=0;continue}}b++}0<=c&&Jc(a.u,a.L,c)}k.Fd=function(a,b){var c=this.B;0<=this.w&&(this.w<this.g.length?(c=this.g[this.w],this.w++,c=M.Cb[c.Lb],c&128&&(c&=127)):(this.w=-1,c=M.Jc),this.B=c,Dd(this.u,1));y(this,a,null,b,"KBDUART.ADDRESS",c);return c};
|
||||||
l.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.w.Da){case be.Da:return!0;case W.Da:return this.K=b[0],ee(this,this.K&W.Na.ec),this.I=b[1],this.D=b[2],this.L=b[3],this.B=b[4],!0}return!1};function ee(a,b){var c;null!=b?a.N=b:b=a.N;for(var d in a.w.tb)if(c="led-"+d,c=a.M[c]){var e=a.w.tb[d],f=!!(b&e);e&e-1&&(f=!(b&~e));c.style.backgroundColor=f?"#"+t(16711680,6):"#000000"}if(c=a.M["led-caps-lock"])c.style.backgroundColor=a.u&512?"#"+t(65280,6):"#000000"}
|
k.Td=function(a,b,c){y(this,a,b,c,"KBDUART.STATUS");this.D=b;this.A=!0;this.F=Cc(this.u);De(this,b&M.Ba.Vb);b&M.Ba.ed&&(this.w=0,Dd(this.u,1))};var He=1,Ie=2,fe=3,Je=4,Ke=8,Re=12,Le=16,Me=32,Pe=48,Ne=64,Oe=128,ge=512,Qe=4096,Se=50,Te={};Te[m.pb]=37;Te[m.Rb]=39;Te[m.Ub]=32;
|
||||||
function ce(a,b,c){var d=!0,e=b.keyCode,f=2==b.location,g=0;switch(e){case 16:g=f?1:2;break;case 17:g=f?4:8;break;case 18:g=f?16:32;break;case 91:g=f?64:128;break;case 20:g=512}g&&(a.u=c?a.u|g:a.u&~g);var h;a:if(e=a.w.$b[e]||e,a.w.Nb[e])h=e;else{for(h in a.w.ib)if(a.w.ib[h]===e)break a;h=null}h&&!b.metaKey&&(d=!1,a.u&4144&&(13==h?(h=118,d=!0):8==h&&(h=46,d=!0),d&&(a.u=c?a.u|4096:a.u&-4097)),d=de(a,h,c),(!(h>=n.Eb&&h<=n.Pb)||a.u|12)&&b.preventDefault&&b.preventDefault());return d}
|
var Ge={pa:1978.1,Cb:{},Pb:Te,bb:{},Ta:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},N={},M={pa:100,Cb:(N[8]=3,N[m.Tc]=5,N[m.Sc]=6,N[m.od]=7,N[m.hd]=8,N[m.ld]=9,N[m.Q]=10,N[39]=16,N[221]=20,N[219]=21,N[m.Ac]=22,N[m.jd]=23,N[m.Zc]=24,N[m.E]=25,N[49]=26,N[37]=32,N[40]=34,N[117]=35,N[19]=35,N[192]=36,N[189]=37,N[57]=38,N[55]=39,N[52]=40,N[51]=41,N[27]=42,N[38]=48,N[114]=49,N[112]=50,N[46]=51,N[187]=52,N[48]=53,N[56]=54,N[54]=55,N[53]=56,N[50]=57,N[9]=58,N[103]=64,N[115]=65,N[113]=66,N[96]=67,N[118]=
|
||||||
function de(a,b,c,d){var e;a:{for(e=0;e<a.j.length;e++)if(a.j[e].Xb==b)break a;e=-1}if(c)0>e?a.j.push({Xb:b,Ub:Date.now(),Hb:d||!1}):(a.j[e].Ub=Date.now(),a.j[e].Hb=d||!1),d&&ge(a);else if(0<=e){if(!a.j[e].Hb&&(d=a.j[e].Ub)&&50>Date.now()-d)return a.j[e].Hb=!0,ge(a),!0;a.j.splice(e,1)}if(a.F){d=0;switch(b){case "1p":d=S.Ya.od;break;case "2p":d=S.Ya.sd;break;case "coin":d=S.Ya.Pc;break;case "left":d=S.Ya.qd;break;case "right":d=S.Ya.rd;break;case "fire":d=S.Ya.pd}d&&(a=a.F,b=d,a.D&=~b,c&&(a.D|=b))}return!0}
|
68,N[220]=69,N[m.Ub]=70,N[m.Ic]=71,N[m.yc]=72,N[m.xc]=73,N[m.pb]=74,N[104]=80,N[2013]=81,N[98]=82,N[97]=83,N[222]=85,N[186]=86,N[m.Hc]=87,N[m.zc]=88,N[m.Rb]=89,N[m.bd]=90,N[110]=96,N[116]=97,N[101]=98,N[100]=99,N[13]=100,N[190]=101,N[188]=102,N[m.Qc]=103,N[m.rc]=104,N[m.nd]=105,N[119]=106,N[105]=112,N[99]=113,N[102]=114,N[109]=115,N[191]=117,N[m.Pc]=118,N[m[" "]]=119,N[m.kd]=120,N[m.tc]=121,N[m.Db]=122,N[120]=123,N[17]=124,N[16]=125,N[20]=126,N),Pb:{},bb:{},Ta:{"num-comma":116,"break":117,"line-feed":118,
|
||||||
function ge(a){for(var b=0,c=-1;b<a.j.length;){if(a.j[b].Hb){var d=a.j[b].Xb,e=50-(Date.now()-a.j[b].Ub);if(0<e){if(0>c||c>e)c=e}else{de(a,d,!1);b=0;continue}}b++}0<=c&&Ic(a.b,a.O,c)}l.Zd=function(a,b){var c=this.I;0<=this.B&&(this.B<this.j.length?(c=this.j[this.B],this.B++,c=W.Nb[c.Xb],c&128&&(c&=127)):(this.B=-1,c=W.cd),this.I=c,Gd(this.b,1));E(this,a,null,b,"KBDUART.ADDRESS",c);return c};
|
"no-scroll":119,setup:120},qc:{qa:130,INIT:127},Ba:{qa:130,Nc:1,Mc:2,Lc:4,Kc:8,Oc:16,Wb:32,Vb:63,ed:64,me:128,INIT:0},Jc:127};M.bb={l4:M.Ba.Nc,l3:M.Ba.Mc,l2:M.Ba.Lc,l1:M.Ba.Kc,locked:M.Ba.Oc,local:M.Ba.Wb,online:~M.Ba.Wb,"caps-lock":ge};var de={SI1978:Ge,VT100:M};M.INIT=[[M.Ba.INIT,M.qc.INIT,!1,0,-1]];M.xb={130:ce.prototype.Fd};M.yb={130:ce.prototype.Td};Na(function(){for(var a=gb(document,"pc8080","keyboard"),b=0;b<a.length;b++){var c=a[b],d=eb(c),d=new ce(d);fb(d,c)}});
|
||||||
l.ne=function(a,b,c){E(this,a,b,c,"KBDUART.STATUS");this.K=b;this.D=!0;this.L=Dc(this.b);ee(this,b&W.Na.ec);b&W.Na.zd&&(this.B=0,Gd(this.b,1))};W.Kb={130:Zd.prototype.Zd};W.Lb={130:Zd.prototype.ne};Qa(function(){for(var a=D(document,"pc8080","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Zd(d);db(d,c)}});
|
function Ue(a,b,c,d,e){x.call(this,"Video",a,0,262144);var f=this;this.Sa=Fa("Gecko/");var g=["","moz","ms","webkit"];this.M=a.screenWidth;this.I=a.screenHeight;this.la=a.bufferAddr;this.sd=a.bufferRAM;var h=a.bufferFormat;this.Y=h&&Ve[h.toUpperCase()]||We;this.O=a.bufferCols;this.Z=a.bufferRows;this.Ha=this.fa=a.cellWidth||1;this.ba=a.cellHeight||1;this.ea=null;this.Na=!1;this.na=a.bufferBits||1;this.ud=a.bufferLeft||0;if(this.g=a.bufferRotate)this.g=this.g%360,0<this.g&&(this.g-=360),-90!=this.g&&
|
||||||
function he(a,b,c,d,e){var f=this;this.pc=Da("Gecko/");var g=["","moz","ms","webkit"];x.call(this,"Video",a,he,262144);this.X=a.screenWidth;this.N=a.screenHeight;this.Va=a.bufferAddr;this.Md=a.bufferRAM;var h=a.bufferFormat;this.ma=h&&ie[h.toUpperCase()]||je;this.ba=a.bufferCols;this.va=a.bufferRows;this.kc=this.ra=a.cellWidth||1;this.na=a.cellHeight||1;this.Ca=null;this.oc=!1;this.Wa=a.bufferBits||1;this.Od=a.bufferLeft||0;if(this.u=a.bufferRotate)this.u=this.u%360,0<this.u&&(this.u-=360),-90!=this.u&&
|
(this.aa("unsupported buffer rotation: "+this.g),this.g=0);this.oa=a.interruptRate;this.hb=a.refreshRate||60;this.F=b;this.j=c;this.V=(this.xd=d)||b||null;this.zb=this.M;this.rd=this.I;this.La=this.M/this.O|0;this.Ma=this.I/this.Z|0;1<this.ba&&(this.Z++,this.sa=0,this.ya=!1);b=a.smoothing;(c=Ga("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.j[d]){this.j[d]=b;break}if(this.w=a.screenRotate)this.w=this.w%360,
|
||||||
(this.ja("unsupported buffer rotation: "+this.u),this.u=0);this.Xa=a.interruptRate;this.wc=a.refreshRate||60;this.L=b;this.F=c;this.ka=(this.Rd=d)||b||null;this.Ic=this.X;this.Ld=this.N;this.lc=this.X/this.ba|0;this.mc=this.N/this.va|0;1<this.na&&(this.va++,this.hb=0,this.sb=!1);b=a.smoothing;(c=Ea("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.B=a.screenRotate)this.B=this.B%
|
0<this.w&&(this.w-=360),-90!=this.w?(this.aa("unsupported screen rotation: "+this.w),this.w=0):(this.j.translate(0,this.I),this.j.rotate(this.w*Math.PI/180),this.j.scale(this.I/this.M,this.M/this.I));if(this.b=e)if(this.b.Wa=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.b.Wa){for(c=0;c<g.length;c++)if(d=g[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){Xe(f,!!(document.fullscreenElement||document.msFullscreenElement||
|
||||||
360,0<this.B&&(this.B-=360),-90!=this.B?(this.ja("unsupported screen rotation: "+this.B),this.B=0):(this.F.translate(0,this.N),this.F.rotate(this.B*Math.PI/180),this.F.scale(this.N/this.X,this.X/this.N));if(this.j=e)if(this.j.kb=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.j.kb){for(c=0;c<g.length;c++)if(d=g[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){ke(f,!!(document.fullscreenElement||document.msFullscreenElement||
|
document.mozFullScreenElement||document.webkitFullscreenElement))},!1);break}for(c=0;c<g.length;c++)if(d=g[c]+"fullscreenerror","on"+d in document){document.addEventListener(d,function(){Xe(f,null)},!1);break}}if(this.R=a.fontROM)"json"!=ga(this.R)&&(this.R=ja()+"/api/v1/dump?file="+this.R+"&format=bytes"),va(this.R,null,!0,function(a,b,c){Ye(f,a,b,c)});this.Fa={}}ba(Ue,x);
|
||||||
document.mozFullScreenElement||document.webkitFullscreenElement))},!1);break}for(c=0;c<g.length;c++)if(d=g[c]+"fullscreenerror","on"+d in document){document.addEventListener(d,function(){ke(f,null)},!1);break}}if(this.da=a.fontROM)"json"!=fa(this.da)&&(this.da=ia()+"/api/v1/dump?file="+this.da+"&format=bytes"),ta(this.da,null,!0,function(a,b,c){le(f,a,b,c)});this.Ob={}}A(he);var je=0,ie={SI1978:1,VT100:2};
|
function Qd(a){a.C=a.O*a.fa;a.N=a.Z*a.ba;var b=a.C,c=a.N;a.g&&(b=a.N,c=a.C);a.L=0;if(!a.sd&&(a.L=(a.C*a.na>>3)*a.N,!zb(a.H,a.la,a.L,3)))return!1;a.L?(a.Ua=a.j.createImageData(b,c),a.eb=16/a.na|0,Ze(a,a.L>>1)):Ze(a,(a.O+1)*a.Z);a.D=document.createElement("canvas");a.D.width=b;a.D.height=c;a.va=a.D.getContext("2d");a.T={};a.X=1<<a.na;a.U=Array(a.X+$e);a.U[0]=[0,0,0,255];a.U[1]=[255,255,255,255];a.Y==af&&(a.U[a.X+bf]=[255,255,0,255],a.U[a.X+cf]=[0,255,0,255]);a.Y==df&&(a.gb=60,a.za=!1,a.ga=Array(a.O));
|
||||||
function Qd(a){a.J=a.ba*a.ra;a.aa=a.va*a.na;var b=a.J,c=a.aa;a.u&&(b=a.aa,c=a.J);a.O=0;if(!a.Md&&(a.O=(a.J*a.Wa>>3)*a.aa,!vb(a.w,a.Va,a.O,3)))return!1;a.O?(a.qc=a.F.createImageData(b,c),a.tc=16/a.Wa|0,me(a,a.O>>1)):me(a,(a.ba+1)*a.va);a.K=document.createElement("canvas");a.K.width=b;a.K.height=c;a.rb=a.K.getContext("2d");a.ea={};a.la=1<<a.Wa;a.ga=Array(a.la+2);a.ga[0]=[0,0,0,255];a.ga[1]=[255,255,255,255];1==a.ma&&(a.ga[a.la+0]=[255,255,0,255],a.ga[a.la+1]=[0,255,0,255]);2==a.ma&&(a.vc=60,a.ub=!1,
|
return!0}Ue.prototype.Ea=function(a,b,c,d){this.S=a;this.H=b;this.u=c;this.K=d;Qd(this);if(this.B=vb(a,"Keyboard")){for(var e in this.Fa)this.B.ca("led",e,this.Fa[e]);this.F&&this.B.ca(this.xd?"textarea":"canvas","screen",this.V)}var f=this;this.tb=Ic(this.u,function(){Nc(f)});Jc(this.u,this.tb,1E3/Math.max(this.hb,this.oa));this.fb=0;this.R||kb(this)};
|
||||||
a.Ha=Array(a.ba));return!0}he.prototype.Qa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.H=d;Qd(this);if(this.I=rb(a,"Keyboard")){for(var e in this.Ob)this.I.pa("led",e,this.Ob[e]);this.L&&this.I.pa(this.Rd?"textarea":"canvas","screen",this.ka)}var f=this;this.xc=Hc(this.b,function(){Kc(f)});Ic(this.b,this.xc,1E3/Math.max(this.wc,this.Xa));this.uc=0;this.da||F(this)};
|
function Ye(a,b,c,d){if(d)a.aa("Unable to load font ROM (error "+d+": "+b+")");else{$a(a.ab,b,c);try{var e=eval("("+c+")"),f=e.bytes||e;if(!f||!f.length){v("Empty font ROM: "+b);return}if(1==f.length){v(f[0]);return}if(2048==f.length)a.ea=f,Rd(a);else{a.aa("Unrecognized font data length ("+f.length+")");return}}catch(g){a.aa("Font ROM data error: "+g.message);return}(a.j||a.K)&&kb(a)}}
|
||||||
function le(a,b,c,d){if(d)a.ja("Unable to load font ROM (error "+d+": "+b+")");else{Za(a.gb,b,c);try{var e=eval("("+c+")"),f=e.bytes||e;if(!f||!f.length){w("Empty font ROM: "+b);return}if(1==f.length){w(f[0]);return}if(2048==f.length)a.Ca=f,Rd(a);else{a.ja("Unrecognized font data length ("+f.length+")");return}}catch(g){a.ja("Font ROM data error: "+g.message);return}(a.F||a.H)&&F(a)}}
|
function Rd(a){a.ea&&(a.Na=a.Y==df,a.T[ef]=[ff(a,a.fa,a.ba),ff(a,a.fa,a.ba,a.za)],a.T[gf]=[ff(a,2*a.fa,a.ba),ff(a,2*a.fa,a.ba,a.za)],a.T[hf]=a.T[jf]=[ff(a,2*a.fa,2*a.ba),ff(a,2*a.fa,2*a.ba,a.za)])}
|
||||||
function Rd(a){a.Ca&&(a.oc=2==a.ma,a.ea[96]=[ne(a,a.ra,a.na),ne(a,a.ra,a.na,a.ub)],a.ea[64]=[ne(a,2*a.ra,a.na),ne(a,2*a.ra,a.na,a.ub)],a.ea[32]=a.ea[0]=[ne(a,2*a.ra,2*a.na),ne(a,2*a.ra,2*a.na,a.ub)])}
|
function ff(a,b,c,d){var e=8>=a.Ha?8:16,f=8<e?15:0,g=a.ea.length/e,h=!1===d,l={fa:b,ba: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 p=l.context.createImageData(b,c),r=0;r<g;r++){for(var t=0,A=t;t<a.ba;t++)for(var w=r*e+(f+t&e-1),w=d&&8==t?255:a.ea[w],u=0;u<c/a.ba;u++){for(var B=0,S=0,ya=S;S<a.fa;S++){for(var K=w&128>>(7<S?7:S),B=a.Na&&!K&&B?B:K,ia=0;ia<b/a.fa;ia++)h&&(B=!B),kf(a,p,ya,A,B?1:0),ya++;B=K}A++}l.context.putImageData(p,
|
||||||
function ne(a,b,c,d){var e=8>=a.kc?8:16,f=8<e?15:0,g=a.Ca.length/e,h=!1===d,k={ra:b,na:c};k.canvas=document.createElement("canvas");k.canvas.width=16*b;k.canvas.height=g/16*c;k.context=k.canvas.getContext("2d");for(var m=k.context.createImageData(b,c),p=0;p<g;p++){for(var q=0,y=q;q<a.na;q++)for(var u=p*e+(f+q&e-1),u=d&&8==q?255:a.Ca[u],r=0;r<c/a.na;r++){for(var z=0,H=0,ha=H;H<a.ra;H++){for(var C=u&128>>(7<H?7:H),z=a.oc&&!C&&z?z:C,U=0;U<b/a.ra;U++)h&&(z=!z),oe(a,m,ha,y,z?1:0),ha++;z=C}y++}k.context.putImageData(m,
|
(r&15)*b,(r>>4)*c)}return l}Ue.prototype.ua=function(){return!0};Ue.prototype.ca=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.Fa[b]=c,!0;switch(b){case "fullScreen":return this.P[b]=c,this.b&&this.b.Wa?c.onclick=function(){d.Wa()}:c.parentNode.removeChild(c),!0}return!1};
|
||||||
(p&15)*b,(p>>4)*c)}return k}he.prototype.Ga=function(){return!0};he.prototype.pa=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.Ob[b]=c,!0;switch(b){case "fullScreen":return this.M[b]=c,this.j&&this.j.kb?c.onclick=function(){d.kb()}:c.parentNode.removeChild(c),!0}return!1};
|
Ue.prototype.Wa=function(){var a=!1;if(this.b){if(this.b.Wa){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.M/this.I;b>c&&(a=Math.round(c/b*100)+"%")}this.Sa?(this.F.style.width=a,this.F.style.width=a,this.F.style.display="block",this.F.style.margin="auto"):(this.b.style.width=a,this.b.style.height="auto");this.b.style.backgroundColor="black";this.b.Wa();a=!0}this.V&&this.V.focus()}return a};
|
||||||
he.prototype.kb=function(){var a=!1;if(this.j){if(this.j.kb){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.X/this.N;b>c&&(a=Math.round(c/b*100)+"%")}this.pc?(this.L.style.width=a,this.L.style.width=a,this.L.style.display="block",this.L.style.margin="auto"):(this.j.style.width=a,this.j.style.height="auto");this.j.style.backgroundColor="black";this.j.kb();a=!0}this.ka&&this.ka.focus()}return a};
|
function Xe(a,b){!b&&a.b&&(a.Sa?a.F.style.width=a.F.style.height="":a.b.style.width=a.b.style.height="");ob(a,"notifyFullScreen("+b+")")}function Ze(a,b){a.cb=b;a.W=!1;if(void 0===a.A||a.A.length!=a.cb)a.A=Array(a.cb)}function kf(a,b,c,d,e){d=a.g?(b.height-c-1)*b.width+d:c+d*b.width;e&&a.Y==af&&(208<=c&&236>c?e=a.X+bf:28<=c&&72>c&&(e=a.X+cf));a=a.U[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 ke(a,b){!b&&a.j&&(a.pc?a.L.style.width=a.L.style.height="":a.j.style.width=a.j.style.height="");fb(a,"notifyFullScreen("+b+")")}function me(a,b){a.sc=b;a.ia=!1;if(void 0===a.D||a.D.length!=a.sc)a.D=Array(a.sc)}function oe(a,b,c,d,e){d=a.u?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.ma&&(208<=c&&236>c?e=a.la+0:28<=c&&72>c&&(e=a.la+1));a=a.ga[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 Nc(a,b){var c=!0;if(!b){a.oa&&(120==a.oa?a.fb&1?(Dd(a.u,2),c=!1):Dd(a.u,1):Dd(a.u,4));if(c&&a.W&&a.L){for(var d=a.H,e=a.L,f=!0,g=a.la>>>d.g;0<e&&g<d.b.length;)d.b[g].Ca&&(d.b[g].Ca=f=!1,d.b[g].gc=!0),e-=d.w,g++;f&&(c=!1)}Jc(a.u,a.tb,1E3/Math.max(a.hb,a.oa));a.fb++}if(c)if(1<a.fa)switch(a.Y){case df:for(var c=a.la,d=-1,e=0,f=60==a.gb?2:5,h=g=0,l=-1;e<a.Z;){var p=0,r=c,t=d,A=a.O;for(t!=ef&&(A>>=1);;){var w=Eb(a.H,r++);if((w&lf)==lf){var u=Eb(a.H,r++),d=u&mf,c=(u&nf)<<8|Eb(a.H,r),c=c+(u&of?
|
||||||
function Kc(a,b){var c=!0;if(!b){a.Xa&&(120==a.Xa?a.uc&1?(Gd(a.b,2),c=!1):Gd(a.b,1):Gd(a.b,4));if(c&&a.ia&&a.O){for(var d=a.w,e=a.O,f=!0,g=a.Va>>>d.ha;0<e&&g<d.W.length;)d.W[g].Oa&&(d.W[g].Oa=f=!1,d.W[g].Cc=!0),e-=d.Ja,g++;f&&(c=!1)}Ic(a.b,a.xc,1E3/Math.max(a.wc,a.Xa));a.uc++}if(c)if(1<a.ra)switch(a.ma){case 2:for(var c=a.Va,d=-1,e=0,f=60==a.vc?2:5,h=g=0,k=-1;e<a.va;){var m=0,p=c,q=d,y=a.ba;for(96!=q&&(y>>=1);;){var u=yb(a.w,p++);if(127==(u&127)){var r=yb(a.w,p++),d=r&96,c=(r&15)<<8|yb(a.w,p),c=c+
|
pf:qf);break}if(p<A)a.ga[p++]=w;else break}if(f)f--;else{for(;p<a.ga.length;)a.ga[p++]=0;if(0<=t)for(r=a.W&&a.A[g]==A,a.A[g++]=A,A=0;A<p;A++){w=a.ga[A];if(!r||w!==a.A[g]){a.A[l=g]=w;var u=a,B=a.va,S=w&127;if(w=u.T[t][w&128?1:0]){var ya=(S&15)*w.fa,S=(S>>4)*w.ba,K,ia,ta,ma,La=w.fa,dc=w.ba;B?(K=A*u.fa,ia=e*u.ba,ta=u.fa,ma=u.ba):(K=A*u.La,ia=e*u.Ma,ta=u.La,ma=u.Ma);w.fa>u.fa&&(K*=2,ta*=2);w.ba>u.ba&&(t==jf&&(S+=u.ba),dc=u.ba);B?B.drawImage(w.canvas,ya,S,La,dc,K,ia,ta,ma):(K+=0,ia+=0,u.j.drawImage(w.canvas,
|
||||||
(r&16?8192:16384);break}if(m<y)a.Ha[m++]=u;else break}if(f)f--;else{for(;m<a.Ha.length;)a.Ha[m++]=0;if(0<=q)for(p=a.ia&&a.D[g]==y,a.D[g++]=y,y=0;y<m;y++){u=a.Ha[y];if(!p||u!==a.D[g]){a.D[k=g]=u;var r=a,z=a.rb,H=u&127;if(u=r.ea[q][u&128?1:0]){var ha=(H&15)*u.ra,H=(H>>4)*u.na,C,U,ea,Y,va=u.ra,Gb=u.na;z?(C=y*r.ra,U=e*r.na,ea=r.ra,Y=r.na):(C=y*r.lc,U=e*r.mc,ea=r.lc,Y=r.mc);u.ra>r.ra&&(C*=2,ea*=2);u.na>r.na&&(q||(H+=r.na),Gb=r.na);z?z.drawImage(u.canvas,ha,H,va,Gb,C,U,ea,Y):(C+=0,U+=0,r.F.drawImage(u.canvas,
|
ya,S,La,dc,K,ia,ta,ma))}h++}g++}e++}}a.W=!0;!b&&a.ya&&1==h&&(a.A[l]=-1,h=0);a.ya=!1;(h||b)&&a.va&&a.j.drawImage(a.D,0,a.sa,a.C,a.N-a.ba,0,0,a.zb,a.rd)}else{e=a.la;f=e+a.L;l=h=g=0;b=a.C;p=0;c=a.N;t=d=0;r=a.na;A=(1<<r)-1;a.ud&&(r=-r,t=16+r);for(;e<f;){u=Gb(a.H,e);if(a.W&&u===a.A[g])h+=a.eb;else{a.A[g]=u;(B=t)&&(u=u>>8|(u&255)<<8);h<b&&(b=h);for(w=a.eb;w--;)ya=u>>B&A,kf(a,a.Ua,h++,l,ya),B+=r;h>p&&(p=h);l<c&&(c=l);l>=d&&(d=l+1)}e+=2;g++;if(h>=a.C&&(h=0,l++,l>a.N))break}a.W=!0;b<a.C&&(e=p-b,d-=c,a.g&&
|
||||||
ha,H,va,Gb,C,U,ea,Y))}h++}g++}e++}}a.ia=!0;!b&&a.sb&&1==h&&(a.D[k]=-1,h=0);a.sb=!1;(h||b)&&a.rb&&a.F.drawImage(a.K,0,a.hb,a.J,a.aa-a.na,0,0,a.Ic,a.Ld)}else{e=a.Va;f=e+a.O;k=h=g=0;b=a.J;m=0;c=a.aa;q=d=0;p=a.Wa;y=(1<<p)-1;a.Od&&(p=-p,q=16+p);for(;e<f;){r=zb(a.w,e);if(a.ia&&r===a.D[g])h+=a.tc;else{a.D[g]=r;(z=q)&&(r=r>>8|(r&255)<<8);h<b&&(b=h);for(u=a.tc;u--;)ha=r>>z&y,oe(a,a.qc,h++,k,ha),z+=p;h>m&&(m=h);k<c&&(c=k);k>=d&&(d=k+1)}e+=2;g++;if(h>=a.J&&(h=0,k++,k>a.aa))break}a.ia=!0;b<a.J&&(e=m-b,d-=c,a.u&&
|
(f=b,g=e,b=c,e=d,c=a.C-(f+g),d=g),a.va.putImageData(a.Ua,0,0,b,c,e,d),a.j.drawImage(a.D,0,0,a.D.width,a.D.height,0,0,a.M,a.I))}}var bf=0,cf=1,$e=2,We=0,af=1,df=2,Ve={SI1978:af,VT100:df},ef=96,gf=64,hf=32,jf=0,lf=127,nf=15,of=16,mf=96,pf=8192,qf=16384;
|
||||||
(f=b,g=e,b=c,e=d,c=a.J-(f+g),d=g),a.rb.putImageData(a.qc,0,0,b,c,e,d),a.F.drawImage(a.K,0,0,a.K.width,a.K.height,0,0,a.X,a.N))}}
|
Na(function(){for(var a=gb(document,"pc8080","video"),b=0;b<a.length;b++){var c=a[b],d=eb(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<=xa().indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height=
|
||||||
Qa(function(){for(var a=D(document,"pc8080","video"),b=0;b<a.length;b++){var c=a[b],d=B(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<=xa().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||Ga("aspect"));f&&.3<=f&&3.33>=f&&(Ka("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");Fa("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new Ue(d,e,g,f,c);fb(d,c)}});
|
||||||
(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Ea("aspect"));f&&.3<=f&&3.33>=f&&(Pa("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");Da("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new he(d,e,g,f,c);db(d,c)}});
|
function rf(a){x.call(this,"SerialPort",a,0,8388608);this.T=+a.adapter;switch(this.T){case 0:this.U=0;this.X=2;break;default:v("Unrecognized serial adapter #"+this.T);return}this.g=this.j=null;this.V=a.tabSize;this.R=a.charBOL;this.w=0;this.N=!1;this.D=!0;var b=a.binding;if("console"==b)this.j="";else{var c;a=sf;b&&(void 0===c&&(c="Panel"),(c=db(c,this.id))&&(b=c.P[b])&&this.ca(null,a,b))}this.A="";this.b=this.Ra=this.I=null;this.exports={connect:this.ic,receiveData:this.Kb,receiveStatus:this.be}}
|
||||||
function pe(a){this.ea=+a.adapter;switch(this.ea){case 0:this.ga=0;this.ka=2;break;default:w("Unrecognized serial adapter #"+this.ea);return}this.u=this.B=null;this.ia=a.tabSize;this.da=a.charBOL;this.D=0;this.aa=!1;this.L=!0;x.call(this,"SerialPort",a,pe,8388608);var b=a.binding;if("console"==b)this.B="";else{var c;a=qe;b&&(void 0===c&&(c="Panel"),(c=cb(c,this.id))&&(b=c.M[b])&&this.pa(null,a,b))}this.I="";this.j=this.eb=this.Aa=null;this.exports={connect:this.Ec,receiveData:this.Wb,receiveStatus:this.oe}}
|
ba(rf,x);k=rf.prototype;
|
||||||
A(pe);var re=[50,75,110,134.5,150,200,300,600,1200,1800,2E3,2400,3600,4800,9600,19200],se=[!1,0,0,133,142,39,238],qe="buffer";l=pe.prototype;
|
k.ca=function(a,b,c,d){var e=this;switch(b){case sf:return this.P[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),tf(e,b);return!0},c.onkeypress=function(a){a=a||window.event;tf(e,a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0;default:if(d)return this.P[b]=c,d=d.replace(/\\e/g,String.fromCharCode(27)),c.onclick=function(){e.Kb(d);return!0},
|
||||||
l.pa=function(a,b,c,d){var e=this;switch(b){case qe:return this.M[b]=this.u=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),te(e,b);return!0},c.onkeypress=function(a){a=a||window.event;te(e,a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0;default:if(d)return this.M[b]=c,d=d.replace(/\\e/g,String.fromCharCode(27)),c.onclick=function(){e.Wb(d);return!0},
|
!0}return!1};k.Ea=function(a,b,c,d){this.S=a;this.H=b;this.u=c;this.K=d;var e=this;this.Y=Ic(this.u,function(){e.Kb()});this.Z=Ic(this.u,function(){Ee(e)});this.W=vb(a,"ChipSet");Nb(b,this,uf,this.U);Rb(b,this,vf,this.U);kb(this)};
|
||||||
!0}return!1};l.Qa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.H=d;var e=this;this.la=Hc(this.b,function(){e.Wb()});this.ma=Hc(this.b,function(){fe(e)});this.F=rb(a,"ChipSet");Db(b,this,ue,this.ga);Ib(b,this,ve,this.ga);F(this)};
|
k.ic=function(a){if(!this.b){var b=vc(this.S,"connection");if(b){var c=b.split("->");if(2==c.length){var d=oa(c[0]);if(d!=this.$a)return;c=oa(c[1]);if(this.b=cb(c)){var e=this.b.exports;if(e){var f=e.connect;f&&f.call(this.b,this.D);if(this.Ra=e.receiveData){this.D=a;this.I=e.receiveStatus;this.status(this.ab+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
||||||
l.Ec=function(a){if(!this.j){var b=lc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=na(c[0]);if(d!=this.fb)return;c=na(c[1]);if(this.j=bb(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.L);if(this.eb=e.receiveData){this.L=a;this.Aa=e.receiveStatus;this.status(this.gb+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
k.ua=function(a,b){if(!b)if(this.ic(this.D),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.wa=function(a){return a?this.save():!0};k.reset=function(){wf(this)};k.save=function(){var a=new Vc(this),b=0,c=[];c[b++]=this.F;c[b++]=this.M;c[b++]=this.O;c[b++]=this.ia;c[b++]=this.B;c[b++]=this.C;c[b]=this.L;a.set(0,c);return a.data()};k.restore=function(a){return wf(this,a[0])};
|
||||||
l.Ga=function(a,b){if(!b)if(this.Ec(this.L),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.Ka=function(a){return a?this.save():!0};l.reset=function(){we(this)};l.save=function(){var a=new Sc(this),b=0,c=[];c[b++]=this.N;c[b++]=this.X;c[b++]=this.ba;c[b++]=this.wa;c[b++]=this.J;c[b++]=this.K;c[b]=this.O;a.set(0,c);return a.data()};l.restore=function(a){return we(this,a[0])};
|
function wf(a,b){var c=0;b||(b=xf);a.F=b[c++];a.M=b[c++];a.O=b[c++];a.ia=b[c++];a.B=b[c++];a.C=b[c++];a.L=b[c];return!0}function yf(a,b){var c=a.L&b;b&15||(c>>=4);b=zf[c];c=((a.B&Af)>>2)+6;a.B&Bf&&c++;c+=((a.B&Cf)>>6)+1>>1;return 1E3/Math.round(b/c)}function tf(a,b){ob(a,"receiveByte("+ea(b)+"), status="+ea(a.ia));return a.N||a.ia&Df?!1:(a.M=b,a.ia|=Df,Dd(a.u,a.X),!0)}
|
||||||
function we(a,b){var c=0;b||(b=se);a.N=b[c++];a.X=b[c++];a.ba=b[c++];a.wa=b[c++];a.J=b[c++];a.K=b[c++];a.O=b[c];return!0}function xe(a,b){var c=a.O&b;b&15||(c>>=4);b=re[c];c=((a.J&12)>>2)+6;a.J&16&&c++;c+=((a.J&192)>>6)+1>>1;return 1E3/Math.round(b/c)}function te(a,b){fb(a,"receiveByte("+ca(b)+"), status="+ca(a.wa));return a.aa||a.wa&2?!1:(a.X=b,a.wa|=2,Gd(a.b,a.ka),!0)}
|
k.Kb=function(a){null!=a&&(this.A="number"!=typeof a?a:this.A+String.fromCharCode(a));this.A&&(tf(this,this.A.charCodeAt(0))&&(this.A=this.A.substr(1)),this.A&&this.u&&Jc(this.u,this.Y,yf(this,Ef)));return!0};k.be=function(a){this.ia&=~Ff;a&64&&(this.ia|=Ff)};function Ee(a,b){a.ia=a.ia|Pd|Gf;b&&a.Ra&&a.Ra.call(a.b,b)}k.zd=function(a,b){var c=this.M;y(this,a,null,b,"DATA",c);this.ia&=~Df;return c};k.yd=function(a,b){var c=this.ia;y(this,a,null,b,"STATUS",c);return c};
|
||||||
l.Wb=function(a){null!=a&&(this.I="number"!=typeof a?a:this.I+String.fromCharCode(a));this.I&&(te(this,this.I.charCodeAt(0))&&(this.I=this.I.substr(1)),this.I&&this.b&&Ic(this.b,this.la,xe(this,15)));return!0};l.oe=function(a){this.wa&=-129;a&64&&(this.wa|=128)};function fe(a,b){a.wa|=5;b&&a.eb&&a.eb.call(a.j,b)}l.Td=function(a,b){var c=this.X;E(this,a,null,b,"DATA",c);this.wa&=-3;return c};l.Sd=function(a,b){var c=this.wa;E(this,a,null,b,"STATUS",c);return c};
|
k.Jd=function(a,b,c){y(this,a,b,c,"DATA");this.O=b;this.ia&=~(Pd|Gf);ob(this,"transmitByte("+ea(b)+")");if(19==b)this.N=!0;else if(17==b)this.N=!1;else if(this.Ra&&this.Ra.call(this.b,b),this.g)if(8==b)this.g.value=this.g.value.slice(0,-1),0<this.w&&this.w--;else{var d;13!=b&&10!=b&&(d=pa[b]);a=d=d?"<"+d+">":String.fromCharCode(b);c=a.length;9==b?(b=this.V||8,c=b-this.w%b,this.V&&(a=na("",c))):13==b&&(this.w=c=0,a="\n");this.R&&!this.w&&c&&(a=String.fromCharCode(this.R)+a);this.g.value+=a;this.g.scrollTop=
|
||||||
l.de=function(a,b,c){E(this,a,b,c,"DATA");this.ba=b;this.wa&=-6;fb(this,"transmitByte("+ca(b)+")");if(19==b)this.aa=!0;else if(17==b)this.aa=!1;else if(this.eb&&this.eb.call(this.j,b),this.u)8==b?(this.u.value=this.u.value.slice(0,-1),0<this.D&&this.D--):(a=(a=13!=b&&10!=b?oa[b]:null)?"<"+a+">":String.fromCharCode(b),c=a.length,9==b?(b=this.ia||8,c=b-this.D%b,this.ia&&(a=ma("",c))):13==b&&(this.D=c=0,a="\n"),this.da&&!this.D&&c&&(a=String.fromCharCode(this.da)+a),this.u.value+=a,this.u.scrollTop=
|
this.g.scrollHeight;this.w+=c}else if(null!=this.j){if(10==b||1024<=this.j.length)this.i(this.j),this.j="";10!=b&&(this.j+=String.fromCharCode(b))}this.u&&Jc(this.u,this.Z,yf(this,Hf))};k.Id=function(a,b,c){y(this,a,b,c,"CONTROL");this.F?(this.I&&(b^this.C)&(If|Jf)&&(a=0,this.D?(a|=b&If?32:0,a|=b&Jf?320:0):(a|=b&If?16:0,a|=b&Jf?1048576:0),this.I.call(this.b,a)),this.C=b,this.C&Kf&&(this.F=!1)):(this.B=b,this.F=!0)};k.Hd=function(a,b,c){y(this,a,b,c,"BAUDRATES");this.L=b};
|
||||||
this.u.scrollHeight,this.D+=c);else if(null!=this.B){if(10==b||1024<=this.B.length)this.g(this.B),this.B="";10!=b&&(this.B+=String.fromCharCode(b))}this.b&&Ic(this.b,this.ma,xe(this,240))};l.ce=function(a,b,c){E(this,a,b,c,"CONTROL");this.N?(this.Aa&&(b^this.K)&34&&(a=0,a=this.L?a|(b&32?32:0)|(b&2?320:0):a|(b&32?16:0)|(b&2?1048576:0),this.Aa.call(this.j,a)),this.K=b,this.K&64&&(this.N=!1)):(this.J=b,this.N=!0)};l.be=function(a,b,c){E(this,a,b,c,"BAUDRATES");this.O=b};
|
var Af=12,Bf=16,Cf=192,Jf=2,If=32,Kf=64,Pd=1,Df=2,Gf=4,Ff=128,Ef=15,Hf=240,zf=[50,75,110,134.5,150,200,300,600,1200,1800,2E3,2400,3600,4800,9600,19200],xf=[!1,0,0,133,142,39,238],sf="buffer",uf={0:rf.prototype.zd,1:rf.prototype.yd},vf={0:rf.prototype.Jd,1:rf.prototype.Id,2:rf.prototype.Hd};Na(function(){for(var a=gb(document,"pc8080","serial"),b=0;b<a.length;b++){var c=a[b],d=eb(c),d=new rf(d);fb(d,c)}});
|
||||||
var ue={0:pe.prototype.Td,1:pe.prototype.Sd},ve={0:pe.prototype.de,1:pe.prototype.ce,2:pe.prototype.be};Qa(function(){for(var a=D(document,"pc8080","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new pe(d);db(d,c)}});function ye(a){x.call(this,"Debugger",a,ye);this.Wa=a.base||16;this.aa=this.ma=this.J=0;this.O=!1;this.j=-1;this.u=[];this.da={}}A(ye);var ze={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
|
function Lf(a){x.call(this,"Debugger",a);this.na=a.base||16;this.N=this.Y=this.C=0;this.L=!1;this.b=-1;this.g=[];this.R={}}ba(Lf,x);Lf.prototype.Gb=function(){return-1};Lf.prototype.Hb=function(){};
|
||||||
ye.prototype.Sb=function(){return-1};ye.prototype.Tb=function(){};ye.prototype.Jb=function(a,b,c){if(b)if(a){0>this.j&&this.u.length&&(this.j=0);if(0>this.j||a!=this.u[this.j])this.u.splice(0,0,a),this.j=0;this.j--}else this.O?a="end":a=this.u[this.j+1];b=[];if(a){a=a.replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(na(a.substring(d,f))),d=f+1}}return b};
|
Lf.prototype.wb=function(a,b,c){if(b)if(a){0>this.b&&this.g.length&&(this.b=0);if(0>this.b||a!=this.g[this.b])this.g.splice(0,0,a),this.b=0;this.b--}else this.L?a="end":a=this.g[this.b+1];b=[];if(a){a=a.replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(oa(a.substring(d,f))),d=f+1}}return b};
|
||||||
function Ae(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 Mf(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}
|
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 Be(a,b,c){var d;if(b){b=Ce(a,b);for(var e=0,f=!1,g=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var p=m[e++],q=p.length,p=na(p);if(!p){f=!0;break}p=De(a,p,null,!1===c);if(void 0===p){f=!0;c=!1;break}h.push(p);if(e==m.length)break;var p=m[e++],y=p.length;k.length&&ze[p]<ze[k[k.length-1]]&&Ae(h,k,1);k.push(p);b=b.substr(q+y)}Ae(h,k)&&1==h.length||(f=!0);f?c&&a.g("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Ee(a,null,
|
function Nf(a,b,c){var d;if(b){b=Of(a,b);for(var e=0,f=!1,g=b,h=[],l=[],p=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<p.length;){var r=p[e++],t=r.length,r=oa(r);if(!r){f=!0;break}r=Pf(a,r,null,!1===c);if(void 0===r){f=!0;c=!1;break}h.push(r);if(e==p.length)break;var r=p[e++],A=r.length;l.length&&Qf[r]<Qf[l[l.length-1]]&&Mf(h,l,1);l.push(r);b=b.substr(t+A)}Mf(h,l)&&1==h.length||(f=!0);f?c&&a.i("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Rf(a,null,
|
||||||
d))}return d}function Ce(a,b){for(var c,d=/\{(.*?)\}/;(c=b.match(d))&&!(0<=c[1].indexOf("{"));){var e=Be(a,c[1]);b=b.replace("{"+c[1]+"}",null!=e?Fe(a,e):"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.aa-a.ma}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
|
d))}return d}function Of(a,b){for(var c,d=/\{(.*?)\}/;(c=b.match(d))&&!(0<=c[1].indexOf("{"));){var e=Nf(a,c[1]);b=b.replace("{"+c[1]+"}",null!=e?Sf(a,e):"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.N-a.Y}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
|
||||||
function De(a,b,c,d){var e;null!=b?(e=a.Sb(b),0<=e?e=a.Tb(e):(e=a.da[b],null==e&&(e=aa(b,a.Wa))),null!=e||d||a.g("invalid "+(c?c:"value")+": "+b)):d||a.g("missing "+(c||"value"));return e}
|
function Pf(a,b,c,d){var e;null!=b?(e=a.Gb(b),0<=e?e=a.Hb(e):(e=a.R[b],null==e&&(e=ca(b,a.na))),null!=e||d||a.i("invalid "+(c?c:"value")+": "+b)):d||a.i("missing "+(c||"value"));return e}
|
||||||
function Ee(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=4,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var k=d&255,m=void 0,p=8,q="";p?32<p&&(p=32):p=32;for(var y=null==k||isNaN(k),u=m=m||p;0<p--;)u||(q=","+q,u=m),q=(y?"?":k&1?"1":"0")+q,k>>=1,u--;g=q+g;d>>=8}d=t(c,0,!0)+" "+c+". "+ba(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.g((null!=b?b+": ":"")+d);return e}
|
function Rf(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=4,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var l=d&255,p=void 0,r=8,t="";r?32<r&&(r=32):r=32;for(var A=null==l||isNaN(l),w=p=p||r;0<r--;)w||(t=","+t,w=p),t=(A?"?":l&1?"1":"0")+t,l>>=1,w--;g=t+g;d>>=8}d=n(c,0,!0)+" "+c+". "+da(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}
|
||||||
function Ge(a,b){if(b)return Ee(a,b,a.da[b]);var c=0;for(b in a.da)Ee(a,b,a.da[b]),c++;return 0<c}function Fe(a,b){switch(a.Wa){case 8:a=ba(b,NaN);break;case 10:a=b.toString();break;default:a=t(b,NaN)}return a}
|
function Tf(a,b){if(b)return Rf(a,b,a.R[b]);var c=0;for(b in a.R)Rf(a,b,a.R[b]),c++;return 0<c}function Sf(a,b){switch(a.na){case 8:a=da(b,NaN);break;case 10:a=b.toString();break;default:a=n(b,NaN)}return a}var Qf={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
|
||||||
function He(a){ye.call(this,a);this.style=Ie;this.L=X();this.Va=X();this.ba=X();this.D=[];this.F=this.N=this.B=[];Je(this);this.ia=0;Ke(this);this.va={};Le(this,a.messages);this.Ca=a.commands;var b=this;window?void 0===window.pc8080&&(window.pc8080=function(a){return oc(b,a)}):void 0===global.pc8080&&(global.pc8080=function(a){return oc(b,a)})}A(He,ye);
|
function Uf(a){Lf.call(this,a);this.style=Vf;this.F=Wf();this.la=Wf();this.O=Wf();this.A=[];this.j=this.I=this.w=[];Xf(this);this.W=0;Yf(this);this.Z={};Zf(this,a.messages);this.ea=a.commands;var b=this;window?void 0===window.pc8080&&(window.pc8080=function(a){return zc(b,a)}):void 0===global.pc8080&&(global.pc8080=function(a){return zc(b,a)})}ba(Uf,Lf);k=Uf.prototype;
|
||||||
var Me={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory",f:"frequencies","g [#]":"go [to #]",h:"halt","i [#]":"input port #","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages","o [#]":"output port #",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble",v:"print version","var":"assign variable"},
|
k.Ea=function(a,b,c,d){this.H=b;this.u=c;this.S=a;(a=vc(a,"messages"))&&Zf(this,a);this.ga=$f;Md(this,64,function(a){a:{var b=d.H.b,c=a[0],e=a=0,l=b.length;if(c){a=ag(bg(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.H.g;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;l--;){var r=b[e];r.type==c?p++||d.i("..."):(c=r.type,p=Cb[c],r&&d.i(n(r.id)+" %"+n(e<<d.H.g)+" %%"+n(r.J)+" "+q(r.mb)+" "+
|
||||||
Ie=8080,Ne="NONE ACI ADC ADD ADI ANA ANI CALL CC CM CNC CNZ CP CPE CPO CZ CMA CMC CMP CPI DAA DAD DCR DCX DI EI HLT IN INR INX JMP JC JM JNC JNZ JP JPE JPO JZ LDA LDAX LHLD LXI MOV MVI NOP ORA ORI OUT PCHL POP PUSH RAL RAR RET RC RM RNC RNZ RP RPE RPO RZ RLC RRC RST SBB SBI SHLD SPHL STA STAX STC SUB SUI XCHG XRA XRI XTHL".split(" "),Oe="NONE ADC ADC ADD ADD AND AND CALL CALLC CALLS CALLNC CALLNZ CALLNS CALLP CALLNP CALLZ NOT CMC CMP CMP DAA ADD DEC DEC CLI STI HLT IN INC INC JMP JC JS JNC JNZ JNS JP JNP JZ MOV MOV MOV MOV MOV MOV NOP OR OR OUT JMP POP PUSH RCL RCR RET RETC RETS RETNC RETNZ RETNS RETP RETNP RETZ ROL ROR RST SBB SBB MOV MOV MOV MOV STC SUB SUB XCHG XOR XOR XCHG".split(" "),
|
q(r.size)+" "+p),c!=Yb&&(c=-1),p=0);a+=d.H.w;e++}}});kb(this)};
|
||||||
Pe="B C D E H L M A BC DE HL SP PC PS PSW".split(" "),Qe=[[45],[42,2067,32],[71,2131,18193],[29,2067],[28,17],[22,17],[44,17,32],[63],[45,32768],[21,18963,2067],[40,18193,2131],[23,2067],[28,273],[22,273],[44,273,32],[64],[45,32768],[42,2323,32],[71,2387,18193],[29,2323],[28,529],[22,529],[44,529,32],[52],[45,32768],[21,18963,2323],[40,18193,2387],[23,2323],[28,785],[22,785],[44,785,32],[53],[45,32768],[42,2579,32],[68,115,18963],[29,2579],[28,1041],[22,1041],[44,1041,32],[20],[45,32768],[21,18963,
|
k.ca=function(a,b,c){var d=this;switch(b){case "debugInput":return this.U=this.P[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",zc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.b<d.g.length-1&&(b=d.g[++d.b])):40==a.keyCode&&(0<d.b?b=d.g[--d.b]:(b="",d.b=-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.P[b]=c,Ja(c,function(){if(d.U){var a=d.U.value;d.U.value=
|
||||||
2579],[41,18963,115],[23,2579],[28,1297],[22,1297],[44,1297,32],[16,18193],[45,32768],[42,2835,32],[70,115,18193],[29,2835],[28,1617],[22,1617],[44,1617,32],[72],[45,32768],[21,18963,2835],[39,18193,115],[23,2835],[28,1809],[22,1809],[44,1809,32],[17],[43,17,17],[43,17,273],[43,17,529],[43,17,785],[43,17,1041],[43,17,1297],[43,17,1617],[43,17,1809],[43,273,17],[43,273,273],[43,273,529],[43,273,785],[43,273,1041],[43,273,1297],[43,273,1617],[43,273,1809],[43,529,17],[43,529,273],[43,529,529],[43,529,
|
"";zc(d,a,!0);return!0}return!1}),!0;case "step":return this.P[b]=c,Ja(c,function(a){var b=!1;lb(d,!0)||(mb(d,!0),b=cg(d,a?1:0),mb(d,!1));return b}),!0}return!1};function ag(a){a=a&&a.J;null==a&&(a=-1);return a}k.Ga=function(a,b){var c=255,d=ag(a);-1!==d&&(c=Eb(this.H,d),b&&dg(a,b));return c};k.Bb=function(a,b){var c=65535,d=ag(a);-1!==d&&(c=Gb(this.H,d),b&&dg(a,b));return c};k.Sb=function(a,b,c){var d=ag(a);-1!==d&&(Hb(this.H,d,b),c&&dg(a,c),Ac(this.u,!0))};
|
||||||
785],[43,529,1041],[43,529,1297],[43,529,1617],[43,529,1809],[43,785,17],[43,785,273],[43,785,529],[43,785,785],[43,785,1041],[43,785,1297],[43,785,1617],[43,785,1809],[43,1041,17],[43,1041,273],[43,1041,529],[43,1041,785],[43,1041,1041],[43,1041,1297],[43,1041,1617],[43,1041,1809],[43,1297,17],[43,1297,273],[43,1297,529],[43,1297,785],[43,1297,1041],[43,1297,1297],[43,1297,1617],[43,1297,1809],[43,1617,17],[43,1617,273],[43,1617,529],[43,1617,785],[43,1617,1041],[43,1617,1297],[26],[43,1617,1809],
|
k.vc=function(a,b,c){var d=ag(a);if(-1!==d){var e=this.H,f=d&e.j,g=(d&e.C)>>>e.g;f!=e.j?e.b[g].Ob(f,b&65535,d):(e.b[g++].nb(f,b&255,d),e.b[g&e.I].nb(0,b>>8&255,d+1));c&&dg(a,c);Ac(this.u,!0)}};function Wf(a){return{J:a,Da:!1}}function eg(a){return[a.J,a.Da]}function fg(a){return{J:a[0],Da:a[1]}}
|
||||||
[43,1809,17],[43,1809,273],[43,1809,529],[43,1809,785],[43,1809,1041],[43,1809,1297],[43,1809,1617],[43,1809,1809],[3,18193,17],[3,18193,273],[3,18193,529],[3,18193,785],[3,18193,1041],[3,18193,1297],[3,18193,1617],[3,18193,1809],[2,18193,17],[2,18193,273],[2,18193,529],[2,18193,785],[2,18193,1041],[2,18193,1297],[2,18193,1617],[2,18193,1809],[73,18193,17],[73,18193,273],[73,18193,529],[73,18193,785],[73,18193,1041],[73,18193,1297],[73,18193,1617],[73,18193,1809],[66,18193,17],[66,18193,273],[66,
|
function bg(a,b,c){var d;c=(c?a.F:a.la).J;if(void 0!==b){d=b=Of(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c<a.A.length;c++){var f=a.A[c].ra[d];if(void 0!==f){d=f.o;void 0!==d&&(e=Wf(d));break}}if(d=e)return d;c=Nf(a,b,void 0)}null!=c&&(d=Wf(c));return d}function gg(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.qd=a.wb(b.mc=c[2]))}function dg(a,b){null!=a.J&&(a.J+=b||1)}function hg(a){return n(a,4)}
|
||||||
18193,529],[66,18193,785],[66,18193,1041],[66,18193,1297],[66,18193,1617],[66,18193,1809],[5,18193,17],[5,18193,273],[5,18193,529],[5,18193,785],[5,18193,1041],[5,18193,1297],[5,18193,1617],[5,18193,1809],[76,18193,17],[76,18193,273],[76,18193,529],[76,18193,785],[76,18193,1041],[76,18193,1297],[76,18193,1617],[76,18193,1809],[46,18193,17],[46,18193,273],[46,18193,529],[46,18193,785],[46,18193,1041],[46,18193,1297],[46,18193,1617],[46,18193,1809],[18,18193,17],[18,18193,273],[18,18193,529],[18,18193,
|
function ig(a,b,c){var d="";for(c=c||256;d.length<c;){var e=a.Ga(b,1);if(!e||36==e||127<=e)break;d+=32<=e?String.fromCharCode(e):"."}return d}function Zf(a,b){a.K=a;a.ha=a.td=536870912;a.V=null;a.X=[];b=a.wb(b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in tb)0<=ua(b,c)&&(a.ha|=tb[c],a.i(c+" messages enabled"))}function Md(a,b,c){for(var d in tb)if(b==tb[d]){a.Z[d]=c;break}}
|
||||||
785],[18,18193,1041],[18,18193,1297],[18,18193,1617],[18,18193,1809],[58],[50,2067],[34,51],[30,51],[11,51],[51,2067],[4,18193,33],[65,128],[62],[54],[38,51],[30,32819],[15,51],[7,51],[1,18193,33],[65,128],[57],[50,2323],[33,51],[48,33,18193],[10,51],[51,2323],[74,18193,33],[65,128],[55],[54,32768],[31,51],[27,18193,33],[8,51],[7,32819],[67,18193,33],[65,128],[61],[50,2579],[37,51],[78,19283,18963],[14,51],[51,2579],[6,18193,33],[65,128],[60],[49,2579],[36,51],[75,18963,18707],[13,51],[7,32819],[77,
|
k.Gb=function(a,b){var c;a=a.toUpperCase();null==b?c=ua(Gg,a):(c=ua(Gg,a.substr(b,2)),0>c&&(c=ua(Gg,a.substr(b,1))));return c};function Ig(a,b){var c=0;a=a.Hb(b);if(void 0!==a)switch(b){case Jg:case Kg:case Lg:case Mg:case Ng:case Og:case Pg:case Qg:c=2;break;case Rg:case Sg:case Tg:case Ug:case Vg:case Wg:case Xg:c=4}return c?n(a,c):"??"}
|
||||||
18193,33],[65,128],[59],[50,3603],[35,51],[24],[12,51],[51,3603],[47,18193,33],[65,128],[56],[69,19219,18963],[32,51],[25],[9,51],[7,32819],[19,18193,33],[65,128]];l=He.prototype;
|
k.Hb=function(a){var b;if(0<=a){var c=this.u;switch(a){case Jg:b=c.g;break;case Kg:b=c.w;break;case Lg:b=c.A;break;case Rg:b=Wc(c);break;case Mg:b=c.B;break;case Ng:b=c.C;break;case Sg:b=jd(c);break;case Og:b=c.D;break;case Pg:b=c.F;break;case Tg:b=D(c);break;case Qg:b=F(c,D(c));break;case Ug:b=c.M;break;case Vg:b=c.j;break;case Wg:b=Uc(c);break;case Xg:b=Uc(c)&255|c.g<<8}}return b};
|
||||||
l.Qa=function(a,b,c,d){this.w=b;this.b=c;this.A=a;(a=lc(a,"messages"))&&Le(this,a);this.Ha=Qe;Od(this,64,function(a){a:{var b=d.w.W,c=a[0],e=a=0,k=b.length;if(c){a=Re(Se(d,c));if(-1===a){d.g("invalid address: "+c);break a}e=a>>>d.w.ha;k=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;k--;){var p=b[e];p.type==c?m++||d.g("..."):(c=p.type,m=xb[c],p&&d.g(t(p.id)+" %"+t(e<<d.w.ha)+" %%"+t(p.G)+" "+v(p.Cb)+" "+
|
function Yg(a,b){b=Of(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=a.Gb(b,c+1),0<=e&&(b=b.substr(0,c)+Ig(a,e)+b.substr(c+1+Gg[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=ca(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=bg(a,e))?(d=e+' "'+ig(a,d)+'"',b=b.replace("$"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("^",c));)e=b.substr(c+1,9),(d=bg(a,e))?(dg(d),d=e+
|
||||||
v(p.size)+" "+m),c!=Yb&&(c=-1),m=0);a+=d.w.Ja;e++}}});F(this)};
|
' "'+ig(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}k.message=function(a,b){b&&(a+=" at "+hg(Wf(this.u.j).J));this.ha&1073741824?this.X.push(a):this.V&&a==this.V||(this.V=a,this.ha&-2147483648&&(this.da(),a+=" (cpu halted)"),this.i(a),this.u&&(a=this.u,Kc(a),a.va=0,Ac(a)))};
|
||||||
l.pa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ga=this.M[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",oc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.j<d.u.length-1&&(b=d.u[++d.j])):40==a.keyCode&&(0<d.j?b=d.u[--d.j]:(b="",d.j=-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.M[b]=c,Ka(c,function(){if(d.ga){var a=d.ga.value;
|
function pb(a,b,c,d,e,f,g,h){h|=256;null!=f&&(a.ha&h)!=h||a.message(b.$a+"."+(null!=d?"outPort":"inPort")+"("+q(c)+","+(f?f:"unknown")+(null!=d?","+ea(d):"")+")"+(null!=g?": "+ea(g):"")+(null!=e?" at "+hg(e):""))}
|
||||||
d.ga.value="";oc(d,a,!0);return!0}return!1}),!0;case "step":return this.M[b]=c,Ka(c,function(a){var b=!1;ib(d,!0)||(hb(d,!0),b=d.ob(a?1:0),hb(d,!1));return b}),!0}return!1};l.Bb=function(){this.ga&&this.ga.focus()};function Re(a){a=a&&a.G;null==a&&(a=-1);return a}l.Z=function(a,b){var c=255,d=Re(a);-1!==d&&(c=yb(this.w,d),b&&Te(a,b));return c};l.ab=function(a,b){var c=65535,d=Re(a);-1!==d&&(c=zb(this.w,d),b&&Te(a,b));return c};
|
function Yf(a){var b;if(Ed(a)){if(!a.D||!a.D.length){a.D=Array(Zg);for(b=0;b<a.D.length;b++)a.D[b]=Wf();a.T=0;a.i("instruction history buffer allocated")}if(!a.B||!a.B.length)for(a.B=Array(256),b=0;b<a.B.length;b++)a.B[b]=[b,0]}else a.D&&a.D.length&&a.i("instruction history buffer freed"),a.T=0,a.D=[],a.B=[]}function $g(a,b){if(!ah(a))return!1;a.u.qb(b);return!0}
|
||||||
l.ua=function(a,b,c){var d=Re(a);-1!==d&&(Ab(this.w,d,b),c&&Te(a,c),pc(this.b,!0))};l.Mb=function(a,b,c){var d=Re(a);if(-1!==d){var e=this.w,f=d&e.w,g=(d&e.u)>>>e.ha;f!=e.w?e.W[g].Zb(f,b&65535,d):(e.W[g++].Db(f,b&255,d),e.W[g&e.D].Db(0,b>>8&255,d+1));c&&Te(a,c);pc(this.b,!0)}};function X(a){return{G:a,Pa:!1}}function Ue(a){return[a.G,a.Pa]}function uf(a){return{G:a[0],Pa:a[1]}}
|
function cg(a,b,c,d){if(!ah(a))return!1;a.C=0;b||Ed(a)&&Fd(a,a.u.j,0);try{var e=a.u.Ab(b);0<e&&(a.C+=e,Ec(a.u,e,!0),Bc(a.u,e),a.N++)}catch(f){"number"!=typeof f&&(a.C=0,hb(a.u,f.stack||f.message))}!1!==d&&Ac(a.u);yc(a,c||!1);return 0<a.C}k.da=function(a){this.u&&this.u.da(a)};function yc(a,b){void 0===b&&(b=!0);a.F=Wf(a.u.j);b&&1!=a.M?bh(a):ch(a)}
|
||||||
function Se(a,b,c){var d;c=(c?a.L:a.Va).G;if(void 0!==b){d=b=Ce(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c<a.D.length;c++){var f=a.D[c].Fa[d];if(void 0!==f){d=f.o;void 0!==d&&(e=X(d));break}}if(d=e)return d;c=Be(a,b,void 0)}null!=c&&(d=X(c));return d}function vf(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Kd=a.Jb(b.Gc=c[2]))}function Te(a,b){null!=a.G&&(a.G+=b||1)}function Z(a){return t(a,4)}
|
function ah(a){var b;if(b=a.u&&ib(a.u))b=a.u,b.G.ja?b=!0:(b.i(b.toString()+" not powered"),b=!1);b&&!lb(a.u)?(a=a.u,a.G.error?(a.i(a.toString()+" error"),a=!0):a=!1,a=!a):a=!1;return a}k.ua=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};k.wa=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Yf(this);this.N=this.Y=0;this.V=null;this.C=0;this.F=Wf(this.u.j);this.G.ka=!1;dh(this);a||yc(this)};
|
||||||
function wf(a,b,c){var d="";for(c=c||256;d.length<c;){var e=a.Z(b,1);if(!e||36==e||127<=e)break;d+=32<=e?String.fromCharCode(e):"."}return d}function Le(a,b){a.H=a;a.sa=a.Nd=536870912;a.ka=null;a.la=[];b=a.Jb(b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in nb)0<=sa(b,c)&&(a.sa|=nb[c],a.g(c+" messages enabled"))}function Od(a,b,c){for(var d in nb)if(b==nb[d]){a.va[d]=c;break}}
|
k.save=function(){var a=new Vc(this);a.set(0,eg(this.F));a.set(1,eg(this.O));a.set(2,[this.g,this.L,this.ha]);a.set(3,this.A);return a.data()};k.restore=function(a){var b=0;void 0!==a[2]&&(this.F=fg(a[b++]),this.O=fg(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.L=a[b][1],this.ha|=a[b][2]);a[3]&&(this.A=a[3]);return!0};k.start=function(a,b){this.M||this.i("running");this.G.ka=!0;this.va=a;this.ya=b};
|
||||||
l.Sb=function(a,b){var c;a=a.toUpperCase();null==b?c=sa(Pe,a):(c=sa(Pe,a.substr(b,2)),0>c&&(c=sa(Pe,a.substr(b,1))));return c};function xf(a,b){var c=0;a=a.Tb(b);if(void 0!==a)switch(b){case 7:case 0:case 1:case 2:case 3:case 4:case 5:case 6:c=2;break;case 8:case 9:case 10:case 11:case 12:case 13:case 14:c=4}return c?t(a,c):"??"}
|
k.stop=function(a,b){if(this.G.ka){this.G.ka=!1;this.C=b-this.ya;if(!this.M){b="stopped";if(this.C){a-=this.va;var c=0<a?Math.round(1E3*this.C/a):0;b+=" (";Ed(this)&&(b+=this.N+" opcodes, ",this.Y-=this.N,this.N=0);b+=this.C+" cycles, "+a+" ms, "+c+" hz)"}else nb(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.i(b)}yc(this,!0);this.U&&this.U.focus();dh(this,this.u.j)}};function Ed(a){return 1<a.j.length||!!a.W}
|
||||||
l.Tb=function(a){var b;if(0<=a){var c=this.b;switch(a){case 7:b=c.i;break;case 0:b=c.R;break;case 1:b=c.S;break;case 8:b=Tc(c);break;case 2:b=c.T;break;case 3:b=c.U;break;case 9:b=Vc(c);break;case 4:b=c.V;break;case 5:b=c.Y;break;case 10:b=J(c);break;case 6:b=c.Z(J(c));break;case 11:b=c.oa;break;case 12:b=c.P;break;case 13:b=Rc(c);break;case 14:b=Rc(c)&255|c.i<<8}}return b};
|
function Fd(a,b,c){var d=a.u;if(0<c&&(a.W&&!--a.W||sc(a,b,1,a.j)))return!0;0<=c&&a.B.length&&(a.N++,b=Eb(a.H,b),null!=b&&(a.B[b][1]++,b=a.D[a.T],b.J=d.j,b.Da=!1,++a.T==a.D.length&&(a.T=0)));return!1}function Pb(a,b,c){a.i("break on input from port "+q(b)+": "+n(c));a.da(!0)}function Tb(a,b,c){a.i("break on output to port "+q(b)+": "+n(c));a.da(!0)}
|
||||||
function yf(a,b){b=Ce(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=a.Sb(b,c+1),0<=e&&(b=b.substr(0,c)+xf(a,e)+b.substr(c+1+Pe[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=aa(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=Se(a,e))?(d=e+' "'+wf(a,d)+'"',b=b.replace("$"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("^",c));)e=b.substr(c+1,9),(d=Se(a,e))?(Te(d),d=e+
|
function Xf(a){var b,c;a.j=["bp"];if(a.I)for(b=1;b<a.I.length;b++){c=a.I[b];var d=a.H;rc(d.b[ag(c)>>>d.g],!1)}a.I=["br"];if(a.w)for(b=1;b<a.w.length;b++)c=a.w[b],d=a.H,rc(d.b[ag(c)>>>d.g],!0);a.w=["bw"];a.oa=0}k.Pa=function(a,b,c){var d=!0;c||eh(this,a,b,!1,!0);if(a!=this.j){var e=ag(b);if(-1===e)this.i("invalid address: "+hg(b.J)),d=!1;else{var f=this.H;f.b[e>>>f.g].Pa(e&f.j,a==this.w)}}d&&(a.push(b),c?b.Da=!0:(fh(this,a,a.length-1,"set"),Yf(this)));return d};
|
||||||
' "'+wf(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}l.message=function(a,b){b&&(a+=" at "+Z(X(this.b.P).G));this.sa&1073741824?this.la.push(a):this.ka&&a==this.ka||(this.ka=a,this.sa&-2147483648&&(this.qa(),a+=" (cpu halted)"),this.g(a),this.b&&(a=this.b,Jc(a),a.O=0,pc(a)))};
|
function eh(a,b,c,d,e){var f=!1;c=ag(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==ag(h)&&(!d||h.Da)){f=!0;h.Da||e||fh(a,b,g,"cleared");b.splice(g,1);b!=a.j&&(d=a.H,rc(d.b[c>>>d.g],b==a.w));h.Da||Yf(a);break}}return f}function gh(a,b){for(var c=1;c<b.length;c++)fh(a,b,c);return b.length-1}function fh(a,b,c,d){c=b[c];a.i(b[0]+" "+hg(c.J)+(d?" "+d:c.mc?' "'+c.mc+'"':""))}
|
||||||
function eb(a,b,c,d,e,f,g,h){h|=256;null!=f&&(a.sa&h)!=h||a.message(b.fb+"."+(null!=d?"outPort":"inPort")+"("+v(c)+","+(f?f:"unknown")+(null!=d?","+ca(d):"")+")"+(null!=g?": "+ca(g):"")+(null!=e?" at "+Z(e):""))}
|
function dh(a,b){if(void 0!==b)sc(a,b,1,a.j,!0),a.M=0;else for(b=1;b<a.j.length;b++){var c=a.j[b];if(c.Da){if(!eh(a,a.j,c,!0))break;b=0}}}
|
||||||
function Ke(a){var b;if(Hd(a)){if(!a.K||!a.K.length){a.K=Array(1E3);for(b=0;b<a.K.length;b++)a.K[b]=X();a.ea=0;a.g("instruction history buffer allocated")}if(!a.I||!a.I.length)for(a.I=Array(256),b=0;b<a.I.length;b++)a.I[b]=[b,0]}else a.K&&a.K.length&&a.g("instruction history buffer freed"),a.ea=0,a.K=[],a.I=[]}l.cb=function(a){if(!zf(this))return!1;this.b.cb(a);return!0};
|
function sc(a,b,c,d,e){var f=!1;if(!a.oa++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Da)for(var l=ag(h),p=0;p<c;p++)if(b+p==l){var r,f=!0;h.Da&&(eh(a,d,h,!0),e=!0);if(r=h.qd){for(var f=!1,t=0;t<r.length;t++)if(!hh(a,r[t],!0)){if(r[t].indexOf("if")){f=!0;break}for(var A=t+1;A<r.length&&r[A].indexOf("else");A++)t++;if(A==r.length){f=!0;break}}a.u.G.ka||(f=!0)}if(f){e||fh(a,d,g,"hit");break}}}a.oa--;return f}
|
||||||
l.ob=function(a,b,c){if(!zf(this))return!1;this.J=0;a||Hd(this)&&Id(this,this.b.P,0);try{var d=this.b.ob(a);0<d&&(this.J+=d,Fc(this.b,d,!0),qc(this.b,d),this.aa++)}catch(e){"number"!=typeof e&&(this.J=0,kb(this.b,e.stack||e.message))}!1!==c&&pc(this.b);this.Aa(b||!1);return 0<this.J};l.qa=function(a){this.b&&this.b.qa(a)};l.Aa=function(a){void 0===a&&(a=!0);this.L=X(this.b.P);a&&1!=this.X?Af(this):Bf(this)};
|
function ih(a,b,c,d){for(var e=Wf(b.J),f=a.Ga(b,1),g=a.ga[f],h="",l=(a.style!=jh?kh:lh)[g[0]],p=g.length-1,r=mh,t,A=1;A<=p;A++){var w="";t=g[A];if(void 0!==t&&!(t&O&&a.style==Vf)){var u=t&nh;if(u){var B=t&oh;B?r=B:t|=r;t&ph||(t|=1==A?qh:rh);if(u&P)a:{w=a;u=t;B=b;switch(u&oh){case Q:B=n(w.Ga(B,1),2);break;case sh:B=n(w.Ga(B,1)<<24>>24,4);break;case th:B=n(w.Bb(B,2),4);break;default:w="imm("+q(u)+")";break a}w.style==jh&&u&uh?B="["+B+"]":u&vh||(B=(w.style==Vf?"$":"0x")+B);w=B}else u&vh?(w=(t&wh)>>8,
|
||||||
function zf(a){var b;if(b=a.b&&jb(a.b))b=a.b,b.C.xa?b=!0:(b.g(b.toString()+" not powered"),b=!1);b&&!ib(a.b)?(a=a.b,a.C.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){Ke(this);this.aa=this.ma=0;this.ka=null;this.J=0;this.L=X(this.b.P);this.C.za=!1;Cf(this);a||this.Aa()};
|
u=Gg[w],a.style==jh&&t&uh&&(w==Qg&&(u="HL"),u="["+u+"]"),w=u):u&xh&&(w=(f>>3&7).toString());if(!w||!w.length){h="INVALID";break}0<h.length&&(h+=",");h+=w||"???"}}}f="";g=hg(e.J)+" ";if(-1!==e.J&&-1!==b.J){do if(f+=n(a.Ga(e,1),2),null==e.J)break;while(e.J!=b.J)}g+=na(f,10);g+=t&yh?"*":" ";g+=na(l,7);h&&(g+=" "+h);c&&(g=na(g,40)+";"+c,g=a.u.G.Va?g+("cycles="+Cc(a.u).toString()+" cs="+n(a.u.ya)):g+(null!=d?"="+d.toString():""));return g}
|
||||||
l.save=function(){var a=new Sc(this);a.set(0,Ue(this.L));a.set(1,Ue(this.ba));a.set(2,[this.u,this.O,this.sa]);a.set(3,this.D);return a.data()};l.restore=function(a){var b=0;void 0!==a[2]&&(this.L=uf(a[b++]),this.ba=uf(a[b++]),this.u=a[b][0],"string"==typeof this.u&&(this.u=[this.u]),this.O=a[b][1],this.sa|=a[b][2]);a[3]&&(this.D=a[3]);return!0};l.start=function(a,b){this.X||this.g("running");this.C.za=!0;this.rb=a;this.sb=b};
|
function zh(a,b){switch(b){case "IF":a=a.u.N&512;break;case "SF":a=rd(a.u);break;case "ZF":a=qd(a.u);break;case "AF":a=pd(a.u);break;case "PF":a=od(a.u);break;case "CF":a=md(a.u);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}function Ah(a,b){return Gg[b]+"="+Ig(a,b)+" "}function Bh(a){return Ah(a,Jg)+Ah(a,Rg)+Ah(a,Sg)+Ah(a,Tg)+Ah(a,Ug)+zh(a,"IF")+zh(a,"SF")+zh(a,"ZF")+zh(a,"AF")+zh(a,"PF")+zh(a,"CF")}k.dc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||||
l.stop=function(a,b){if(this.C.za){this.C.za=!1;this.J=b-this.sb;if(!this.X){b="stopped";if(this.J){a-=this.rb;var c=0<a?Math.round(1E3*this.J/a):0;b+=" (";Hd(this)&&(b+=this.aa+" opcodes, ",this.ma-=this.aa,this.aa=0);b+=this.J+" cycles, "+a+" ms, "+c+" hz)"}else gb(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.g(b)}this.Aa(!0);this.Bb();Cf(this,this.b.P)}};function Hd(a){return 1<a.F.length||!!a.ia}
|
function Ch(a,b,c){var d=[],e=ag(b)>>>0;for(b=0;b<a.A.length;b++){var f=a.A[b],g=f.J>>>0,h=f.Gd;if(e>=g&&e<g+h){e=qa(f.cc,[e-g],a.dc);0<=e?Dh(a,b,e,d):c&&(e=~e,Dh(a,b,e-1,d),Dh(a,b,e,d));break}}return d}function Dh(a,b,c,d){var e={},f=a.A[b].cc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.A[b].ra[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}
|
||||||
function Id(a,b,c){var d=a.b;if(0<c&&(a.ia&&!--a.ia||gc(a,b,1,a.F)))return!0;0<=c&&a.I.length&&(a.aa++,b=yb(a.w,b),null!=b&&(a.I[b][1]++,b=a.K[a.ea],b.G=d.P,b.Pa=!1,++a.ea==a.K.length&&(a.ea=0)));return!1}function Fb(a,b,c){a.g("break on input from port "+v(b)+": "+t(c));a.qa(!0)}function Tb(a,b,c){a.g("break on output to port "+v(b)+": "+t(c));a.qa(!0)}
|
function Eh(a,b){if("?"==b)a.i("frequency commands:"),a.i("\tclear\tclear all frequency counts");else{var c=0;if(a.B)if("clear"==b){for(b=0;b<a.B.length;b++)a.B[b]=[b,0];a.i("frequency data cleared");c++}else if(void 0!==b)a.i("unknown frequency command: "+b),c++;else{var d=a.B.slice();d.sort(function(a,b){return b[1]-a[1]});var e=a.style!=jh?kh:lh;for(b=0;b<d.length;b++){var f=d[b][0],g=d[b][1];g&&(a.i((e[a.ga[f][0]]+" ").substr(0,5)+" ("+ea(f)+"): "+g+" times"),c++)}}c||a.i("no frequency data available")}}
|
||||||
function Je(a){var b,c;a.F=["bp"];if(a.N)for(b=1;b<a.N.length;b++){c=a.N[b];var d=a.w;hc(d.W[Re(c)>>>d.ha],!1)}a.N=["br"];if(a.B)for(b=1;b<a.B.length;b++)c=a.B[b],d=a.w,hc(d.W[Re(c)>>>d.ha],!0);a.B=["bw"];a.Xa=0}l.Za=function(a,b,c){var d=!0;c||Df(this,a,b,!1,!0);if(a!=this.F){var e=Re(b);if(-1===e)this.g("invalid address: "+Z(b.G)),d=!1;else{var f=this.w;f.W[e>>>f.ha].Za(e&f.w,a==this.B)}}d&&(a.push(b),c?b.Pa=!0:(Ef(this,a,a.length-1,"set"),Ke(this)));return d};
|
function Fh(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Tf(a)||a.i("no variables"),!0;if(!c[2])return Tf(a,c[1]);if(!c[3])return delete a.R[c[1]],!0;b=Nf(a,c[3]);return void 0!==b?(a.R[c[1]]=b,!0):!1}a.i("invalid assignment:"+b);return!1}
|
||||||
function Df(a,b,c,d,e){var f=!1;c=Re(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==Re(h)&&(!d||h.Pa)){f=!0;h.Pa||e||Ef(a,b,g,"cleared");b.splice(g,1);b!=a.F&&(d=a.w,hc(d.W[c>>>d.ha],b==a.B));h.Pa||Ke(a);break}}return f}function Ff(a,b){for(var c=1;c<b.length;c++)Ef(a,b,c);return b.length-1}function Ef(a,b,c,d){c=b[c];a.g(b[0]+" "+Z(c.G)+(d?" "+d:c.Gc?' "'+c.Gc+'"':""))}
|
function Gh(a,b,c){var d=null;if(b=bg(a,b,!0)){var e=Ch(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.J-e[1])&&(g=" + "+q(f)),f=e[0]+" ("+hg(e[1])+")"+g,c&&a.i(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.J)&&(g=" - "+q(f)),f=e[4]+" ("+hg(e[5])+")"+g,c&&a.i(f),d||(d=f))}else c&&a.i("no symbols")}return d}
|
||||||
function Cf(a,b){if(void 0!==b)gc(a,b,1,a.F,!0),a.X=0;else for(b=1;b<a.F.length;b++){var c=a.F[b];if(c.Pa){if(!Df(a,a.F,c,!0))break;b=0}}}
|
function Hh(a,b){switch(b[1]){case "8080":a.style=Vf;break;case "8086":a.style=jh;break;case "cs":var c;void 0!==b[3]&&(c=+b[3]);switch(b[2]){case "int":a.u.na=c;break;case "start":a.u.za=c;break;case "stop":a.u.sa=c;break;default:a.i("unknown cs option");return}void 0!==c&&xc(a.u);a.i("checksums "+(a.u.G.Va?"enabled":"disabled"));return;case "sp":void 0!==b[2]&&(Dc(a.u,+b[2])||a.i("warning: using 1x multiplier, previous target not reached"));a.i("target speed: "+(a.u.Z.toFixed(2)+"Mhz")+" ("+a.u.U+
|
||||||
function gc(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.Pa)for(var k=Re(h),m=0;m<c;m++)if(b+m==k){var p,f=!0;h.Pa&&(Df(a,d,h,!0),e=!0);if(p=h.Kd){for(var f=!1,q=0;q<p.length;q++)if(!Gf(a,p[q],!0)){if(p[q].indexOf("if")){f=!0;break}for(var y=q+1;y<p.length&&p[y].indexOf("else");y++)q++;if(y==p.length){f=!0;break}}a.b.C.za||(f=!0)}if(f){e||Ef(a,d,g,"hit");break}}}a.Xa--;return f}
|
"x)");return;case "?":a.i("debugger options:");a.i("\t8080\t\tselect 8080-style mnemonics");a.i("\t8086\t\tselect 8086-style mnemonics");a.i("\tcs int #\tset checksum cycle interval to #");a.i("\tcs start #\tset checksum cycle start count to #");a.i("\tcs stop #\tset checksum cycle stop count to #");a.i("\tsp #\t\tset speed multiplier to #");break;default:if(b[1]){a.i("unknown option: "+b[1]);return}}a.i(a.style+"-style mnemonics enabled")}
|
||||||
function Hf(a,b,c,d){for(var e=X(b.G),f=a.Z(b,1),g=a.Ha[f],h="",k=(8086!=a.style?Ne:Oe)[g[0]],m=g.length-1,p=0,q,y=1;y<=m;y++){var u="";q=g[y];if(void 0!==q&&!(q&16384&&a.style==Ie)){var r=q&240;if(r){var z=q&15;z?p=z:q|=p;q&61440||(q|=1==y?8192:4096);if(r&32)a:{u=a;r=q;z=b;switch(r&15){case 1:z=t(u.Z(z,1),2);break;case 2:z=t(u.Z(z,1)<<24>>24,4);break;case 3:z=t(u.ab(z,2),4);break;default:u="imm("+v(r)+")";break a}8086==u.style&&r&64?z="["+z+"]":r&16||(z=(u.style==Ie?"$":"0x")+z);u=z}else r&16?(u=
|
function bh(a,b){var c;if(b&&"?"==b[1])a.i("register commands:"),a.i("\tr\tdump registers"),a.i("\trx [#]\tset flag or register x to [#]");else{var d=a.u;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.i("missing value for "+b[1]);return}f=Nf(a,b);if(void 0===f)return;switch(e.toUpperCase()){case "A":d.g=f&255;break;case "B":d.w=f&255;break;case "BC":d.w=f>>8&255;case "C":d.A=f&255;break;case "D":d.B=f&255;break;
|
||||||
(q&3840)>>8,r=Pe[u],8086==a.style&&q&64&&(6==u&&(r="HL"),r="["+r+"]"),u=r):r&128&&(u=(f>>3&7).toString());if(!u||!u.length){h="INVALID";break}0<h.length&&(h+=",");h+=u||"???"}}}f="";g=Z(e.G)+" ";if(-1!==e.G&&-1!==b.G){do if(f+=t(a.Z(e,1),2),null==e.G)break;while(e.G!=b.G)}g+=ma(f,10);g=g+(q&32768?"*":" ")+ma(k,7);h&&(g+=" "+h);c&&(g=ma(g,40)+";"+c,g=a.b.C.jb?g+("cycles="+Dc(a.b).toString()+" cs="+t(a.b.xb)):g+(null!=d?"="+d.toString():""));return g}
|
case "DE":d.B=f>>8&255;case "E":d.C=f&255;break;case "H":d.D=f&255;break;case "HL":d.D=f>>8&255;case "L":d.F=f&255;break;case "SP":d.M=f&65535;break;case "PC":C(d,f);a.F=Wf(d.j);break;case "PS":Sc(d,f);break;case "PSW":Sc(d,f&255|d.N&-256);d.g=f>>8;break;case "CF":d.I=f?d.I|256:d.I&255;break;case "PF":f?od(d)||(d.L^=1):od(d)&&(d.L^=1);break;case "AF":d.O=f?~d.L&16|d.O&-17:d.L&16|d.O&-17;break;case "ZF":d.I=f?d.I&-256:d.I|255;break;case "SF":f?rd(d)||(d.L^=192):rd(d)&&(d.L^=192);break;case "IF":d.N=
|
||||||
function If(a,b){switch(b){case "IF":a=a.b.ta&512;break;case "SF":a=cd(a.b);break;case "ZF":a=bd(a.b);break;case "AF":a=ad(a.b);break;case "PF":a=$c(a.b);break;case "CF":a=Yc(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}function Jf(a,b){return Pe[b]+"="+xf(a,b)+" "}function Kf(a){return Jf(a,7)+Jf(a,8)+Jf(a,9)+Jf(a,10)+Jf(a,11)+If(a,"IF")+If(a,"SF")+If(a,"ZF")+If(a,"AF")+If(a,"PF")+If(a,"CF")}l.zc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
f?d.N|512:d.N&-513;break;default:a.i("unknown register: "+e);return}Ac(d);a.i("updated registers:")}a.i(Bh(a));c&&(a.F=Wf(d.j),ch(a,hg(a.F.J)))}}function Ih(a,b){b=oa(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.i(Yg(a,c[2])):Nf(a,b,!0)}function Jh(a,b,c){var d="t"!=b;c=Pf(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ia(c,function(){return mb(a,!0)&&cg(a,e,d,!1)},function(){Ac(a.u);mb(a,!1)})}
|
||||||
function Lf(a,b,c){var d=[],e=Re(b)>>>0;for(b=0;b<a.D.length;b++){var f=a.D[b],g=f.G>>>0,h=f.$d;if(e>=g&&e<g+h){e=pa(f.yc,[e-g],a.zc);0<=e?Mf(a,b,e,d):c&&(e=~e,Mf(a,b,e-1,d),Mf(a,b,e,d));break}}return d}function Mf(a,b,c,d){var e={},f=a.D[b].yc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.D[b].Fa[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}
|
function ch(a,b,c,d){if(b=bg(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=bg(a,c,!0);if(!d||d.J<b.J)return;e=d.J-b.J;if(256<e){a.i("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=lb(a,!1)||a.M?a.C:null;var g=null!=f?"cycles":null,h=Ch(a,b),l=b.J;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var p=h[0]+":";h[2]&&(p+=" "+h[2]);a.i(p)}h[3]&&(g=h[3],f=null);f=ih(a,b,g,f);a.i(f);a.F=b;e-=b.J-l;c++}}}
|
||||||
function Nf(a,b){if("?"==b)a.g("frequency commands:"),a.g("\tclear\tclear all frequency counts");else{var c=0;if(a.I)if("clear"==b){for(b=0;b<a.I.length;b++)a.I[b]=[b,0];a.g("frequency data cleared");c++}else if(void 0!==b)a.g("unknown frequency command: "+b),c++;else{var d=a.I.slice();d.sort(function(a,b){return b[1]-a[1]});var e=8086!=a.style?Ne:Oe;for(b=0;b<d.length;b++){var f=d[b][0],g=d[b][1];g&&(a.g((e[a.Ha[f][0]]+" ").substr(0,5)+" ("+ca(f)+"): "+g+" times"),c++)}}c||a.g("no frequency data available")}}
|
k.wb=function(a,b,c){if(b)if(a){0>this.b&&this.g.length&&(this.b=0);if(0>this.b||a!=this.g[this.b])this.g.splice(0,0,a),this.b=0;this.b--}else this.L?a="end":a=this.g[this.b+1];b=[];if(a){a=a.toLowerCase().replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(oa(a.substring(d,f))),d=f+1}}return b};
|
||||||
function Of(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Ge(a)||a.g("no variables"),!0;if(!c[2])return Ge(a,c[1]);if(!c[3])return delete a.da[c[1]],!0;b=Be(a,c[3]);return void 0!==b?(a.da[c[1]]=b,!0):!1}a.g("invalid assignment:"+b);return!1}
|
function hh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.L&&(a.i("ended assemble at "+hg(a.O.J)),a.F=a.O,a.L=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.V=null;if(ib(a)&&0<b.length){a.L&&(b="a "+hg(a.O.J)+" "+b);var f=b.replace(/ +/g," ").split(" ");if(f&&f.length)for(var g=f[0],h=g.charAt(0),l=1;l<g.length;l++){var p=g.charAt(l);if("?"==h||"r"==h||"a">p||"z"<p){f[0]=g.substr(l);f.unshift(g.substr(0,l));break}}switch(f[0].charAt(0)){case "a":var r=bg(a,f[1],!0);if(r)if(a.O=
|
||||||
function Pf(a,b,c){var d=null;if(b=Se(a,b,!0)){var e=Lf(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.G-e[1])&&(g=" + "+v(f)),f=e[0]+" ("+Z(e[1])+")"+g,c&&a.g(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.G)&&(g=" - "+v(f)),f=e[4]+" ("+Z(e[5])+")"+g,c&&a.g(f),d||(d=f))}else c&&a.g("no symbols")}return d}
|
r,void 0===f[2])a.i("begin assemble at "+hg(r.J)),a.L=!0,Ac(a.u);else{var t;a.i("not supported yet");t=[];if(t.length){for(var A=0;A<t.length;A++)a.Sb(r,t[A],1);a.i(ih(a,a.O))}}break;case "b":a:{var w=f[0],u=f[1],B=b;if("?"==u)a.i("breakpoint commands:"),a.i("\tbi [p]\ttoggle break on input port [p]"),a.i("\tbo [p]\ttoggle break on output port [p]"),a.i("\tbp [a]\tset exec breakpoint at addr [a]"),a.i("\tbr [a]\tset read breakpoint at addr [a]"),a.i("\tbw [a]\tset write breakpoint at addr [a]"),a.i("\tbc [a]\tclear breakpoint at addr [a]"),
|
||||||
function Qf(a,b){switch(b[1]){case "8080":a.style=Ie;break;case "8086":a.style=8086;break;case "cs":var c;void 0!==b[3]&&(c=+b[3]);switch(b[2]){case "int":a.b.lb=c;break;case "start":a.b.yb=c;break;case "stop":a.b.mb=c;break;default:a.g("unknown cs option");return}void 0!==c&&nc(a.b);a.g("checksums "+(a.b.C.jb?"enabled":"disabled"));return;case "sp":void 0!==b[2]&&(Ec(a.b,+b[2])||a.g("warning: using 1x multiplier, previous target not reached"));a.g("target speed: "+(a.b.bb.toFixed(2)+"Mhz")+" ("+
|
a.i("\tbl\tlist all breakpoints"),a.i("\tbn [n]\tbreak after [n] instruction(s)");else{var S=w.charAt(1);if("l"==S){var ya;ya=0+gh(a,a.j);ya+=gh(a,a.I);(ya+=gh(a,a.w))||a.i("no breakpoints")}else if("n"==S)a.W=Pf(a,u),a.i("break after "+a.W+" instruction(s)");else if(void 0===u)a.i("missing breakpoint address");else{var K=Wf();if("*"!=u&&(K=bg(a,u,!0),!K))break a;u=q(K.J);"c"==S?null==K.J?(Xf(a),a.i("all breakpoints cleared")):eh(a,a.j,K)||eh(a,a.I,K)||eh(a,a.w,K)||a.i("breakpoint missing: "+hg(K.J)):
|
||||||
a.b.Ra+"x)");return;case "?":a.g("debugger options:");a.g("\t8080\t\tselect 8080-style mnemonics");a.g("\t8086\t\tselect 8086-style mnemonics");a.g("\tcs int #\tset checksum cycle interval to #");a.g("\tcs start #\tset checksum cycle start count to #");a.g("\tcs stop #\tset checksum cycle stop count to #");a.g("\tsp #\t\tset speed multiplier to #");break;default:if(b[1]){a.g("unknown option: "+b[1]);return}}a.g(a.style+"-style mnemonics enabled")}
|
"i"==S?a.i("breakpoint "+(Kb(a.H,K.J)?"enabled":"cleared")+": port "+u+" (input)"):"o"==S?a.i("breakpoint "+(Qb(a.H,K.J)?"enabled":"cleared")+": port "+u+" (output)"):null!=K.J&&(gg(a,K,B),"p"==S?a.Pa(a.j,K):"r"==S?a.Pa(a.I,K):"w"==S?a.Pa(a.w,K):a.i("unknown breakpoint command: "+S))}}}break;case "c":a.ta&&(a.ta.value="");break;case "d":a:{var ia,ta=f[0],ma=f[1],La=f[2],dc=f[3];if("?"==ma){var Lb="";for(ia in tb)a.Z[ia]&&(Lb&&(Lb+=","),Lb+=ia);Lb+=",state,symbols";a.i("dump memory commands:");a.i("\tdb [a] [#] dump # bytes at address a");
|
||||||
function Af(a,b){var c;if(b&&"?"==b[1])a.g("register commands:"),a.g("\tr\tdump registers"),a.g("\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.g("missing value for "+b[1]);return}f=Be(a,b);if(void 0===f)return;switch(e.toUpperCase()){case "A":d.i=f&255;break;case "B":d.R=f&255;break;case "BC":d.R=f>>8&255;case "C":d.S=f&255;break;case "D":d.T=f&255;break;
|
a.i("\tdw [a] [#] dump # words at address a");a.i("\tdd [a] [#] dump # dwords at address a");a.i("\tdh [#] [#] dump # instructions from history");Lb.length&&a.i("dump extension commands:\n\t"+Lb)}else if("state"==ma){var ie=Kh(a.S,!0);"console"==La?console.log(ie):(a.ta&&(a.ta.value=""),ie&&a.i(ie))}else if("symbols"==ma)for(var je=0;je<a.A.length;je++){var ke=a.A[je],Mb;for(Mb in ke.ra)if("."!=Mb.charAt(0)){var jg=ke.ra[Mb].o;if(void 0!==jg){var kg=ke.ra[Mb].l;kg&&(Mb=kg);a.i(hg(jg)+" "+
|
||||||
case "DE":d.T=f>>8&255;case "E":d.U=f&255;break;case "H":d.V=f&255;break;case "HL":d.V=f>>8&255;case "L":d.Y=f&255;break;case "SP":d.oa=f&65535;break;case "PC":I(d,f);a.L=X(d.P);break;case "PS":Pc(d,f);break;case "PSW":Pc(d,f&255|d.ta&-256);d.i=f>>8;break;case "CF":d.ca=f?d.ca|256:d.ca&255;break;case "PF":f?$c(d)||(d.fa^=1):$c(d)&&(d.fa^=1);break;case "AF":d.ya=f?~d.fa&16|d.ya&-17:d.fa&16|d.ya&-17;break;case "ZF":d.ca=f?d.ca&-256:d.ca|255;break;case "SF":f?cd(d)||(d.fa^=192):cd(d)&&(d.fa^=192);break;
|
Mb)}}}else{if("d"==ta){for(ia in tb)if(f[1]==ia){var lg=a.Z[ia];lg?(f.shift(),f.shift(),lg(f)):a.i("no dump registered for "+ma);break a}ma||(ta=a.za||"db")}else a.za=ta;if("dh"==ta){var mg=ma,ng=La,og="",pg=0,Ma=a.T,Xa=a.D;if(Xa.length){var Aa=+mg||a.sa,ic=+ng||10;isNaN(Aa)?Aa=ic:og="more ";Aa>Xa.length&&(a.i("note: only "+Xa.length+" available"),Aa=Xa.length);Ma-=Aa;0>Ma&&(null==Xa[Xa.length-1].J?(Aa=Ma+Aa,Ma=0):Ma+=Xa.length);var le=[];"call"==ng&&(ic=1E5,le=["CALL"]);for(void 0!==mg&&a.i(Aa+" instructions earlier:");0<
|
||||||
case "IF":d.ta=f?d.ta|512:d.ta&-513;break;default:a.g("unknown register: "+e);return}pc(d);a.g("updated registers:")}a.g(Kf(a));c&&(a.L=X(d.P),Bf(a,Z(a.L.G)))}}function Rf(a,b){b=na(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(yf(a,c[2])):Be(a,b,!0)}function Sf(a,b,c){var d="t"!=b;c=De(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ga(c,function(){return hb(a,!0)&&a.ob(e,d,!1)},function(){pc(a.b);hb(a,!1)})}
|
ic&&Ma!=a.T;){var qg=Xa[Ma++];if(null==qg.J)break;var jc=Wf(qg.J),ni=Aa--,rg=ih(a,jc,"history",ni);(!le.length||0<=rg.indexOf(le[0]))&&a.i(rg);jc.Fb&&(Ma+=jc.Fb,ic-=jc.Fb,Aa-=jc.Fb);Ma>=Xa.length&&(Ma=0);a.sa=Aa;pg++;ic--}}pg||(a.i("no "+og+"history available"),a.sa=void 0)}else{var Xc=bg(a,ma);if(Xc){var Yc=0;La&&("l"==La.charAt(0)&&(La=La.substr(1)||dc),Yc=Pf(a,La)>>>0,65536<Yc&&(Yc=65536));for(var kc="",Zc="dd"==ta?4:"dw"==ta?2:1,$c=Zc*Yc||128,oi=$c+15>>4||1;oi--&&0<$c;){var ad=0,me=0,lc,ne="",
|
||||||
function Bf(a,b,c,d){if(b=Se(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=Se(a,c,!0);if(!d||d.G<b.G)return;e=d.G-b.G;if(256<e){a.g("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=ib(a,!1)||a.X?a.J:null;var g=null!=f?"cycles":null,h=Lf(a,b),k=b.G;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.g(m)}h[3]&&(g=h[3],f=null);f=Hf(a,b,g,f);a.g(f);a.L=b;e-=b.G-k;c++}}}
|
sg="",ma=hg(Xc.J);for(lc=16;0<lc&&0<$c;lc--){var bd=a.Ga(Xc,1),ad=ad|bd<<(me++<<3);me==Zc&&(ne+=n(ad,2*Zc),ne+=1==Zc?9==lc?"-":" ":" ",ad=me=0);sg+=32<=bd&&128>bd?String.fromCharCode(bd):".";$c--}kc&&(kc+="\n");kc+=ma+" "+ne+(lc?"":" "+sg)}kc&&a.i(kc);a.la=Xc}}}}break;case "e":if("else"==f[0])break;var cd=1,tg=255,ug=a.Ga,vg=a.Sb;"ew"==f[0]&&(cd=2,tg=65535,ug=a.Bb,vg=a.vc);var wg=cd<<1,xg=f[1];if(null==xg)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");
|
||||||
l.Jb=function(a,b,c){if(b)if(a){0>this.j&&this.u.length&&(this.j=0);if(0>this.j||a!=this.u[this.j])this.u.splice(0,0,a),this.j=0;this.j--}else this.O?a="end":a=this.u[this.j+1];b=[];if(a){a=a.toLowerCase().replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(na(a.substring(d,f))),d=f+1}}return b};
|
else{var dd=bg(a,xg);if(dd)for(var ed=2;ed<f.length;ed++){var mc=Nf(a,f[ed]);if(void 0===mc){a.i("unrecognized value: "+f[ed]);break}mc&~tg&&a.i("warning: "+n(mc)+" exceeds "+cd+"-byte value");var pi=ug.call(a,dd);a.i("changing "+hg(dd.J)+" from "+n(pi,wg,!0)+" to "+n(mc,wg,!0));vg.call(a,dd,mc,cd)}}break;case "f":Eh(a,f[1]);break;case "g":a:{var yg=f[1],qi=b;if(void 0!==yg){var oe=bg(a,yg,!0);if(!oe)break a;gg(a,oe,qi);a.Pa(a.j,oe,!0)}$g(a,!0)||c||a.i("cpu busy or unavailable, run command ignored")}break;
|
||||||
function Gf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.O&&(a.g("ended assemble at "+Z(a.ba.G)),a.L=a.ba,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ka=null;if(jb(a)&&0<b.length){a.O&&(b="a "+Z(a.ba.G)+" "+b);var f=b.replace(/ +/g," ").split(" ");if(f&&f.length)for(var g=f[0],h=g.charAt(0),k=1;k<g.length;k++){var m=g.charAt(k);if("?"==h||"r"==h||"a">m||"z"<m){f[0]=g.substr(k);f.unshift(g.substr(0,k));break}}switch(f[0].charAt(0)){case "a":var p=Se(a,f[1],!0);if(p)if(a.ba=
|
case "h":a:{var pe;if(a.G.ka)pe="halting",a.da();else{if(lb(a,!0))break a;pe="already halted"}c||a.i(pe)}break;case "i":if("if"==f[0]){var qe;var nc=b.substr(2),nc=oa(nc);Nf(a,nc)?(c||a.i("true: "+nc),qe=!0):(c||a.i("false: "+nc),qe=!1);qe||(d=!1);break}if("int"==f[0]){var fd;var ri=f[1];if(a.u.N&512){var re=Nf(a,ri);null==re?fd=!1:(a.i("requesting interrupt level "+re),Dd(a.u,re),fd=!0)}else a.i("interrupts disabled (use rif=1 to enable)"),fd=!1;fd||(d=!1);break}var se=f[1];if(se&&"?"!=se){var te=
|
||||||
p,void 0===f[2])a.g("begin assemble at "+Z(p.G)),a.O=!0,pc(a.b);else{var q;a.g("not supported yet");q=[];if(q.length){for(var y=0;y<q.length;y++)a.ua(p,q[y],1);a.g(Hf(a,a.ba))}}break;case "b":a:{var u=f[0],r=f[1],z=b;if("?"==r)a.g("breakpoint commands:"),a.g("\tbi [p]\ttoggle break on input port [p]"),a.g("\tbo [p]\ttoggle break on output port [p]"),a.g("\tbp [a]\tset exec breakpoint at addr [a]"),a.g("\tbr [a]\tset read breakpoint at addr [a]"),a.g("\tbw [a]\tset write breakpoint at addr [a]"),a.g("\tbc [a]\tclear breakpoint at addr [a]"),
|
Pf(a,se);if(void 0!==te){var si=Ob(a.H,te);a.i(q(te)+": "+ea(si))}}else a.i("input commands:"),a.i("\ti [p]\tread port [p]"),a.i("warning: port accesses can affect hardware state");break;case "k":var ti=f[0];if("?"==f[1])a.i("stack trace commands:"),a.i("\tk\tshow frame addresses"),a.i("\tks\tshow symbol information");else{var ue=0,zg=Wf(),oc=Wf(a.u.M);for(a.i("stack trace for "+hg(oc.J));10>ue;){for(var qb=null,ui=256;65536>oc.J>>>0;){zg.J=a.Bb(oc,2);if(null==oc.J||!ui--)break;for(var vi=a,gd=zg,
|
||||||
a.g("\tbl\tlist all breakpoints"),a.g("\tbn [n]\tbreak after [n] instruction(s)");else{var H=u.charAt(1);if("l"==H){var ha;ha=0+Ff(a,a.F);ha+=Ff(a,a.N);(ha+=Ff(a,a.B))||a.g("no breakpoints")}else if("n"==H)a.ia=De(a,r),a.g("break after "+a.ia+" instruction(s)");else if(void 0===r)a.g("missing breakpoint address");else{var C=X();if("*"!=r&&(C=Se(a,r,!0),!C))break a;r=v(C.G);"c"==H?null==C.G?(Je(a),a.g("all breakpoints cleared")):Df(a,a.F,C)||Df(a,a.N,C)||Df(a,a.B,C)||a.g("breakpoint missing: "+Z(C.G)):
|
Ag=null,pc=gd.J,Bg=pc,ve=1;6>=ve&&pc;ve++){if(2<ve){gd.J=pc;var hd=ih(vi,gd);if(0<=hd.indexOf("CALL")){var Cg=hd.indexOf(" ");if(pc+(hd.indexOf(" ",Cg+1)-Cg-1)/2==Bg){Ag=hd;break}}}pc--}gd.J=Bg;if(qb=Ag)break}if(!qb||null==qb)break;var Dg=null;if("ks"==ti){var Eg=qb.match(/[0-9A-F]+$/);Eg&&(Dg=Gh(a,Eg[0]))}qb=na(qb,50)+" ;"+(Dg||"stack="+hg(oc.J));a.i(qb);ue++}ue||a.i("no return addresses found")}break;case "l":"ln"==f[0]&&Gh(a,f[1],!0);break;case "m":a:{var Ya,Za=null,aa=f[1];"?"==aa&&(aa=void 0);
|
||||||
"i"==H?a.g("breakpoint "+(Cb(a.w,C.G)?"enabled":"cleared")+": port "+r+" (input)"):"o"==H?a.g("breakpoint "+(Hb(a.w,C.G)?"enabled":"cleared")+": port "+r+" (output)"):null!=C.G&&(vf(a,C,z),"p"==H?a.Za(a.F,C):"r"==H?a.Za(a.N,C):"w"==H?a.Za(a.B,C):a.g("unknown breakpoint command: "+H))}}}break;case "c":a.Ia&&(a.Ia.value="");break;case "d":a:{var U,ea=f[0],Y=f[1],va=f[2],Gb=f[3];if("?"==Y){var pb="";for(U in nb)a.va[U]&&(pb&&(pb+=","),pb+=U);pb+=",state,symbols";a.g("dump memory commands:");a.g("\tdb [a] [#] dump # bytes at address a");
|
if(void 0!==aa){var jb=0;if("all"==aa)jb=1878917119,aa=null;else if("on"==aa)Za=!0,aa=null;else if("off"==aa)Za=!1,aa=null;else{"keys"==aa&&(aa="key");"kbd"==aa&&(aa="keyboard");for(Ya in tb)if(aa==Ya){jb=tb[Ya];Za=!!(a.ha&jb);break}if(!jb){a.i("unknown message category: "+aa);break a}}if(jb)if("on"==f[2])a.ha|=jb,Za=!0;else if("off"==f[2]&&(a.ha&=~jb,Za=!1,1073741824==jb)){for(var we=0;we<a.X.length;we++)a.i(a.X[we]);a.X=[]}}var wi=0,qc="";for(Ya in tb)if(!aa||aa==Ya){var xi=!!(a.ha&tb[Ya]);if(null===
|
||||||
a.g("\tdw [a] [#] dump # words at address a");a.g("\tdd [a] [#] dump # dwords at address a");a.g("\tdh [#] [#] dump # instructions from history");pb.length&&a.g("dump extension commands:\n\t"+pb)}else if("state"==Y){var Ve=Tf(a.A,!0);"console"==va?console.log(Ve):(a.Ia&&(a.Ia.value=""),a.g(Ve))}else if("symbols"==Y)for(var md=0;md<a.D.length;md++){var nd=a.D[md],qb;for(qb in nd.Fa)if("."!=qb.charAt(0)){var We=nd.Fa[qb].o;if(void 0!==We){var Xe=nd.Fa[qb].l;Xe&&(qb=Xe);a.g(Z(We)+" "+qb)}}}else{if("d"==
|
Za||Za==xi)qc&&(qc+=","),++wi%10||(qc+="\n\t"),"key"==Ya&&(Ya="keys"),qc+=Ya}void 0===aa&&a.i("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.i((null!==Za?Za?"messages on: ":"messages off: ":"message categories:\n\t")+(qc||"none"));Yf(a)}break;case "o":var xe=f[1],yi=f[2];if(xe&&"?"!=xe){var ye=Pf(a,xe,"port #"),ze=Pf(a,yi);void 0!==ye&&void 0!==ze&&(Sb(a.H,ye,ze),a.i(q(ye)+": "+ea(ze)))}else a.i("output commands:"),a.i("\to [p] [b]\twrite byte [b] to port [p]"),a.i("warning: port accesses can affect hardware state");
|
||||||
ea){for(U in nb)if(f[1]==U){var Ye=a.va[U];Ye?(f.shift(),f.shift(),Ye(f)):a.g("no dump registered for "+Y);break a}Y||(ea=a.ub||"db")}else a.ub=ea;if("dh"==ea){var Ze=Y,$e=va,af="",bf=0,wa=a.ea,Ha=a.K;if(Ha.length){var ja=+Ze||a.hb,Kb=+$e||10;isNaN(ja)?ja=Kb:af="more ";ja>Ha.length&&(a.g("note: only "+Ha.length+" available"),ja=Ha.length);wa-=ja;0>wa&&(null==Ha[Ha.length-1].G?(ja=wa+ja,wa=0):wa+=Ha.length);var od=[];"call"==$e&&(Kb=1E5,od=["CALL"]);for(void 0!==Ze&&a.g(ja+" instructions earlier:");0<
|
break;case "p":if("print"==f[0]){Ih(a,b.substr(5));break}var Fg="pr"==f[0]?1:0,zi=1+Fg;if(a.M)a.i("step in progress");else{var Ae=Wf(a.u.j);switch(a.Ga(Ae)){case 205:a.M=zi,dg(Ae,3)}a.M?(a.Pa(a.j,Ae,!0),$g(a)||(a.S&&Hc(a.S),a.M=0)):Jh(a,Fg?"tr":"t")}break;case "r":if("reset"==b){a.S&&a.S.reset();break}bh(a,f);break;case "s":Hh(a,f);break;case "t":Jh(a,f[0],f[1]);break;case "u":ch(a,f[1],f[2],8);break;case "v":if("var"==f[0]){Fh(a,b.substr(3))||(d=!1);break}a.i("PC8080 version 1.31.1 ("+a.u.tb+",RELEASE"+
|
||||||
Kb&&wa!=a.ea;){var cf=Ha[wa++];if(null==cf.G)break;var Lb=X(cf.G),kg=ja--,df=Hf(a,Lb,"history",kg);(!od.length||0<=df.indexOf(od[0]))&&a.g(df);Lb.Rb&&(wa+=Lb.Rb,Kb-=Lb.Rb,ja-=Lb.Rb);wa>=Ha.length&&(wa=0);a.hb=ja;bf++;Kb--}}bf||(a.g("no "+af+"history available"),a.hb=void 0)}else{var rc=Se(a,Y);if(rc){var sc=0;va&&("l"==va.charAt(0)&&(va=va.substr(1)||Gb),sc=De(a,va)>>>0,65536<sc&&(sc=65536));for(var Mb="",tc="dd"==ea?4:"dw"==ea?2:1,uc=tc*sc||128,lg=uc+15>>4||1;lg--&&0<uc;){var vc=0,pd=0,Nb,qd="",
|
(rb?",TYPEDARRAYS":",LONGARRAYS")+")");a.i(xa());break;case "?":if(f[1]){Ih(a,b.substr(1));break}var Be="commands:",Ce;for(Ce in Lh)Be+="\n"+na(Ce,9)+Lh[Ce];Ed(a)||(Be+="\nnote: frequency/history disabled if no exec breakpoints");a.i(Be);break;default:a.i("unknown command: "+b),d=!1}}}catch(Hg){a.i("debugger error: "+(Hg.stack||Hg.message)),d=!1}return d}function zc(a,b,c){b=a.wb(b,c);for(var d in b)if(!hh(a,b[+d]))return!1;return!0}
|
||||||
ef="",Y=Z(rc.G);for(Nb=16;0<Nb&&0<uc;Nb--){var wc=a.Z(rc,1),vc=vc|wc<<(pd++<<3);pd==tc&&(qd+=t(vc,2*tc),qd+=1==tc?9==Nb?"-":" ":" ",vc=pd=0);ef+=32<=wc&&128>wc?String.fromCharCode(wc):".";uc--}Mb&&(Mb+="\n");Mb+=Y+" "+qd+(Nb?"":" "+ef)}Mb&&a.g(Mb);a.Va=rc}}}}break;case "e":if("else"==f[0])break;var xc=1,ff=255,gf=a.Z,hf=a.ua;"ew"==f[0]&&(xc=2,ff=65535,gf=a.ab,hf=a.Mb);var jf=xc<<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");
|
var Lh={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory",f:"frequencies","g [#]":"go [to #]",h:"halt","i [#]":"input port #","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages","o [#]":"output port #",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble",v:"print version","var":"assign variable"},
|
||||||
else{var yc=Se(a,kf);if(yc)for(var zc=2;zc<f.length;zc++){var Ob=Be(a,f[zc]);if(void 0===Ob){a.g("unrecognized value: "+f[zc]);break}Ob&~ff&&a.g("warning: "+t(Ob)+" exceeds "+xc+"-byte value");var mg=gf.call(a,yc);a.g("changing "+Z(yc.G)+" from "+t(mg,jf,!0)+" to "+t(Ob,jf,!0));hf.call(a,yc,Ob,xc)}}break;case "f":Nf(a,f[1]);break;case "g":a:{var lf=f[1],ng=b;if(void 0!==lf){var rd=Se(a,lf,!0);if(!rd)break a;vf(a,rd,ng);a.Za(a.F,rd,!0)}a.cb(!0)||c||a.g("cpu busy or unavailable, run command ignored")}break;
|
Vf=8080,jh=8086,kh="NONE ACI ADC ADD ADI ANA ANI CALL CC CM CNC CNZ CP CPE CPO CZ CMA CMC CMP CPI DAA DAD DCR DCX DI EI HLT IN INR INX JMP JC JM JNC JNZ JP JPE JPO JZ LDA LDAX LHLD LXI MOV MVI NOP ORA ORI OUT PCHL POP PUSH RAL RAR RET RC RM RNC RNZ RP RPE RPO RZ RLC RRC RST SBB SBI SHLD SPHL STA STAX STC SUB SUI XCHG XRA XRI XTHL".split(" "),lh="NONE ADC ADC ADD ADD AND AND CALL CALLC CALLS CALLNC CALLNZ CALLNS CALLP CALLNP CALLZ NOT CMC CMP CMP DAA ADD DEC DEC CLI STI HLT IN INC INC JMP JC JS JNC JNZ JNS JP JNP JZ MOV MOV MOV MOV MOV MOV NOP OR OR OUT JMP POP PUSH RCL RCR RET RETC RETS RETNC RETNZ RETNS RETP RETNP RETZ ROL ROR RST SBB SBB MOV MOV MOV MOV STC SUB SUB XCHG XOR XOR XCHG".split(" "),
|
||||||
case "h":a:{var sd;if(a.C.za)sd="halting",a.qa();else{if(ib(a,!0))break a;sd="already halted"}c||a.g(sd)}break;case "i":if("if"==f[0]){var td;var Pb=b.substr(2),Pb=na(Pb);Be(a,Pb)?(c||a.g("true: "+Pb),td=!0):(c||a.g("false: "+Pb),td=!1);td||(d=!1);break}if("int"==f[0]){var Ac;var og=f[1];if(a.b.ta&512){var ud=Be(a,og);null==ud?Ac=!1:(a.g("requesting interrupt level "+ud),Gd(a.b,ud),Ac=!0)}else a.g("interrupts disabled (use rif=1 to enable)"),Ac=!1;Ac||(d=!1);break}var vd=f[1];if(vd&&"?"!=vd){var wd=
|
Kg=0,Lg=1,Mg=2,Ng=3,Og=4,Pg=5,Qg=6,Jg=7,Rg=8,Sg=9,Tg=10,Ug=11,Vg=12,Wg=13,Xg=14,Gg="B C D E H L M A BC DE HL SP PC PS PSW".split(" "),oh=15,nh=240,wh=3840,ph=61440,mh=0,Q=1,sh=2,th=3,vh=16,P=32,uh=64,xh=128,R=Jg<<8|vh|Q,T=Kg<<8|vh|Q,U=Lg<<8|vh|Q,V=Mg<<8|vh|Q,W=Ng<<8|vh|Q,X=Og<<8|vh|Q,Y=Pg<<8|vh|Q,Z=Qg<<8|vh|Q|uh,Mh=Rg<<8|vh|th,Nh=Sg<<8|vh|th,Oh=Tg<<8|vh|th,Ph=Ug<<8|vh|th,Qh=Xg<<8|vh|th,rh=4096,qh=8192,O=16384,yh=32768,$f=[[45],[42,Mh,P],[71,Mh|uh,R|O],[29,Mh],[28,T],[22,T],[44,T,P],[63],[45,yh],[21,
|
||||||
De(a,vd);if(void 0!==wd){var pg=Eb(a.w,wd);a.g(v(wd)+": "+ca(pg))}}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 qg=f[0];if("?"==f[1])a.g("stack trace commands:"),a.g("\tk\tshow frame addresses"),a.g("\tks\tshow symbol information");else{var xd=0,mf=X(),Qb=X(a.b.oa);for(a.g("stack trace for "+Z(Qb.G));10>xd;){for(var $a=null,rg=256;65536>Qb.G>>>0;){mf.G=a.ab(Qb,2);if(null==Qb.G||!rg--)break;for(var sg=a,Bc=mf,nf=
|
Oh|O,Mh],[40,R|O,Mh|uh],[23,Mh],[28,U],[22,U],[44,U,P],[64],[45,yh],[42,Nh,P],[71,Nh|uh,R|O],[29,Nh],[28,V],[22,V],[44,V,P],[52],[45,yh],[21,Oh|O,Nh],[40,R|O,Nh|uh],[23,Nh],[28,W],[22,W],[44,W,P],[53],[45,yh],[42,Oh,P],[68,51|uh,Oh|O],[29,Oh],[28,X],[22,X],[44,X,P],[20],[45,yh],[21,Oh|O,Oh],[41,Oh|O,51|uh],[23,Oh],[28,Y],[22,Y],[44,Y,P],[16,R|O],[45,yh],[42,Ph,P],[70,51|uh,R|O],[29,Ph],[28,Z],[22,Z],[44,Z,P],[72],[45,yh],[21,Oh|O,Ph],[39,R|O,51|uh],[23,Ph],[28,R],[22,R],[44,R,P],[17],[43,T,T],[43,
|
||||||
null,Rb=Bc.G,of=Rb,yd=1;6>=yd&&Rb;yd++){if(2<yd){Bc.G=Rb;var Cc=Hf(sg,Bc);if(0<=Cc.indexOf("CALL")){var pf=Cc.indexOf(" ");if(Rb+(Cc.indexOf(" ",pf+1)-pf-1)/2==of){nf=Cc;break}}}Rb--}Bc.G=of;if($a=nf)break}if(!$a||null==$a)break;var qf=null;if("ks"==qg){var rf=$a.match(/[0-9A-F]+$/);rf&&(qf=Pf(a,rf[0]))}$a=ma($a,50)+" ;"+(qf||"stack="+Z(Qb.G));a.g($a);xd++}xd||a.g("no return addresses found")}break;case "l":"ln"==f[0]&&Pf(a,f[1],!0);break;case "m":a:{var Ia,Ja=null,O=f[1];"?"==O&&(O=void 0);if(void 0!==
|
T,U],[43,T,V],[43,T,W],[43,T,X],[43,T,Y],[43,T,Z],[43,T,R],[43,U,T],[43,U,U],[43,U,V],[43,U,W],[43,U,X],[43,U,Y],[43,U,Z],[43,U,R],[43,V,T],[43,V,U],[43,V,V],[43,V,W],[43,V,X],[43,V,Y],[43,V,Z],[43,V,R],[43,W,T],[43,W,U],[43,W,V],[43,W,W],[43,W,X],[43,W,Y],[43,W,Z],[43,W,R],[43,X,T],[43,X,U],[43,X,V],[43,X,W],[43,X,X],[43,X,Y],[43,X,Z],[43,X,R],[43,Y,T],[43,Y,U],[43,Y,V],[43,Y,W],[43,Y,X],[43,Y,Y],[43,Y,Z],[43,Y,R],[43,Z,T],[43,Z,U],[43,Z,V],[43,Z,W],[43,Z,X],[43,Z,Y],[26],[43,Z,R],[43,R,T],[43,R,
|
||||||
O){var Sa=0;if("all"==O)Sa=1878917119,O=null;else if("on"==O)Ja=!0,O=null;else if("off"==O)Ja=!1,O=null;else{"keys"==O&&(O="key");"kbd"==O&&(O="keyboard");for(Ia in nb)if(O==Ia){Sa=nb[Ia];Ja=!!(a.sa&Sa);break}if(!Sa){a.g("unknown message category: "+O);break a}}if(Sa)if("on"==f[2])a.sa|=Sa,Ja=!0;else if("off"==f[2]&&(a.sa&=~Sa,Ja=!1,1073741824==Sa)){for(var zd=0;zd<a.la.length;zd++)a.g(a.la[zd]);a.la=[]}}var tg=0,Sb="";for(Ia in nb)if(!O||O==Ia){var ug=!!(a.sa&nb[Ia]);if(null===Ja||Ja==ug)Sb&&(Sb+=
|
U],[43,R,V],[43,R,W],[43,R,X],[43,R,Y],[43,R,Z],[43,R,R],[3,R|O,T],[3,R|O,U],[3,R|O,V],[3,R|O,W],[3,R|O,X],[3,R|O,Y],[3,R|O,Z],[3,R|O,R],[2,R|O,T],[2,R|O,U],[2,R|O,V],[2,R|O,W],[2,R|O,X],[2,R|O,Y],[2,R|O,Z],[2,R|O,R],[73,R|O,T],[73,R|O,U],[73,R|O,V],[73,R|O,W],[73,R|O,X],[73,R|O,Y],[73,R|O,Z],[73,R|O,R],[66,R|O,T],[66,R|O,U],[66,R|O,V],[66,R|O,W],[66,R|O,X],[66,R|O,Y],[66,R|O,Z],[66,R|O,R],[5,R|O,T],[5,R|O,U],[5,R|O,V],[5,R|O,W],[5,R|O,X],[5,R|O,Y],[5,R|O,Z],[5,R|O,R],[76,R|O,T],[76,R|O,U],[76,R|
|
||||||
","),++tg%10||(Sb+="\n\t"),"key"==Ia&&(Ia="keys"),Sb+=Ia}void 0===O&&a.g("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.g((null!==Ja?Ja?"messages on: ":"messages off: ":"message categories:\n\t")+(Sb||"none"));Ke(a)}break;case "o":var Ad=f[1],vg=f[2];if(Ad&&"?"!=Ad){var Bd=De(a,Ad,"port #"),Cd=De(a,vg);void 0!==Bd&&void 0!==Cd&&(Jb(a.w,Bd,Cd),a.g(v(Bd)+": "+ca(Cd)))}else a.g("output commands:"),a.g("\to [p] [b]\twrite byte [b] to port [p]"),a.g("warning: port accesses can affect hardware state");
|
O,V],[76,R|O,W],[76,R|O,X],[76,R|O,Y],[76,R|O,Z],[76,R|O,R],[46,R|O,T],[46,R|O,U],[46,R|O,V],[46,R|O,W],[46,R|O,X],[46,R|O,Y],[46,R|O,Z],[46,R|O,R],[18,R|O,T],[18,R|O,U],[18,R|O,V],[18,R|O,W],[18,R|O,X],[18,R|O,Y],[18,R|O,Z],[18,R|O,R],[58],[50,Mh],[34,51],[30,51],[11,51],[51,Mh],[4,R|O,P|Q],[65,xh],[62],[54],[38,51],[30,51|yh],[15,51],[7,51],[1,R|O,P|Q],[65,xh],[57],[50,Nh],[33,51],[48,P|Q,R|O],[10,51],[51,Nh],[74,R|O,P|Q],[65,xh],[55],[54,yh],[31,51],[27,R|O,P|Q],[8,51],[7,51|yh],[67,R|O,P|Q],[65,
|
||||||
break;case "p":if("print"==f[0]){Rf(a,b.substr(5));break}var sf="pr"==f[0]?1:0,wg=1+sf;if(a.X)a.g("step in progress");else{var Dd=X(a.b.P);switch(a.Z(Dd)){case 205:a.X=wg,Te(Dd,3)}a.X?(a.Za(a.F,Dd,!0),a.cb()||(a.A&&a.A.Bb(),a.X=0)):Sf(a,sf?"tr":"t")}break;case "r":if("reset"==b){a.A&&a.A.reset();break}Af(a,f);break;case "s":Qf(a,f);break;case "t":Sf(a,f[0],f[1]);break;case "u":Bf(a,f[1],f[2],8);break;case "v":if("var"==f[0]){Of(a,b.substr(3))||(d=!1);break}a.g("PC8080 version 1.31.1 ("+a.b.ae+",RELEASE"+
|
xh],[61],[50,Oh],[37,51],[78,Ph|uh|O,Oh|O],[14,51],[51,Oh],[6,R|O,P|Q],[65,xh],[60],[49,Oh],[36,51],[75,Oh|O,Nh|O],[13,51],[7,51|yh],[77,R|O,P|Q],[65,xh],[59],[50,Qh],[35,51],[24],[12,51],[51,Qh],[47,R|O,P|Q],[65,xh],[56],[69,Ph|O,Oh|O],[32,51],[25],[9,51],[7,51|yh],[19,R|O,P|Q],[65,xh]],Zg=1E3;Na(function(){for(var a=gb(document,"pc8080","debugger"),b=0;b<a.length;b++){var c=a[b],d=eb(c),d=new Uf(d);fb(d,c)}});
|
||||||
(lb?",TYPEDARRAYS":",LONGARRAYS")+")");a.g(xa());break;case "?":if(f[1]){Rf(a,b.substr(1));break}var Ed="commands:",Fd;for(Fd in Me)Ed+="\n"+ma(Fd,9)+Me[Fd];Hd(a)||(Ed+="\nnote: frequency/history disabled if no exec breakpoints");a.g(Ed);break;default:a.g("unknown command: "+b),d=!1}}}catch(tf){a.g("debugger error: "+(tf.stack||tf.message)),d=!1}return d}function oc(a,b,c){b=a.Jb(b,c);for(var d in b)if(!Gf(a,b[+d]))return!1;return!0}
|
function Rh(a,b,c){x.call(this,"Computer",a,0,67108864);this.G.ja=!1;Sh(this,b);this.L=vc(this,"autoPower",a);this.j=0;this.T=a.busWidth||a.buswidth;this.b=Th;this.F=null;this.C=this.O=!1;this.U=vc(this,"url")||"";(Math.random()+.1).toString(36);this.g=Uh(this);if(this.u=db("CPU",this.id)){this.K=db("Debugger",this.id);this.A=[];for(b=null;b=vb(this,"Video",b);)this.A.push(b);this.H=new xb({id:this.ab+".bus",busWidth:this.T},this.u,this.K);var d,e=bb(this.id);if((this.B=db("Panel",this.id))&&this.B.ta)for(b=
|
||||||
Qa(function(){for(var a=D(document,"pc8080","debugger"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new He(d);db(d,c)}});
|
0;b<e.length;b++)d=e[b],d.aa=this.B.aa,d.i=this.B.i,d.ta=this.B.ta;this.i("PC8080 v1.31.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.Ea&&d.Ea(this,this.H,this.u,this.K);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.D=d:this.b=parseInt(d,10));var f;if(a=vc(this,"state")||(f=!0,a.state))b=this.M=a,f||(this.C=!0,this.b=Th),this.b&&(this.I=new Vc(this,"1.31.1"),Vh(this.I)?b=null:delete this.I);
|
||||||
function Uf(a,b,c){x.call(this,"Computer",a,Uf,67108864);this.C.xa=!1;Vf(this,b);this.N=lc(this,"autoPower",a);this.u=0;this.da=a.busWidth||a.buswidth;this.A=Wf;this.K=null;this.I=this.aa=!1;this.ea=lc(this,"url")||"";(Math.random()+.1).toString(36);this.j=Xf(this);if(this.b=cb("CPU",this.id)){this.H=cb("Debugger",this.id);this.D=[];for(b=null;b=rb(this,"Video",b);)this.D.push(b);this.w=new tb({id:this.gb+".bus",busWidth:this.da},this.b,this.H);var d,e=ab(this.id);if((this.F=cb("Panel",this.id))&&
|
!b&&this.b&&(b=Wh(this))&&(this.C=!0);if(b){var g=this;va(b,null,!0,function(a,b,c){c?(g.D=null,g.C=!1,g.aa("Unable to load machine state from server (error "+c+(b?": "+oa(b):"")+")")):(g.F=b,g.O=!0);kb(g)})}else kb(this);this.P.power||(this.L=!0);!c&&this.L&&Xh(this,this.kb)}else v("Unable to find CPU component")}ba(Rh,x);function Sh(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){v(d.message+" ("+c+")")}}a.R=b}
|
||||||
this.F.Ia)for(b=0;b<e.length;b++)d=e[b],d.ja=this.F.ja,d.g=this.F.g,d.Ia=this.F.Ia;this.g("PC8080 v1.31.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.Qa&&d.Qa(this,this.w,this.b,this.H);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.J=d:this.A=parseInt(d,10));var f;if(a=lc(this,"state")||(f=!0,a.state))b=this.O=a,f||(this.I=!0,this.A=Wf),this.A&&(this.L=new Sc(this,"1.31.1"),Yf(this.L)?
|
function vc(a,b,c){var d=b.toLowerCase(),d=Ga(b)||Ga(d);void 0===d&&a.R&&(d=a.R[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Xh(a,b,c){for(var d=bb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!ib(f)){ib(f,function(){Xh(a,b,c)});return}}b.call(a,c)}
|
||||||
b=null:delete this.L);!b&&this.A&&(b=Zf(this))&&(this.I=!0);if(b){var g=this;ta(b,null,!0,function(a,b,c){c?(g.J=null,g.I=!1,g.ja("Unable to load machine state from server (error "+c+(b?": "+na(b):"")+")")):(g.K=b,g.aa=!0);F(g)})}else F(this);this.M.power||(this.N=!0);!c&&this.N&&$f(this,this.zb)}else w("Unable to find CPU component")}A(Uf);var Wf=0;function Vf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){w(d.message+" ("+c+")")}}a.ba=b}
|
function Yh(a,b){var c=new Vc(a,"1.31.1",Zh);if(Vh(c)&&$h(c)){var d=c.get(ai),e=b?b.get(ai):"unknown";d!=e&&(a.aa("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Rh.prototype;
|
||||||
function lc(a,b,c){var d=b.toLowerCase(),d=Ea(b)||Ea(d);void 0===d&&a.ba&&(d=a.ba[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function $f(a,b,c){for(var d=ab(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!jb(f)){jb(f,function(){$f(a,b,c)});return}}b.call(a,c)}
|
k.kb=function(a){void 0===a&&(a=this.b||(this.F?bi:Th));if(!this.j){this.j++;var b=!1,c=!1;this.N=!1;var d=this.I||new Vc(this,"1.31.1");if(a==ci)b=!0;else if(a>Th){if(Vh(d,this.F)){this.w=new Vc(this,"1.31.1",di);Vh(this.w)&&(ei(this,d),a=fi,gi(this.w));this.w.set(ai,sa());hi(this.w);var e=this.b&&!this.C;if(a==bi||za("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=$h(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Vh(d,g):("error"==f&&"no machine state"!=
|
||||||
function ag(a,b){var c=new Sc(a,"1.31.1","validate");if(Yf(c)&&bg(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.ja("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}l=Uf.prototype;
|
g?(this.aa("Error: "+g),"unable to verify user"==g&&(Ea(ii,""),this.g=null)):this.i(f+": "+g),gi(d),Vh(d)?(c=$h(d),e=!0):c=!1))}e&&Yh(this,c?d:null)}else a==fi&&d.clear()}else Yh(this);delete this.F;delete this.I}e=bb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.u&&(c=ji(this,g,d,b,c));b=[d,a,c];a!=ci?Xh(this,this.fc,b):this.fc(b)}};
|
||||||
l.zb=function(a){void 0===a&&(a=this.A||(this.K?1:Wf));if(!this.u){this.u++;var b=!1,c=!1;this.X=!1;var d=this.L||new Sc(this,"1.31.1");if(-1==a)b=!0;else if(a>Wf){if(Yf(d,this.K)){this.B=new Sc(this,"1.31.1","failsafe");Yf(this.B)&&(cg(this,d),a=2,dg(this.B));this.B.set("timestamp",ra());eg(this.B);var e=this.A&&!this.I;if(1==a||ya("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=bg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Yf(d,g):("error"==
|
function ji(a,b,c,d,e){if(!b.G.ja){b.G.ja=!0;if(b.ua){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.ua(f,d)&&f&&(v("Unable to restore state for "+b.type),a.M&&!a.O?(c.clear(),a.b=Th,window&&window.location.reload()):a.N=!0,b.ua(null),e=!1)}if(!d&&b.bc)for(a=b.bc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||||
f&&"no machine state"!=g?(this.ja("Error: "+g),"unable to verify user"==g&&(Ca("user",""),this.j=null)):this.g(f+": "+g),dg(d),Yf(d)?(c=bg(d),e=!0):c=!1))}e&&ag(this,c?d:null)}else 2==a&&d.clear()}else ag(this);delete this.K;delete this.L}e=ab(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=fg(this,g,d,b,c));b=[d,a,c];-1!=a?$f(this,this.Bc,b):this.Bc(b)}};
|
k.fc=function(a){var b=a[0],c=0>a[1];a=a[2];this.W=!0;this.G.ja=!0;var d=this.P.power;d&&(d.textContent="Shutdown");this.u&&(ji(this,this.u,b,c,a),this.u.ib());this.N&&(ei(this,b),b.clear());!c&&this.w&&(this.w.clear(),delete this.w);this.j=0};
|
||||||
function fg(a,b,c,d,e){if(!b.C.xa){b.C.xa=!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&&(w("Unable to restore state for "+b.type),a.O&&!a.aa?(c.clear(),a.A=Wf,window&&window.location.reload()):a.X=!0,b.Ga(null),e=!1)}if(!d&&b.jc)for(a=b.jc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
function ei(a,b){if(za("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.g||"";b=b.toString();var d={app:"PC8080",ver:"1.31.1"};d.url=a.U;d.user=c;d.type="bug";d.data=b;va("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||||
l.Bc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ga=!0;this.C.xa=!0;var d=this.M.power;d&&(d.textContent="Shutdown");this.b&&(fg(this,this.b,b,c,a),this.b.vb());this.X&&(cg(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.u=0};
|
function Kh(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new Vc(a,"1.31.1"),g=new Vc(a,"1.31.1",Zh),h=sa();g.set(ai,h);f.set(ai,h);f.set(ki,"1.31.1");f.set(li,window?window.location.href:null);f.set(mi,xa());a.u&&a.u.wa&&(c&&a.u.da(),d=a.u.wa(b,c),"object"===typeof d&&f.set(a.u.id,d),c&&(a.u.G.ja=!1,!1===d&&(e=null)));for(var h=bb(a.id),l=0;l<h.length;l++){var p=h[l];p.G.ja&&(p.wa&&(d=p.wa(b,c),"object"===typeof d&&f.set(p.id,d)),c&&(p.G.ja=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&Ai(a,
|
||||||
function cg(a,b){if(ya("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.j||"";b=b.toString();var d={app:"PC8080",ver:"1.31.1"};d.url=a.ea;d.user=c;d.type="bug";d.data=b;ta("http://www.pcjs.org/api/v1/report",d,!0)}}
|
a.g,f.toString()),hi(g)&&hi(f)||(e=null,d=h=!0)):a.b&&(d=!0,h=a.b==Bi),d&&f.clear(h)):e=f.toString());c&&(a.G.ja=!1,b=a.P.power)&&(b.textContent="Power");a.j=0;return e}k.reset=function(){this.H&&this.H.reset&&(ob(this,"Resetting "+this.H.type),this.H.reset());for(var a=bb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.H&&c.reset&&(ob(this,"Resetting "+c.type),c.reset())}};
|
||||||
function Tf(a,b,c){var d,e="none";if(a.u)return null;a.u--;var f=new Sc(a,"1.31.1"),g=new Sc(a,"1.31.1","validate"),h=ra();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.31.1");f.set("url",window?window.location.href:null);f.set("browser",xa());a.b&&a.b.Ka&&(c&&a.b.qa(),d=a.b.Ka(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.C.xa=!1,!1===d&&(e=null)));for(var h=ab(a.id),k=0;k<h.length;k++){var m=h[k];m.C.xa&&(m.Ka&&(d=m.Ka(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.C.xa=!1,!1===
|
k.start=function(a,b){for(var c=bb(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=bb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
||||||
d&&(e=null)))}e&&(c?(h=d=!1,b?(a.j&&gg(a,a.j,f.toString()),eg(g)&&eg(f)||(e=null,d=h=!0)):a.A&&(d=!0,h=3==a.A),d&&f.clear(h)):e=f.toString());c&&(a.C.xa=!1,b=a.M.power)&&(b.textContent="Power");a.u=0;return e}l.reset=function(){this.w&&this.w.reset&&(fb(this,"Resetting "+this.w.type),this.w.reset());for(var a=ab(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.w&&c.reset&&(fb(this,"Resetting "+c.type),c.reset())}};
|
k.ca=function(a,b,c){var d=this;switch(b){case "power":return this.P[b]=c,c.onclick=function(){d.j||(d.G.ja?Kh(d,!1,!0):Xh(d,d.kb))},!0;case "reset":return this.P[b]=c,c.onclick=function(){if(d.G.ja&&!d.j)if(d.b&&!d.D){var a=za("Click OK to save changes to this PC8080 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Kh(d,a,!0);!a&&d.M?window&&window.location.reload():d.kb(Th)}else d.reset(),d.u&&d.u.ib()},!0;case "save":if(ha())c.parentNode.removeChild(c);else return this.P[b]=
|
||||||
l.start=function(a,b){for(var c=ab(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};l.stop=function(a,b){for(var c=ab(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
c,c.onclick=function(){var a=Uh(d,!0);if(a){var b=!!(d.b&&!d.D||d.M),c=Kh(d,b);b?Ai(d,a,c):d.aa("Resume disabled, machine state not saved")}},!0}return!1};
|
||||||
l.pa=function(a,b,c){var d=this;switch(b){case "power":return this.M[b]=c,c.onclick=function(){d.u||(d.C.xa?Tf(d,!1,!0):$f(d,d.zb))},!0;case "reset":return this.M[b]=c,c.onclick=function(){if(d.C.xa&&!d.u)if(d.A&&!d.J){var a=ya("Click OK to save changes to this PC8080 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Tf(d,a,!0);!a&&d.O?window&&window.location.reload():d.zb(Wf)}else d.reset(),d.b&&d.b.vb()},!0;case "save":if(ga())c.parentNode.removeChild(c);else return this.M[b]=
|
function Uh(a,b){var c=a.g;c||((c=Da(ii),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=Ci(a,c))||a.aa("The user ID is invalid.")):b&&a.aa("Browser local storage is not available"));return c}
|
||||||
c,c.onclick=function(){var a=Xf(d,!0);if(a){var b=!!(d.A&&!d.J||d.O),c=Tf(d,b);b?gg(d,a,c):d.ja("Resume disabled, machine state not saved")}},!0}return!1};
|
function Ci(a,b){a.g=null;b=va(ja()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ea(ii,b.data),a.g=b.data)}catch(d){v(d.message+" ("+c+")")}return a.g}function Wh(a){var b=null;a.g&&(b=ja()+"/api/v1/user?req=load&user="+a.g+"&state="+Di(a,"1.31.1"));return b}
|
||||||
function Xf(a,b){var c=a.j;c||((c=Ba("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=hg(a,c))||a.ja("The user ID is invalid.")):b&&a.ja("Browser local storage is not available"));return c}
|
function Ai(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Di(a,"1.31.1");d.data=c;b=va(ja()+"/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.aa("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.aa(c),Ea(ii,""),a.g=null)}}
|
||||||
function hg(a,b){a.j=null;b=ta(ia()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ca("user",b.data),a.j=b.data)}catch(d){w(d.message+" ("+c+")")}return a.j}function Zf(a){var b=null;a.j&&(b=ia()+"/api/v1/user?req=load&user="+a.j+"&state="+ig(a,"1.31.1"));return b}
|
function vb(a,b,c){a=bb(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 Hc(a,b){if(a.A.length){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a=a.A[0];a.V&&a.V.focus();!b&&window&&window.scrollTo(c,d)}}
|
||||||
function gg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=ig(a,"1.31.1");d.data=c;b=ta(ia()+"/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.ja("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.ja(c),Ca("user",""),a.j=null)}}
|
function Lc(a,b){a.u&&(a=a.u,a.fb&&(b||!a.G.ka||a.G.ec)&&(J(a,"A",a.g),J(a,"B",a.w),J(a,"C",a.A),J(a,"BC",Wc(a),4),J(a,"D",a.B),J(a,"E",a.C),J(a,"DE",jd(a),4),J(a,"H",a.D),J(a,"L",a.F),J(a,"HL",D(a),4),J(a,"SP",a.M,4),J(a,"PC",a.j,4),b=Uc(a),J(a,"PS",b,4),J(a,"IF",b&512?1:0,1),J(a,"SF",b&128?1:0,1),J(a,"ZF",b&64?1:0,1),J(a,"AF",b&16?1:0,1),J(a,"PF",b&4?1:0,1),J(a,"CF",b&1?1:0,1)),b=a.P.speed)&&(b.textContent=a.G.ka&&a.Y?a.Y.toFixed(2)+"Mhz":"Stopped")}
|
||||||
function rb(a,b,c){a=ab(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}l.Bb=function(a){if(this.D.length){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);var d=this.D[0];d.ka&&d.ka.focus();!a&&window&&window.scrollTo(b,c)}};l.Aa=function(a){this.b&&this.b.Aa(a);this.F&&this.F.Aa(a)};
|
var di="failsafe",Zh="validate",ai="timestamp",ki="version",li="url",mi="browser",ii="user",ci=-1,Th=0,bi=1,fi=2,Bi=3;Na(function(){for(var a=gb(document,"pc8080-machine"),b=0;b<a.length;b++)for(var c=a[b],d=eb(c),c=gb(c,"pc8080","computer"),e=0;e<c.length;e++){var f=c[e],g=eb(f),g=new Rh(g,d,!0);fb(g,f);g.L&&Xh(g,g.kb)}});Oa.show.push(function(){for(var a=gb(document,"pc8080","computer"),b=0;b<a.length;b++){var c=eb(a[b]);(c=db("Computer",c.id))&&c.W&&!c.G.ja&&c.kb(ci)}});
|
||||||
Qa(function(){for(var a=D(document,"pc8080-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=D(c,"pc8080","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new Uf(g,d,!0);db(g,f);g.N&&$f(g,g.zb)}});La.show.push(function(){for(var a=D(document,"pc8080","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=cb("Computer",c.id))&&c.ga&&!c.C.xa&&c.zb(-1)}});
|
Oa.exit.push(function(){for(var a=gb(document,"pc8080","computer"),b=0;b<a.length;b++){var c=eb(a[b]);(c=db("Computer",c.id))&&c.G.ja&&Kh(c,!(!c.b||c.D),!0)}});function Vc(a,b,c){this.id=a.id;this.K=a.K;this.g="";this.b={};this.u=this.H=!1;this.key=Di(a,b,c);gi(this,a.wd)}k=Vc.prototype;k.set=function(a,b){try{this.b[a]=b}catch(c){}};k.get=function(a){return this.b[a]||null};k.data=function(){return this.b};
|
||||||
La.exit.push(function(){for(var a=D(document,"pc8080","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=cb("Computer",c.id))&&c.C.xa&&Tf(c,!(!c.A||c.J),!0)}});function Sc(a,b,c){this.id=a.id;this.key=ig(a,b,c);this.H=a.H;dg(this,a.Qd)}function ig(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}
|
function Vh(a,b){return b?(a.g=b,a.u=!0,a.H=!1,!0):a.u?!0:Ba()&&(b=Da(a.key))?(a.g=b,a.u=!0):!1}function $h(a){var b=!0;if(!a.H)try{a.b=JSON.parse(a.g),a.H=!0}catch(c){v(c.message||c),b=!1}return b}function hi(a){var b=!0;if(Ba()){var c=JSON.stringify(a.b);Ea(a.key,c)||(v("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}k.toString=function(){return this.b?JSON.stringify(this.b):this.g};function gi(a,b){a.g="";a.b={};a.u=a.H=!1;b&&a.set("parms",b)}
|
||||||
Sc.prototype={constructor:Sc,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){dg(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,
|
k.clear=function(a){gi(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 Di(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}var Ei=0;
|
||||||
1);c=0}}};function dg(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function eg(a){var b=!0;if(Aa()){var c=JSON.stringify(a[a.id]);Ca(a.key,c)||(w("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function bg(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){w(c.message||c),b=!1}return b}function Yf(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Aa()&&(b=Ba(a.key))?(a[a.id]=b,a.b=!0):!1}var jg=0;
|
function Fi(a,b,c,d,e,f){e("Loading "+a+"...");va(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):Gi(h,a,b,c,d,e,f)})}
|
||||||
function xg(a,b,c,d,e,f){e("Loading "+a+"...");ta(a,null,!0,function(g,h,k){k?(h||(h="unable to load "+a+" ("+k+")"),f(h,null)):yg(h,a,b,c,d,e,f)})}
|
function Gi(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&($a(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>)/,"$1PC8080$2"),
|
||||||
function yg(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(Za(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>)/,"$1PC8080$2"),
|
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$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(r){f=null,a=r.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Hi(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),
|
||||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$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(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?zg(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),
|
|
||||||
null)}
|
null)}
|
||||||
function zg(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");ta(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 k=h[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)k=0>k.indexOf(m[1])?k.replace(">",m[0]+">"):k.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=k&&(g=g.replace(h[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,"");
|
function Hi(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");va(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],p,r=/( [a-z]+=)(['"])(.*?)\2/g;p=r.exec(f);)l=0>l.indexOf(p[1])?l.replace(">",p[0]+">"):l.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[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);zg(a,b,c)}})}else c(a,null)}
|
a=a.replace(d[0],g);Hi(a,b,c)}})}else c(a,null)}
|
||||||
function Ag(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=la(a))}function f(a){e("Error: "+a);k&&(--jg||Ua(!0));k=!1}var g,h,k=!0;jg++;Ya[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=m:q.appendChild(document.createTextNode(m));p.appendChild(q)}c||
|
function Ii(a,b,c,d){function e(a){if(void 0===h){var b=g&&gb(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ka(a))}function f(a){e("Error: "+a);l&&(--Ei||Sa(!0));l=!1}var g,h,l=!0;Ei++;ab[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var r=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=p:t.appendChild(document.createTextNode(p));r.appendChild(t)}c||
|
||||||
(c="/versions/pc8080/1.31.1/components.xsl");m=function(d,h){h?xg(c,null,null,!1,e,function(d,k){k?(Za(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(k=h.transformNode(k))?(g.outerHTML=k,--jg||Ua(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(k),(k=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(k,g),--jg||Ua(!0)):f("invalid machine element: "+
|
(c="/versions/pc8080/1.31.1/components.xsl");p=function(d,h){h?Fi(c,null,null,!1,e,function(d,l){l?($a(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Ei||Sa(!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),--Ei||Sa(!0)):f("invalid machine element: "+
|
||||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?xg(b,a,d,!0,e,m):yg(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(y){f(y.message)}return k}window.embedPC8080=function(a,b,c,d){Ua(!1);return Ag(a,b,c,d)};window.enableEvents=Ua;window.sendEvent=Va;})();
|
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Fi(b,a,d,!0,e,p):Gi(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(A){f(A.message)}return l}window.embedPC8080=function(a,b,c,d){Sa(!1);return Ii(a,b,c,d)};window.enableEvents=Sa;window.sendEvent=Ua;})();
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,17 @@
|
||||||
(function(){/*
|
(function(){/*
|
||||||
http://pcjs.org/modules/shared/lib/dumpapi.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/dumpapi.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/reportapi.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/reportapi.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/userapi.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/userapi.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/keys.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/keys.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/strlib.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/strlib.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/usrlib.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/weblib.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/weblib.js (C) Jeff Parsons 2012-2016
|
|
||||||
http://pcjs.org/modules/pc8080/lib/cpudef.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/cpudef.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/messages.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/messages.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/debugger.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/state.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/debugger.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/embed.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/embed.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/defines.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/defines.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/usrlib.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/component.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/shared/es6/component.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/defines.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/defines.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/panel.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/panel.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/bus.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/bus.js (C) Jeff Parsons 2012-2016
|
||||||
|
|
@ -26,181 +25,183 @@
|
||||||
http://pcjs.org/modules/pc8080/lib/keyboard.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/keyboard.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/video.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/video.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/serialport.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/serialport.js (C) Jeff Parsons 2012-2016
|
||||||
|
http://pcjs.org/modules/shared/es6/debugger.js (C) Jeff Parsons 2012-2016
|
||||||
|
http://pcjs.org/modules/pc8080/lib/debugger.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/pc8080/lib/computer.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pc8080/lib/computer.js (C) Jeff Parsons 2012-2016
|
||||||
http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016
|
|
||||||
*/
|
*/
|
||||||
var l,m={ud:0,xd:1,yd:2,zd:3,Ad:4,Bd:5,Cd:6,Dd:7,Ed:8,Fd:9,Gd:10,Hd:11,Id:12,Jd:13,Kd:14,Ld:15,Md:16,Nd:17,Od:18,Pd:19,Qd:20,Rd:21,Sd:22,Td:23,Ud:24,Vd:25,Wd:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Wa:65,Sb:66,Ub:67,sb:68,E:69,Xb:70,Yb:71,Zb:72,$b:73,gc:74,hc:75,ub:76,oc:77,pc:78,sc:79,tc:80,Q:81,zc:82,Cc:83,Hc:84,Ic:85,Jc:86,Kc:87,
|
var k;function m(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}
|
||||||
Mc:88,Nc:89,kb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Pc:97,Ee:98,Fe:99,d:100,e:101,Ge:102,He:103,Ie:104,Je:105,Ke:106,k:107,Le:108,Me:109,n:110,Ne:111,p:112,q:113,r:114,Oe:115,t:116,Pe:117,Qe:118,Re:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Xd:127};
|
var p={Jd:0,Md:1,Nd:2,Od:3,Pd:4,Qd:5,Rd:6,Sd:7,Td:8,Ud:9,Vd:10,Wd:11,Xd:12,Yd:13,Zd:14,$d:15,ae:16,be:17,ce:18,de:19,ee:20,fe:21,ge:22,he:23,ie:24,je:25,ke:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Ua:65,Sb:66,Ub:67,rb:68,E:69,Xb:70,Yb:71,Zb:72,$b:73,gc:74,hc:75,tb:76,oc:77,pc:78,sc:79,tc:80,Q:81,zc:82,Cc:83,Hc:84,Ic:85,Jc:86,Kc:87,
|
||||||
|
Mc:88,Nc:89,ib:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Oc:97,Te:98,Ue:99,d:100,e:101,Ve:102,We:103,Xe:104,Ye:105,Ze:106,k:107,$e:108,af:109,n:110,bf:111,p:112,q:113,r:114,cf:115,t:116,df:117,ef:118,ff:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,le:127};
|
||||||
function aa(a){var b=16,c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==
|
function aa(a){var b=16,c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==
|
||||||
e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function p(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 ca(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 da(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}
|
e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function q(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 ba(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 da(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}
|
||||||
function ea(){var a=fa();return-1!==a.indexOf("pcjs.org",a.length-8)}var ga={"&":"&","<":"<",">":">",'"':""","'":"'"};function ha(a){return a.replace(/[&<>"']/g,function(a){return ga[a]})}function ia(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
function ea(){var a=fa();return-1!==a.indexOf("pcjs.org",a.length-8)}function ga(a){return a.replace(/[&<>"']/g,function(a){return ha[a]})}function ia(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
||||||
var ja={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},ka=Date.now||function(){return+new Date};
|
var ha={"&":"&","<":"<",">":">",'"':""","'":"'"},ja={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};function ka(){return Date.now()||+new Date}
|
||||||
function la(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
function la(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
||||||
function ma(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"==
|
function ma(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var 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,
|
||||||
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}
|
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 na(a,b){var c,d={aa:null,wa:null,Da:null,xa: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.Da=g.load;d.xa=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++]=
|
function na(a,b){var c,d={W:null,sa:null,Aa:null,ta: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.Aa=g.load;d.ta=g.exec;if(e=g.bytes)d.W=e;else if(e=g.words)for(d.W=Array(2*e.length),f=c=0;c<e.length;c++)d.W[f++]=e[c]&255,d.W[f++]=e[c]>>8&255;else if(e=g.data)for(d.W=Array(4*e.length),f=c=0;c<e.length;c++)d.W[f++]=e[c]&
|
||||||
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}
|
255,d.W[f++]=e[c]>>8&255,d.W[f++]=e[c]>>16&255,d.W[f++]=e[c]>>24&255;else d.W=g;d.sa=g.symbols;d.W.length?1==d.W.length&&(r(d.W[0]),d=null):(r("Empty resource: "+a),d=null)}catch(h){r("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)){r("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.W=e)}return d}
|
||||||
function fa(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function oa(a){var b=!1;window&&(b=window.confirm(a));return b}var pa=null;function qa(){if(null==pa){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}pa=a}return pa}
|
function fa(){return"http://"+(window?window.location.host:"www.pcjs.org")}function r(a){window&&window.alert(a)}function oa(a){var b=!1;window&&(b=window.confirm(a));return b}function pa(){if(null==qa){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}qa=a}return qa}
|
||||||
function ra(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function sa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function ua(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 ra(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function sa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function ua(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)}return!1}
|
||||||
function va(a){if(!wa){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}wa=c}return wa[a]}var wa=null,xa={init:[],show:[],exit:[]},ya=!1,za=!1,Aa=!0;function Ba(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ca(a){xa.init.push(a)}
|
function va(a){if(!wa){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}wa=c}return wa[a]}function xa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function ya(a){za.init.push(a)}
|
||||||
function Da(a){if(Aa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){Ea("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks.",void 0,void 0)}}function Fa(a){!Aa&&a?(Aa=!0,ya&&Ga("init"),za&&Ga("show")):Aa=a}function Ga(a){xa[a]&&Da(xa[a])}Ba("onload",function(){ya=!0;Da(xa.init)});Ba("onpageshow",function(){za=!0;Da(xa.show)});Ba(ua("Opera")||ua("iOS")?"onunload":"onbeforeunload",function(){Da(xa.exit)});
|
function Aa(a){if(Ba)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){Ca("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks.",void 0,void 0)}}function Da(a){!Ba&&a?(Ba=!0,Ea&&Fa("init"),Ga&&Fa("show")):Ba=a}function Fa(a){za[a]&&Aa(za[a])}var wa=null,za={init:[],show:[],exit:[]},Ea=!1,Ga=!1,Ba=!0,qa=null;xa("onload",function(){Ea=!0;Aa(za.init)});xa("onpageshow",function(){Ga=!0;Aa(za.show)});
|
||||||
function r(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Ab=b.comment;this.Sc=b;b=this.id.indexOf(".");0>b?this.Ya=this.id:(this.za=this.id.substr(0,b),this.Ya=this.id.substr(b+1));this[a]=c;this.j={ready:!1,ab:!1,lb:!1,Y:!1,error:!1};this.eb=null;this.j.error=!1;this.v={};this.N=null;u.push(this)}
|
xa(ua("Opera")||ua("iOS")?"onunload":"onbeforeunload",function(){Aa(za.exit)});function u(a,b){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Ab=b.comment;this.Rc=b;this.exports={};a=this.id.indexOf(".");0>a?this.Wa=this.id:(this.Ia=this.id.substr(0,a),this.Wa=this.id.substr(a+1));this.i={ready:!1,Ya:!1,kb:!1,U:!1,error:!1};this.ab=null;this.i.error=!1;this.w={};this.J=this.m=this.u=this.F=this.pa=null;w.push(this)}function Ha(a,b,c){Ia[a]&&b&&(Ia[a][b]=c)}
|
||||||
function Ha(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=Ha(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ia=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else Ia={},u=[];
|
function Ca(a,b,c){b||r((c?c+": ":"")+a)}function Ja(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<w.length;b++){var d=w[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Ka(a){if(void 0!==a){var b;for(b=0;b<w.length;b++)if(w[b].id===a)return w[b]}return null}function La(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<w.length;d++)if(c)c==w[d]&&(c=null);else if(!(a!=w[d].type||b&&w[d].id.indexOf(b)))return w[d]}return null}
|
||||||
function Ja(a,b,c){Ia[a]&&b&&(Ia[a][b]=c)}function Ea(a,b,c){b||q((c?c+": ":"")+a)}function Ka(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<u.length;b++){var d=u[b];a&&d.id.indexOf(a)||c.push(d)}return c}function La(a){if(void 0!==a){var b;for(b=0;b<u.length;b++)if(u[b].id===a)return u[b]}return null}
|
function y(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){r(c.message+" ("+a+")")}return b}function Ma(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.S(g.type,g.binding,f,g.value),l=h.length}}}}
|
||||||
function Ma(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<u.length;d++)if(c)c==u[d]&&(c=null);else if(!(a!=u[d].type||b&&u[d].id.indexOf(b)))return u[d]}return null}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 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}k=u.prototype;k.toString=function(){return this.name?this.name:this.id||this.type};
|
||||||
function Na(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(" "),k=0;k<h.length;k++)switch(g=h[k],g){case "pc8080-binding":(g=y(f))&&g.binding&&a.U(g.type,g.binding,f,g.value),k=h.length}}}}
|
k.S=function(a,b,c){switch(b){case "clear":return this.w[b]||(this.w[b]=c,c.onclick=function(a){return function(){a.w.print&&(a.w.print.value="")}}(this)),!0;case "print":return this.w[b]||(this.pa=this.w[b]=c,c.value="",this.aa=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.G=function(a){this.aa(a,this.Wa)}),!0;default:return!1}};k.log=function(){};k.aa=function(){};
|
||||||
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}
|
k.status=function(a){this.aa(this.Wa+": "+a)};k.G=function(a,b,c){Ca(a,b,c||this.type)};function Na(a,b){b&&(a.i.ready?b():a.ab=b);return a.i.ready}function B(a){if(!a.i.error&&(a.i.ready=!0,a.i.ready)){var b=a.ab;a.ab=null;b&&b()}}function Oa(a,b){if(a.i.kb)return a.i.Ya=!1,a.i.kb=!1;if(a.i.error)return a.aa(a.toString()+" error"),!1;a.i.Ya=b;return a.i.Ya}k.ba=function(){return this.i.U=!0};k.fa=function(a,b){b&&(this.i.U=!1);return!0};
|
||||||
r.prototype={constructor:r,parent:null,toString:function(){return this.name?this.name:this.id||this.type},U: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.ya=this.v[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),
|
window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var Ia=window?window.PCjs.Machines:{},w=window?window.PCjs.Components:[];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});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
||||||
this.K=function(a){this.ea(a,this.Ya)}),!0;default:return!1}},log:function(){},ea:function(){},status:function(a){this.ea(this.Ya+": "+a)},K:function(a,b,c){Ea(a,b,c||this.type)},fa:function(){return this.j.Y=!0},ha:function(a,b){b&&(this.j.Y=!1);return!0}};function Oa(a,b){if(a.j.lb)return a.j.ab=!1,a.j.lb=!1;if(a.j.error)return a.ea(a.toString()+" error"),!1;a.j.ab=b;return a.j.ab}function B(a){if(!a.j.error&&(a.j.ready=!0,a.j.ready)){var b=a.eb;a.eb=null;b&&b()}}
|
|
||||||
function Pa(a,b){b&&(a.j.ready?b():a.eb=b);return a.j.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});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
|
||||||
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});
|
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 Qa="undefined"!==typeof ArrayBuffer,Sa=[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,
|
var Pa="undefined"!==typeof ArrayBuffer,Qa=[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 Ta(a){r.call(this,"Panel",a,Ta)}w(Ta);l=Ta.prototype;l.U=function(a,b,c,d){return this.w&&this.w.U(a,b,c,d)||this.a&&this.a.U(a,b,c,d)||this.l&&this.l.U(a,b,c,d)?!0:this.parent.U.call(this,a,b,c,d)};l.ra=function(a,b,c,d){this.w=a;this.i=b;this.a=c;this.N=d;this.l=C(a,"Keyboard")};l.fa=function(a,b){b||Ua();return!0};l.ha=function(){return!0};l.ia=function(){};
|
0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1];function Ra(a){u.call(this,"Panel",a)}m(Ra,u);Ra.prototype.S=function(a,b,c,d){return this.F&&this.F.S(a,b,c,d)||this.m&&this.m.S(a,b,c,d)||this.h&&this.h.S(a,b,c,d)?!0:u.prototype.S.call(this,a,b,c,d)};Ra.prototype.qa=function(a,b,c,d){this.F=a;this.u=b;this.m=c;this.J=d;this.h=C(a,"Keyboard")};Ra.prototype.ba=function(a,b){b||Sa();return!0};Ra.prototype.fa=function(){return!0};
|
||||||
function Ua(){for(var a=!1,b=A(document,"pc8080","panel"),c=0;c<b.length;c++){var d=b[c],e=y(d),f=La(e.id);f||(a=!0,f=new Ta(e));Na(f,d);a&&B(f)}}Ca(Ua);
|
function Sa(){for(var a=!1,b=A(document,"pc8080","panel"),c=0;c<b.length;c++){var d=b[c],e=y(d),f=Ka(e.id);f||(a=!0,f=new Ra(e));Ma(f,d);a&&B(f)}}ya(Sa);
|
||||||
function Va(a,b,c){r.call(this,"Bus",a,Va);this.a=b;this.N=c;this.o=a.busWidth||16;this.s=Math.pow(2,this.o);this.g=this.s-1|0;this.i=(this.o>>1)+2;10>this.i&&(this.i=10);15<this.i&&(this.i=15);this.c=1<<this.i;this.u=this.c>>2;this.f=this.c-1;this.h=this.s/this.c|0;this.m=this.h-1;this.l=[];this.w=[];this.A=[];this.B=[];a=new D;Wa(a,this.N);this.b=Array(this.h);for(b=0;b<this.h;b++)this.b[b]=a;B(this)}w(Va);Va.prototype.reset=function(){};Va.prototype.fa=function(a,b){b||this.reset();return!0};
|
function Ta(a,b,c){u.call(this,"Bus",a);this.m=b;this.J=c;this.s=a.busWidth||16;this.v=Math.pow(2,this.s);this.g=this.v-1|0;this.b=(this.s>>1)+2;10>this.b&&(this.b=10);15<this.b&&(this.b=15);this.c=1<<this.b;this.A=this.c>>2;this.f=this.c-1;this.h=this.v/this.c|0;this.o=this.h-1;this.j=[];this.l=[];this.B=[];this.C=[];a=new D;Va(a,this.J);this.a=Array(this.h);for(b=0;b<this.h;b++)this.a[b]=a;B(this)}m(Ta,u);Ta.prototype.reset=function(){};Ta.prototype.ba=function(a,b){b||this.reset();return!0};
|
||||||
function Xa(a,b,c,d){for(var e=b,f=c,g=e>>>a.i;0<f&&g<a.b.length;){var h=a.b[g],k=g*a.c,n=a.c-(e-k);n>f&&(n=f);if(h&&h.size){if(h.type==d){if(e+f<=h.Ra)return h.ib+=h.Ra-e,h.Ra=e,!0;if(e>=h.Ra+h.ib){n=h.size-(e-k);n>f&&(n=f);h.ib=e-h.Ra+n;e=k+a.c;f-=n;g++;continue}}return Ya(1,e,f)}e=new D(e,n,a.c,d);Wa(e,a.N,h);a.b[g++]=e;e=k+a.c;f-=n}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+Za[d]+" at "+p(b,4,!0)),!0):Ya(2,b,c)}Va.prototype.J=function(a){return this.b[(a&this.g)>>>this.i].Ua(a&this.f,a)};
|
function Wa(a,b,c,d){for(var e=b,f=c,g=e>>>a.b;0<f&&g<a.a.length;){var h=a.a[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 Xa(Ya,e,f)}e=new D(e,n,a.c,d);Va(e,a.J,h);a.a[g++]=e;e=l+a.c;f-=n}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+Za[d]+" at "+q(b,4,!0)),!0):Xa($a,b,c)}function ab(a,b){return a.a[(b&a.g)>>>a.b].eb(b&a.f,b)}
|
||||||
function $a(a,b){return a.b[(b&a.g)>>>a.i].hb(b&a.f,b)}function ab(a,b){var c=b&a.f,d=(b&a.g)>>>a.i;return c!=a.f?a.b[d].qd(c,b):a.b[d++].Ua(c,b)|a.b[d&a.m].Ua(0,b+1)<<8}Va.prototype.ba=function(a,b){this.b[(a&this.g)>>>this.i].Va(a&this.f,b&255,a)};function bb(a,b,c){a.b[(b&a.g)>>>a.i].Nb(b&a.f,c&255,b)}function cb(a,b,c){var d=b&a.f,e=(b&a.g)>>>a.i;d!=a.f?a.b[e].sd(d,c&65535,b):(a.b[e++].Va(d,c&255,b),a.b[e&a.m].Va(0,c>>8&255,b+1))}
|
function bb(a,b){var c=b&a.f,d=(b&a.g)>>>a.b;return c!=a.f?a.a[d].td(c,b):a.a[d++].Sa(c,b)|a.a[d&a.o].Sa(0,b+1)<<8}function cb(a,b,c){a.a[(b&a.g)>>>a.b].Lb(b&a.f,c&255,b)}function db(a,b,c){var d=b&a.f,e=(b&a.g)>>>a.b;d!=a.f?a.a[e].Dd(d,c&65535,b):(a.a[e++].Ta(d,c&255,b),a.a[e&a.o].Ta(0,c>>8&255,b+1))}
|
||||||
function db(a){for(var b=0,c=[],d=0;d<a.h;d++){var e=a.b[d];if(e.oa||e.Gb){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,k=[];g<e.length;){for(var n=e[g],v=g+1;v<e.length&&e[v]===n;)v++;k[h++]=v-g;k[h++]=n;g=v}k.length<e.length&&(e=k)}c[f]=e}}return c}function eb(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 k=+e+d;k<=g;k++)void 0!==f.l[k]?q("Input port "+p(k,4,!0)+" already registered"):f.l[k]=[h,!1]}}
|
function eb(a){for(var b=0,c=[],d=0;d<a.h;d++){var e=a.a[d];if(e.ja||e.Db){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var n=e[g],v=g+1;v<e.length&&e[v]===n;)v++;l[h++]=v-g;l[h++]=n;g=v}l.length<e.length&&(e=l)}c[f]=e}}return c}function fb(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.j[l]?r("Input port "+q(l,4,!0)+" already registered"):f.j[l]=[h,!1]}}
|
||||||
function fb(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 k=+e+d;k<=g;k++)void 0!==f.w[k]?q("Output port "+p(k,4,!0)+" already registered"):f.w[k]=[h,!1]}}function Ya(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}var gb;if(Qa){var hb=new ArrayBuffer(2);(new DataView(hb)).setUint16(0,256,!0);gb=256===(new Uint16Array(hb))[0]}else gb=!1;var jb=gb;
|
function gb(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.l[l]?r("Output port "+q(l,4,!0)+" already registered"):f.l[l]=[h,!1]}}function Xa(a,b,c){r("Memory block error ("+a+": "+q(b)+","+q(c)+")");return!1}var Ya=1,$a=2,hb;if(Pa){var ib=new ArrayBuffer(2);(new DataView(ib)).setUint16(0,256,!0);hb=256===(new Uint16Array(ib))[0]}else hb=!1;var jb=hb;
|
||||||
function D(a,b,c,d){this.id=kb+=2;this.a=null;this.Ra=a;this.ib=b;this.size=c||0;this.type=d||lb;this.c=d==mb;Wa(this);this.oa=this.Gb=!1;if(c)if(Qa)this.i=new ArrayBuffer(c),this.v=new DataView(this.i,0,c),this.b=new Uint8Array(this.i,0,c),this.h=new Uint16Array(this.i,0,c>>1),this.a=new Int32Array(this.i,0,c>>2),nb(this,jb?ob:pb);else{this.a=Array(c>>2);for(a=0;a<this.a.length;a++)this.a[a]=0;nb(this,qb)}else nb(this)}var lb=0,mb=2,Za=["NONE","RAM","ROM","VID","H/W"],kb=0;
|
function D(a,b,c,d){this.id=kb+=2;this.a=null;this.Pa=a;this.fb=b;this.size=c||0;this.type=d||lb;this.w=d==nb;Va(this);this.ja=this.Db=!1;if(c)if(Pa)this.m=new ArrayBuffer(c),this.u=new DataView(this.m,0,c),this.b=new Uint8Array(this.m,0,c),this.g=new Uint16Array(this.m,0,c>>1),this.a=new Int32Array(this.m,0,c>>2),ob(this,jb?pb:qb);else{this.a=Array(c>>2);for(a=0;a<this.a.length;a++)this.a[a]=0;ob(this,rb)}else ob(this)}k=D.prototype;
|
||||||
D.prototype={constructor:D,parent:null,save:function(){var a,b;if(Qa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.v.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(a&&this.size==a.length<<2){var b;if(Qa)for(b=0;b<a.length;b++)this.v.setInt32(b<<2,a[b],!0);else this.a=a;return this.oa=!0}return!1},l:function(){return 255},m:function(){},w:function(a,b){return this.Ua(a++,b++)|this.Ua(a,b)<<8},o:function(a,b,c){this.Va(a++,b&255,c++);this.Va(a,b>>8,c)},B:function(a){return this.a[a>>
|
k.save=function(){var a,b;if(Pa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.u.getInt32(b<<2,!0);else a=this.a;return a};k.restore=function(a){if(a&&this.size==a.length<<2){var b;if(Pa)for(b=0;b<a.length;b++)this.u.setInt32(b<<2,a[b],!0);else this.a=a;return this.ja=!0}return!1};function ob(a,b){b||(b=sb);tb(a,b,void 0);ub(a,b,void 0)}function tb(a,b,c){c&&a.c||(a.Sa=b[0]||a.Hb,a.td=b[2]||a.Ib);if(c||void 0===c)a.eb=b[0]||a.Hb,a.Jb=b[2]||a.Ib}
|
||||||
2]>>>((a&3)<<3)&255},H: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},R: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},u:function(a,b){return this.hb(a,b)},G:function(a,b){return this.Kb(a,b)},M:function(a,b,c){this.c||this.Nb(a,b,c)},V:function(a,
|
function ub(a,b,c){c&&a.f||(a.Ta=!a.w&&b[1]||a.Mb,a.Dd=!a.w&&b[3]||a.Nb);if(c||void 0===c)a.Lb=b[1]||a.Mb,a.h=b[3]||a.Nb}function Va(a,b,c){a.J=b;a.c=a.f=0;c&&((a.c=c.c)&&tb(a,vb,!1),(a.f=c.f)&&ub(a,vb,!1))}k.Hb=function(){return 255};k.Mb=function(){};k.Ib=function(a,b){return this.Sa(a++,b++)|this.Sa(a,b)<<8};k.Nb=function(a,b,c){this.Ta(a++,b&255,c++);this.Ta(a,b>>8,c)};k.sd=function(a){return this.a[a>>2]>>>((a&3)<<3)&255};
|
||||||
b,c){this.c||this.W(a,b,c)},s:function(a){return this.b[a]},A:function(a){return this.b[a]},F:function(a){return this.v.getUint16(a,!0)},L:function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.h[a>>1]},I:function(a,b){this.b[a]=b;this.oa=!0},P:function(a,b){this.b[a]=b;this.oa=!0},T:function(a,b){this.v.setUint16(a,b,!0);this.oa=!0},za:function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.h[a>>1]=b;this.oa=!0}};function Wa(a,b,c){a.N=b;a.f=a.g=0;c&&((a.f=c.f)&&rb(a,sb,!1),(a.g=c.g)&&tb(a,sb,!1))}
|
k.xd=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};k.Cd=function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.ja=!0};k.Hd=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.ja=!0};k.qd=function(a,b){return this.eb(a,b)};k.vd=function(a,b){return this.Jb(a,b)};k.Ad=function(a,b,c){this.w||this.Lb(a,b,c)};
|
||||||
function tb(a,b,c){c&&a.g||(a.Va=!a.c&&b[1]||a.m,a.sd=!a.c&&b[3]||a.o);if(c||void 0===c)a.Nb=b[1]||a.m,a.W=b[3]||a.o}function rb(a,b,c){c&&a.f||(a.Ua=b[0]||a.l,a.qd=b[2]||a.w);if(c||void 0===c)a.hb=b[0]||a.l,a.Kb=b[2]||a.w}function nb(a,b){b||(b=ub);rb(a,b,void 0);tb(a,b,void 0)}var ub=[],qb=[D.prototype.B,D.prototype.R,D.prototype.H,D.prototype.Z],sb=[D.prototype.u,D.prototype.M,D.prototype.G,D.prototype.V];
|
k.Fd=function(a,b,c){this.w||this.h(a,b,c)};k.pd=function(a){return this.b[a]};k.rd=function(a){return this.b[a]};k.ud=function(a){return this.u.getUint16(a,!0)};k.wd=function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.g[a>>1]};k.zd=function(a,b){this.b[a]=b;this.ja=!0};k.Bd=function(a,b){this.b[a]=b;this.ja=!0};k.Ed=function(a,b){this.u.setUint16(a,b,!0);this.ja=!0};k.Gd=function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.g[a>>1]=b;this.ja=!0};
|
||||||
if(Qa)var pb=[D.prototype.s,D.prototype.I,D.prototype.F,D.prototype.T],ob=[D.prototype.A,D.prototype.P,D.prototype.L,D.prototype.za];function vb(a,b){r.call(this,"CPU",a,vb);var c=a.multiplier||1;this.ma=a.cycles||b;this.I=c;this.Ga=Math.round(this.ma/1E4)/100;this.T=this.Ga*this.I;this.j.pa=!1;this.j.Lb=!1;this.j.Sa=a.autoStart;this.j.Eb=!1;this.j.bb=!1;this.ua=this.W=0;this.va=a.csStart;this.Z=a.csInterval;this.ja=a.csStop;this.F=[];this.$a=this.ob.bind(this);B(this)}w(vb);var wb=["power","reset"];
|
var lb=0,nb=2,Za=["NONE","RAM","ROM","VID","H/W"],kb=0,sb=[],rb=[D.prototype.sd,D.prototype.Cd,D.prototype.xd,D.prototype.Hd],vb=[D.prototype.qd,D.prototype.Ad,D.prototype.vd,D.prototype.Fd];if(Pa)var qb=[D.prototype.pd,D.prototype.zd,D.prototype.ud,D.prototype.Ed],pb=[D.prototype.rd,D.prototype.Bd,D.prototype.wd,D.prototype.Gd];
|
||||||
l=vb.prototype;l.ra=function(a,b,c,d){this.w=a;this.i=b;this.N=d;for(b=0;b<wb.length;b++)(c=this.v[wb[b]])&&this.w.U(null,wb[b],c);this.L=C(a,"ChipSet");a=xb(a,"autoStart");null!=a&&(this.j.Sa="true"==a?!0:"false"==a?!1:!!a);B(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};l.fa=function(a,b){if(!b){if(a&&this.restore){yb(this);if(!this.restore(a))return!1;zb(this)}else this.reset();this.ea("No debugger detected")}Ab(this);return!0};
|
function wb(a,b){u.call(this,"CPU",a);var c=a.multiplier||1;this.na=a.cycles||b;this.O=c;this.Da=Math.round(this.na/1E4)/100;this.X=this.Da*this.O;this.i.ka=!1;this.i.Kb=!1;this.i.Qa=a.autoStart;this.i.Bb=!1;this.i.Za=!1;this.wa=this.da=0;this.xa=a.csStart;this.ha=a.csInterval;this.la=a.csStop;this.H=[];this.jb=this.gb.bind(this);B(this)}m(wb,u);k=wb.prototype;
|
||||||
l.ha=function(a){return a?this.save():!0};l.Sa=function(){return this.j.Sa||void 0===this.v.run?(this.ob(),!0):!1};l.Hb=function(){return 0};function zb(a){void 0===a.va&&(a.va=0);void 0===a.Z&&(a.Z=-1);void 0===a.ja&&(a.ja=-1);a.j.bb=0<=a.va&&0<a.Z;a.j.bb&&(a.ua=0,a.W=a.va-a.G)}
|
k.qa=function(a,b,c,d){this.F=a;this.u=b;this.J=d;for(b=0;b<xb.length;b++)(c=this.w[xb[b]])&&this.F.S(null,xb[b],c);this.N=C(a,"ChipSet");a=yb(a,"autoStart");null!=a&&(this.i.Qa="true"==a?!0:"false"==a?!1:!!a);B(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};k.ba=function(a,b){if(!b){if(a&&this.restore){zb(this);if(!this.restore(a))return!1;Ab(this)}else this.reset();this.aa("No debugger detected")}Bb(this);return!0};
|
||||||
l.U=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.v[b]=c;a=!0;break;case "run":this.v[b]=c;c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.j.Y)a=!0;else{var b=null,c,h=Ka(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.j.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.j.Y);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.j.ready?"powered yet":"ready yet"+(b.eb?" (waiting for notification)":""))+".");a=!1}a&&(d.j.pa?Bb(d):d.ob())};a=!0;
|
k.fa=function(a){return a?this.save():!0};k.Qa=function(){return this.i.Qa||void 0===this.w.run?(this.gb(),!0):!1};k.Eb=function(){return 0};function Ab(a){void 0===a.xa&&(a.xa=0);void 0===a.ha&&(a.ha=-1);void 0===a.la&&(a.la=-1);a.i.Za=0<=a.xa&&0<a.ha;a.i.Za&&(a.wa=0,a.da=a.xa-a.I)}
|
||||||
break;case "speed":this.v[b]=c;a=!0;break;case "setSpeed":this.v[b]=c,c.onclick=function(){Cb(d,d.I<<1,!0)},c.textContent=this.T.toFixed(2)+"Mhz",a=!0}return a};function Db(a,b){var c=1;b&&1<a.I&&a.P&&(c=a.P/a.Ga);a.Pa=Math.round(1E3/30);a.Ba=Math.floor(a.ma/30*c);b||(a.la=a.Ba);a.Ha=0}function Eb(a){return a.G+a.M+a.V-a.a}function yb(a){a.P=0;a.Qa=0;a.G=a.M=a.V=a.a=0;zb(a);Cb(a,1)}
|
k.S=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.w[b]=c;a=!0;break;case "run":this.w[b]=c;c.onclick=function(){var a;if(a=d.F)if(a=d.F,a.i.U)a=!0;else{var b=null,c,h=Ja(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.i.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.i.U);c++);c==h.length&&(b=a);r("The "+b.type+" component ("+b.id+") is not "+(b.i.ready?"powered yet":"ready yet"+(b.ab?" (waiting for notification)":""))+".");a=!1}a&&(d.i.ka?Cb(d):d.gb())};a=!0;
|
||||||
function Cb(a,b,c){if(void 0!==b){.8>a.P/a.T&&(b=1);a.I=b;b=a.Ga*a.I;if(a.T!=b){a.T=b;b=a.T.toFixed(2)+"Mhz";var d=a.v.setSpeed;d&&(d.textContent=b);a.ea("target speed: "+b)}c&&a.w&&Fb(a.w)}a.G+=a.M;a.M=0;a.H=ka();a.R=0;Db(a)}function Gb(a,b){var c=a.F.length;a.F.push([-1,b]);return c}function Hb(a,b,c){0<=b&&b<a.F.length&&0>a.F[b][0]&&(c*=a.ma*a.I/1E3,a.F[b][0]=c+Ib(a))}function Ib(a,b){var c=a.V-=a.a;a.a=0;b&&(a.V=0);return c}
|
break;case "speed":this.w[b]=c;a=!0;break;case "setSpeed":this.w[b]=c,c.onclick=function(){Db(d,d.O<<1,!0)},c.textContent=this.X.toFixed(2)+"Mhz",a=!0}return a};function Eb(a,b){var c=1;b&&1<a.O&&a.R&&(c=a.R/a.Da);a.Na=Math.round(1E3/Fb);a.ya=Math.floor(a.na/Fb*c);b||(a.ma=a.ya);a.Fa=0}function Gb(a){return a.I+a.P+a.ca-a.a}function zb(a){a.R=0;a.Oa=0;a.I=a.P=a.ca=a.a=0;Ab(a);Db(a,1)}
|
||||||
l.ob=function(a){if(Oa(this,!0)){if(!this.j.pa){Cb(this);this.w&&this.w.start(this.H,Eb(this));this.j.pa=!0;this.j.Lb=!0;this.L&&this.L.start();var b=this.v.run;b&&(b.textContent="Halt");this.w&&(this.w.ia(!0),a&&Fb(this.w,!0))}this.Ha>=this.ma&&Db(this,!0);this.qa=0;this.ta=ka();this.R&&(a=this.ta-this.R,a>this.Pa&&(this.H+=a,this.H>this.ta&&(this.H=this.ta)));try{do{for(var c,d=this.j.bb?1:this.Ba,e=this.F.length-1;0<=e;e--){var f=this.F[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.Mb(c);c=Ib(this,!0);
|
function Db(a,b,c){if(void 0!==b){.8>a.R/a.X&&(b=1);a.O=b;b=a.Da*a.O;if(a.X!=b){a.X=b;b=a.X.toFixed(2)+"Mhz";var d=a.w.setSpeed;d&&(d.textContent=b);a.aa("target speed: "+b)}c&&a.F&&Hb(a.F)}a.I+=a.P;a.P=0;a.L=ka();a.V=0;Eb(a)}function Ib(a,b){var c=a.H.length;a.H.push([-1,b]);return c}function Jb(a,b,c){0<=b&&b<a.H.length&&0>a.H[b][0]&&(c*=a.na*a.O/1E3,a.H[b][0]=c+Kb(a))}function Kb(a,b){var c=a.ca-=a.a;a.a=0;b&&(a.ca=0);return c}
|
||||||
this.qa+=c;this.M+=c;a=c;this.j.bb&&(b=!1,this.ua=this.ua+this.Hb()|0,this.W-=a,0>=this.W&&(this.W+=this.Z,b=!0),0<=this.ja&&this.ja<=Eb(this)&&(this.Z=this.ja=-1,zb(this),Bb(this),b=!0),b&&this.ea(Eb(this)+" cycles: checksum="+p(this.ua)));a=c;for(var g=this.F.length-1;0<=g;g--){var h=this.F[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.Ba;15<=++this.Qa&&(this.w&&this.w.ia(),this.Qa=0);break}}while(this.j.pa)}catch(k){Bb(this);Ab(this);this.w&&this.w.stop(ka(),
|
k.gb=function(a){if(Oa(this,!0)){if(!this.i.ka){Db(this);this.F&&this.F.start(this.L,Gb(this));this.i.ka=!0;this.i.Kb=!0;this.N&&this.N.start();var b=this.w.run;b&&(b.textContent="Halt");this.F&&(Lb(this.F,!0),a&&Hb(this.F,!0))}this.Fa>=this.na&&Eb(this,!0);this.oa=0;this.va=ka();this.V&&(a=this.va-this.V,a>this.Na&&(this.L+=a,this.L>this.va&&(this.L=this.va)));try{do{for(var c,d=this.i.Za?1:this.ya,e=this.H.length-1;0<=e;e--){var f=this.H[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.qb(c);c=Kb(this,!0);
|
||||||
Eb(this));Oa(this,!1);c=k.stack||k.message;this.j.error=!0;this.K(c);return}c=setTimeout;d=this.$a;this.R=ka();e=this.Pa;this.qa&&(e=Math.round(e*this.qa/this.Ba));e-=this.R-this.ta;if(f=this.R-this.H)this.P=Math.round(this.M/(10*f))/100,864E5<=f&&(this.G=0,Cb(this));if(0>e||this.P<this.T)-1E3>e&&(this.H-=e),e=0;this.Ha+=this.qa;this.R+=e;c(d,e)}else Ab(this),this.w&&this.w.stop(ka(),Eb(this))};l.Mb=function(){return 0};
|
this.oa+=c;this.P+=c;a=c;this.i.Za&&(b=!1,this.wa=this.wa+this.Eb()|0,this.da-=a,0>=this.da&&(this.da+=this.ha,b=!0),0<=this.la&&this.la<=Gb(this)&&(this.ha=this.la=-1,Ab(this),Cb(this),b=!0),b&&this.aa(Gb(this)+" cycles: checksum="+q(this.wa)));a=c;for(var g=this.H.length-1;0<=g;g--){var h=this.H[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.ma-=c;if(0>=this.ma){this.ma+=this.ya;++this.Oa>=Mb&&(this.F&&Lb(this.F),this.Oa=0);break}}while(this.i.ka)}catch(l){Cb(this);Bb(this);this.F&&this.F.stop(ka(),
|
||||||
function Bb(a){a.j.ab&&(a.j.lb=!0);Ib(a);a.G+=a.M;a.M=0;if(a.j.pa){a.j.pa=!1;a.L&&a.L.stop();var b=a.v.run;b&&(b.textContent="Run")}a.j.complete=void 0}function Ab(a){if(a.w){for(var b=a.w,c=0;c<b.l.length;c++)Jb(b.l[c],void 0);a.w.ia(void 0)}}function Kb(a){vb.call(this,a,1E6);this.Ma=Lb;yb(this);this.j.complete=this.j.Tc=!1;this.Oa=0;this.sa=[];this.Na=0;Mb(this)}w(Kb,vb);function Ob(a,b){a.sa.push(b)}l=Kb.prototype;l.reset=function(){this.j.pa&&Bb(this);Mb(this);yb(this);this.j.error=!1;this.parent.reset.call(this)};
|
Gb(this));Oa(this,!1);c=l.stack||l.message;this.i.error=!0;this.G(c);return}c=setTimeout;d=this.jb;this.V=ka();e=this.Na;this.oa&&(e=Math.round(e*this.oa/this.ya));e-=this.V-this.va;if(f=this.V-this.L)this.R=Math.round(this.P/(10*f))/100,864E5<=f&&(this.I=0,Db(this));if(0>e||this.R<this.X)-1E3>e&&(this.L-=e),e=0;this.Fa+=this.oa;this.V+=e;c(d,e)}else Bb(this),this.F&&this.F.stop(ka(),Gb(this))};k.qb=function(){return 0};
|
||||||
function Mb(a){a.b=0;a.c=0;a.C=0;a.f=0;a.D=0;a.g=0;a.h=0;a.s=0;F(a,a.Na);Pb(a,0);a.A=0}function Qb(a,b){a.Na=b;F(a,b)}l.Hb=function(){var a=this.b+this.c+this.C+this.f+this.D+this.g+this.h|0;return a=a+this.s+this.m+Rb(this)|0};l.save=function(){var a=new G(this);a.set(0,[this.b,this.c,this.C,this.f,this.D,this.g,this.h,this.s,this.m,Rb(this)]);a.set(1,[this.A,this.G,this.I]);a.set(2,db(this.i));return a.data()};
|
function Cb(a){a.i.Ya&&(a.i.kb=!0);Kb(a);a.I+=a.P;a.P=0;if(a.i.ka){a.i.ka=!1;a.N&&a.N.stop();var b=a.w.run;b&&(b.textContent="Run")}a.i.complete=void 0}function Bb(a){if(a.F){for(var b=a.F,c=0;c<b.g.length;c++)Nb(b.g[c],void 0);Lb(a.F,void 0)}}var Fb=30,Mb=15,xb=["power","reset"];function Ob(a){wb.call(this,a,1E6);this.Ka=Pb;zb(this);this.i.complete=this.i.Sc=!1;this.Ma=0;this.ra=[];this.La=0;Qb(this)}m(Ob,wb);function Rb(a,b){a.ra.push(b)}k=Ob.prototype;
|
||||||
l.restore=function(a){var b=a[0];this.b=b[0];this.c=b[1];this.C=b[2];this.f=b[3];this.D=b[4];this.g=b[5];this.h=b[6];this.s=b[7]&65535;F(this,b[8]);Pb(this,b[9]);b=a[1];this.A=b[0];this.G=b[1];Cb(this,b[3]);a:{b=this.i;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.u){for(var f=0,g=Array(b.u),h=0;h<e.length-1;)for(var k=e[h++],n=e[h++];k--;)g[f++]=n;e=g}f=b.b[d];if(!f||!f.restore(e)){q("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
k.reset=function(){this.i.ka&&Cb(this);Qb(this);zb(this);this.i.error=!1;wb.prototype.reset.call(this)};function Qb(a){a.b=0;a.g=0;a.c=0;a.h=0;a.f=0;a.j=0;a.l=0;a.A=0;F(a,a.La);Sb(a,0);a.C=0}function Tb(a,b){a.La=b;F(a,b)}k.Eb=function(){var a=this.b+this.g+this.c+this.h+this.f+this.j+this.l|0;return a=a+this.A+this.s+Ub(this)|0};
|
||||||
l.U=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.v[b]=c;this.Oa++;a=!0;break;default:a=this.parent.U.call(this,a,b,c)}return a};function Sb(a){return a.c<<8|a.C}function Tb(a,b){a.c=b>>8&255;a.C=b&255}function Ub(a){return a.f<<8|a.D}function Vb(a,b){a.f=b>>8&255;a.D=b&255}function H(a){return a.g<<8|a.h}
|
k.save=function(){var a=new G(this);a.set(0,[this.b,this.g,this.c,this.h,this.f,this.j,this.l,this.A,this.s,Ub(this)]);a.set(1,[this.C,this.I,this.O]);a.set(2,eb(this.u));return a.data()};
|
||||||
function J(a,b){a.g=b>>8&255;a.h=b&255}function F(a,b){a.m=b&65535}function K(a){return a.l&256?1:0}function L(a,b){a.l=a.l&255|b}function Wb(a){return Sa[a.o&255]?4:0}function Rb(a){return a.B&-214|(a.o&128?128:0)|(a.l&255?0:64)|((a.o^a.u)&16?16:0)|Wb(a)|K(a)}function Pb(a,b){a.l=a.o=a.u=0;b&1&&(a.l|=256);b&4||(a.o|=1);b&16&&(a.u|=16);b&64||(a.l|=255);b&128&&(a.o^=192);a.B=a.B&-726|b&512|2}function M(a,b){a.u=a.b^b;return a.o=(a.l=a.b+b)&255}
|
k.restore=function(a){var b=a[0];this.b=b[0];this.g=b[1];this.c=b[2];this.h=b[3];this.f=b[4];this.j=b[5];this.l=b[6];this.A=b[7]&65535;F(this,b[8]);Sb(this,b[9]);b=a[1];this.C=b[0];this.I=b[1];Db(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.A){for(var f=0,g=Array(b.A),h=0;h<e.length-1;)for(var l=e[h++],n=e[h++];l--;)g[f++]=n;e=g}f=b.a[d];if(!f||!f.restore(e)){r("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
||||||
function Xb(a,b){a.u=a.b^b;return a.o=(a.l=a.b+b+(a.l&256?1:0))&255}function Yb(a,b){a.l=a.o=a.u=a.b&b;(a.b|b)&8&&(a.u^=16);return a.l}function Zb(a,b){a.u=b^255;b=a.o=b+255&255;a.l=a.l&-256|b;return b}function $b(a,b){a.u=b;b=a.o=b+1&255;a.l=a.l&-256|b;return b}function ac(a,b){return a.o=a.l=a.u=a.b|b}function N(a,b){b^=255;a.u=a.b^b;return a.o=(a.l=a.b+b+1^256)&255}function bc(a,b){b^=255;a.u=a.b^b;return a.o=(a.l=a.b+b+(a.l&256?0:1)^256)&255}function cc(a,b){return a.o=a.l=a.u=a.b^b}l.J=function(a){return this.i.J(a)};
|
k.S=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.w[b]=c;this.Ma++;a=!0;break;default:a=wb.prototype.S.call(this,a,b,c)}return a};function Vb(a){return a.g<<8|a.c}function Xb(a,b){a.g=b>>8&255;a.c=b&255}function Yb(a){return a.h<<8|a.f}function Zb(a,b){a.h=b>>8&255;a.f=b&255}function H(a){return a.j<<8|a.l}
|
||||||
l.ba=function(a,b){this.i.ba(a,b)};function O(a){var b=a.J(a.m);F(a,a.m+1);return b}function P(a){var b=ab(a.i,a.m);F(a,a.m+2);return b}function Q(a){var b=ab(a.i,a.s);a.s=a.s+2&65535;return b}function R(a,b){a.s=a.s-2&65535;cb(a.i,a.s,b)}function dc(a){if(a.a&&a.A&255&&a.B&512){for(var b=0;8>b&&!(a.A&1<<b);b++);a.A&=~(0>b?255:1<<b);a.B&=-513;a.A&=-257;a.Ma[199|b<<3].call(a)}return a.A&256?(Ib(a),!1):!0}function ec(a,b){a.A|=1<<b;a.B&512&&Ib(a)}
|
function I(a,b){a.j=b>>8&255;a.l=b&255}function F(a,b){a.s=b&65535}function J(a){return a.o&256?1:0}function $b(a,b){a.o=a.o&255|b}function ac(a){return Qa[a.v&255]?4:0}function Ub(a){return a.D&-214|(a.v&128?128:0)|(a.o&255?0:64)|((a.v^a.B)&16?16:0)|ac(a)|J(a)}function Sb(a,b){a.o=a.v=a.B=0;b&1&&(a.o|=256);b&4||(a.v|=1);b&16&&(a.B|=16);b&64||(a.o|=255);b&128&&(a.v^=192);a.D=a.D&-726|b&512|2}function bc(a,b){a.B=a.b^b;return a.v=(a.o=a.b+b)&255}
|
||||||
function T(a,b,c,d){d=d||2;a.v[b]&&(void 0===c&&(a.j.error=!0,a.K("Value for "+b+" is invalid"),Bb(a)),c=!a.j.pa||a.j.Eb?p(c,d):"--------".substr(0,d),a.v[b].textContent!=c&&(a.v[b].textContent=c))}
|
function cc(a,b){a.B=a.b^b;return a.v=(a.o=a.b+b+(a.o&256?1:0))&255}function dc(a,b){a.o=a.v=a.B=a.b&b;(a.b|b)&8&&(a.B^=16);return a.o}function ec(a,b){a.B=b^255;b=a.v=b+255&255;a.o=a.o&-256|b;return b}function fc(a,b){a.B=b;b=a.v=b+1&255;a.o=a.o&-256|b;return b}function gc(a,b){return a.v=a.o=a.B=a.b|b}function L(a,b){b^=255;a.B=a.b^b;return a.v=(a.o=a.b+b+1^256)&255}function hc(a,b){b^=255;a.B=a.b^b;return a.v=(a.o=a.b+b+(a.o&256?0:1)^256)&255}function ic(a,b){return a.v=a.o=a.B=a.b^b}
|
||||||
l.ia=function(a){this.Oa&&(a||!this.j.pa||this.j.Eb)&&(T(this,"A",this.b),T(this,"B",this.c),T(this,"C",this.C),T(this,"BC",Sb(this),4),T(this,"D",this.f),T(this,"E",this.D),T(this,"DE",Ub(this),4),T(this,"H",this.g),T(this,"L",this.h),T(this,"HL",H(this),4),T(this,"SP",this.s,4),T(this,"PC",this.m,4),a=Rb(this),T(this,"PS",a,4),T(this,"IF",a&512?1:0,1),T(this,"SF",a&128?1:0,1),T(this,"ZF",a&64?1:0,1),T(this,"AF",a&16?1:0,1),T(this,"PF",a&4?1:0,1),T(this,"CF",a&1?1:0,1));if(a=this.v.speed)a.textContent=
|
function M(a,b){a=a.u;return a.a[(b&a.g)>>>a.b].Sa(b&a.f,b)}function N(a,b,c){a=a.u;a.a[(b&a.g)>>>a.b].Ta(b&a.f,c&255,b)}function O(a){var b=M(a,a.s);F(a,a.s+1);return b}function P(a){var b=bb(a.u,a.s);F(a,a.s+2);return b}function Q(a){var b=bb(a.u,a.A);a.A=a.A+2&65535;return b}function R(a,b){a.A=a.A-2&65535;db(a.u,a.A,b)}function jc(a){if(a.a&&a.C&255&&a.D&512){for(var b=0;8>b&&!(a.C&1<<b);b++);a.C&=~(0>b?255:1<<b);a.D&=-513;a.C&=-257;a.Ka[199|b<<3].call(a)}return a.C&256?(Kb(a),!1):!0}
|
||||||
this.j.pa&&this.P?this.P.toFixed(2)+"Mhz":"Stopped"};l.Mb=function(a){this.j.complete=!0;this.j.Tc=!1;this.j.Lb=!1;this.V=this.a=a;if(dc(this)){do this.Ma[O(this)].call(this);while(0<this.a)}return this.j.complete?this.V-this.a:void 0===this.j.complete?0:-1};Ca(function(){for(var a=A(document,"pc8080","cpu"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Kb(d);Na(d,c)}});function fc(){this.a-=4}function gc(){F(this,P(this));this.a-=10}function hc(){F(this,Q(this));this.a-=10}
|
function kc(a,b){a.C|=1<<b;a.D&512&&Kb(a)}function T(a,b,c,d){d=d||2;a.w[b]&&(void 0===c&&(a.i.error=!0,a.G("Value for "+b+" is invalid"),Cb(a)),c=!a.i.ka||a.i.Bb?q(c,d):"--------".substr(0,d),a.w[b].textContent!=c&&(a.w[b].textContent=c))}k.qb=function(a){this.i.complete=!0;this.i.Sc=!1;this.i.Kb=!1;this.ca=this.a=a;if(jc(this)){do this.Ka[O(this)].call(this);while(0<this.a)}return this.i.complete?this.ca-this.a:void 0===this.i.complete?0:-1};
|
||||||
function ic(){var a=P(this);R(this,this.m);F(this,a);this.a-=17}
|
ya(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);Ma(d,c)}});function lc(){this.a-=4}function mc(){F(this,P(this));this.a-=10}function nc(){F(this,Q(this));this.a-=10}function oc(){var a=P(this);R(this,this.s);F(this,a);this.a-=17}
|
||||||
var Lb=[fc,function(){Tb(this,P(this));this.a-=10},function(){this.ba(Sb(this),this.b);this.a-=7},function(){Tb(this,Sb(this)+1);this.a-=5},function(){this.c=$b(this,this.c);this.a-=5},function(){this.c=Zb(this,this.c);this.a-=5},function(){this.c=O(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|a>>8;L(this,a&256);this.a-=4},fc,function(){var a;J(this,a=H(this)+Sb(this));L(this,a>>8&256);this.a-=10},function(){this.b=this.J(Sb(this));this.a-=7},function(){Tb(this,Sb(this)-1);this.a-=5},
|
var Pb=[lc,function(){Xb(this,P(this));this.a-=10},function(){N(this,Vb(this),this.b);this.a-=7},function(){Xb(this,Vb(this)+1);this.a-=5},function(){this.g=fc(this,this.g);this.a-=5},function(){this.g=ec(this,this.g);this.a-=5},function(){this.g=O(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|a>>8;$b(this,a&256);this.a-=4},lc,function(){var a;I(this,a=H(this)+Vb(this));$b(this,a>>8&256);this.a-=10},function(){this.b=M(this,Vb(this));this.a-=7},function(){Xb(this,Vb(this)-1);this.a-=5},
|
||||||
function(){this.C=$b(this,this.C);this.a-=5},function(){this.C=Zb(this,this.C);this.a-=5},function(){this.C=O(this);this.a-=7},function(){var a=this.b<<8&256;this.b=(a|this.b)>>1;L(this,a);this.a-=4},fc,function(){Vb(this,P(this));this.a-=10},function(){this.ba(Ub(this),this.b);this.a-=7},function(){Vb(this,Ub(this)+1);this.a-=5},function(){this.f=$b(this,this.f);this.a-=5},function(){this.f=Zb(this,this.f);this.a-=5},function(){this.f=O(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|K(this);
|
function(){this.c=fc(this,this.c);this.a-=5},function(){this.c=ec(this,this.c);this.a-=5},function(){this.c=O(this);this.a-=7},function(){var a=this.b<<8&256;this.b=(a|this.b)>>1;$b(this,a);this.a-=4},lc,function(){Zb(this,P(this));this.a-=10},function(){N(this,Yb(this),this.b);this.a-=7},function(){Zb(this,Yb(this)+1);this.a-=5},function(){this.h=fc(this,this.h);this.a-=5},function(){this.h=ec(this,this.h);this.a-=5},function(){this.h=O(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|J(this);
|
||||||
L(this,a&256);this.a-=4},fc,function(){var a;J(this,a=H(this)+Ub(this));L(this,a>>8&256);this.a-=10},function(){this.b=this.J(Ub(this));this.a-=7},function(){Vb(this,Ub(this)-1);this.a-=5},function(){this.D=$b(this,this.D);this.a-=5},function(){this.D=Zb(this,this.D);this.a-=5},function(){this.D=O(this);this.a-=7},function(){var a=this.b<<8;this.b=(K(this)<<8|this.b)>>1;L(this,a&256);this.a-=4},fc,function(){J(this,P(this));this.a-=10},function(){var a=P(this);cb(this.i,a,H(this));this.a-=16},function(){J(this,
|
$b(this,a&256);this.a-=4},lc,function(){var a;I(this,a=H(this)+Yb(this));$b(this,a>>8&256);this.a-=10},function(){this.b=M(this,Yb(this));this.a-=7},function(){Zb(this,Yb(this)-1);this.a-=5},function(){this.f=fc(this,this.f);this.a-=5},function(){this.f=ec(this,this.f);this.a-=5},function(){this.f=O(this);this.a-=7},function(){var a=this.b<<8;this.b=(J(this)<<8|this.b)>>1;$b(this,a&256);this.a-=4},lc,function(){I(this,P(this));this.a-=10},function(){var a=P(this);db(this.u,a,H(this));this.a-=16},
|
||||||
H(this)+1);this.a-=5},function(){this.g=$b(this,this.g);this.a-=5},function(){this.g=Zb(this,this.g);this.a-=5},function(){this.g=O(this);this.a-=7},function(){var a=0,b=K(this);if((this.o^this.u)&16||9<(this.b&15))a|=6;if(b||154<=this.b)a|=96,b=1;this.b=M(this,a);L(this,b?256:0);this.a-=4},fc,function(){var a;J(this,a=H(this)+H(this));L(this,a>>8&256);this.a-=10},function(){var a;a=P(this);a=ab(this.i,a);J(this,a);this.a-=16},function(){J(this,H(this)-1);this.a-=5},function(){this.h=$b(this,this.h);
|
function(){I(this,H(this)+1);this.a-=5},function(){this.j=fc(this,this.j);this.a-=5},function(){this.j=ec(this,this.j);this.a-=5},function(){this.j=O(this);this.a-=7},function(){var a=0,b=J(this);if((this.v^this.B)&16||9<(this.b&15))a|=6;if(b||154<=this.b)a|=96,b=1;this.b=bc(this,a);$b(this,b?256:0);this.a-=4},lc,function(){var a;I(this,a=H(this)+H(this));$b(this,a>>8&256);this.a-=10},function(){var a;a=P(this);a=bb(this.u,a);I(this,a);this.a-=16},function(){I(this,H(this)-1);this.a-=5},function(){this.l=
|
||||||
this.a-=5},function(){this.h=Zb(this,this.h);this.a-=5},function(){this.h=O(this);this.a-=7},function(){this.b=~this.b&255;this.a-=4},fc,function(){this.s=P(this)&65535;this.a-=10},function(){this.ba(P(this),this.b);this.a-=13},function(){this.s=this.s+1&65535;this.a-=5},function(){var a=H(this);this.ba(a,$b(this,this.J(a)));this.a-=10},function(){var a=H(this);this.ba(a,Zb(this,this.J(a)));this.a-=10},function(){this.ba(H(this),O(this));this.a-=10},function(){this.l|=256;this.a-=4},fc,function(){var a;
|
fc(this,this.l);this.a-=5},function(){this.l=ec(this,this.l);this.a-=5},function(){this.l=O(this);this.a-=7},function(){this.b=~this.b&255;this.a-=4},lc,function(){this.A=P(this)&65535;this.a-=10},function(){N(this,P(this),this.b);this.a-=13},function(){this.A=this.A+1&65535;this.a-=5},function(){var a=H(this);N(this,a,fc(this,M(this,a)));this.a-=10},function(){var a=H(this);N(this,a,ec(this,M(this,a)));this.a-=10},function(){N(this,H(this),O(this));this.a-=10},function(){this.o|=256;this.a-=4},lc,
|
||||||
J(this,a=H(this)+this.s);L(this,a>>8&256);this.a-=10},function(){this.b=this.J(P(this));this.a-=13},function(){this.s=this.s-1&65535;this.a-=5},function(){this.b=$b(this,this.b);this.a-=5},function(){this.b=Zb(this,this.b);this.a-=5},function(){this.b=O(this);this.a-=7},function(){L(this,K(this)?0:256);this.a-=4},function(){this.a-=5},function(){this.c=this.C;this.a-=5},function(){this.c=this.f;this.a-=5},function(){this.c=this.D;this.a-=5},function(){this.c=this.g;this.a-=5},function(){this.c=this.h;
|
function(){var a;I(this,a=H(this)+this.A);$b(this,a>>8&256);this.a-=10},function(){this.b=M(this,P(this));this.a-=13},function(){this.A=this.A-1&65535;this.a-=5},function(){this.b=fc(this,this.b);this.a-=5},function(){this.b=ec(this,this.b);this.a-=5},function(){this.b=O(this);this.a-=7},function(){$b(this,J(this)?0:256);this.a-=4},function(){this.a-=5},function(){this.g=this.c;this.a-=5},function(){this.g=this.h;this.a-=5},function(){this.g=this.f;this.a-=5},function(){this.g=this.j;this.a-=5},function(){this.g=
|
||||||
this.a-=5},function(){this.c=this.J(H(this));this.a-=7},function(){this.c=this.b;this.a-=5},function(){this.C=this.c;this.a-=5},function(){this.a-=5},function(){this.C=this.f;this.a-=5},function(){this.C=this.D;this.a-=5},function(){this.C=this.g;this.a-=5},function(){this.C=this.h;this.a-=5},function(){this.C=this.J(H(this));this.a-=7},function(){this.C=this.b;this.a-=5},function(){this.f=this.c;this.a-=5},function(){this.f=this.C;this.a-=5},function(){this.a-=5},function(){this.f=this.D;this.a-=
|
this.l;this.a-=5},function(){this.g=M(this,H(this));this.a-=7},function(){this.g=this.b;this.a-=5},function(){this.c=this.g;this.a-=5},function(){this.a-=5},function(){this.c=this.h;this.a-=5},function(){this.c=this.f;this.a-=5},function(){this.c=this.j;this.a-=5},function(){this.c=this.l;this.a-=5},function(){this.c=M(this,H(this));this.a-=7},function(){this.c=this.b;this.a-=5},function(){this.h=this.g;this.a-=5},function(){this.h=this.c;this.a-=5},function(){this.a-=5},function(){this.h=this.f;
|
||||||
5},function(){this.f=this.g;this.a-=5},function(){this.f=this.h;this.a-=5},function(){this.f=this.J(H(this));this.a-=7},function(){this.f=this.b;this.a-=5},function(){this.D=this.c;this.a-=5},function(){this.D=this.C;this.a-=5},function(){this.D=this.f;this.a-=5},function(){this.a-=5},function(){this.D=this.g;this.a-=5},function(){this.D=this.h;this.a-=5},function(){this.D=this.J(H(this));this.a-=7},function(){this.D=this.b;this.a-=5},function(){this.g=this.c;this.a-=5},function(){this.g=this.C;this.a-=
|
this.a-=5},function(){this.h=this.j;this.a-=5},function(){this.h=this.l;this.a-=5},function(){this.h=M(this,H(this));this.a-=7},function(){this.h=this.b;this.a-=5},function(){this.f=this.g;this.a-=5},function(){this.f=this.c;this.a-=5},function(){this.f=this.h;this.a-=5},function(){this.a-=5},function(){this.f=this.j;this.a-=5},function(){this.f=this.l;this.a-=5},function(){this.f=M(this,H(this));this.a-=7},function(){this.f=this.b;this.a-=5},function(){this.j=this.g;this.a-=5},function(){this.j=
|
||||||
5},function(){this.g=this.f;this.a-=5},function(){this.g=this.D;this.a-=5},function(){this.a-=5},function(){this.g=this.h;this.a-=5},function(){this.g=this.J(H(this));this.a-=7},function(){this.g=this.b;this.a-=5},function(){this.h=this.c;this.a-=5},function(){this.h=this.C;this.a-=5},function(){this.h=this.f;this.a-=5},function(){this.h=this.D;this.a-=5},function(){this.h=this.g;this.a-=5},function(){this.a-=5},function(){this.h=this.J(H(this));this.a-=7},function(){this.h=this.b;this.a-=5},function(){this.ba(H(this),
|
this.c;this.a-=5},function(){this.j=this.h;this.a-=5},function(){this.j=this.f;this.a-=5},function(){this.a-=5},function(){this.j=this.l;this.a-=5},function(){this.j=M(this,H(this));this.a-=7},function(){this.j=this.b;this.a-=5},function(){this.l=this.g;this.a-=5},function(){this.l=this.c;this.a-=5},function(){this.l=this.h;this.a-=5},function(){this.l=this.f;this.a-=5},function(){this.l=this.j;this.a-=5},function(){this.a-=5},function(){this.l=M(this,H(this));this.a-=7},function(){this.l=this.b;
|
||||||
this.c);this.a-=7},function(){this.ba(H(this),this.C);this.a-=7},function(){this.ba(H(this),this.f);this.a-=7},function(){this.ba(H(this),this.D);this.a-=7},function(){this.ba(H(this),this.g);this.a-=7},function(){this.ba(H(this),this.h);this.a-=7},function(){var a=this.m-1;if(this.sa.length)for(var b=0;b<this.sa.length;b++)if(this.sa[b](a))return;this.a-=7;this.A|=256;Ib(this);this.B&512||Bb(this)},function(){this.ba(H(this),this.b);this.a-=7},function(){this.b=this.c;this.a-=5},function(){this.b=
|
this.a-=5},function(){N(this,H(this),this.g);this.a-=7},function(){N(this,H(this),this.c);this.a-=7},function(){N(this,H(this),this.h);this.a-=7},function(){N(this,H(this),this.f);this.a-=7},function(){N(this,H(this),this.j);this.a-=7},function(){N(this,H(this),this.l);this.a-=7},function(){var a=this.s-1;if(this.ra.length)for(var b=0;b<this.ra.length;b++)if(this.ra[b](a))return;this.a-=7;this.C|=256;Kb(this);this.D&512||Cb(this)},function(){N(this,H(this),this.b);this.a-=7},function(){this.b=this.g;
|
||||||
this.C;this.a-=5},function(){this.b=this.f;this.a-=5},function(){this.b=this.D;this.a-=5},function(){this.b=this.g;this.a-=5},function(){this.b=this.h;this.a-=5},function(){this.b=this.J(H(this));this.a-=7},function(){this.a-=5},function(){this.b=M(this,this.c);this.a-=4},function(){this.b=M(this,this.C);this.a-=4},function(){this.b=M(this,this.f);this.a-=4},function(){this.b=M(this,this.D);this.a-=4},function(){this.b=M(this,this.g);this.a-=4},function(){this.b=M(this,this.h);this.a-=4},function(){this.b=
|
this.a-=5},function(){this.b=this.c;this.a-=5},function(){this.b=this.h;this.a-=5},function(){this.b=this.f;this.a-=5},function(){this.b=this.j;this.a-=5},function(){this.b=this.l;this.a-=5},function(){this.b=M(this,H(this));this.a-=7},function(){this.a-=5},function(){this.b=bc(this,this.g);this.a-=4},function(){this.b=bc(this,this.c);this.a-=4},function(){this.b=bc(this,this.h);this.a-=4},function(){this.b=bc(this,this.f);this.a-=4},function(){this.b=bc(this,this.j);this.a-=4},function(){this.b=
|
||||||
M(this,this.J(H(this)));this.a-=7},function(){this.b=M(this,this.b);this.a-=4},function(){this.b=Xb(this,this.c);this.a-=4},function(){this.b=Xb(this,this.C);this.a-=4},function(){this.b=Xb(this,this.f);this.a-=4},function(){this.b=Xb(this,this.D);this.a-=4},function(){this.b=Xb(this,this.g);this.a-=4},function(){this.b=Xb(this,this.h);this.a-=4},function(){this.b=Xb(this,this.J(H(this)));this.a-=7},function(){this.b=Xb(this,this.b);this.a-=4},function(){this.b=N(this,this.c);this.a-=4},function(){this.b=
|
bc(this,this.l);this.a-=4},function(){this.b=bc(this,M(this,H(this)));this.a-=7},function(){this.b=bc(this,this.b);this.a-=4},function(){this.b=cc(this,this.g);this.a-=4},function(){this.b=cc(this,this.c);this.a-=4},function(){this.b=cc(this,this.h);this.a-=4},function(){this.b=cc(this,this.f);this.a-=4},function(){this.b=cc(this,this.j);this.a-=4},function(){this.b=cc(this,this.l);this.a-=4},function(){this.b=cc(this,M(this,H(this)));this.a-=7},function(){this.b=cc(this,this.b);this.a-=4},function(){this.b=
|
||||||
N(this,this.C);this.a-=4},function(){this.b=N(this,this.f);this.a-=4},function(){this.b=N(this,this.D);this.a-=4},function(){this.b=N(this,this.g);this.a-=4},function(){this.b=N(this,this.h);this.a-=4},function(){this.b=N(this,this.J(H(this)));this.a-=7},function(){this.b=N(this,this.b);this.a-=4},function(){this.b=bc(this,this.c);this.a-=4},function(){this.b=bc(this,this.C);this.a-=4},function(){this.b=bc(this,this.f);this.a-=4},function(){this.b=bc(this,this.D);this.a-=4},function(){this.b=bc(this,
|
L(this,this.g);this.a-=4},function(){this.b=L(this,this.c);this.a-=4},function(){this.b=L(this,this.h);this.a-=4},function(){this.b=L(this,this.f);this.a-=4},function(){this.b=L(this,this.j);this.a-=4},function(){this.b=L(this,this.l);this.a-=4},function(){this.b=L(this,M(this,H(this)));this.a-=7},function(){this.b=L(this,this.b);this.a-=4},function(){this.b=hc(this,this.g);this.a-=4},function(){this.b=hc(this,this.c);this.a-=4},function(){this.b=hc(this,this.h);this.a-=4},function(){this.b=hc(this,
|
||||||
this.g);this.a-=4},function(){this.b=bc(this,this.h);this.a-=4},function(){this.b=bc(this,this.J(H(this)));this.a-=7},function(){this.b=bc(this,this.b);this.a-=4},function(){this.b=Yb(this,this.c);this.a-=4},function(){this.b=Yb(this,this.C);this.a-=4},function(){this.b=Yb(this,this.f);this.a-=4},function(){this.b=Yb(this,this.D);this.a-=4},function(){this.b=Yb(this,this.g);this.a-=4},function(){this.b=Yb(this,this.h);this.a-=4},function(){this.b=Yb(this,this.J(H(this)));this.a-=7},function(){this.b=
|
this.f);this.a-=4},function(){this.b=hc(this,this.j);this.a-=4},function(){this.b=hc(this,this.l);this.a-=4},function(){this.b=hc(this,M(this,H(this)));this.a-=7},function(){this.b=hc(this,this.b);this.a-=4},function(){this.b=dc(this,this.g);this.a-=4},function(){this.b=dc(this,this.c);this.a-=4},function(){this.b=dc(this,this.h);this.a-=4},function(){this.b=dc(this,this.f);this.a-=4},function(){this.b=dc(this,this.j);this.a-=4},function(){this.b=dc(this,this.l);this.a-=4},function(){this.b=dc(this,
|
||||||
Yb(this,this.b);this.a-=4},function(){this.b=cc(this,this.c);this.a-=4},function(){this.b=cc(this,this.C);this.a-=4},function(){this.b=cc(this,this.f);this.a-=4},function(){this.b=cc(this,this.D);this.a-=4},function(){this.b=cc(this,this.g);this.a-=4},function(){this.b=cc(this,this.h);this.a-=4},function(){this.b=cc(this,this.J(H(this)));this.a-=7},function(){this.b=cc(this,this.b);this.a-=4},function(){this.b=ac(this,this.c);this.a-=4},function(){this.b=ac(this,this.C);this.a-=4},function(){this.b=
|
M(this,H(this)));this.a-=7},function(){this.b=dc(this,this.b);this.a-=4},function(){this.b=ic(this,this.g);this.a-=4},function(){this.b=ic(this,this.c);this.a-=4},function(){this.b=ic(this,this.h);this.a-=4},function(){this.b=ic(this,this.f);this.a-=4},function(){this.b=ic(this,this.j);this.a-=4},function(){this.b=ic(this,this.l);this.a-=4},function(){this.b=ic(this,M(this,H(this)));this.a-=7},function(){this.b=ic(this,this.b);this.a-=4},function(){this.b=gc(this,this.g);this.a-=4},function(){this.b=
|
||||||
ac(this,this.f);this.a-=4},function(){this.b=ac(this,this.D);this.a-=4},function(){this.b=ac(this,this.g);this.a-=4},function(){this.b=ac(this,this.h);this.a-=4},function(){this.b=ac(this,this.J(H(this)));this.a-=7},function(){this.b=ac(this,this.b);this.a-=4},function(){N(this,this.c);this.a-=4},function(){N(this,this.C);this.a-=4},function(){N(this,this.f);this.a-=4},function(){N(this,this.D);this.a-=4},function(){N(this,this.g);this.a-=4},function(){N(this,this.h);this.a-=4},function(){N(this,
|
gc(this,this.c);this.a-=4},function(){this.b=gc(this,this.h);this.a-=4},function(){this.b=gc(this,this.f);this.a-=4},function(){this.b=gc(this,this.j);this.a-=4},function(){this.b=gc(this,this.l);this.a-=4},function(){this.b=gc(this,M(this,H(this)));this.a-=7},function(){this.b=gc(this,this.b);this.a-=4},function(){L(this,this.g);this.a-=4},function(){L(this,this.c);this.a-=4},function(){L(this,this.h);this.a-=4},function(){L(this,this.f);this.a-=4},function(){L(this,this.j);this.a-=4},function(){L(this,
|
||||||
this.J(H(this)));this.a-=7},function(){N(this,this.b);this.a-=4},function(){this.l&255&&(F(this,Q(this)),this.a-=6);this.a-=5},function(){Tb(this,Q(this));this.a-=10},function(){var a=P(this);this.l&255&&F(this,a);this.a-=10},gc,function(){var a=P(this);this.l&255&&(R(this,this.m),F(this,a),this.a-=6);this.a-=11},function(){R(this,Sb(this));this.a-=11},function(){this.b=M(this,O(this));this.a-=7},function(){R(this,this.m);F(this,0);this.a-=11},function(){this.l&255||(F(this,Q(this)),this.a-=6);this.a-=
|
this.l);this.a-=4},function(){L(this,M(this,H(this)));this.a-=7},function(){L(this,this.b);this.a-=4},function(){this.o&255&&(F(this,Q(this)),this.a-=6);this.a-=5},function(){Xb(this,Q(this));this.a-=10},function(){var a=P(this);this.o&255&&F(this,a);this.a-=10},mc,function(){var a=P(this);this.o&255&&(R(this,this.s),F(this,a),this.a-=6);this.a-=11},function(){R(this,Vb(this));this.a-=11},function(){this.b=bc(this,O(this));this.a-=7},function(){R(this,this.s);F(this,0);this.a-=11},function(){this.o&
|
||||||
5},hc,function(){var a=P(this);this.l&255||F(this,a);this.a-=10},gc,function(){var a=P(this);this.l&255||(R(this,this.m),F(this,a),this.a-=6);this.a-=11},ic,function(){this.b=Xb(this,O(this));this.a-=7},function(){R(this,this.m);F(this,8);this.a-=11},function(){K(this)||(F(this,Q(this)),this.a-=6);this.a-=5},function(){Vb(this,Q(this));this.a-=10},function(){var a=P(this);K(this)||F(this,a);this.a-=10},function(){for(var a=O(this),b=this.i,c=this.b,d=this.m+-2&65535,e=1,f=0;0<e;){var g=b.w[a],h=b.B[a]||
|
255||(F(this,Q(this)),this.a-=6);this.a-=5},nc,function(){var a=P(this);this.o&255||F(this,a);this.a-=10},mc,function(){var a=P(this);this.o&255||(R(this,this.s),F(this,a),this.a-=6);this.a-=11},oc,function(){this.b=cc(this,O(this));this.a-=7},function(){R(this,this.s);F(this,8);this.a-=11},function(){J(this)||(F(this,Q(this)),this.a-=6);this.a-=5},function(){Zb(this,Q(this));this.a-=10},function(){var a=P(this);J(this)||F(this,a);this.a-=10},function(){for(var a=O(this),b=this.u,c=this.b,d=this.s+
|
||||||
1,k=1==h?255:2==h?65535:-1,k=(c>>>=f)&k;if(void 0!==g&&g[0])g[0](a,k,d);f+=h<<3;a+=h;e-=h}this.a-=10},function(){var a=P(this);K(this)||(R(this,this.m),F(this,a),this.a-=6);this.a-=11},function(){R(this,Ub(this));this.a-=11},function(){this.b=N(this,O(this));this.a-=7},function(){R(this,this.m);F(this,16);this.a-=11},function(){K(this)&&(F(this,Q(this)),this.a-=6);this.a-=5},hc,function(){var a=P(this);K(this)&&F(this,a);this.a-=10},function(){for(var a=O(this),b=this.i,c=this.m+-2&65535,d=1,e=0,
|
-2&65535,e=1,f=0;0<e;){var g=b.l[a],h=b.C[a]||1,l=1==h?255:2==h?65535:-1,l=(c>>>=f)&l;if(void 0!==g&&g[0])g[0](a,l,d);f+=h<<3;a+=h;e-=h}this.a-=10},function(){var a=P(this);J(this)||(R(this,this.s),F(this,a),this.a-=6);this.a-=11},function(){R(this,Yb(this));this.a-=11},function(){this.b=L(this,O(this));this.a-=7},function(){R(this,this.s);F(this,16);this.a-=11},function(){J(this)&&(F(this,Q(this)),this.a-=6);this.a-=5},nc,function(){var a=P(this);J(this)&&F(this,a);this.a-=10},function(){for(var a=
|
||||||
f=0;0<d;){var g=b.l[a],h=b.A[a]||1,k=1==h?255:2==h?65535:-1,n=k;void 0!==g&&g[0]&&(n=g[0](a,c),void 0===n?n=k:n&=k);e|=n<<f;f+=h<<3;a+=h;d-=h}this.b=e&255;this.a-=10},function(){var a=P(this);K(this)&&(R(this,this.m),F(this,a),this.a-=6);this.a-=11},ic,function(){this.b=bc(this,O(this));this.a-=7},function(){R(this,this.m);F(this,24);this.a-=11},function(){Wb(this)||(F(this,Q(this)),this.a-=6);this.a-=5},function(){J(this,Q(this));this.a-=10},function(){var a=P(this);Wb(this)||F(this,a);this.a-=10},
|
O(this),b=this.u,c=this.s+-2&65535,d=1,e=0,f=0;0<d;){var g=b.j[a],h=b.B[a]||1,l=1==h?255:2==h?65535:-1,n=l;void 0!==g&&g[0]&&(n=g[0](a,c),void 0===n?n=l:n&=l);e|=n<<f;f+=h<<3;a+=h;d-=h}this.b=e&255;this.a-=10},function(){var a=P(this);J(this)&&(R(this,this.s),F(this,a),this.a-=6);this.a-=11},oc,function(){this.b=hc(this,O(this));this.a-=7},function(){R(this,this.s);F(this,24);this.a-=11},function(){ac(this)||(F(this,Q(this)),this.a-=6);this.a-=5},function(){I(this,Q(this));this.a-=10},function(){var a=
|
||||||
function(){var a=Q(this);R(this,H(this));J(this,a);this.a-=18},function(){var a=P(this);Wb(this)||(R(this,this.m),F(this,a),this.a-=6);this.a-=11},function(){R(this,H(this));this.a-=11},function(){this.b=Yb(this,O(this));this.a-=7},function(){R(this,this.m);F(this,32);this.a-=11},function(){Wb(this)&&(F(this,Q(this)),this.a-=6);this.a-=5},function(){F(this,H(this));this.a-=5},function(){var a=P(this);Wb(this)&&F(this,a);this.a-=10},function(){var a=H(this);J(this,Ub(this));Vb(this,a);this.a-=5},function(){var a=
|
P(this);ac(this)||F(this,a);this.a-=10},function(){var a=Q(this);R(this,H(this));I(this,a);this.a-=18},function(){var a=P(this);ac(this)||(R(this,this.s),F(this,a),this.a-=6);this.a-=11},function(){R(this,H(this));this.a-=11},function(){this.b=dc(this,O(this));this.a-=7},function(){R(this,this.s);F(this,32);this.a-=11},function(){ac(this)&&(F(this,Q(this)),this.a-=6);this.a-=5},function(){F(this,H(this));this.a-=5},function(){var a=P(this);ac(this)&&F(this,a);this.a-=10},function(){var a=H(this);
|
||||||
P(this);Wb(this)&&(R(this,this.m),F(this,a),this.a-=6);this.a-=11},ic,function(){this.b=cc(this,O(this));this.a-=7},function(){R(this,this.m);F(this,40);this.a-=11},function(){this.o&128||(F(this,Q(this)),this.a-=6);this.a-=5},function(){var a=Q(this);Pb(this,a&255|this.B&-256);this.b=a>>8;this.a-=10},function(){var a=P(this);this.o&128||F(this,a);this.a-=10},function(){this.B&=-513;this.a-=4},function(){var a=P(this);this.o&128||(R(this,this.m),F(this,a),this.a-=6);this.a-=11},function(){R(this,
|
I(this,Yb(this));Zb(this,a);this.a-=5},function(){var a=P(this);ac(this)&&(R(this,this.s),F(this,a),this.a-=6);this.a-=11},oc,function(){this.b=ic(this,O(this));this.a-=7},function(){R(this,this.s);F(this,40);this.a-=11},function(){this.v&128||(F(this,Q(this)),this.a-=6);this.a-=5},function(){var a=Q(this);Sb(this,a&255|this.D&-256);this.b=a>>8;this.a-=10},function(){var a=P(this);this.v&128||F(this,a);this.a-=10},function(){this.D&=-513;this.a-=4},function(){var a=P(this);this.v&128||(R(this,this.s),
|
||||||
Rb(this)&255|this.b<<8);this.a-=11},function(){this.b=ac(this,O(this));this.a-=7},function(){R(this,this.m);F(this,48);this.a-=11},function(){this.o&128&&(F(this,Q(this)),this.a-=6);this.a-=5},function(){this.s=H(this)&65535;this.a-=5},function(){var a=P(this);this.o&128&&F(this,a);this.a-=10},function(){this.B|=512;this.a-=4;dc(this)},function(){var a=P(this);this.o&128&&(R(this,this.m),F(this,a),this.a-=6);this.a-=11},ic,function(){N(this,O(this));this.a-=7},function(){R(this,this.m);F(this,56);
|
F(this,a),this.a-=6);this.a-=11},function(){R(this,Ub(this)&255|this.b<<8);this.a-=11},function(){this.b=gc(this,O(this));this.a-=7},function(){R(this,this.s);F(this,48);this.a-=11},function(){this.v&128&&(F(this,Q(this)),this.a-=6);this.a-=5},function(){this.A=H(this)&65535;this.a-=5},function(){var a=P(this);this.v&128&&F(this,a);this.a-=10},function(){this.D|=512;this.a-=4;jc(this)},function(){var a=P(this);this.v&128&&(R(this,this.s),F(this,a),this.a-=6);this.a-=11},oc,function(){L(this,O(this));
|
||||||
this.a-=11}];function U(a){r.call(this,"ChipSet",a,U);var b=a.model;b&&!jc[b]&&Ea("Unrecognized ChipSet model: "+b);this.c=jc[b]||{};a.sound&&(this.I=null,window&&(this.I=window.AudioContext||window.webkitAudioContext),this.I&&new this.I);B(this)}w(U);
|
this.a-=7},function(){R(this,this.s);F(this,56);this.a-=11}];function U(a){u.call(this,"ChipSet",a);var b=a.model;b&&!pc[b]&&Ca("Unrecognized ChipSet model: "+b);this.b=pc[b]||{};a.sound&&(this.I=null,window&&(this.I=window.AudioContext||window.webkitAudioContext),this.I&&new this.I);B(this)}m(U,u);k=U.prototype;k.S=function(){return!1};
|
||||||
var V={ca:1978.1,Fc:{da:0,Zd:1,ce:16,je:32,se:64,re:128,Ka:14},Ca:{da:1,Vb:1,yc:2,uc:4,vc:16,wc:32,xc:64,Ka:8},Gc:{da:2,Yd:3,Be:4,$d:8,ne:16,oe:32,pe:64,ae:128,Ka:0},we:{da:3},ue:{da:2,ke:7},ye:{da:3,Ce:1,xe:2,qe:4,he:8,be:16,td:32},ve:{da:4},ze:{da:5,de:1,ee:2,fe:4,ge:8,De:16}},X={ca:100,ka:{da:66,Bb:1,qc:2,rc:4,me:8,le:16,yb:32,xb:64,tb:128},Tb:{da:66,INIT:0},Aa:{da:194,wd:0,rb:16,Ac:32,zb:48,cc:0,dc:32},Xa:{da:162,te:0,fc:0,bc:0,ec:0,ac:0},na:{ie:{da:98},Fa:{Qb:0,Pb:1,Dc:2,Lc:4,Wb:5,Bc:6,Ae:7},
|
k.qa=function(a,b,c,d){this.u=b;this.m=c;this.J=d;this.F=a;this.h=C(a,"Keyboard");this.g=C(a,"SerialPort");this.video=C(a,"Video");fb(b,this,this.b.bb);gb(b,this,this.b.cb)};k.ba=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.fa=function(a){return a?this.save():!0};k.reset=function(){this.b.INIT&&!this.restore(this.b.INIT)&&this.G("reset error")};
|
||||||
Za:16383}},jc={SI1978:V,VT100:X};U.prototype.U=function(){return!1};U.prototype.ra=function(a,b,c,d){this.i=b;this.a=c;this.N=d;this.w=a;this.l=C(a,"Keyboard");this.h=C(a,"SerialPort");this.video=C(a,"Video");eb(b,this,this.c.fb);fb(b,this,this.c.gb)};U.prototype.fa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};U.prototype.ha=function(a){return a?this.save():!0};V.INIT=[[V.Fc.Ka,V.Ca.Ka,V.Gc.Ka,0,0,0,0]];
|
k.save=function(){var a=new G(this);switch(this.b.Y){case V.Y:a.set(0,[this.V,this.f,this.X,this.B,this.H,this.P,this.R]);break;case W.Y:a.set(0,[this.N,this.s]),a.set(1,[this.l,this.o]),a.set(2,[this.c,this.C,this.O,this.L]),a.set(3,[this.A,this.a,this.v,this.D,this.j])}return a.data()};
|
||||||
X.INIT=[[X.Tb.INIT,X.ka.qc|X.ka.rc],[X.Aa.cc,X.Aa.dc],[X.Xa.fc,X.Xa.bc,X.Xa.ec,X.Xa.ac],[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],
|
k.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.b.Y){case V.Y:return this.V=b[0],this.f=b[1],this.X=b[2],this.B=b[3],this.H=b[4],this.P=b[5],this.R=b[6],!0;case W.Y:return this.N=b[0],this.s=b[1],b=a[1],this.l=b[0],this.o=b[1],b=a[2],this.c=b[0],this.C=b[1],this.O=b[2],this.L=b[3],b=a[3],this.A=b[0],this.a=b[1],this.v=b[2],this.D=b[3],this.j=b[4],!0}return!1};k.start=function(){};k.stop=function(){};k.Xc=function(){return this.V};k.Yc=function(){return this.f};k.Zc=function(){return this.X};
|
||||||
[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]]];l=U.prototype;l.reset=function(){this.c.INIT&&!this.restore(this.c.INIT)&&this.K("reset error")};
|
k.Wc=function(){return this.B>>8-this.H&255};k.ed=function(a,b){this.H=b};k.gd=function(a,b){this.P=b};k.fd=function(a,b){this.B=b<<8|this.B>>8};k.hd=function(a,b){this.R=b};k.jd=function(){};function qc(a){var b=0,c=0,d=~a.A;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}
|
||||||
l.save=function(){var a=new G(this);switch(this.c.ca){case V.ca:a.set(0,[this.W,this.g,this.Z,this.F,this.H,this.T,this.V]);break;case X.ca:a.set(0,[this.M,this.u]),a.set(1,[this.o,this.s]),a.set(2,[this.f,this.G,this.R,this.P]),a.set(3,[this.B,this.b,this.A,this.L,this.m])}return a.data()};
|
k.$c=function(){var a=this.s,a=a&~W.ga.wb;if((Gb(this.m)&64)<<1&&(a|=W.ga.wb,a!=this.s)){var b,c;b=this.v&1;switch(this.v>>1&7){case W.ia.Ca.Pb:this.A=this.A<<1|b;break;case W.ia.Ca.Wb:b=qc(this);this.j[b]=W.ia.Xa;break;case W.ia.Ca.Qb:this.a=this.a<<1|b;break;case W.ia.Ca.Lc:b=qc(this);c=this.a&W.ia.Xa;this.j[b]=c;break;case W.ia.Ca.Bc:b=qc(this);c=this.j[b];null==c&&(c=W.ia.Xa);this.a=c;break;case W.ia.Ca.Dc:this.a<<=1,this.D=this.a&W.ia.Xa+1}}a&=~W.ga.xb;this.D&&(a|=W.ga.xb);a&=~W.ga.sb;if(b=this.h){b=
|
||||||
l.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.Z=b[2],this.F=b[3],this.H=b[4],this.T=b[5],this.V=b[6],!0;case X.ca:return this.M=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.P=b[3],b=a[3],this.B=b[0],this.b=b[1],this.A=b[2],this.L=b[3],this.m=b[4],!0}return!1};l.start=function(){};l.stop=function(){};l.Yc=function(){return this.W};l.Zc=function(){return this.g};l.$c=function(){return this.Z};
|
this.h;if(c=b.h)c=b.m,c=Gb(b.m)>=b.o+c.na*c.O/1E3*1.2731488;c&&(b.h=!1);b=!b.h}b&&(a|=W.ga.sb);a&=~W.ga.zb;this.g&&this.g.T&rc&&(a|=W.ga.zb);return this.s=a};k.kd=function(a,b){this.N=b};k.nd=function(a,b){this.v=b};k.md=function(a,b){a=b&3;switch(b>>2&3){case 0:this.c=this.c&-4|a;break;case 1:this.c=this.c&-13|a<<2;this.video&&(b=this.video,a=this.c,b.la!==a&&((b.la=a)?Nb(b,!0):b.na=!0));break;case 2:switch(a){case 0:this.C=~this.C;break;case 2:case 3:this.O=3-a}break;case 3:this.L=a}};
|
||||||
l.Xc=function(){return this.F>>8-this.H&255};l.fd=function(a,b){this.H=b};l.hd=function(a,b){this.T=b};l.gd=function(a,b){this.F=b<<8|this.F>>8};l.jd=function(a,b){this.V=b};l.kd=function(){};function kc(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.ld=function(a,b){b&W.ua.Ac?(b&=W.ua.yb,this.o!=b&&(this.o=b,this.video&&(this.video.Gb=this.o==W.ua.yb?50:60))):(b&=W.ua.pb,this.l!=b&&(this.l=b,this.video&&(a=this.video,b=this.l==W.ua.pb?132:80,a.C=b,a.M=a.va,80<b&&a.M--,sc(a)&&tc(a))))};
|
||||||
l.ad=function(){var a=this.u,a=a&~X.ka.xb;if((Eb(this.a)&64)<<1&&(a|=X.ka.xb,a!=this.u)){var b,c;b=this.A&1;switch(this.A>>1&7){case X.na.Fa.Pb:this.B=this.B<<1|b;break;case X.na.Fa.Wb:b=kc(this);this.m[b]=X.na.Za;break;case X.na.Fa.Qb:this.b=this.b<<1|b;break;case X.na.Fa.Lc:b=kc(this);c=this.b&X.na.Za;this.m[b]=c;break;case X.na.Fa.Bc:b=kc(this);c=this.m[b];null==c&&(c=X.na.Za);this.b=c;break;case X.na.Fa.Dc:this.b<<=1,this.L=this.b&X.na.Za+1}}a&=~X.ka.yb;this.L&&(a|=X.ka.yb);a&=~X.ka.tb;if(b=this.l){b=
|
var V={Y:1978.1,Fc:{Z:0,ne:1,re:16,ye:32,He:64,Ge:128,Ha:14},za:{Z:1,Vb:1,yc:2,uc:4,vc:16,wc:32,xc:64,Ha:8},Gc:{Z:2,me:3,Qe:4,oe:8,Ce:16,De:32,Ee:64,pe:128,Ha:0},Le:{Z:3},Je:{Z:2,ze:7},Ne:{Z:3,Re:1,Me:2,Fe:4,we:8,qe:16,Id:32},Ke:{Z:4},Oe:{Z:5,se:1,te:2,ue:4,ve:8,Se:16}},W={Y:100,ga:{Z:66,zb:1,qc:2,rc:4,Be:8,Ae:16,xb:32,wb:64,sb:128},Tb:{Z:66,INIT:0},ua:{Z:194,Ld:0,pb:16,Ac:32,yb:48,cc:0,dc:32},Va:{Z:162,Ie:0,fc:0,bc:0,ec:0,ac:0},ia:{xe:{Z:98},Ca:{Qb:0,Pb:1,Dc:2,Lc:4,Wb:5,Bc:6,Pe:7},Xa:16383}},pc=
|
||||||
this.l;if(c=b.g)c=b.a,c=Eb(b.a)>=b.o+c.ma*c.I/1E3*1.2731488;c&&(b.g=!1);b=!b.g}b&&(a|=X.ka.tb);a&=~X.ka.Bb;this.h&&this.h.X&1&&(a|=X.ka.Bb);return this.u=a};l.ld=function(a,b){this.M=b};l.od=function(a,b){this.A=b};l.nd=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)?Jb(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.P=a}};
|
{SI1978:V,VT100:W};V.INIT=[[V.Fc.Ha,V.za.Ha,V.Gc.Ha,0,0,0,0]];
|
||||||
l.md=function(a,b){b&X.Aa.Ac?(b&=X.Aa.zb,this.s!=b&&(this.s=b,this.video&&(this.video.Jb=this.s==X.Aa.zb?50:60))):(b&=X.Aa.rb,this.o!=b&&(this.o=b,this.video&&(a=this.video,b=this.o==X.Aa.rb?132:80,a.G=b,a.S=a.Ba,80<b&&a.S--,lc(a)&&mc(a))))};V.fb={0:U.prototype.Yc,1:U.prototype.Zc,2:U.prototype.$c,3:U.prototype.Xc};V.gb={2:U.prototype.fd,3:U.prototype.hd,4:U.prototype.gd,5:U.prototype.jd,6:U.prototype.kd};X.fb={66:U.prototype.ad};X.gb={66:U.prototype.ld,98:U.prototype.od,162:U.prototype.nd,194:U.prototype.md};
|
W.INIT=[[W.Tb.INIT,W.ga.qc|W.ga.rc],[W.ua.cc,W.ua.dc],[W.Va.fc,W.Va.bc,W.Va.ec,W.Va.ac],[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],
|
||||||
Ca(function(){for(var a=A(document,"pc8080","chipset"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new U(d);Na(d,c)}});function nc(a){r.call(this,"ROM",a,nc);this.b=null;this.h=a.addr;this.c=a.size;this.g=a.alias;this.f=a.file;this.l=ca(this.f);if(this.f){a=this.f;var b=da(this.l);"json"!=b&&"hex"!=b&&(a=fa()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;ma(a,null,!0,function(a,b,f){oc(c,a,b,f)})}}w(nc);nc.prototype.ra=function(a,b,c,d){this.i=b;this.a=c;this.N=d;pc(this)};
|
[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]]];V.bb={0:U.prototype.Xc,1:U.prototype.Yc,2:U.prototype.Zc,3:U.prototype.Wc};
|
||||||
nc.prototype.fa=function(){this.wa&&(this.N&&this.N.a(this.id,this.h,this.c,this.wa),delete this.wa);return!0};nc.prototype.ha=function(){return!0};
|
V.cb={2:U.prototype.ed,3:U.prototype.gd,4:U.prototype.fd,5:U.prototype.hd,6:U.prototype.jd};W.bb={66:U.prototype.$c};W.cb={66:U.prototype.kd,98:U.prototype.nd,162:U.prototype.md,194:U.prototype.ld};ya(function(){for(var a=A(document,"pc8080","chipset"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new U(d);Ma(d,c)}});
|
||||||
function oc(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Ja(a.za,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,
|
function uc(a){u.call(this,"ROM",a);this.a=null;this.g=a.addr;this.b=a.size;this.f=a.alias;this.c=a.file;this.h=ba(this.c);if(this.c){a=this.c;var b=da(this.h);"json"!=b&&"hex"!=b&&(a=fa()+"/api/v1/dump?file="+this.c+"&format=bytes&decimal=true");var c=this;ma(a,null,!0,function(a,b,f){vc(c,a,b,f)})}}m(uc,u);uc.prototype.qa=function(a,b,c,d){this.u=b;this.m=c;this.J=d;wc(this)};uc.prototype.ba=function(){this.sa&&(this.J&&this.J.a(this.id,this.g,this.b,this.sa),delete this.sa);return!0};
|
||||||
" ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e<b.length;e++)a.b[e]=aa(b[e]);pc(a)}}
|
uc.prototype.fa=function(){return!0};
|
||||||
function pc(a){if(!Pa(a))if(!a.f)B(a);else if(a.b&&a.i){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.j.error=!0;a.K(b)}else{b=a.h;if(Xa(a.i,b,a.c,mb)){var c;for(c=0;c<a.b.length;c++)bb(a.i,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.i,g=d.c,h=[],k=d.h>>>f.i;0<g&&k<f.b.length;)h.push(f.b[k++]),g-=f.c;f=d.i;
|
function vc(a,b,c,d){if(d)a.G("Unable to load system ROM (error "+d+": "+b+")");else{Ha(a.Ia,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,g=e.data;if(f)a.a=f;else if(g)for(a.a=Array(4*g.length),d=c=0;c<g.length;c++)a.a[d++]=g[c]&255,a.a[d++]=g[c]>>8&255,a.a[d++]=g[c]>>16&255,a.a[d++]=g[c]>>24&255;else a.a=e;a.sa=e.symbols;if(!a.a.length){r("Empty ROM: "+b);return}if(1==a.a.length){r(a.a[0]);return}}catch(h){a.G("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm,
|
||||||
d=d.c;g=0;for(e>>>=f.i;0<d&&e<f.b.length;){k=h[g++];if(!k)break;f.b[e++]=k;d-=f.c}}delete a.b}}B(a)}}Ca(function(){for(var a=A(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new nc(d);Na(d,c)}});
|
" ").replace(/ +$/,"").split(" "),a.a=Array(b.length),e=0;e<b.length;e++)a.a[e]=aa(b[e]);wc(a)}}
|
||||||
function qc(a){r.call(this,"RAM",a,qc);this.wa=this.c=null;this.g=a.addr;this.h=a.size;this.Da=a.load;this.xa=a.exec;this.f=!1;this.b=a.file;this.l=ca(this.b);if(this.b){a=this.b;var b=da(this.l);"json"!=b&&"hex"!=b&&(a=fa()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;ma(a,null,!0,function(a,b,f){f?c.K("Unable to load RAM resource (error "+f+": "+a+")"):(Ja(c.za,a,b),(a=na(a,b))?(c.c=a.aa,c.wa=a.wa,null==c.Da&&(c.Da=a.Da),null==c.xa&&(c.xa=a.xa)):c.b=null,rc(c))})}}w(qc);
|
function wc(a){if(!Na(a))if(!a.c)B(a);else if(a.a&&a.u){a.b||(a.b=a.a.length);if(a.a.length!=a.b){var b="ROM size ("+q(a.a.length,8,!0)+") does not match specified size ("+q(a.b,8,!0)+")";a.i.error=!0;a.G(b)}else{b=a.g;if(Wa(a.u,b,a.b,nb)){var c;for(c=0;c<a.a.length;c++)cb(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.b,h=[],l=d.g>>>f.b;0<g&&l<f.a.length;)h.push(f.a[l++]),g-=f.c;f=d.u;
|
||||||
var sc=[0,5];qc.prototype.ra=function(a,b,c,d){this.i=b;this.a=c;this.N=d;rc(this)};qc.prototype.fa=function(){return!0};qc.prototype.ha=function(){return!0};
|
d=d.b;g=0;for(e>>>=f.b;0<d&&e<f.a.length;){l=h[g++];if(!l)break;f.a[e++]=l;d-=f.c}}delete a.a}}B(a)}}ya(function(){for(var a=A(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new uc(d);Ma(d,c)}});
|
||||||
function rc(a){!a.f&&a.h&&Xa(a.i,a.g,a.h,1)&&(a.f=!0);if(!Pa(a)){if(!a.f)q("No RAM allocated");else if(a.b){if(!a.c||!a.i)return;var b=a.g;null!==a.Da&&(b=a.Da);for(var c=0;c<a.c.length;c++)bb(a.i,b+c,a.c[c]);if(null!==a.xa){if(256==a.xa){for(c=0;c<sc.length;c++)bb(a.i,sc[c],118);Ob(a.a,function(a){return function(b){if(0<=sc.indexOf(b)){var c=!1,d=a.a,e=a.N;if(5==b)switch(c=!0,d.C){case 2:tc(a,String.fromCharCode(d.D));break;case 9:for(var k=Ub(d),n="",v=255;v--;){var z=a.a.J(k++);if(36==z)break;
|
function xc(a){u.call(this,"RAM",a);this.sa=this.b=null;this.f=a.addr;this.g=a.size;this.Aa=a.load;this.ta=a.exec;this.c=!1;this.a=a.file;this.h=ba(this.a);if(this.a){a=this.a;var b=da(this.h);"json"!=b&&"hex"!=b&&(a=fa()+"/api/v1/dump?file="+this.a+"&format=bytes&decimal=true");var c=this;ma(a,null,!0,function(a,b,f){f?c.G("Unable to load RAM resource (error "+f+": "+a+")"):(Ha(c.Ia,a,b),(a=na(a,b))?(c.b=a.W,c.sa=a.sa,null==c.Aa&&(c.Aa=a.Aa),null==c.ta&&(c.ta=a.ta)):c.a=null,yc(c))})}}m(xc,u);
|
||||||
n+=String.fromCharCode(z)}tc(a,n);break;default:c=!1}c?hc.call(d):e&&(a.ea("\nCP/M vector "+p(b,4,!0)),F(d,b),Bb(e));b=!0}else b=!1;return b}}(a))}Qb(a.a,a.xa)}delete a.c}B(a)}}qc.prototype.reset=function(){};function tc(a,b){b=b.replace(/\r/g,"");a.ya&&(a.ya.value+=b,a.ya.scrollTop=a.ya.scrollHeight)}Ca(function(){for(var a=A(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new qc(d);Na(d,c)}});
|
xc.prototype.qa=function(a,b,c,d){this.u=b;this.m=c;this.J=d;yc(this)};xc.prototype.ba=function(){return!0};xc.prototype.fa=function(){return!0};
|
||||||
function uc(a){r.call(this,"Keyboard",a,uc);(a=a.model)&&!vc[a]&&Ea("Unrecognized Keyboard8080 model: "+a);this.b=vc[a]||{};this.reset();B(this)}w(uc);var wc={};wc[m.Wa]=37;wc[m.sb]=39;wc[m.ub]=32;
|
function yc(a){!a.c&&a.g&&Wa(a.u,a.f,a.g,1)&&(a.c=!0);if(!Na(a)){if(!a.c)r("No RAM allocated");else if(a.a){if(!a.b||!a.u)return;var b=a.f;null!==a.Aa&&(b=a.Aa);for(var c=0;c<a.b.length;c++)cb(a.u,b+c,a.b[c]);if(null!==a.ta){if(a.ta==zc){for(c=0;c<Ac.length;c++)cb(a.u,Ac[c],118);Rb(a.m,function(a){return function(b){if(0<=Ac.indexOf(b)){var c=!1,d=a.m,e=a.J;if(b==Bc)switch(c=!0,d.c){case Cc:Dc(a,String.fromCharCode(d.f));break;case Ec:for(var l=Yb(d),n="",v=255;v--;){var z=M(a.m,l++);if(36==z)break;
|
||||||
var xc={ca:1978.1,jb:{},qb:wc,La:{},Ia:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},Y={},Z={ca:100,jb:(Y[8]=3,Y[m.tc]=5,Y[m.sc]=6,Y[m.Nc]=7,Y[m.Hc]=8,Y[m.Kc]=9,Y[m.Q]=10,Y[39]=16,Y[221]=20,Y[219]=21,Y[m.$b]=22,Y[m.Ic]=23,Y[m.zc]=24,Y[m.E]=25,Y[49]=26,Y[37]=32,Y[40]=34,Y[117]=35,Y[19]=35,Y[192]=36,Y[189]=37,Y[57]=38,Y[55]=39,Y[52]=40,Y[51]=41,Y[27]=42,Y[38]=48,Y[114]=49,Y[112]=50,Y[46]=51,Y[187]=52,Y[48]=53,Y[56]=54,Y[54]=55,Y[53]=56,Y[50]=57,Y[9]=58,Y[103]=64,Y[115]=65,Y[113]=66,Y[96]=67,Y[118]=
|
n+=String.fromCharCode(z)}Dc(a,n);break;default:c=!1}c?nc.call(d):e&&(a.aa("\nCP/M vector "+q(b,4,!0)),F(d,b),Cb(e));b=!0}else b=!1;return b}}(a))}Tb(a.m,a.ta)}delete a.b}B(a)}}xc.prototype.reset=function(){};function Dc(a,b){b=b.replace(/\r/g,"");a.pa&&(a.pa.value+=b,a.pa.scrollTop=a.pa.scrollHeight)}var Bc=5,Cc=2,Ec=9,zc=256,Ac=[0,Bc];ya(function(){for(var a=A(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new xc(d);Ma(d,c)}});
|
||||||
68,Y[220]=69,Y[m.ub]=70,Y[m.hc]=71,Y[m.Yb]=72,Y[m.Xb]=73,Y[m.Wa]=74,Y[104]=80,Y[2013]=81,Y[98]=82,Y[97]=83,Y[222]=85,Y[186]=86,Y[m.gc]=87,Y[m.Zb]=88,Y[m.sb]=89,Y[m.Cc]=90,Y[110]=96,Y[116]=97,Y[101]=98,Y[100]=99,Y[13]=100,Y[190]=101,Y[188]=102,Y[m.pc]=103,Y[m.Sb]=104,Y[m.Mc]=105,Y[119]=106,Y[105]=112,Y[99]=113,Y[102]=114,Y[109]=115,Y[191]=117,Y[m.oc]=118,Y[m[" "]]=119,Y[m.Jc]=120,Y[m.Ub]=121,Y[m.kb]=122,Y[120]=123,Y[17]=124,Y[16]=125,Y[20]=126,Y),qb:{},La:{},Ia:{"num-comma":116,"break":117,"line-feed":118,
|
function Fc(a){u.call(this,"Keyboard",a);(a=a.model)&&!Gc[a]&&Ca("Unrecognized Keyboard8080 model: "+a);this.a=Gc[a]||{};this.reset();B(this)}m(Fc,u);k=Fc.prototype;
|
||||||
"no-scroll":119,setup:120},Rb:{da:130,INIT:127},ga:{da:130,mc:1,lc:2,kc:4,jc:8,nc:16,wb:32,vb:63,Ec:64,vd:128,INIT:0},ic:127};Z.La={l4:Z.ga.mc,l3:Z.ga.lc,l2:Z.ga.kc,l1:Z.ga.jc,locked:Z.ga.nc,local:Z.ga.wb,online:~Z.ga.wb,"caps-lock":512};var vc={SI1978:xc,VT100:Z};
|
k.S=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.w[e]){if("led"==a&&this.a.Ja[b])return this.w[e]=c,!0;switch(b){case "kbd":case "screen":return c.onkeydown=function(a){return Hc(d,a,!0)},c.onkeyup=function(a){return Hc(d,a,!1)},c.onkeypress=function(a){a=a.keyCode;a>=p.Ua&&a<=p.ib?d.c&(Ic|Jc)||(d.c|=Jc,Kc(d,20,!0),Lc(d)):a>=p.Oc&&a<=p.z&&d.c&Jc&&(d.c&=~Jc,Kc(d,20,!1),Lc(d));return!0},c.onpaste=function(a){a:{if(d.g&&d.g.Ba&&(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),
|
||||||
uc.prototype.U=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.v[e]){if("led"==a&&this.b.La[b])return this.v[e]=c,!0;switch(b){case "kbd":case "screen":return c.onkeydown=function(a){return yc(d,a,!0)},c.onkeyup=function(a){return yc(d,a,!1)},c.onkeypress=function(a){a=a.keyCode;a>=m.Wa&&a<=m.kb?d.c&515||(d.c|=512,Ac(d,20,!0),Bc(d)):a>=m.Pc&&a<=m.z&&d.c&512&&(d.c&=-513,Ac(d,20,!1),Bc(d));return!0},c.onpaste=function(a){a:{if(d.h&&d.h.Ea&&(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&
|
a=a.clipboardData||window.clipboardData)){Mc(d.g,a.getData("Text"));a=!1;break a}a=!0}return a},!0;default:if(this.a.Ea&&void 0!==this.a.Ea[b])return this.w[e]=c,c.onclick=function(a,b){return function(c){c.preventDefault&&c.preventDefault();Kc(a,b,!0,!0)}}(this,this.a.Ea[b]),!0}}return!1};k.qa=function(a,b,c,d){this.F=a;this.m=c;this.J=d;var e=this;this.v=Ib(this.m,function(){Nc(e)});this.N=C(a,"ChipSet");this.g=C(a,"SerialPort");fb(b,this,this.a.bb);gb(b,this,this.a.cb)};
|
||||||
a.preventDefault(),a=a.clipboardData||window.clipboardData)){Cc(d.h,a.getData("Text"));a=!1;break a}a=!0}return a},!0;default:if(this.b.Ia&&void 0!==this.b.Ia[b])return this.v[e]=c,c.onclick=function(a,b){return function(c){c.preventDefault&&c.preventDefault();Ac(a,b,!0,!0)}}(this,this.b.Ia[b]),!0}}return!1};uc.prototype.ra=function(a,b,c,d){this.w=a;this.a=c;this.N=d;var e=this;this.u=Gb(this.a,function(){Dc(e)});this.L=C(a,"ChipSet");this.h=C(a,"SerialPort");eb(b,this,this.b.fb);fb(b,this,this.b.gb)};
|
k.ba=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.fa=function(a){return a?this.save():!0};k.reset=function(){this.b=[];this.c=0;this.a.INIT&&!this.restore(this.a.INIT)&&this.G("reset error")};k.save=function(){var a=new G(this);switch(this.a.Y){case X.Y:a.set(0,[this.l,this.j,this.h,this.o,-1])}return a.data()};
|
||||||
uc.prototype.fa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};uc.prototype.ha=function(a){return a?this.save():!0};Z.INIT=[[Z.ga.INIT,Z.Rb.INIT,!1,0,-1]];l=uc.prototype;l.reset=function(){this.i=[];this.c=0;this.b.INIT&&!this.restore(this.b.INIT)&&this.K("reset error")};l.save=function(){var a=new G(this);switch(this.b.ca){case Z.ca:a.set(0,[this.m,this.l,this.g,this.o,-1])}return a.data()};
|
k.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.a.Y){case Oc.Y:return!0;case X.Y:return this.l=b[0],Lc(this,this.l&X.ea.ub),this.j=b[1],this.h=b[2],this.o=b[3],this.f=b[4],!0}return!1};function Lc(a,b){var c;null!=b?a.s=b:b=a.s;for(var d in a.a.Ja)if(c="led-"+d,c=a.w[c]){var e=a.a.Ja[d],f=!!(b&e);e&e-1&&(f=!(b&~e));c.style.backgroundColor=f?"#"+q(16711680,6):"#000000"}if(c=a.w["led-caps-lock"])c.style.backgroundColor=a.c&Jc?"#"+q(65280,6):"#000000"}
|
||||||
l.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.b.ca){case xc.ca:return!0;case Z.ca:return this.m=b[0],Bc(this,this.m&Z.ga.vb),this.l=b[1],this.g=b[2],this.o=b[3],this.f=b[4],!0}return!1};function Bc(a,b){var c;null!=b?a.s=b:b=a.s;for(var d in a.b.La)if(c="led-"+d,c=a.v[c]){var e=a.b.La[d],f=!!(b&e);e&e-1&&(f=!(b&~e));c.style.backgroundColor=f?"#"+p(16711680,6):"#000000"}if(c=a.v["led-caps-lock"])c.style.backgroundColor=a.c&512?"#"+p(65280,6):"#000000"}
|
function Hc(a,b,c){var d=!0,e=b.keyCode,f=2==b.location,g=0;switch(e){case 16:g=f?Pc:Qc;break;case 17:g=f?Rc:Sc;break;case 18:g=f?Tc:Uc;break;case 91:g=f?Wc:Xc;break;case 20:g=Jc}g&&(a.c=c?a.c|g:a.c&~g);var h;a:if(e=a.a.ob[e]||e,a.a.hb[e])h=e;else{for(h in a.a.Ea)if(a.a.Ea[h]===e)break a;h=null}h&&!b.metaKey&&(d=!1,a.c&(Yc|Zc)&&(13==h?(h=118,d=!0):8==h&&(h=46,d=!0),d&&(a.c=c?a.c|Zc:a.c&~Zc)),d=Kc(a,h,c),(!(h>=p.Ua&&h<=p.ib)||a.c|$c)&&b.preventDefault&&b.preventDefault());return d}
|
||||||
function yc(a,b,c){var d=!0,e=b.keyCode,f=2==b.location,g=0;switch(e){case 16:g=f?1:2;break;case 17:g=f?4:8;break;case 18:g=f?16:32;break;case 91:g=f?64:128;break;case 20:g=512}g&&(a.c=c?a.c|g:a.c&~g);var h;a:if(e=a.b.qb[e]||e,a.b.jb[e])h=e;else{for(h in a.b.Ia)if(a.b.Ia[h]===e)break a;h=null}h&&!b.metaKey&&(d=!1,a.c&4144&&(13==h?(h=118,d=!0):8==h&&(h=46,d=!0),d&&(a.c=c?a.c|4096:a.c&-4097)),d=Ac(a,h,c),(!(h>=m.Wa&&h<=m.kb)||a.c|12)&&b.preventDefault&&b.preventDefault());return d}
|
function Kc(a,b,c,d){var e;a:{for(e=0;e<a.b.length;e++)if(a.b[e].nb==b)break a;e=-1}if(c)0>e?a.b.push({nb:b,lb:Date.now(),$a:d||!1}):(a.b[e].lb=Date.now(),a.b[e].$a=d||!1),d&&Nc(a);else if(0<=e){if(!a.b[e].$a&&(d=a.b[e].lb)&&Date.now()-d<ad)return a.b[e].$a=!0,Nc(a),!0;a.b.splice(e,1)}if(a.N){d=0;switch(b){case "1p":d=V.za.uc;break;case "2p":d=V.za.yc;break;case "coin":d=V.za.Vb;break;case "left":d=V.za.wc;break;case "right":d=V.za.xc;break;case "fire":d=V.za.vc}d&&(a=a.N,b=d,a.f&=~b,c&&(a.f|=b))}return!0}
|
||||||
function Ac(a,b,c,d){var e;a:{for(e=0;e<a.i.length;e++)if(a.i[e].pb==b)break a;e=-1}if(c)0>e?a.i.push({pb:b,mb:Date.now(),cb:d||!1}):(a.i[e].mb=Date.now(),a.i[e].cb=d||!1),d&&Dc(a);else if(0<=e){if(!a.i[e].cb&&(d=a.i[e].mb)&&50>Date.now()-d)return a.i[e].cb=!0,Dc(a),!0;a.i.splice(e,1)}if(a.L){d=0;switch(b){case "1p":d=V.Ca.uc;break;case "2p":d=V.Ca.yc;break;case "coin":d=V.Ca.Vb;break;case "left":d=V.Ca.wc;break;case "right":d=V.Ca.xc;break;case "fire":d=V.Ca.vc}d&&(a=a.L,b=d,a.g&=~b,c&&(a.g|=b))}return!0}
|
function Nc(a){for(var b=0,c=-1;b<a.b.length;){if(a.b[b].$a){var d=a.b[b].nb,e=ad-(Date.now()-a.b[b].lb);if(0<e){if(0>c||c>e)c=e}else{Kc(a,d,!1);b=0;continue}}b++}0<=c&&Jb(a.m,a.v,c)}k.ad=function(){var a=this.j;0<=this.f&&(this.f<this.b.length?(a=this.b[this.f],this.f++,a=X.hb[a.nb],a&128&&(a&=127)):(this.f=-1,a=X.ic),this.j=a,kc(this.m,1));return a};k.od=function(a,b){this.l=b;this.h=!0;this.o=Gb(this.m);Lc(this,b&X.ea.ub);b&X.ea.Ec&&(this.f=0,kc(this.m,1))};
|
||||||
function Dc(a){for(var b=0,c=-1;b<a.i.length;){if(a.i[b].cb){var d=a.i[b].pb,e=50-(Date.now()-a.i[b].mb);if(0<e){if(0>c||c>e)c=e}else{Ac(a,d,!1);b=0;continue}}b++}0<=c&&Hb(a.a,a.u,c)}l.bd=function(){var a=this.l;0<=this.f&&(this.f<this.i.length?(a=this.i[this.f],this.f++,a=Z.jb[a.pb],a&128&&(a&=127)):(this.f=-1,a=Z.ic),this.l=a,ec(this.a,1));return a};l.pd=function(a,b){this.m=b;this.g=!0;this.o=Eb(this.a);Bc(this,b&Z.ga.vb);b&Z.ga.Ec&&(this.f=0,ec(this.a,1))};Z.fb={130:uc.prototype.bd};Z.gb={130:uc.prototype.pd};
|
var Pc=1,Qc=2,Ic=3,Rc=4,Sc=8,$c=12,Tc=16,Uc=32,Yc=48,Wc=64,Xc=128,Jc=512,Zc=4096,ad=50,bd={};bd[p.Ua]=37;bd[p.rb]=39;bd[p.tb]=32;
|
||||||
Ca(function(){for(var a=A(document,"pc8080","keyboard"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new uc(d);Na(d,c)}});
|
var Oc={Y:1978.1,hb:{},ob:bd,Ja:{},Ea:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},Z={},X={Y:100,hb:(Z[8]=3,Z[p.tc]=5,Z[p.sc]=6,Z[p.Nc]=7,Z[p.Hc]=8,Z[p.Kc]=9,Z[p.Q]=10,Z[39]=16,Z[221]=20,Z[219]=21,Z[p.$b]=22,Z[p.Ic]=23,Z[p.zc]=24,Z[p.E]=25,Z[49]=26,Z[37]=32,Z[40]=34,Z[117]=35,Z[19]=35,Z[192]=36,Z[189]=37,Z[57]=38,Z[55]=39,Z[52]=40,Z[51]=41,Z[27]=42,Z[38]=48,Z[114]=49,Z[112]=50,Z[46]=51,Z[187]=52,Z[48]=53,Z[56]=54,Z[54]=55,Z[53]=56,Z[50]=57,Z[9]=58,Z[103]=64,Z[115]=65,Z[113]=66,Z[96]=67,Z[118]=
|
||||||
function Ec(a,b,c,d,e){var f=this;this.Na=ua("Gecko/");var g=["","moz","ms","webkit"];r.call(this,"Video",a,Ec);this.B=a.screenWidth;this.u=a.screenHeight;this.ja=a.bufferAddr;this.Qc=a.bufferRAM;var h=a.bufferFormat;this.T=h&&Fc[h.toUpperCase()]||Gc;this.G=a.bufferCols;this.V=a.bufferRows;this.Ba=this.S=a.cellWidth||1;this.O=a.cellHeight||1;this.W=null;this.Ma=!1;this.la=a.bufferBits||1;this.Rc=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: "+
|
68,Z[220]=69,Z[p.tb]=70,Z[p.hc]=71,Z[p.Yb]=72,Z[p.Xb]=73,Z[p.Ua]=74,Z[104]=80,Z[2013]=81,Z[98]=82,Z[97]=83,Z[222]=85,Z[186]=86,Z[p.gc]=87,Z[p.Zb]=88,Z[p.rb]=89,Z[p.Cc]=90,Z[110]=96,Z[116]=97,Z[101]=98,Z[100]=99,Z[13]=100,Z[190]=101,Z[188]=102,Z[p.pc]=103,Z[p.Sb]=104,Z[p.Mc]=105,Z[119]=106,Z[105]=112,Z[99]=113,Z[102]=114,Z[109]=115,Z[191]=117,Z[p.oc]=118,Z[p[" "]]=119,Z[p.Jc]=120,Z[p.Ub]=121,Z[p.ib]=122,Z[120]=123,Z[17]=124,Z[16]=125,Z[20]=126,Z),ob:{},Ja:{},Ea:{"num-comma":116,"break":117,"line-feed":118,
|
||||||
this.c),this.c=0);this.ma=a.interruptRate;this.Cb=a.refreshRate||60;this.s=b;this.f=c;this.P=(this.Uc=d)||b||null;this.Oc=this.B;this.Ob=this.u;this.Ga=this.B/this.G|0;this.Ha=this.u/this.V|0;1<this.O&&(this.V++,this.qa=0,this.ta=!1);b=a.smoothing;(c=va("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: "+
|
"no-scroll":119,setup:120},Rb:{Z:130,INIT:127},ea:{Z:130,mc:1,lc:2,kc:4,jc:8,nc:16,vb:32,ub:63,Ec:64,Kd:128,INIT:0},ic:127};X.Ja={l4:X.ea.mc,l3:X.ea.lc,l2:X.ea.kc,l1:X.ea.jc,locked:X.ea.nc,local:X.ea.vb,online:~X.ea.vb,"caps-lock":Jc};var Gc={SI1978:Oc,VT100:X};X.INIT=[[X.ea.INIT,X.Rb.INIT,!1,0,-1]];X.bb={130:Fc.prototype.ad};X.cb={130:Fc.prototype.od};ya(function(){for(var a=A(document,"pc8080","keyboard"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Fc(d);Ma(d,c)}});
|
||||||
this.g),this.g=0):(this.f.translate(0,this.u),this.f.rotate(this.g*Math.PI/180),this.f.scale(this.u/this.B,this.B/this.u));if(this.b=e)if(this.b.Ja=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.b.Ja){for(c=0;c<g.length;c++)if(d=g[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){Hc(f,!!(document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement))},!1);
|
function cd(a,b,c,d,e){u.call(this,"Video",a);var f=this;this.Da=ua("Gecko/");var g=["","moz","ms","webkit"];this.A=a.screenWidth;this.s=a.screenHeight;this.ca=a.bufferAddr;this.Pc=a.bufferRAM;var h=a.bufferFormat;this.P=h&&dd[h.toUpperCase()]||ed;this.C=a.bufferCols;this.R=a.bufferRows;this.va=this.M=a.cellWidth||1;this.K=a.cellHeight||1;this.V=null;this.ya=!1;this.da=a.bufferBits||1;this.Qc=a.bufferLeft||0;if(this.b=a.bufferRotate)this.b=this.b%360,0<this.b&&(this.b-=360),-90!=this.b&&(this.G("unsupported buffer rotation: "+
|
||||||
break}for(c=0;c<g.length;c++)if(d=g[c]+"fullscreenerror","on"+d in document){document.addEventListener(d,function(){Hc(f,null)},!1);break}}if(this.L=a.fontROM)"json"!=da(this.L)&&(this.L=fa()+"/api/v1/dump?file="+this.L+"&format=bytes"),ma(this.L,null,!0,function(a,b,c){Ic(f,a,b,c)});this.va={}}w(Ec);var Gc=0,Fc={SI1978:1,VT100:2};
|
this.b),this.b=0);this.ha=a.interruptRate;this.Na=a.refreshRate||60;this.o=b;this.c=c;this.L=(this.Tc=d)||b||null;this.jb=this.A;this.Ob=this.s;this.wa=this.A/this.C|0;this.xa=this.s/this.R|0;1<this.K&&(this.R++,this.la=0,this.na=!1);b=a.smoothing;(c=va("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.c[d]){this.c[d]=b;break}if(this.f=a.screenRotate)this.f=this.f%360,0<this.f&&(this.f-=360),-90!=this.f?(this.G("unsupported screen rotation: "+
|
||||||
function lc(a){a.m=a.G*a.S;a.F=a.V*a.O;var b=a.m,c=a.F;a.c&&(b=a.F,c=a.m);a.A=0;if(!a.Qc&&(a.A=(a.m*a.la>>3)*a.F,!Xa(a.i,a.ja,a.A,3)))return!1;a.A?(a.Oa=a.f.createImageData(b,c),a.Qa=16/a.la|0,Jc(a,a.A>>1)):Jc(a,(a.G+1)*a.V);a.o=document.createElement("canvas");a.o.width=b;a.o.height=c;a.sa=a.o.getContext("2d");a.H={};a.R=1<<a.la;a.I=Array(a.R+2);a.I[0]=[0,0,0,255];a.I[1]=[255,255,255,255];1==a.T&&(a.I[a.R+0]=[255,255,0,255],a.I[a.R+1]=[0,255,0,255]);2==a.T&&(a.Jb=60,a.ua=!1,a.Z=Array(a.G));return!0}
|
this.f),this.f=0):(this.c.translate(0,this.s),this.c.rotate(this.f*Math.PI/180),this.c.scale(this.s/this.A,this.A/this.s));if(this.a=e)if(this.a.Ga=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.a.Ga){for(c=0;c<g.length;c++)if(d=g[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){fd(f,!!(document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement))},!1);
|
||||||
Ec.prototype.ra=function(a,b,c,d){this.w=a;this.i=b;this.a=c;this.N=d;lc(this);if(this.l=C(a,"Keyboard")){for(var e in this.va)this.l.U("led",e,this.va[e]);this.s&&this.l.U(this.Uc?"textarea":"canvas","screen",this.P)}var f=this;this.Db=Gb(this.a,function(){Jb(f)});Hb(this.a,this.Db,1E3/Math.max(this.Cb,this.ma));this.$a=0;this.L||B(this)};
|
break}for(c=0;c<g.length;c++)if(d=g[c]+"fullscreenerror","on"+d in document){document.addEventListener(d,function(){fd(f,null)},!1);break}}if(this.D=a.fontROM)"json"!=da(this.D)&&(this.D=fa()+"/api/v1/dump?file="+this.D+"&format=bytes"),ma(this.D,null,!0,function(a,b,c){gd(f,a,b,c)});this.ra={}}m(cd,u);
|
||||||
function Ic(a,b,c,d){if(d)a.K("Unable to load font ROM (error "+d+": "+b+")");else{Ja(a.za,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.W=f,mc(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.N)&&B(a)}}
|
function sc(a){a.j=a.C*a.M;a.B=a.R*a.K;var b=a.j,c=a.B;a.b&&(b=a.B,c=a.j);a.v=0;if(!a.Pc&&(a.v=(a.j*a.da>>3)*a.B,!Wa(a.u,a.ca,a.v,3)))return!1;a.v?(a.Fa=a.c.createImageData(b,c),a.La=16/a.da|0,hd(a,a.v>>1)):hd(a,(a.C+1)*a.R);a.l=document.createElement("canvas");a.l.width=b;a.l.height=c;a.ma=a.l.getContext("2d");a.H={};a.O=1<<a.da;a.I=Array(a.O+id);a.I[0]=[0,0,0,255];a.I[1]=[255,255,255,255];a.P==jd&&(a.I[a.O+kd]=[255,255,0,255],a.I[a.O+ld]=[0,255,0,255]);a.P==md&&(a.Gb=60,a.oa=!1,a.X=Array(a.C));
|
||||||
function mc(a){a.W&&(a.Ma=2==a.T,a.H[96]=[Kc(a,a.S,a.O),Kc(a,a.S,a.O,a.ua)],a.H[64]=[Kc(a,2*a.S,a.O),Kc(a,2*a.S,a.O,a.ua)],a.H[32]=a.H[0]=[Kc(a,2*a.S,2*a.O),Kc(a,2*a.S,2*a.O,a.ua)])}
|
return!0}cd.prototype.qa=function(a,b,c,d){this.F=a;this.u=b;this.m=c;this.J=d;sc(this);if(this.h=C(a,"Keyboard")){for(var e in this.ra)this.h.S("led",e,this.ra[e]);this.o&&this.h.S(this.Tc?"textarea":"canvas","screen",this.L)}var f=this;this.Oa=Ib(this.m,function(){Nb(f)});Jb(this.m,this.Oa,1E3/Math.max(this.Na,this.ha));this.Ma=0;this.D||B(this)};
|
||||||
function Kc(a,b,c,d){var e=8>=a.Ba?8:16,f=8<e?15:0,g=a.W.length/e,h=!1===d,k={S:b,O:c};k.canvas=document.createElement("canvas");k.canvas.width=16*b;k.canvas.height=g/16*c;k.context=k.canvas.getContext("2d");for(var n=k.context.createImageData(b,c),v=0;v<g;v++){for(var z=0,I=z;z<a.O;z++)for(var x=v*e+(f+z&e-1),x=d&&8==z?255:a.W[x],t=0;t<c/a.O;t++){for(var E=0,S=0,W=S;S<a.S;S++){for(var ba=x&128>>(7<S?7:S),E=a.Ma&&!ba&&E?E:ba,ta=0;ta<b/a.S;ta++)h&&(E=!E),Lc(a,n,W,I,E?1:0),W++;E=ba}I++}k.context.putImageData(n,
|
function gd(a,b,c,d){if(d)a.G("Unable to load font ROM (error "+d+": "+b+")");else{Ha(a.Ia,b,c);try{var e=eval("("+c+")"),f=e.bytes||e;if(!f||!f.length){r("Empty font ROM: "+b);return}if(1==f.length){r(f[0]);return}if(2048==f.length)a.V=f,tc(a);else{a.G("Unrecognized font data length ("+f.length+")");return}}catch(g){a.G("Font ROM data error: "+g.message);return}(a.c||a.J)&&B(a)}}
|
||||||
(v&15)*b,(v>>4)*c)}return k}Ec.prototype.fa=function(){return!0};Ec.prototype.U=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.va[b]=c,!0;switch(b){case "fullScreen":return this.v[b]=c,this.b&&this.b.Ja?c.onclick=function(){d.Ja()}:c.parentNode.removeChild(c),!0}return!1};
|
function tc(a){a.V&&(a.ya=a.P==md,a.H[nd]=[od(a,a.M,a.K),od(a,a.M,a.K,a.oa)],a.H[pd]=[od(a,2*a.M,a.K),od(a,2*a.M,a.K,a.oa)],a.H[qd]=a.H[rd]=[od(a,2*a.M,2*a.K),od(a,2*a.M,2*a.K,a.oa)])}
|
||||||
Ec.prototype.Ja=function(){var a=!1;if(this.b){if(this.b.Ja){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.B/this.u;b>c&&(a=Math.round(c/b*100)+"%")}this.Na?(this.s.style.width=a,this.s.style.width=a,this.s.style.display="block",this.s.style.margin="auto"):(this.b.style.width=a,this.b.style.height="auto");this.b.style.backgroundColor="black";this.b.Ja();a=!0}this.P&&this.P.focus()}return a};
|
function od(a,b,c,d){var e=8>=a.va?8:16,f=8<e?15:0,g=a.V.length/e,h=!1===d,l={M:b,K: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),v=0;v<g;v++){for(var z=0,K=z;z<a.K;z++)for(var x=v*e+(f+z&e-1),x=d&&8==z?255:a.V[x],t=0;t<c/a.K;t++){for(var E=0,S=0,Y=S;S<a.M;S++){for(var ca=x&128>>(7<S?7:S),E=a.ya&&!ca&&E?E:ca,ta=0;ta<b/a.M;ta++)h&&(E=!E),sd(a,n,Y,K,E?1:0),Y++;E=ca}K++}l.context.putImageData(n,
|
||||||
function Hc(a,b){!b&&a.b&&(a.Na?a.s.style.width=a.s.style.height="":a.b.style.width=a.b.style.height="")}function Jc(a,b){a.Pa=b;a.M=!1;if(void 0===a.h||a.h.length!=a.Pa)a.h=Array(a.Pa)}function Lc(a,b,c,d,e){d=a.c?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.T&&(208<=c&&236>c?e=a.R+0:28<=c&&72>c&&(e=a.R+1));a=a.I[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]}
|
(v&15)*b,(v>>4)*c)}return l}cd.prototype.ba=function(){return!0};cd.prototype.S=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.ra[b]=c,!0;switch(b){case "fullScreen":return this.w[b]=c,this.a&&this.a.Ga?c.onclick=function(){d.Ga()}:c.parentNode.removeChild(c),!0}return!1};
|
||||||
function Jb(a,b){var c=!0;if(!b){a.ma&&(120==a.ma?a.$a&1?(ec(a.a,2),c=!1):ec(a.a,1):ec(a.a,4));if(c&&a.M&&a.A){for(var d=a.i,e=a.A,f=!0,g=a.ja>>>d.i;0<e&&g<d.b.length;)d.b[g].oa&&(d.b[g].oa=f=!1,d.b[g].Gb=!0),e-=d.c,g++;f&&(c=!1)}Hb(a.a,a.Db,1E3/Math.max(a.Cb,a.ma));a.$a++}if(c)if(1<a.S)switch(a.T){case 2:for(var c=a.ja,d=-1,e=0,f=60==a.Jb?2:5,h=g=0,k=-1;e<a.V;){var n=0,v=c,z=d,I=a.G;for(96!=z&&(I>>=1);;){var x=$a(a.i,v++);if(127==(x&127)){var t=$a(a.i,v++),d=t&96,c=(t&15)<<8|$a(a.i,v),c=c+(t&16?
|
cd.prototype.Ga=function(){var a=!1;if(this.a){if(this.a.Ga){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.A/this.s;b>c&&(a=Math.round(c/b*100)+"%")}this.Da?(this.o.style.width=a,this.o.style.width=a,this.o.style.display="block",this.o.style.margin="auto"):(this.a.style.width=a,this.a.style.height="auto");this.a.style.backgroundColor="black";this.a.Ga();a=!0}this.L&&this.L.focus()}return a};
|
||||||
8192:16384);break}if(n<I)a.Z[n++]=x;else break}if(f)f--;else{for(;n<a.Z.length;)a.Z[n++]=0;if(0<=z)for(v=a.M&&a.h[g]==I,a.h[g++]=I,I=0;I<n;I++){x=a.Z[I];if(!v||x!==a.h[g]){a.h[k=g]=x;var t=a,E=a.sa,S=x&127;if(x=t.H[z][x&128?1:0]){var W=(S&15)*x.S,S=(S>>4)*x.O,ba,ta,Ra,ib,zc=x.S,Nb=x.O;E?(ba=I*t.S,ta=e*t.O,Ra=t.S,ib=t.O):(ba=I*t.Ga,ta=e*t.Ha,Ra=t.Ga,ib=t.Ha);x.S>t.S&&(ba*=2,Ra*=2);x.O>t.O&&(z||(S+=t.O),Nb=t.O);E?E.drawImage(x.canvas,W,S,zc,Nb,ba,ta,Ra,ib):(ba+=0,ta+=0,t.f.drawImage(x.canvas,W,S,zc,
|
function fd(a,b){!b&&a.a&&(a.Da?a.o.style.width=a.o.style.height="":a.a.style.width=a.a.style.height="")}function hd(a,b){a.Ka=b;a.N=!1;if(void 0===a.g||a.g.length!=a.Ka)a.g=Array(a.Ka)}function sd(a,b,c,d,e){d=a.b?(b.height-c-1)*b.width+d:c+d*b.width;e&&a.P==jd&&(208<=c&&236>c?e=a.O+kd:28<=c&&72>c&&(e=a.O+ld));a=a.I[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]}
|
||||||
Nb,ba,ta,Ra,ib))}h++}g++}e++}}a.M=!0;!b&&a.ta&&1==h&&(a.h[k]=-1,h=0);a.ta=!1;(h||b)&&a.sa&&a.f.drawImage(a.o,0,a.qa,a.m,a.F-a.O,0,0,a.Oc,a.Ob)}else{e=a.ja;f=e+a.A;k=h=g=0;b=a.m;n=0;c=a.F;z=d=0;v=a.la;I=(1<<v)-1;a.Rc&&(v=-v,z=16+v);for(;e<f;){t=a.i;E=e;x=E&t.f;W=(E&t.g)>>>t.i;t=x!=t.f?t.b[W].Kb(x,E):t.b[W++].hb(x,E)|t.b[W&t.m].hb(0,E+1)<<8;if(a.M&&t===a.h[g])h+=a.Qa;else{a.h[g]=t;(E=z)&&(t=t>>8|(t&255)<<8);h<b&&(b=h);for(x=a.Qa;x--;)W=t>>E&I,Lc(a,a.Oa,h++,k,W),E+=v;h>n&&(n=h);k<c&&(c=k);k>=d&&(d=k+
|
function Nb(a,b){var c=!0;if(!b){a.ha&&(120==a.ha?a.Ma&1?(kc(a.m,2),c=!1):kc(a.m,1):kc(a.m,4));if(c&&a.N&&a.v){for(var d=a.u,e=a.v,f=!0,g=a.ca>>>d.b;0<e&&g<d.a.length;)d.a[g].ja&&(d.a[g].ja=f=!1,d.a[g].Db=!0),e-=d.c,g++;f&&(c=!1)}Jb(a.m,a.Oa,1E3/Math.max(a.Na,a.ha));a.Ma++}if(c)if(1<a.M)switch(a.P){case md:for(var c=a.ca,d=-1,e=0,f=60==a.Gb?2:5,h=g=0,l=-1;e<a.R;){var n=0,v=c,z=d,K=a.C;for(z!=nd&&(K>>=1);;){var x=ab(a.u,v++);if((x&td)==td){var t=ab(a.u,v++),d=t&ud,c=(t&vd)<<8|ab(a.u,v),c=c+(t&wd?xd:
|
||||||
1)}e+=2;g++;if(h>=a.m&&(h=0,k++,k>a.F))break}a.M=!0;b<a.m&&(e=n-b,d-=c,a.c&&(f=b,g=e,b=c,e=d,c=a.m-(f+g),d=g),a.sa.putImageData(a.Oa,0,0,b,c,e,d),a.f.drawImage(a.o,0,0,a.o.width,a.o.height,0,0,a.B,a.u))}}
|
yd);break}if(n<K)a.X[n++]=x;else break}if(f)f--;else{for(;n<a.X.length;)a.X[n++]=0;if(0<=z)for(v=a.N&&a.g[g]==K,a.g[g++]=K,K=0;K<n;K++){x=a.X[K];if(!v||x!==a.g[g]){a.g[l=g]=x;var t=a,E=a.ma,S=x&127;if(x=t.H[z][x&128?1:0]){var Y=(S&15)*x.M,S=(S>>4)*x.K,ca,ta,Ua,mb,Vc=x.M,Wb=x.K;E?(ca=K*t.M,ta=e*t.K,Ua=t.M,mb=t.K):(ca=K*t.wa,ta=e*t.xa,Ua=t.wa,mb=t.xa);x.M>t.M&&(ca*=2,Ua*=2);x.K>t.K&&(z==rd&&(S+=t.K),Wb=t.K);E?E.drawImage(x.canvas,Y,S,Vc,Wb,ca,ta,Ua,mb):(ca+=0,ta+=0,t.c.drawImage(x.canvas,Y,S,Vc,Wb,
|
||||||
Ca(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=
|
ca,ta,Ua,mb))}h++}g++}e++}}a.N=!0;!b&&a.na&&1==h&&(a.g[l]=-1,h=0);a.na=!1;(h||b)&&a.ma&&a.c.drawImage(a.l,0,a.la,a.j,a.B-a.K,0,0,a.jb,a.Ob)}else{e=a.ca;f=e+a.v;l=h=g=0;b=a.j;n=0;c=a.B;z=d=0;v=a.da;K=(1<<v)-1;a.Qc&&(v=-v,z=16+v);for(;e<f;){t=a.u;E=e;x=E&t.f;Y=(E&t.g)>>>t.b;t=x!=t.f?t.a[Y].Jb(x,E):t.a[Y++].eb(x,E)|t.a[Y&t.o].eb(0,E+1)<<8;if(a.N&&t===a.g[g])h+=a.La;else{a.g[g]=t;(E=z)&&(t=t>>8|(t&255)<<8);h<b&&(b=h);for(x=a.La;x--;)Y=t>>E&K,sd(a,a.Fa,h++,l,Y),E+=v;h>n&&(n=h);l<c&&(c=l);l>=d&&(d=l+1)}e+=
|
||||||
(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||va("aspect"));f&&.3<=f&&3.33>=f&&(Ba("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");ua("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new Ec(d,e,g,f,c);Na(d,c)}});
|
2;g++;if(h>=a.j&&(h=0,l++,l>a.B))break}a.N=!0;b<a.j&&(e=n-b,d-=c,a.b&&(f=b,g=e,b=c,e=d,c=a.j-(f+g),d=g),a.ma.putImageData(a.Fa,0,0,b,c,e,d),a.c.drawImage(a.l,0,0,a.l.width,a.l.height,0,0,a.A,a.s))}}var kd=0,ld=1,id=2,ed=0,jd=1,md=2,dd={SI1978:jd,VT100:md},nd=96,pd=64,qd=32,rd=0,td=127,vd=15,wd=16,ud=96,xd=8192,yd=16384;
|
||||||
function Mc(a){this.H=+a.adapter;switch(this.H){case 0:this.I=0;this.P=2;break;default:q("Unrecognized serial adapter #"+this.H);return}this.c=this.f=null;this.M=a.tabSize;this.G=a.charBOL;this.g=0;this.B=!1;this.o=!0;r.call(this,"SerialPort",a,Mc);var b=a.binding;if("console"==b)this.f="";else{var c;a=Nc;b&&(void 0===c&&(c="Panel"),(c=Ma(c,this.id))&&(b=c.v[b])&&this.U(null,a,b))}this.h="";this.b=this.Ea=this.ia=null;this.exports={connect:this.Ib,receiveData:this.nb,receiveStatus:this.rd}}w(Mc);
|
ya(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=
|
||||||
var Oc=[50,75,110,134.5,150,200,300,600,1200,1800,2E3,2400,3600,4800,9600,19200],Pc=[!1,0,0,133,142,39,238],Nc="buffer";l=Mc.prototype;
|
(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||va("aspect"));f&&.3<=f&&3.33>=f&&(xa("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");ua("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new cd(d,e,g,f,c);Ma(d,c)}});
|
||||||
l.U=function(a,b,c,d){var e=this;switch(b){case Nc:return this.v[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),Qc(e,b);return!0},c.onkeypress=function(a){a=a||window.event;Qc(e,a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0;default:if(d)return this.v[b]=c,d=d.replace(/\\e/g,String.fromCharCode(27)),c.onclick=function(){e.nb(d);return!0},
|
function zd(a){u.call(this,"SerialPort",a);this.H=+a.adapter;switch(this.H){case 0:this.I=0;this.O=2;break;default:r("Unrecognized serial adapter #"+this.H);return}this.b=this.c=null;this.L=a.tabSize;this.D=a.charBOL;this.f=0;this.B=!1;this.l=!0;var b=a.binding;if("console"==b)this.c="";else{var c;a=Ad;b&&(void 0===c&&(c="Panel"),(c=La(c,this.id))&&(b=c.w[b])&&this.S(null,a,b))}this.g="";this.a=this.Ba=this.s=null;this.exports={connect:this.Fb,receiveData:this.mb,receiveStatus:this.yd}}m(zd,u);
|
||||||
!0}return!1};l.ra=function(a,b,c,d){this.w=a;this.i=b;this.a=c;this.N=d;var e=this;this.R=Gb(this.a,function(){e.nb()});this.T=Gb(this.a,function(){Cc(e)});this.L=C(a,"ChipSet");eb(b,this,Rc,this.I);fb(b,this,Sc,this.I);B(this)};
|
k=zd.prototype;
|
||||||
l.Ib=function(a){if(!this.b){var b=xb(this.w,"connection");if(b){var c=b.split("->");if(2==c.length){var d=ia(c[0]);if(d!=this.Ya)return;c=ia(c[1]);if(this.b=La(c)){var e=this.b.exports;if(e){var f=e.connect;f&&f.call(this.b,this.o);if(this.Ea=e.receiveData){this.o=a;this.ia=e.receiveStatus;this.status(this.za+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
k.S=function(a,b,c,d){var e=this;switch(b){case Ad:return this.w[b]=this.b=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),Bd(e,b);return!0},c.onkeypress=function(a){a=a||window.event;Bd(e,a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0;default:if(d)return this.w[b]=c,d=d.replace(/\\e/g,String.fromCharCode(27)),c.onclick=function(){e.mb(d);return!0},
|
||||||
l.fa=function(a,b){if(!b)if(this.Ib(this.o),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.ha=function(a){return a?this.save():!0};l.reset=function(){Tc(this)};l.save=function(){var a=new G(this),b=0,c=[];c[b++]=this.s;c[b++]=this.A;c[b++]=this.F;c[b++]=this.X;c[b++]=this.l;c[b++]=this.m;c[b]=this.u;a.set(0,c);return a.data()};l.restore=function(a){return Tc(this,a[0])};
|
!0}return!1};k.qa=function(a,b,c,d){this.F=a;this.u=b;this.m=c;this.J=d;var e=this;this.P=Ib(this.m,function(){e.mb()});this.R=Ib(this.m,function(){Mc(e)});this.N=C(a,"ChipSet");fb(b,this,Cd,this.I);gb(b,this,Dd,this.I);B(this)};
|
||||||
function Tc(a,b){var c=0;b||(b=Pc);a.s=b[c++];a.A=b[c++];a.F=b[c++];a.X=b[c++];a.l=b[c++];a.m=b[c++];a.u=b[c];return!0}function Uc(a,b){var c=a.u&b;b&15||(c>>=4);b=Oc[c];c=((a.l&12)>>2)+6;a.l&16&&c++;c+=((a.l&192)>>6)+1>>1;return 1E3/Math.round(b/c)}function Qc(a,b){return a.B||a.X&2?!1:(a.A=b,a.X|=2,ec(a.a,a.P),!0)}
|
k.Fb=function(a){if(!this.a){var b=yb(this.F,"connection");if(b){var c=b.split("->");if(2==c.length){var d=ia(c[0]);if(d!=this.Wa)return;c=ia(c[1]);if(this.a=Ka(c)){var e=this.a.exports;if(e){var f=e.connect;f&&f.call(this.a,this.l);if(this.Ba=e.receiveData){this.l=a;this.s=e.receiveStatus;this.status(this.Ia+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
||||||
l.nb=function(a){null!=a&&(this.h="number"!=typeof a?a:this.h+String.fromCharCode(a));this.h&&(Qc(this,this.h.charCodeAt(0))&&(this.h=this.h.substr(1)),this.h&&this.a&&Hb(this.a,this.R,Uc(this,15)));return!0};l.rd=function(a){this.X&=-129;a&64&&(this.X|=128)};function Cc(a,b){a.X|=5;b&&a.Ea&&a.Ea.call(a.b,b)}l.Wc=function(){var a=this.A;this.X&=-3;return a};l.Vc=function(){return this.X};
|
k.ba=function(a,b){if(!b)if(this.Fb(this.l),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.fa=function(a){return a?this.save():!0};k.reset=function(){Ed(this)};k.save=function(){var a=new G(this),b=0,c=[];c[b++]=this.o;c[b++]=this.A;c[b++]=this.C;c[b++]=this.T;c[b++]=this.h;c[b++]=this.j;c[b]=this.v;a.set(0,c);return a.data()};k.restore=function(a){return Ed(this,a[0])};
|
||||||
l.ed=function(a,b){this.F=b;this.X&=-6;if(19==b)this.B=!0;else if(17==b)this.B=!1;else if(this.Ea&&this.Ea.call(this.b,b),this.c)if(8==b)this.c.value=this.c.value.slice(0,-1),0<this.g&&this.g--;else{a=(a=13!=b&&10!=b?ja[b]:null)?"<"+a+">":String.fromCharCode(b);var c=a.length;9==b?(b=this.M||8,c=b-this.g%b,this.M&&(a=" ".slice(0,c))):13==b&&(this.g=c=0,a="\n");this.G&&!this.g&&c&&(a=String.fromCharCode(this.G)+a);this.c.value+=a;this.c.scrollTop=this.c.scrollHeight;
|
function Ed(a,b){var c=0;b||(b=Fd);a.o=b[c++];a.A=b[c++];a.C=b[c++];a.T=b[c++];a.h=b[c++];a.j=b[c++];a.v=b[c];return!0}function Gd(a,b){var c=a.v&b;b&15||(c>>=4);b=Hd[c];c=((a.h&Id)>>2)+6;a.h&Jd&&c++;c+=((a.h&Kd)>>6)+1>>1;return 1E3/Math.round(b/c)}function Bd(a,b){return a.B||a.T&Ld?!1:(a.A=b,a.T|=Ld,kc(a.m,a.O),!0)}
|
||||||
this.g+=c}else if(null!=this.f){if(10==b||1024<=this.f.length)this.ea(this.f),this.f="";10!=b&&(this.f+=String.fromCharCode(b))}this.a&&Hb(this.a,this.T,Uc(this,240))};l.dd=function(a,b){this.s?(this.ia&&(b^this.m)&34&&(a=0,a=this.o?a|(b&32?32:0)|(b&2?320:0):a|(b&32?16:0)|(b&2?1048576:0),this.ia.call(this.b,a)),this.m=b,this.m&64&&(this.s=!1)):(this.l=b,this.s=!0)};l.cd=function(a,b){this.u=b};var Rc={0:Mc.prototype.Wc,1:Mc.prototype.Vc},Sc={0:Mc.prototype.ed,1:Mc.prototype.dd,2:Mc.prototype.cd};
|
k.mb=function(a){null!=a&&(this.g="number"!=typeof a?a:this.g+String.fromCharCode(a));this.g&&(Bd(this,this.g.charCodeAt(0))&&(this.g=this.g.substr(1)),this.g&&this.m&&Jb(this.m,this.P,Gd(this,Md)));return!0};k.yd=function(a){this.T&=~Nd;a&64&&(this.T|=Nd)};function Mc(a,b){a.T=a.T|rc|Od;b&&a.Ba&&a.Ba.call(a.a,b)}k.Vc=function(){var a=this.A;this.T&=~Ld;return a};k.Uc=function(){return this.T};
|
||||||
Ca(function(){for(var a=A(document,"pc8080","serial"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Mc(d);Na(d,c)}});
|
k.dd=function(a,b){this.C=b;this.T&=~(rc|Od);if(19==b)this.B=!0;else if(17==b)this.B=!1;else if(this.Ba&&this.Ba.call(this.a,b),this.b)if(8==b)this.b.value=this.b.value.slice(0,-1),0<this.f&&this.f--;else{var c;13!=b&&10!=b&&(c=ja[b]);a=c=c?"<"+c+">":String.fromCharCode(b);c=a.length;9==b?(b=this.L||8,c=b-this.f%b,this.L&&(a=" ".slice(0,c))):13==b&&(this.f=c=0,a="\n");this.D&&!this.f&&c&&(a=String.fromCharCode(this.D)+a);this.b.value+=a;this.b.scrollTop=this.b.scrollHeight;
|
||||||
function Vc(a,b,c){r.call(this,"Computer",a,Vc);this.j.Y=!1;Wc(this,b);this.u=xb(this,"autoPower",a);this.f=0;this.L=a.busWidth||a.buswidth;this.b=Xc;this.o=null;this.w=this.F=!1;this.H=xb(this,"url")||"";(Math.random()+.1).toString(36);this.c=Yc(this);if(this.a=Ma("CPU",this.id)){this.N=Ma("Debugger",this.id);this.l=[];for(b=null;b=C(this,"Video",b);)this.l.push(b);this.i=new Va({id:this.za+".bus",busWidth:this.L},this.a,this.N);var d,e=Ka(this.id);if((this.g=Ma("Panel",this.id))&&this.g.ya)for(b=
|
this.f+=c}else if(null!=this.c){if(10==b||1024<=this.c.length)this.aa(this.c),this.c="";10!=b&&(this.c+=String.fromCharCode(b))}this.m&&Jb(this.m,this.R,Gd(this,Pd))};k.cd=function(a,b){this.o?(this.s&&(b^this.j)&(Qd|Rd)&&(a=0,this.l?(a|=b&Qd?32:0,a|=b&Rd?320:0):(a|=b&Qd?16:0,a|=b&Rd?1048576:0),this.s.call(this.a,a)),this.j=b,this.j&Sd&&(this.o=!1)):(this.h=b,this.o=!0)};k.bd=function(a,b){this.v=b};
|
||||||
0;b<e.length;b++)d=e[b],d.K=this.g.K,d.ea=this.g.ea,d.ya=this.g.ya;this.ea("PC8080 v1.31.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.i,this.a,this.N);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.m=d:this.b=parseInt(d,10));var f;if(a=xb(this,"state")||(f=!0,a.state))b=this.A=a,f||(this.w=!0,this.b=Xc),this.b&&(this.s=new G(this,"1.31.1"),Zc(this.s)?b=null:delete this.s);
|
var Id=12,Jd=16,Kd=192,Rd=2,Qd=32,Sd=64,rc=1,Ld=2,Od=4,Nd=128,Md=15,Pd=240,Hd=[50,75,110,134.5,150,200,300,600,1200,1800,2E3,2400,3600,4800,9600,19200],Fd=[!1,0,0,133,142,39,238],Ad="buffer",Cd={0:zd.prototype.Vc,1:zd.prototype.Uc},Dd={0:zd.prototype.dd,1:zd.prototype.cd,2:zd.prototype.bd};ya(function(){for(var a=A(document,"pc8080","serial"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new zd(d);Ma(d,c)}});
|
||||||
!b&&this.b&&(b=$c(this))&&(this.w=!0);if(b){var g=this;ma(b,null,!0,function(a,b,c){c?(g.m=null,g.w=!1,g.K("Unable to load machine state from server (error "+c+(b?": "+ia(b):"")+")")):(g.o=b,g.F=!0);B(g)})}else B(this);this.v.power||(this.u=!0);!c&&this.u&&ad(this,this.Ta)}else q("Unable to find CPU component")}w(Vc);var Xc=0;function Wc(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.G=b}
|
function Td(a,b,c){u.call(this,"Computer",a);this.i.U=!1;Ud(this,b);this.v=yb(this,"autoPower",a);this.c=0;this.H=a.busWidth||a.buswidth;this.a=Vd;this.o=null;this.j=this.C=!1;this.I=yb(this,"url")||"";(Math.random()+.1).toString(36);this.b=Wd(this);if(this.m=La("CPU",this.id)){this.J=La("Debugger",this.id);this.g=[];for(b=null;b=C(this,"Video",b);)this.g.push(b);this.u=new Ta({id:this.Ia+".bus",busWidth:this.H},this.m,this.J);var d,e=Ja(this.id);if((this.h=La("Panel",this.id))&&this.h.pa)for(b=0;b<
|
||||||
function xb(a,b,c){var d=b.toLowerCase(),d=va(b)||va(d);void 0===d&&a.G&&(d=a.G[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function ad(a,b,c){for(var d=Ka(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Pa(f)){Pa(f,function(){ad(a,b,c)});return}}b.call(a,c)}
|
e.length;b++)d=e[b],d.G=this.h.G,d.aa=this.h.aa,d.pa=this.h.pa;this.aa("PC8080 v1.31.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.qa&&d.qa(this,this.u,this.m,this.J);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.l=d:this.a=parseInt(d,10));var f;if(a=yb(this,"state")||(f=!0,a.state))b=this.A=a,f||(this.j=!0,this.a=Vd),this.a&&(this.s=new G(this,"1.31.1"),Xd(this.s)?b=null:delete this.s);
|
||||||
function bd(a,b){var c=new G(a,"1.31.1","validate");if(Zc(c)&&cd(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())}}l=Vc.prototype;
|
!b&&this.a&&(b=Yd(this))&&(this.j=!0);if(b){var g=this;ma(b,null,!0,function(a,b,c){c?(g.l=null,g.j=!1,g.G("Unable to load machine state from server (error "+c+(b?": "+ia(b):"")+")")):(g.o=b,g.C=!0);B(g)})}else B(this);this.w.power||(this.v=!0);!c&&this.v&&Zd(this,this.Ra)}else r("Unable to find CPU component")}m(Td,u);function Ud(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){r(d.message+" ("+c+")")}}a.D=b}
|
||||||
l.Ta=function(a){void 0===a&&(a=this.b||(this.o?1:Xc));if(!this.f){this.f++;var b=!1,c=!1;this.B=!1;var d=this.s||new G(this,"1.31.1");if(-1==a)b=!0;else if(a>Xc){if(Zc(d,this.o)){this.h=new G(this,"1.31.1","failsafe");Zc(this.h)&&(dd(this,d),a=2,ed(this.h));this.h.set("timestamp",la());fd(this.h);var e=this.b&&!this.w;if(1==a||oa("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=cd(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Zc(d,g):("error"==
|
function yb(a,b,c){var d=b.toLowerCase(),d=va(b)||va(d);void 0===d&&a.D&&(d=a.D[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Zd(a,b,c){for(var d=Ja(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Na(f)){Na(f,function(){Zd(a,b,c)});return}}b.call(a,c)}
|
||||||
f&&"no machine state"!=g?(this.K("Error: "+g),"unable to verify user"==g&&(sa("user",""),this.c=null)):this.ea(f+": "+g),ed(d),Zc(d)?(c=cd(d),e=!0):c=!1))}e&&bd(this,c?d:null)}else 2==a&&d.clear()}else bd(this);delete this.o;delete this.s}e=Ka(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=gd(this,g,d,b,c));b=[d,a,c];-1!=a?ad(this,this.Fb,b):this.Fb(b)}};
|
function $d(a,b){var c=new G(a,"1.31.1",ae);if(Xd(c)&&be(c)){var d=c.get(ce),e=b?b.get(ce):"unknown";d!=e&&(a.G("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Td.prototype;
|
||||||
function gd(a,b,c,d,e){if(!b.j.Y){b.j.Y=!0;if(b.fa){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.fa(f,d)&&f&&(q("Unable to restore state for "+b.type),a.A&&!a.F?(c.clear(),a.b=Xc,window&&window.location.reload()):a.B=!0,b.fa(null),e=!1)}if(!d&&b.Ab)for(a=b.Ab.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
k.Ra=function(a){void 0===a&&(a=this.a||(this.o?de:Vd));if(!this.c){this.c++;var b=!1,c=!1;this.B=!1;var d=this.s||new G(this,"1.31.1");if(a==ee)b=!0;else if(a>Vd){if(Xd(d,this.o)){this.f=new G(this,"1.31.1",fe);Xd(this.f)&&(ge(this,d),a=he,ie(this.f));this.f.set(ce,la());je(this.f);var e=this.a&&!this.j;if(a==de||oa("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=be(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Xd(d,g):("error"==f&&"no machine state"!=
|
||||||
l.Fb=function(a){var b=a[0],c=0>a[1];a=a[2];this.I=!0;this.j.Y=!0;var d=this.v.power;d&&(d.textContent="Shutdown");this.a&&(gd(this,this.a,b,c,a),this.a.Sa());this.B&&(dd(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.f=0};
|
g?(this.G("Error: "+g),"unable to verify user"==g&&(sa(ke,""),this.b=null)):this.aa(f+": "+g),ie(d),Xd(d)?(c=be(d),e=!0):c=!1))}e&&$d(this,c?d:null)}else a==he&&d.clear()}else $d(this);delete this.o;delete this.s}e=Ja(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.m&&(c=le(this,g,d,b,c));b=[d,a,c];a!=ee?Zd(this,this.Cb,b):this.Cb(b)}};
|
||||||
function dd(a,b){if(oa("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.31.1"};d.url=a.H;d.user=c;d.type="bug";d.data=b;ma("http://www.pcjs.org/api/v1/report",d,!0)}}
|
function le(a,b,c,d,e){if(!b.i.U){b.i.U=!0;if(b.ba){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.ba(f,d)&&f&&(r("Unable to restore state for "+b.type),a.A&&!a.C?(c.clear(),a.a=Vd,window&&window.location.reload()):a.B=!0,b.ba(null),e=!1)}if(!d&&b.Ab)for(a=b.Ab.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||||
function hd(a,b,c){var d,e="none";if(a.f)return null;a.f--;var f=new G(a,"1.31.1"),g=new G(a,"1.31.1","validate"),h=la();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.31.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ha&&(c&&Bb(a.a),d=a.a.ha(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.j.Y=!1,!1===d&&(e=null)));for(var h=Ka(a.id),k=0;k<h.length;k++){var n=h[k];n.j.Y&&(n.ha&&(d=n.ha(b,c),"object"===typeof d&&f.set(n.id,
|
k.Cb=function(a){var b=a[0],c=0>a[1];a=a[2];this.N=!0;this.i.U=!0;var d=this.w.power;d&&(d.textContent="Shutdown");this.m&&(le(this,this.m,b,c,a),this.m.Qa());this.B&&(ge(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.c=0};
|
||||||
d)),c&&(n.j.Y=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.c&&id(a,a.c,f.toString()),fd(g)&&fd(f)||(e=null,d=h=!0)):a.b&&(d=!0,h=3==a.b),d&&f.clear(h)):e=f.toString());c&&(a.j.Y=!1,b=a.v.power)&&(b.textContent="Power");a.f=0;return e}l.reset=function(){this.i&&this.i.reset&&this.i.reset();for(var a=Ka(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.i&&c.reset&&c.reset()}};
|
function ge(a,b){if(oa("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.b||"";b=b.toString();var d={app:"PC8080",ver:"1.31.1"};d.url=a.I;d.user=c;d.type="bug";d.data=b;ma("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||||
l.start=function(a,b){for(var c=Ka(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};l.stop=function(a,b){for(var c=Ka(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
function me(a,b,c){var d,e="none";if(a.c)return null;a.c--;var f=new G(a,"1.31.1"),g=new G(a,"1.31.1",ae),h=la();g.set(ce,h);f.set(ce,h);f.set(ne,"1.31.1");f.set(oe,window?window.location.href:null);f.set(pe,window?window.navigator.userAgent:"");a.m&&a.m.fa&&(c&&Cb(a.m),d=a.m.fa(b,c),"object"===typeof d&&f.set(a.m.id,d),c&&(a.m.i.U=!1,!1===d&&(e=null)));for(var h=Ja(a.id),l=0;l<h.length;l++){var n=h[l];n.i.U&&(n.fa&&(d=n.fa(b,c),"object"===typeof d&&f.set(n.id,d)),c&&(n.i.U=!1,!1===d&&(e=null)))}e&&
|
||||||
l.U=function(a,b,c){var d=this;switch(b){case "power":return this.v[b]=c,c.onclick=function(){d.f||(d.j.Y?hd(d,!1,!0):ad(d,d.Ta))},!0;case "reset":return this.v[b]=c,c.onclick=function(){if(d.j.Y&&!d.f)if(d.b&&!d.m){var a=oa("Click OK to save changes to this PC8080 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");hd(d,a,!0);!a&&d.A?window&&window.location.reload():d.Ta(Xc)}else d.reset(),d.a&&d.a.Sa()},!0;case "save":if(ea())c.parentNode.removeChild(c);else return this.v[b]=
|
(c?(h=d=!1,b?(a.b&&qe(a,a.b,f.toString()),je(g)&&je(f)||(e=null,d=h=!0)):a.a&&(d=!0,h=a.a==re),d&&f.clear(h)):e=f.toString());c&&(a.i.U=!1,b=a.w.power)&&(b.textContent="Power");a.c=0;return e}k.reset=function(){this.u&&this.u.reset&&this.u.reset();for(var a=Ja(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.u&&c.reset&&c.reset()}};k.start=function(a,b){for(var c=Ja(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};
|
||||||
c,c.onclick=function(){var a=Yc(d,!0);if(a){var b=!!(d.b&&!d.m||d.A),c=hd(d,b);b?id(d,a,c):d.K("Resume disabled, machine state not saved")}},!0}return!1};
|
k.stop=function(a,b){for(var c=Ja(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
||||||
function Yc(a,b){var c=a.c;c||((c=ra("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=jd(a,c))||a.K("The user ID is invalid.")):b&&a.K("Browser local storage is not available"));return c}
|
k.S=function(a,b,c){var d=this;switch(b){case "power":return this.w[b]=c,c.onclick=function(){d.c||(d.i.U?me(d,!1,!0):Zd(d,d.Ra))},!0;case "reset":return this.w[b]=c,c.onclick=function(){if(d.i.U&&!d.c)if(d.a&&!d.l){var a=oa("Click OK to save changes to this PC8080 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");me(d,a,!0);!a&&d.A?window&&window.location.reload():d.Ra(Vd)}else d.reset(),d.m&&d.m.Qa()},!0;case "save":if(ea())c.parentNode.removeChild(c);else return this.w[b]=
|
||||||
function jd(a,b){a.c=null;b=ma(fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(sa("user",b.data),a.c=b.data)}catch(d){q(d.message+" ("+c+")")}return a.c}function $c(a){var b=null;a.c&&(b=fa()+"/api/v1/user?req=load&user="+a.c+"&state="+kd(a,"1.31.1"));return b}
|
c,c.onclick=function(){var a=Wd(d,!0);if(a){var b=!!(d.a&&!d.l||d.A),c=me(d,b);b?qe(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1};function Wd(a,b){var c=a.b;c||((c=ra(ke),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=se(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c}
|
||||||
function id(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=kd(a,"1.31.1");d.data=c;b=ma(fa()+"/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),sa("user",""),a.c=null)}}
|
function se(a,b){a.b=null;b=ma(fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(sa(ke,b.data),a.b=b.data)}catch(d){r(d.message+" ("+c+")")}return a.b}function Yd(a){var b=null;a.b&&(b=fa()+"/api/v1/user?req=load&user="+a.b+"&state="+te(a,"1.31.1"));return b}
|
||||||
function C(a,b,c){a=Ka(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 Fb(a,b){if(a.l.length){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a=a.l[0];a.P&&a.P.focus();!b&&window&&window.scrollTo(c,d)}}l.ia=function(a){this.a&&this.a.ia(a);this.g&&this.g.ia(a)};
|
function qe(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=te(a,"1.31.1");d.data=c;b=ma(fa()+"/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.G("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.G(c),sa(ke,""),a.b=null)}}
|
||||||
Ca(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 Vc(g,d,!0);Na(g,f);g.u&&ad(g,g.Ta)}});xa.show.push(function(){for(var a=A(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Ma("Computer",c.id))&&c.I&&!c.j.Y&&c.Ta(-1)}});
|
function C(a,b,c){a=Ja(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 Hb(a,b){if(a.g.length){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a=a.g[0];a.L&&a.L.focus();!b&&window&&window.scrollTo(c,d)}}
|
||||||
xa.exit.push(function(){for(var a=A(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Ma("Computer",c.id))&&c.j.Y&&hd(c,!(!c.b||c.m),!0)}});function G(a,b,c){this.id=a.id;this.key=kd(a,b,c);this.N=a.N;ed(this,a.Sc)}function kd(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}
|
function Lb(a,b){a.m&&(a=a.m,a.Ma&&(b||!a.i.ka||a.i.Bb)&&(T(a,"A",a.b),T(a,"B",a.g),T(a,"C",a.c),T(a,"BC",Vb(a),4),T(a,"D",a.h),T(a,"E",a.f),T(a,"DE",Yb(a),4),T(a,"H",a.j),T(a,"L",a.l),T(a,"HL",H(a),4),T(a,"SP",a.A,4),T(a,"PC",a.s,4),b=Ub(a),T(a,"PS",b,4),T(a,"IF",b&512?1:0,1),T(a,"SF",b&128?1:0,1),T(a,"ZF",b&64?1:0,1),T(a,"AF",b&16?1:0,1),T(a,"PF",b&4?1:0,1),T(a,"CF",b&1?1:0,1)),b=a.w.speed)&&(b.textContent=a.i.ka&&a.R?a.R.toFixed(2)+"Mhz":"Stopped")}
|
||||||
G.prototype={constructor:G,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){ed(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,
|
var fe="failsafe",ae="validate",ce="timestamp",ne="version",oe="url",pe="browser",ke="user",ee=-1,Vd=0,de=1,he=2,re=3;ya(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 Td(g,d,!0);Ma(g,f);g.v&&Zd(g,g.Ra)}});za.show.push(function(){for(var a=A(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=La("Computer",c.id))&&c.N&&!c.i.U&&c.Ra(ee)}});
|
||||||
1);c=0}}};function ed(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function fd(a){var b=!0;if(qa()){var c=JSON.stringify(a[a.id]);sa(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function cd(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function Zc(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:qa()&&(b=ra(a.key))?(a[a.id]=b,a.a=!0):!1}var ld=0;
|
za.exit.push(function(){for(var a=A(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=La("Computer",c.id))&&c.i.U&&me(c,!(!c.a||c.l),!0)}});function G(a,b,c){this.id=a.id;this.J=a.J;this.b="";this.a={};this.m=this.u=!1;this.key=te(a,b,c);ie(this,a.Rc)}k=G.prototype;k.set=function(a,b){try{this.a[a]=b}catch(c){}};k.get=function(a){return this.a[a]||null};k.data=function(){return this.a};
|
||||||
function md(a,b,c,d,e,f){e("Loading "+a+"...");ma(a,null,!0,function(g,h,k){k?(h||(h="unable to load "+a+" ("+k+")"),f(h,null)):nd(h,a,b,c,d,e,f)})}
|
function Xd(a,b){return b?(a.b=b,a.m=!0,a.u=!1,!0):a.m?!0:pa()&&(b=ra(a.key))?(a.b=b,a.m=!0):!1}function be(a){var b=!0;if(!a.u)try{a.a=JSON.parse(a.b),a.u=!0}catch(c){r(c.message||c),b=!1}return b}function je(a){var b=!0;if(pa()){var c=JSON.stringify(a.a);sa(a.key,c)||(r("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}k.toString=function(){return this.a?JSON.stringify(this.a):this.b};function ie(a,b){a.b="";a.a={};a.m=a.u=!1;b&&a.set("parms",b)}
|
||||||
function nd(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(Ja(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>)/,"$1PC8080$2"),
|
k.clear=function(a){ie(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 te(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}var ue=0;
|
||||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$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(v){f=null,a=v.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?od(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),
|
function ve(a,b,c,d,e,f){e("Loading "+a+"...");ma(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):we(h,a,b,c,d,e,f)})}
|
||||||
|
function we(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(Ha(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>)/,"$1PC8080$2"),
|
||||||
|
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$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(v){f=null,a=v.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?xe(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),
|
||||||
null)}
|
null)}
|
||||||
function od(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");ma(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 k=h[0],n,v=/( [a-z]+=)(['"])(.*?)\2/g;n=v.exec(f);)k=0>k.indexOf(n[1])?k.replace(">",n[0]+">"):k.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);h[0]!=k&&(g=g.replace(h[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,"");
|
function xe(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");ma(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,v=/( [a-z]+=)(['"])(.*?)\2/g;n=v.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);od(a,b,c)}})}else c(a,null)}
|
a=a.replace(d[0],g);xe(a,b,c)}})}else c(a,null)}
|
||||||
function pd(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=ha(a))}function f(a){e("Error: "+a);k&&(--ld||Fa(!0));k=!1}var g,h,k=!0;ld++;Ia[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var v=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));v.appendChild(z)}c||
|
function ye(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&&(--ue||Da(!0));l=!1}var g,h,l=!0;ue++;Ia[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var v=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));v.appendChild(z)}c||
|
||||||
(c="/versions/pc8080/1.31.1/components.xsl");n=function(d,h){h?md(c,null,null,!1,e,function(d,k){k?(Ja(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(k=h.transformNode(k))?(g.outerHTML=k,--ld||Fa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(k),(k=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(k,g),--ld||Fa(!0)):f("invalid machine element: "+
|
(c="/versions/pc8080/1.31.1/components.xsl");n=function(d,h){h?ve(c,null,null,!1,e,function(d,l){l?(Ha(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--ue||Da(!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),--ue||Da(!0)):f("invalid machine element: "+
|
||||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?md(b,a,d,!0,e,n):nd(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(I){f(I.message)}return k}window.embedPC8080=function(a,b,c,d){Fa(!1);return pd(a,b,c,d)};window.enableEvents=Fa;window.sendEvent=Ga;})();
|
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ve(b,a,d,!0,e,n):we(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(K){f(K.message)}return l}window.embedPC8080=function(a,b,c,d){Da(!1);return ye(a,b,c,d)};window.enableEvents=Da;window.sendEvent=Fa;})();
|
||||||
|
|
|
||||||
|
|
@ -33,339 +33,339 @@
|
||||||
http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2016
|
http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2016
|
||||||
*/
|
*/
|
||||||
var h;function p(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}
|
var h;function p(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}
|
||||||
for(var 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],ha=ba[fa],ia=ha?ha:function(a){return Math.log(a)/Math.LN2};
|
for(var 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 ga=ca[ca.length-1],ha=ba[ga],ia=ha?ha:function(a){return Math.log(a)/Math.LN2};
|
||||||
ia!=ha&&null!=ia&&aa(ba,fa,{configurable:!0,writable:!0,value:ia});
|
ia!=ha&&null!=ia&&aa(ba,ga,{configurable:!0,writable:!0,value:ia});
|
||||||
var ja={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},ka={ng:0,sd:1,pg:2,qg:3,rg:4,sg:5,tg:6,ug:7,Kc:8,vg:9,td:10,wg:11,xg:12,ud:13,yg:14,zg:15,Ag:16,Bg:17,Cg:18,Dg:19,Eg:20,Fg:21,Gg:22,Hg:23,Ig:24,Jg:25,Kg:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,
|
var ja={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},ka={pg:0,ud:1,rg:2,sg:3,tg:4,ug:5,vg:6,wg:7,Lc:8,xg:9,vd:10,yg:11,zg:12,wd:13,Ag:14,Bg:15,Cg:16,Dg:17,Eg:18,Fg:19,Gg:20,Hg:21,Ig:22,Jg:23,Kg:24,Lg:25,Mg:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,
|
||||||
"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Hc:65,mg:66,og:67,Lg:68,E:69,Mg:70,Ng:71,Og:72,Pg:73,Qg:74,Rg:75,Sg:76,Tg:77,Ug:78,Vg:79,Wg:80,Q:81,Xg:82,Yg:83,Zg:84,$g:85,ah:86,bh:87,dh:88,eh:89,Ed:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,fh:97,gh:98,hh:99,d:100,e:101,jh:102,kh:103,lh:104,mh:105,ph:106,k:107,qh:108,rh:109,n:110,sh:111,p:112,q:113,r:114,th:115,t:116,vh:117,wh:118,xh:119,x:120,y:121,z:122,"{":123,
|
"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Ic:65,og:66,qg:67,Ng:68,E:69,Og:70,Pg:71,Qg:72,Rg:73,Sg:74,Tg:75,Ug:76,Vg:77,Wg:78,Xg:79,Yg:80,Q:81,Zg:82,$g:83,ah:84,bh:85,dh:86,eh:87,fh:88,gh:89,Gd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,hh:97,ih:98,jh:99,d:100,e:101,lh:102,mh:103,nh:104,oh:105,rh:106,k:107,sh:108,th:109,n:110,uh:111,p:112,q:113,r:114,vh:115,t:116,xh:117,yh:118,zh:119,x:120,y:121,z:122,"{":123,
|
||||||
"|":124,"}":125,"~":126,vd:127};
|
"|":124,"}":125,"~":126,xd:127};
|
||||||
function la(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
function la(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ma(a,b,c){var d="";b?32<b&&(b=32):b=32;for(var e=null==a||isNaN(a),f=c=c||b;0<b--;)f||(d=","+d,f=c),d=(e?"?":a&1?"1":"0")+d,a>>=1,f--;return d}function q(a,b,c){var d="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8: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}
|
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ma(a,b,c){var d="";b?32<b&&(b=32):b=32;for(var e=null==a||isNaN(a),f=c=c||b;0<b--;)f||(d=","+d,f=c),d=(e?"?":a&1?"1":"0")+d,a>>=1,f--;return d}function q(a,b,c){var d="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8: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 na(a){var b=2,c="";b?10<b&&(b=10):b=a&-65536?10:5;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode(a%10+48)+c,a/=10;return c}function v(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 w(a){return v(a,4,!0)}
|
function na(a){var b=2,c="";b?10<b&&(b=10):b=a&-65536?10:5;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode(a%10+48)+c,a/=10;return c}function v(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 w(a){return v(a,4,!0)}
|
||||||
function x(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 oa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function pa(a,b){return-1!==a.indexOf(b,a.length-b.length)}function qa(a){return a.replace(/[&<>"']/g,function(a){return sa[a]})}function ta(a,b){return(a+" ").slice(0,b)}
|
function x(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 oa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function pa(a,b){return-1!==a.indexOf(b,a.length-b.length)}function ra(a){return a.replace(/[&<>"']/g,function(a){return sa[a]})}function ta(a,b){return(a+" ").slice(0,b)}
|
||||||
function ua(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var sa={"&":"&","<":"<",">":">",'"':""","'":"'"},va={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
function ua(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var sa={"&":"&","<":"<",">":">",'"':""","'":"'"},wa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
||||||
function xa(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}function ya(){return Date.now()||+new Date}function za(){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 xa(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}function ya(){return Date.now()||+new Date}function za(){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 Aa(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,
|
function Aa(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,
|
||||||
f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g}
|
f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g}
|
||||||
function Ba(a,b){var c,d={ba:null,da:null,La:null,Ka: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.La=g.load;d.Ka=g.exec;if(e=g.bytes)d.ba=e;else if(e=g.words)for(d.ba=Array(2*e.length),f=c=0;c<e.length;c++)d.ba[f++]=e[c]&255,d.ba[f++]=e[c]>>8&255;else if(e=g.data)for(d.ba=Array(4*e.length),f=c=0;c<e.length;c++)d.ba[f++]=
|
function Ba(a,b){var c,d={ba:null,ea:null,La:null,Ka: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.La=g.load;d.Ka=g.exec;if(e=g.bytes)d.ba=e;else if(e=g.words)for(d.ba=Array(2*e.length),f=c=0;c<e.length;c++)d.ba[f++]=e[c]&255,d.ba[f++]=e[c]>>8&255;else if(e=g.data)for(d.ba=Array(4*e.length),f=c=0;c<e.length;c++)d.ba[f++]=
|
||||||
e[c]&255,d.ba[f++]=e[c]>>8&255,d.ba[f++]=e[c]>>16&255,d.ba[f++]=e[c]>>24&255;else d.ba=g;d.da=g.symbols;d.ba.length?1==d.ba.length&&(y(d.ba[0]),d=null):(y("Empty resource: "+a),d=null)}catch(k){y("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)){y("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.ba=e)}return d}
|
e[c]&255,d.ba[f++]=e[c]>>8&255,d.ba[f++]=e[c]>>16&255,d.ba[f++]=e[c]>>24&255;else d.ba=g;d.ea=g.symbols;d.ba.length?1==d.ba.length&&(y(d.ba[0]),d=null):(y("Empty resource: "+a),d=null)}catch(k){y("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)){y("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.ba=e)}return d}
|
||||||
function Ca(){return"http://"+(window?window.location.host:"www.pcjs.org")}function y(a){window&&window.alert(a)}function Da(a){var b=!1;window&&(b=window.confirm(a));return b}function Ea(){if(null==Fa){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}Fa=a}return Fa}
|
function Ca(){return"http://"+(window?window.location.host:"www.pcjs.org")}function y(a){window&&window.alert(a)}function Da(a){var b=!1;window&&(b=window.confirm(a));return b}function Ea(){if(null==Ja){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}Ja=a}return Ja}
|
||||||
function Ka(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function La(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ma(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)}return!1}
|
function Ka(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function La(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ma(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)}return!1}
|
||||||
function Na(a){if(!Oa){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}Oa=c}return Oa[a]}
|
function Na(a){if(!Oa){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}Oa=c}return Oa[a]}
|
||||||
function Pa(a,b){var c=null;a="data:application/octet-stream;base64,"+a;b&&(c=document.createElement("a"),"string"!=typeof c.download&&(c=null));c?(c.href=a,c.download=b,document.body.appendChild(c),c.click(),document.body.removeChild(c),b="Check your Downloads folder for "+b+"."):(window.open(a),b="Check your browser for a new window/tab containing the requested data"+(b?" ("+b+")":"")+".");return b}function Qa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
function Pa(a,b){var c=null;a="data:application/octet-stream;base64,"+a;b&&(c=document.createElement("a"),"string"!=typeof c.download&&(c=null));c?(c.href=a,c.download=b,document.body.appendChild(c),c.click(),document.body.removeChild(c),b="Check your Downloads folder for "+b+"."):(window.open(a),b="Check your browser for a new window/tab containing the requested data"+(b?" ("+b+")":"")+".");return b}function Qa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||||
function Ra(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}}function Sa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ta(a){Xa.init.push(a)}
|
function Ra(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}}function Sa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Wa(a){Xa.init.push(a)}
|
||||||
function Ya(a){if(Za)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){y(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function $a(a){!Za&&a?(Za=!0,ab&&bb("init"),cb&&bb("show")):Za=a}function bb(a){Xa[a]&&Ya(Xa[a])}var Oa=null,Xa={init:[],show:[],exit:[]},ab=!1,cb=!1,Za=!0,Fa=null;Sa("onload",function(){ab=!0;Ya(Xa.init)});Sa("onpageshow",function(){cb=!0;Ya(Xa.show)});Sa(Ma("Opera")||Ma("iOS")?"onunload":"onbeforeunload",function(){Ya(Xa.exit)});
|
function Ya(a){if(Za)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){y(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function $a(a){!Za&&a?(Za=!0,ab&&bb("init"),cb&&bb("show")):Za=a}function bb(a){Xa[a]&&Ya(Xa[a])}var Oa=null,Xa={init:[],show:[],exit:[]},ab=!1,cb=!1,Za=!0,Ja=null;Sa("onload",function(){ab=!0;Ya(Xa.init)});Sa("onpageshow",function(){cb=!0;Ya(Xa.show)});Sa(Ma("Opera")||Ma("iOS")?"onunload":"onbeforeunload",function(){Ya(Xa.exit)});
|
||||||
function A(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Qc=b.comment;this.Dd=b;this.exports={};a=this.id.indexOf(".");0>a?this.jb=this.id:(this.kb=this.id.substr(0,a),this.jb=this.id.substr(a+1));this.A={ready:!1,bb:!1,yc:!1,ea:!1,error:!1};this.bc=null;this.A.error=!1;this.B={};this.fa=d||0;this.F=this.f=this.D=this.I=this.Oa=null;db.push(this)}function eb(a,b,c){gb[a]&&b&&(gb[a][b]=c)}
|
function A(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Rc=b.comment;this.Fd=b;this.exports={};a=this.id.indexOf(".");0>a?this.kb=this.id:(this.lb=this.id.substr(0,a),this.kb=this.id.substr(a+1));this.A={ready:!1,cb:!1,zc:!1,fa:!1,error:!1};this.bc=null;this.A.error=!1;this.B={};this.ga=d||0;this.F=this.f=this.D=this.I=this.Oa=null;db.push(this)}function fb(a,b,c){lb[a]&&b&&(lb[a][b]=c)}
|
||||||
function mb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<db.length;b++){var d=db[b];a&&d.id.indexOf(a)||c.push(d)}return c}function nb(a){if(void 0!==a){var b;for(b=0;b<db.length;b++)if(db[b].id===a)return db[b]}return null}function ob(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<db.length;d++)if(c)c==db[d]&&(c=null);else if(!(a!=db[d].type||b&&db[d].id.indexOf(b)))return db[d]}return null}
|
function mb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<db.length;b++){var d=db[b];a&&d.id.indexOf(a)||c.push(d)}return c}function nb(a){if(void 0!==a){var b;for(b=0;b<db.length;b++)if(db[b].id===a)return db[b]}return null}function ob(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<db.length;d++)if(c)c==db[d]&&(c=null);else if(!(a!=db[d].type||b&&db[d].id.indexOf(b)))return db[d]}return null}
|
||||||
function pb(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){y(c.message+" ("+a+")")}return b}function qb(a,b){var c=B;b=D(b.parentNode,c+"-control");for(var d=0;d<b.length;d++)for(var e=b[d].childNodes,f=0;f<e.length;f++){var g=e[f];if(1===g.nodeType){var k=g.getAttribute("class");if(k)for(var l=k.split(" "),m=0;m<l.length;m++)switch(k=l[m],k){case c+"-binding":(k=pb(g))&&k.binding&&a.na(k.type,k.binding,g,k.value),m=l.length}}}}
|
function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){y(c.message+" ("+a+")")}return b}function pb(a,b){var c=D;b=G(b.parentNode,c+"-control");for(var d=0;d<b.length;d++)for(var e=b[d].childNodes,f=0;f<e.length;f++){var g=e[f];if(1===g.nodeType){var k=g.getAttribute("class");if(k)for(var l=k.split(" "),m=0;m<l.length;m++)switch(k=l[m],k){case c+"-binding":(k=B(g))&&k.binding&&a.oa(k.type,k.binding,g,k.value),m=l.length}}}}
|
||||||
function D(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}h=A.prototype;h.toString=function(){return this.name?this.name:this.id||this.type};
|
function G(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}h=A.prototype;h.toString=function(){return this.name?this.name:this.id||this.type};
|
||||||
h.na=function(a,b,c){switch(b){case "clear":return this.B[b]||(this.B[b]=c,c.onclick=function(a){return function(){a.B.print&&(a.B.print.value="")}}(this)),!0;case "print":return this.B[b]||(this.Oa=this.B[b]=c,c.value="",this.u=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.N=function(a){this.u(a,this.jb)}),!0;default:return!1}};h.log=function(){};h.u=function(){};
|
h.oa=function(a,b,c){switch(b){case "clear":return this.B[b]||(this.B[b]=c,c.onclick=function(a){return function(){a.B.print&&(a.B.print.value="")}}(this)),!0;case "print":return this.B[b]||(this.Oa=this.B[b]=c,c.value="",this.u=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.N=function(a){this.u(a,this.kb)}),!0;default:return!1}};h.log=function(){};h.u=function(){};
|
||||||
h.status=function(a){this.u(this.jb+": "+a)};h.N=function(a,b,c){c=c||this.type;b||y((c?c+": ":"")+a)};function rb(a,b){a.A.error=!0;a.N(b)}function sb(a){return a.A.error?(a.u(a.toString()+" error"),!0):!1}function tb(a,b){b&&(a.A.ready?b():a.bc=b);return a.A.ready}function G(a,b){a.A.error||(a.A.ready=!1!==b,a.A.ready&&(b=a.bc,a.bc=null,b&&b()))}function ub(a,b){a.A.bb&&(b?a.A.yc=!0:void 0===b&&a.u(a.toString()+" busy"));return a.A.bb}
|
h.status=function(a){this.u(this.kb+": "+a)};h.N=function(a,b,c){c=c||this.type;b||y((c?c+": ":"")+a)};function qb(a,b){a.A.error=!0;a.N(b)}function rb(a){return a.A.error?(a.u(a.toString()+" error"),!0):!1}function sb(a,b){b&&(a.A.ready?b():a.bc=b);return a.A.ready}function H(a,b){a.A.error||(a.A.ready=!1!==b,a.A.ready&&(b=a.bc,a.bc=null,b&&b()))}function tb(a,b){a.A.cb&&(b?a.A.zc=!0:void 0===b&&a.u(a.toString()+" busy"));return a.A.cb}
|
||||||
function vb(a,b){if(a.A.yc)return a.A.bb=!1,a.A.yc=!1;if(a.A.error)return a.u(a.toString()+" error"),!1;a.A.bb=b;return a.A.bb}h.qa=function(){return this.A.ea=!0};h.za=function(a,b){b&&(this.A.ea=!1);return!0};function H(a,b){if(a.F){a===a.F?b|=0:b=b||a.fa;var c=a.F.fa&b;return!!b&&c===b||!!(c&a.F.ya)}return!1}function I(a,b,c,d){a.F&&(!0===c||H(a,c|0))&&a.F.message(b,d)}
|
function ub(a,b){if(a.A.zc)return a.A.cb=!1,a.A.zc=!1;if(a.A.error)return a.u(a.toString()+" error"),!1;a.A.cb=b;return a.A.cb}h.ra=function(){return this.A.fa=!0};h.Aa=function(a,b){b&&(this.A.fa=!1);return!0};function I(a,b){if(a.F){a===a.F?b|=0:b=b||a.ga;var c=a.F.ga&b;return!!b&&c===b||!!(c&a.F.cd)}return!1}function J(a,b,c,d){a.F&&(!0===c||I(a,c|0))&&a.F.message(b,d)}
|
||||||
window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var gb=window?window.PCjs.Machines:{},db=window?window.PCjs.Components:[];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});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var lb=window?window.PCjs.Machines:{},db=window?window.PCjs.Components:[];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});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
||||||
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});
|
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 wb="undefined"!==typeof ArrayBuffer,B="pdp11",xb="PDPjs",yb=!1,zb=wb,Ab=!0,Bb=!0,Cb="UNKNOWN PANIC ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Db={48:"DL11R",52:"DL11X",56:"PC11R",60:"PC11X",64:"KW11",112:"RL11",144:"RK11"},B="pdp11",xb="PDPjs",yb=!1,zb=wb,Bb=Ab=!0,Eb={cpu:1,trap:2,fault:4,"int":8,bus:16,memory:32,mmu:64,rom:128,device:256,panel:512,keyboard:1024,key:2048,pc11:4096,paper:4096,disk:8192,read:16384,write:32768,rk11:65536,rl11:131072,dl11:262144,serial:262144,
|
var vb="undefined"!==typeof ArrayBuffer,D="pdp11",wb="PDPjs",xb=!1,yb=vb,zb=!0,Ab=!0,Bb="UNKNOWN PANIC ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Cb={48:"DL11R",52:"DL11X",56:"PC11R",60:"PC11X",64:"KW11",112:"RL11",144:"RK11"},D="pdp11",wb="PDPjs",xb=!1,yb=vb,Ab=zb=!0,Db={cpu:1,trap:2,fault:4,"int":8,bus:16,memory:32,mmu:64,rom:128,device:256,panel:512,keyboard:1024,key:2048,pc11:4096,paper:4096,disk:8192,read:16384,write:32768,rk11:65536,rl11:131072,dl11:262144,serial:262144,
|
||||||
kw11:524288,timer:524288,speaker:16777216,computer:33554432,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};
|
kw11:524288,timer:524288,speaker:16777216,computer:33554432,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};
|
||||||
function Fb(a){A.call(this,"Panel",a,0,512);this.ra=this.i=this.Ua=this.sb=this.j=this.v=0;this.C=this.G=this.w=!1;this.H=Mb;this.g={};this.b={START:[1,1,!0,!1,this.Vd],STEP:[1,1,!1,!1,this.Wd],ENABLE:[1,1,!1,!1,this.Rd],CONT:[1,1,!0,!1,this.Pd],DEP:[0,0,!0,!1,this.Qd],EXAM:[1,1,!0,!1,this.Sd],LOAD:[1,1,!0,!1,this.Ud],TEST:[0,0,!0,!1,this.Td]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.Xd,a];this.F=this.f=this.D=this.I=null}p(Fb,A);h=Fb.prototype;h.reset=function(){this.stop()};
|
function Eb(a){A.call(this,"Panel",a,0,512);this.sa=this.i=this.Va=this.tb=this.j=this.v=0;this.C=this.G=this.w=!1;this.H=Lb;this.g={};this.b={START:[1,1,!0,!1,this.Xd],STEP:[1,1,!1,!1,this.Yd],ENABLE:[1,1,!1,!1,this.Td],CONT:[1,1,!0,!1,this.Rd],DEP:[0,0,!0,!1,this.Sd],EXAM:[1,1,!0,!1,this.Ud],LOAD:[1,1,!0,!1,this.Wd],TEST:[0,0,!0,!1,this.Vd]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.Zd,a];this.F=this.f=this.D=this.I=null}p(Eb,A);h=Eb.prototype;h.reset=function(){this.stop()};
|
||||||
h.na=function(a,b,c,d){if(this.I&&this.I.na(a,b,c,d)||this.f&&this.f.na(a,b,c,d)||this.F&&this.F.na(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.B[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.B[b]=c,this.g[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.B[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,
|
h.oa=function(a,b,c,d){if(this.I&&this.I.oa(a,b,c,d)||this.f&&this.f.oa(a,b,c,d)||this.F&&this.F.oa(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.B[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.B[b]=c,this.g[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.B[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,
|
||||||
b){return function(){Nb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Ob(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Nb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Ob(a,b)}}(this,b),!0):A.prototype.na.call(this,a,b,c,d)}};h.pa=function(a,b,c,d){this.I=a;this.D=b;this.f=c;this.F=d;Pb(b,this,Qb);Rb(b,this.reset.bind(this));Sb(this);Tb(this)};h.qa=function(a,b){b||(Ub(),this.reset());return!0};h.za=function(){return!0};
|
b){return function(){Mb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Nb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Mb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Nb(a,b)}}(this,b),!0):A.prototype.oa.call(this,a,b,c,d)}};h.qa=function(a,b,c,d){this.I=a;this.D=b;this.f=c;this.F=d;Ob(b,this,Pb);Qb(b,this.reset.bind(this));Rb(this);Sb(this)};h.ra=function(a,b){b||(Tb(),this.reset());return!0};h.Aa=function(){return!0};
|
||||||
function Vb(a,b,c){if(a=a.B[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Sb(a,b){for(var c in a.g)Vb(a,c,null!=b?b:a.g[c])}function Wb(a,b,c){if(a=a.B[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Tb(a){for(var b in a.b)Wb(a,b,a.b[b][1])}function Xb(a,b,c,d){a.B[b]&&(void 0===c&&(rb(a,"Value for "+b+" is invalid"),J(a.f)),c=8==(a.F&&a.F.ua||8)?q(c,d):v(c,d),a.B[b].textContent!=c&&(a.B[b].textContent=c))}
|
function Ub(a,b,c){if(a=a.B[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Rb(a,b){for(var c in a.g)Ub(a,c,null!=b?b:a.g[c])}function Vb(a,b,c){if(a=a.B[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Sb(a){for(var b in a.b)Vb(a,b,a.b[b][1])}function Wb(a,b,c,d){a.B[b]&&(void 0===c&&(qb(a,"Value for "+b+" is invalid"),a.f.Y()),c=8==(a.F&&a.F.va||8)?q(c,d):v(c,d),a.B[b].textContent!=c&&(a.B[b].textContent=c))}
|
||||||
function Nb(a,b){var c=a.b[b];Wb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=Yb&&(a.C=b==Zb,a.G=b==$b)}function Ob(a,b){var c=a.b[b];c[2]&&c[3]&&(Wb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Vd=function(a){a||this.f.A.U||(a=this.f,a.D.reset(),ac(a),this.b[bc]&&this.b[bc][1]&&cc(this.f))};h.Wd=function(){};h.Rd=function(a){a||J(this.f)};
|
function Mb(a,b){var c=a.b[b];Vb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=Xb&&(a.C=b==Yb,a.G=b==Zb)}function Nb(a,b){var c=a.b[b];c[2]&&c[3]&&(Vb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Xd=function(a){a||this.f.A.U||(a=this.f,a.D.reset(),$b(a),this.b[ac]&&this.b[ac][1]&&bc(this.f))};h.Yd=function(){};h.Td=function(a){a||this.f.Y()};
|
||||||
h.Pd=function(a){if(!a&&!this.f.A.U)if(this.b[bc]&&this.b[bc][1])cc(this.f);else{if((a=this.F)&&!ub(a,!0))vb(a,!0),dc(a,0,null),vb(a,!1);else try{var b=this.f.$b(1);0<b&&(ec(this.f,b),fc(this.f,b,!0),gc(this.f,b))}catch(c){"number"!=typeof c&&rb(this.f,c.stack||c.message)}this.stop();this.I&&L(this.I)}};h.Qd=function(a){if(a&&!this.f.A.U)if(this.C&&hc(this),a=ic(this,this.Ua),this.H==Mb)jc(this.D,this.ra,a);else{var b=this.f,c=this.ra;b.la++;b.D.Kb(kc(b,c,4),a);b.la--}};
|
h.Rd=function(a){if(!a&&!this.f.A.U)if(this.b[ac]&&this.b[ac][1])bc(this.f);else{if((a=this.F)&&!tb(a,!0))ub(a,!0),cc(a,0,null),ub(a,!1);else try{var b=this.f.$b(1);0<b&&(dc(this.f,b),ec(this.f,b,!0),fc(this.f,b))}catch(c){"number"!=typeof c&&qb(this.f,c.stack||c.message)}this.stop();this.I&&L(this.I)}};h.Sd=function(a){if(a&&!this.f.A.U)if(this.C&&gc(this),a=hc(this,this.Va),this.H==Lb)ic(this.D,this.sa,a);else{var b=this.f,c=this.sa;b.ma++;b.D.Lb(jc(b,c,4),a);b.ma--}};
|
||||||
h.Sd=function(a){a||this.f.A.U||(this.G&&hc(this),a=this.H==Mb?lc(this.D,this.ra):mc(this.f,this.ra),ic(this,a))};h.Ud=function(a){a||this.f.A.U||nc(this,this.Ua)};h.Td=function(a){a?(this.w=!0,Sb(this,!0)):(this.w=!1,Sb(this),oc(this,0))};h.Xd=function(a,b){this.Ua=a?this.Ua|1<<b:this.Ua&~(1<<b)};function hc(a){var b=1145>a.f.xa?8:16,c=65472<=a.ra&&a.ra<65472+b,b=c?1:2,c=c?15:a.D.J;a.b[Yb]&&a.b[Yb][1]||(b=-b);nc(a,a.ra&~c|a.ra+b&c)}
|
h.Ud=function(a){a||this.f.A.U||(this.G&&gc(this),a=this.H==Lb?kc(this.D,this.sa):lc(this.f,this.sa),hc(this,a))};h.Wd=function(a){a||this.f.A.U||mc(this,this.Va)};h.Vd=function(a){a?(this.w=!0,Rb(this,!0)):(this.w=!1,Rb(this),nc(this,0))};h.Zd=function(a,b){this.Va=a?this.Va|1<<b:this.Va&~(1<<b)};function gc(a){var b=1145>a.f.ya?8:16,c=65472<=a.sa&&a.sa<65472+b,b=c?1:2,c=c?15:a.D.J;a.b[Xb]&&a.b[Xb][1]||(b=-b);mc(a,a.sa&~c|a.sa+b&c)}
|
||||||
function nc(a,b){a.ra=b&a.D.J;b=a.ra;for(var c=0;22>c;c++)pc(a,"A"+c,b&1<<c)}function ic(a,b){a.i=b&65535;b=a.i;for(var c=0;16>c;c++)pc(a,"D"+c,b&1<<c);return a.i}function pc(a,b,c){a.g[b]=c;a.w||Vb(a,b,c)}function qc(a){return void 0!==a.B[rc]}function oc(a,b){if(qc(a)){a.Ua=b;for(var c=0;22>c;c++)a.b["S"+c][1]=b&1<<c?1:0;Tb(a)}}h.stop=function(){nc(this,this.f.g[7])};h.Ec=function(a){this.ra=a};h.setData=function(a,b){b?this.sb=a:this.i=a};h.be=function(a,b){return(b?this.sb:this.Ua)&65535};
|
function mc(a,b){a.sa=b&a.D.J;b=a.sa;for(var c=0;22>c;c++)oc(a,"A"+c,b&1<<c)}function hc(a,b){a.i=b&65535;b=a.i;for(var c=0;16>c;c++)oc(a,"D"+c,b&1<<c);return a.i}function oc(a,b,c){a.g[b]=c;a.w||Ub(a,b,c)}function pc(a){return void 0!==a.B[Bc]}function nc(a,b){if(pc(a)){a.Va=b;for(var c=0;22>c;c++)a.b["S"+c][1]=b&1<<c?1:0;Sb(a)}}h.stop=function(){mc(this,this.f.g[7])};h.Fc=function(a){this.sa=a};h.setData=function(a,b){b?this.tb=a:this.i=a};h.de=function(a,b){return(b?this.tb:this.Va)&65535};
|
||||||
h.lf=function(a){this.sb=a};function Ub(){for(var a=!1,b=D(document,B,"panel"),c=0;c<b.length;c++){var d=b[c],e=pb(d),f=nb(e.id);f||(a=!0,f=new Fb(e));qb(f,d);a&&G(f)}}var Mb=7,rc="S0",Zb="DEP",bc="ENABLE",$b="EXAM",Yb="STEP",Dc={},Qb=(Dc[65400]=[null,null,Fb.prototype.be,Fb.prototype.lf,"CNSW"],Dc);Ta(Ub);
|
h.nf=function(a){this.tb=a};function Tb(){for(var a=!1,b=G(document,D,"panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=nb(e.id);f||(a=!0,f=new Eb(e));pb(f,d);a&&H(f)}}var Lb=7,Bc="S0",Yb="DEP",ac="ENABLE",Zb="EXAM",Xb="STEP",Cc={},Pb=(Cc[65400]=[null,null,Eb.prototype.de,Eb.prototype.nf,"CNSW"],Cc);Wa(Tb);
|
||||||
function Ec(a,b,c){A.call(this,"Bus",a,0,16);this.f=b;this.F=c;this.V=a.busWidth||16;this.M=1<<this.V;this.J=this.M-1;this.j=Fc;this.g=Math.log2(this.j);this.S=this.j>>2;this.i=this.j-1;this.H=this.M/this.j|0;this.T=this.H-1;this.Ja=[];this.ha=0;this.G=!1;this.O=[];this.Fd=[Gc,Hc,Ic,Jc];this.b=this.v=[];this.C=this.L=this.w=this.P=this.R=0;a=new M(this);Kc(a,this.F);this.b=Array(this.H);this.v=Array(this.H);for(b=0;b<this.H;b++)this.b[b]=this.v[b]=a;this.C=this.M-Fc;Lc(this,this.C,Fc,Mc,this);this.R=
|
function Dc(a,b,c){A.call(this,"Bus",a,0,16);this.f=b;this.F=c;this.V=a.busWidth||16;this.M=1<<this.V;this.J=this.M-1;this.j=Ec;this.g=Math.log2(this.j);this.S=this.j>>2;this.i=this.j-1;this.H=this.M/this.j|0;this.T=this.H-1;this.Ja=[];this.ia=0;this.G=!1;this.O=[];this.Hd=[Fc,Gc,Hc,Ic];this.b=this.v=[];this.C=this.L=this.w=this.P=this.R=0;a=new M(this);Jc(a,this.F);this.b=Array(this.H);this.v=Array(this.H);for(b=0;b<this.H;b++)this.b[b]=this.v[b]=a;this.C=this.M-Ec;Kc(this,this.C,Ec,Lc,this);this.R=
|
||||||
this.P=(this.C&this.J)>>>this.g;this.L=0;this.w=this.J;G(this)}p(Ec,A);function Nc(a,b){if(b!=a.L){for(var c=0;c<a.H;c++)a.v[c]=a.b[c];a.L=0;a.w=a.J;b&&(a.L=b,b=1<<b,a.w=b-1,b-=Fc,a.R=(b&a.w)>>>a.g,a.v[a.R]=a.b[a.P])}}h=Ec.prototype;h.reset=function(){for(var a=0;a<this.O.length;a++)this.O[a]();Nc(this,16)};h.qa=function(a,b){b||this.reset();return!0};
|
this.P=(this.C&this.J)>>>this.g;this.L=0;this.w=this.J;H(this)}p(Dc,A);function Mc(a,b){if(b!=a.L){for(var c=0;c<a.H;c++)a.v[c]=a.b[c];a.L=0;a.w=a.J;b&&(a.L=b,b=1<<b,a.w=b-1,b-=Ec,a.R=(b&a.w)>>>a.g,a.v[a.R]=a.b[a.P])}}h=Dc.prototype;h.reset=function(){for(var a=0;a<this.O.length;a++)this.O[a]();Mc(this,16)};h.ra=function(a,b){b||this.reset();return!0};
|
||||||
function Lc(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.g;0<g&&k<a.b.length;){var l=a.b[k],m=k*a.j,n=a.j-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.K)return l.Gb+=l.K-f,l.K=f,!0;if(f>=l.K+l.Gb){n=l.size-(f-m);n>g&&(n=g);l.Gb=f-l.K+n;f=m+a.j;g-=n;k++;continue}}return Oc(Pc,f,g)}f=new M(a,f,n,a.j,d,e);Kc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status((c>>10)+"Kb "+Qc[d]+" at "+q(b)),!0):Oc(Rc,b,c)}h.Ic=function(a){return this.v[(a&this.w)>>>this.g].rb(a&this.i,a)};
|
function Kc(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.g;0<g&&k<a.b.length;){var l=a.b[k],m=k*a.j,n=a.j-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.K)return l.Hb+=l.K-f,l.K=f,!0;if(f>=l.K+l.Hb){n=l.size-(f-m);n>g&&(n=g);l.Hb=f-l.K+n;f=m+a.j;g-=n;k++;continue}}return Nc(Oc,f,g)}f=new M(a,f,n,a.j,d,e);Jc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status((c>>10)+"Kb "+Pc[d]+" at "+q(b)),!0):Nc(Qc,b,c)}h.Jc=function(a){return this.v[(a&this.w)>>>this.g].sb(a&this.i,a)};
|
||||||
h.Zb=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Bb||b!=this.i?this.v[c].ia(b,a):this.v[c++].rb(b,a)|this.v[c&this.T].rb(0,a+1)<<8};h.Jc=function(a,b){this.v[(a&this.w)>>>this.g].tb(a&this.i,b,a)};h.Kb=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Bb||c!=this.i?this.v[d].ub(c,b,a):(this.v[d++].tb(c,b&255,a),this.v[d&this.T].tb(0,b>>8&255,a+1))};function Sc(a,b){return a.b[(b&a.J)>>>a.g]}
|
h.Zb=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Ab||b!=this.i?this.v[c].ja(b,a):this.v[c++].sb(b,a)|this.v[c&this.T].sb(0,a+1)<<8};h.Kc=function(a,b){this.v[(a&this.w)>>>this.g].ub(a&this.i,b,a)};h.Lb=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Ab||c!=this.i?this.v[d].vb(c,b,a):(this.v[d++].ub(c,b&255,a),this.v[d&this.T].ub(0,b>>8&255,a+1))};function Rc(a,b){return a.b[(b&a.J)>>>a.g]}
|
||||||
function lc(a,b){var c;a.G=!1;a.ha++;var d=b&a.i,e=Sc(a,b);Bb||d!=a.i?c=e.C(d,b):c=e.j(d,b)|Sc(a,b+1).j(0,b+1)<<8;a.ha--;return c}function Tc(a,b,c){a.G=!1;a.ha++;Sc(a,b).D(b&a.i,c&255,b);a.ha--}function jc(a,b,c){a.G=!1;a.ha++;var d=b&a.i,e=Sc(a,b);Bb||d!=a.i?e.G(d,c&65535,b):(e.D(d,c&255,b),Sc(a,b+1).D(0,c>>8&255,b+1));a.ha--}
|
function kc(a,b){var c;a.G=!1;a.ia++;var d=b&a.i,e=Rc(a,b);Ab||d!=a.i?c=e.C(d,b):c=e.j(d,b)|Rc(a,b+1).j(0,b+1)<<8;a.ia--;return c}function Sc(a,b,c){a.G=!1;a.ia++;Rc(a,b).D(b&a.i,c&255,b);a.ia--}function ic(a,b,c){a.G=!1;a.ia++;var d=b&a.i,e=Rc(a,b);Ab||d!=a.i?e.G(d,c&65535,b):(e.D(d,c&255,b),Rc(a,b+1).D(0,c>>8&255,b+1));a.ia--}
|
||||||
function Uc(a){for(var b=0,c=[],d=0;d<a.H;d++){var e=a.b[d];if(e.Sa||e.Ld){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[k++]=n-g;l[k++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}function Vc(a){for(var b=Wc,c=0,d=0;d<a.b.length;d++){var e=a.b[d];e.type==b&&(c=e.K+e.Gb)}return c}
|
function Tc(a){for(var b=0,c=[],d=0;d<a.H;d++){var e=a.b[d];if(e.Ta||e.Nd){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[k++]=n-g;l[k++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}function Uc(a){for(var b=Vc,c=0,d=0;d<a.b.length;d++){var e=a.b[d];e.type==b&&(c=e.K+e.Hb)}return c}
|
||||||
function Xc(a,b,c,d,e,f,g,k,l){for(var m=b==c?-1:0;b<=c;b+=2){var n=b&Yc;if(void 0!==a.Ja[n])return y("I/O address already registered: "+v(b,8,!0)),!1;var r=l||"unknown";r&&0<=m&&(r+=m++);a.Ja[n]=[d,e,f,g,r,k||16,!1]}return!0}
|
function Wc(a,b,c,d,e,f,g,k,l){for(var m=b==c?-1:0;b<=c;b+=2){var n=b&Xc;if(void 0!==a.Ja[n])return y("I/O address already registered: "+v(b,8,!0)),!1;var r=l||"unknown";r&&0<=m&&(r+=m++);a.Ja[n]=[d,e,f,g,r,k||16,!1]}return!0}
|
||||||
function Pb(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.f.xa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t<u;t++,f+=2)if(r&&1<u&&(r=g[4]+t),!Xc(a,f,f,k,l,m,n,g[7]||b.fa,r||b.jb))return!1}}return!0}
|
function Ob(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.f.ya)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t<u;t++,f+=2)if(r&&1<u&&(r=g[4]+t),!Wc(a,f,f,k,l,m,n,g[7]||b.ga,r||b.kb))return!1}}return!0}
|
||||||
function Rb(a,b){a.O.push(b)}h.Ia=function(a,b,c){this.G=!0;this.ha||(this.F&&H(this.F,4)&&I(this.F,"memory fault ("+c+") on "+O(this.F,a),!0,!0),b&&(this.f.R|=b),this.f.ja(4,0,a))};function Zc(a){var b=a.G;a.G=!1;return b}function Oc(a,b,c){y("Memory block error ("+a+": "+v(b)+","+v(c)+")");return!1}var Fc=8192,Yc=Fc-1,Pc=1,Rc=2;
|
function Qb(a,b){a.O.push(b)}h.Ia=function(a,b,c){this.G=!0;this.ia||(this.F&&I(this.F,4)&&J(this.F,"memory fault ("+c+") on "+O(this.F,a),!0,!0),b&&(this.f.R|=b),this.f.ka(4,0,a))};function Yc(a){var b=a.G;a.G=!1;return b}function Nc(a,b,c){y("Memory block error ("+a+": "+v(b)+","+v(c)+")");return!1}var Ec=8192,Xc=Ec-1,Oc=1,Qc=2;
|
||||||
function Gc(a,b){var c=-1,d=this.controller,e=d.Ja[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Ja[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&H(this.f,16|e[5])&&I(this.f,e[4]+".readByte("+O(this.f,b)+"): "+O(this.f,c),!0,!d.ha),c;d.Ia(b,16,3);c=255;this.f&&H(this.f,16)&&I(this.f,"warning: unconverted read access to byte @"+O(this.f,b)+": "+O(this.f,c),!0,!d.ha);return c}
|
function Fc(a,b){var c=-1,d=this.controller,e=d.Ja[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Ja[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&I(this.f,16|e[5])&&J(this.f,e[4]+".readByte("+O(this.f,b)+"): "+O(this.f,c),!0,!d.ia),c;d.Ia(b,16,3);c=255;this.f&&I(this.f,16)&&J(this.f,"warning: unconverted read access to byte @"+O(this.f,b)+": "+O(this.f,c),!0,!d.ia);return c}
|
||||||
function Hc(a,b,c){var d=!1,e=this.controller,f=e.Ja[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ja[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&H(this.f,16|f[5])&&I(this.f,f[4]+".writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.ha):(e.Ia(c,16,5),this.f&&H(this.f,16)&&I(this.f,"warning: unconverted write access to byte @"+O(this.f,c)+": "+O(this.f,
|
function Gc(a,b,c){var d=!1,e=this.controller,f=e.Ja[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ja[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&I(this.f,16|f[5])&&J(this.f,f[4]+".writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.ia):(e.Ia(c,16,5),this.f&&I(this.f,16)&&J(this.f,"warning: unconverted write access to byte @"+O(this.f,c)+": "+O(this.f,
|
||||||
b),!0,!e.ha))}function Ic(a,b){var c=-1,d=this.controller;a=d.Ja[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&H(this.f,16|a[5])&&I(this.f,a[4]+".readWord("+O(this.f,b)+"): "+O(this.f,c),!0,!d.ha),c;d.Ia(b,16,2);c=65535;this.f&&H(this.f,16)&&I(this.f,"warning: unconverted read access to word @"+O(this.f,b)+": "+O(this.f,c),!0,!d.ha);return c}
|
b),!0,!e.ia))}function Hc(a,b){var c=-1,d=this.controller;a=d.Ja[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&I(this.f,16|a[5])&&J(this.f,a[4]+".readWord("+O(this.f,b)+"): "+O(this.f,c),!0,!d.ia),c;d.Ia(b,16,2);c=65535;this.f&&I(this.f,16)&&J(this.f,"warning: unconverted read access to word @"+O(this.f,b)+": "+O(this.f,c),!0,!d.ia);return c}
|
||||||
function Jc(a,b,c){var d=!1,e=this.controller;a=e.Ja[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&H(this.f,16|a[5])&&I(this.f,a[4]+".writeWord("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.ha):(e.Ia(c,16,4),this.f&&H(this.f,16)&&I(this.f,"warning: unconverted write access to word @"+O(this.f,c)+": "+O(this.f,b),!0,!e.ha))}function P(a){A.call(this,"Device",a,0,256);this.b={ih:0,Fc:-1}}p(P,A);h=P.prototype;
|
function Ic(a,b,c){var d=!1,e=this.controller;a=e.Ja[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&I(this.f,16|a[5])&&J(this.f,a[4]+".writeWord("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.ia):(e.Ia(c,16,4),this.f&&I(this.f,16)&&J(this.f,"warning: unconverted write access to word @"+O(this.f,c)+": "+O(this.f,b),!0,!e.ia))}function P(a){A.call(this,"Device",a,0,256);this.b={kh:0,Gc:-1}}p(P,A);h=P.prototype;
|
||||||
h.pa=function(a,b,c,d){this.D=b;this.I=a;this.f=c;this.F=d;var e=this;this.b.Fc=$c(c,function(){e.b.Db|=128;e.b.Db&64&&ad(e.f,e.b.cb);e.I&&L(e.I,1);bd(e.f,e.b.Fc,1E3/60)});this.b.cb=cd(c,64,6,524288);Pb(b,this,dd);Rb(b,this.reset.bind(this));d&&ed(d,64,function(a){var b=e.f;fd(e,"KIPDR",b.C[0],0,a[0]);fd(e,"KDPDR",b.C[0],8,a[0]);fd(e,"KIPAR",b.M[0],0,a[0]);fd(e,"KDPAR",b.M[0],8,a[0],!0);fd(e,"SIPDR",b.C[1],0,a[0]);fd(e,"SDPDR",b.C[1],8,a[0]);fd(e,"SIPAR",b.M[1],0,a[0]);fd(e,"SDPAR",b.M[1],8,a[0],
|
h.qa=function(a,b,c,d){this.D=b;this.I=a;this.f=c;this.F=d;var e=this;this.b.Gc=Zc(c,function(){e.b.Eb|=128;e.b.Eb&64&&$c(e.f,e.b.eb);e.I&&L(e.I,1);ad(e.f,e.b.Gc,1E3/60)});this.b.eb=bd(c,64,6,524288);Ob(b,this,cd);Qb(b,this.reset.bind(this));d&&dd(d,64,function(a){var b=e.f;ed(e,"KIPDR",b.C[0],0,a[0]);ed(e,"KDPDR",b.C[0],8,a[0]);ed(e,"KIPAR",b.M[0],0,a[0]);ed(e,"KDPAR",b.M[0],8,a[0],!0);ed(e,"SIPDR",b.C[1],0,a[0]);ed(e,"SDPDR",b.C[1],8,a[0]);ed(e,"SIPAR",b.M[1],0,a[0]);ed(e,"SDPAR",b.M[1],8,a[0],
|
||||||
!0);fd(e,"UIPDR",b.C[3],0,a[0]);fd(e,"UDPDR",b.C[3],8,a[0]);fd(e,"UIPAR",b.M[3],0,a[0]);fd(e,"UDPAR",b.M[3],8,a[0],!0);b.T&32&&fd(e,"UNIMAP",b.Fa,-1,a[0])});G(this)};function fd(a,b,c,d,e,f){a=a.F;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n<e;n++)n%m||(g&&(g+="\n"),g+=b+(k?"["+na(n)+"]":"")+":"),g+=" "+O(a,c[d+n],l);a.u(g+(f?"\n":""))}}h.reset=function(){this.b.Db=128;bd(this.f,this.b.Fc,1E3/60,!0)};h.ie=function(){return this.b.Db};
|
!0);ed(e,"UIPDR",b.C[3],0,a[0]);ed(e,"UDPDR",b.C[3],8,a[0]);ed(e,"UIPAR",b.M[3],0,a[0]);ed(e,"UDPAR",b.M[3],8,a[0],!0);b.T&32&&ed(e,"UNIMAP",b.Ra,-1,a[0])});H(this)};function ed(a,b,c,d,e,f){a=a.F;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n<e;n++)n%m||(g&&(g+="\n"),g+=b+(k?"["+na(n)+"]":"")+":"),g+=" "+O(a,c[d+n],l);a.u(g+(f?"\n":""))}}h.reset=function(){this.b.Eb=128;ad(this.f,this.b.Gc,1E3/60,!0)};h.ke=function(){return this.b.Eb};
|
||||||
h.tf=function(a){this.b.Db=a&192;this.b.Db&64||gd(this.f,this.b.cb)};h.ke=function(){return hd(this.f)};h.vf=function(a){id(this.f,a&-129|this.f.S&128)};h.le=function(){return jd(this.f)};h.me=function(){return kd(this.f)};h.ne=function(){return this.f.T};h.wf=function(a){ld(this.f,a)};h.Ve=function(a){a=a>>1&63;var b=this.f.Fa[a>>1];return a&1?b>>16:b&65535};h.dg=function(a,b){b=b>>1&63;var c=b>>1;this.f.Fa[c]=b&1?this.f.Fa[c]&65535|(a&63)<<16:this.f.Fa[c]&-65536|a&65534};
|
h.vf=function(a){this.b.Eb=a&192;this.b.Eb&64||fd(this.f,this.b.eb)};h.me=function(){return gd(this.f)};h.xf=function(a){hd(this.f,a&-129|this.f.S&128)};h.ne=function(){return id(this.f)};h.oe=function(){return jd(this.f)};h.pe=function(){return this.f.T};h.yf=function(a){kd(this.f,a)};h.Xe=function(a){a=a>>1&63;var b=this.f.Ra[a>>1];return a&1?b>>16:b&65535};h.fg=function(a,b){b=b>>1&63;var c=b>>1;this.f.Ra[c]=b&1?this.f.Ra[c]&65535|(a&63)<<16:this.f.Ra[c]&-65536|a&65534};
|
||||||
h.Oe=function(a){return this.f.C[1][a>>1&7]};h.Xf=function(a,b){this.f.C[1][b>>1&7]=a&65295};h.Me=function(a){return this.f.C[1][(a>>1&7)+8]};h.Vf=function(a,b){this.f.C[1][(b>>1&7)+8]=a&65295};h.Ne=function(a){return this.f.M[1][a>>1&7]};h.Wf=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.C[1][b]&=65295};h.Le=function(a){return this.f.M[1][(a>>1&7)+8]};h.Uf=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.C[1][b]&=65295};h.he=function(a){return this.f.C[0][a>>1&7]};
|
h.Qe=function(a){return this.f.C[1][a>>1&7]};h.Zf=function(a,b){this.f.C[1][b>>1&7]=a&65295};h.Oe=function(a){return this.f.C[1][(a>>1&7)+8]};h.Xf=function(a,b){this.f.C[1][(b>>1&7)+8]=a&65295};h.Pe=function(a){return this.f.M[1][a>>1&7]};h.Yf=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.C[1][b]&=65295};h.Ne=function(a){return this.f.M[1][(a>>1&7)+8]};h.Wf=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.C[1][b]&=65295};h.je=function(a){return this.f.C[0][a>>1&7]};
|
||||||
h.sf=function(a,b){this.f.C[0][b>>1&7]=a&65295};h.fe=function(a){return this.f.C[0][(a>>1&7)+8]};h.qf=function(a,b){this.f.C[0][(b>>1&7)+8]=a&65295};h.ge=function(a){return this.f.M[0][a>>1&7]};h.rf=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.C[0][b]&=65295};h.ee=function(a){return this.f.M[0][(a>>1&7)+8]};h.pf=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.C[0][b]&=65295};h.Ue=function(a){return this.f.C[3][a>>1&7]};h.cg=function(a,b){this.f.C[3][b>>1&7]=a&65295};
|
h.uf=function(a,b){this.f.C[0][b>>1&7]=a&65295};h.he=function(a){return this.f.C[0][(a>>1&7)+8]};h.sf=function(a,b){this.f.C[0][(b>>1&7)+8]=a&65295};h.ie=function(a){return this.f.M[0][a>>1&7]};h.tf=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.C[0][b]&=65295};h.ge=function(a){return this.f.M[0][(a>>1&7)+8]};h.rf=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.C[0][b]&=65295};h.We=function(a){return this.f.C[3][a>>1&7]};h.eg=function(a,b){this.f.C[3][b>>1&7]=a&65295};
|
||||||
h.Se=function(a){return this.f.C[3][(a>>1&7)+8]};h.ag=function(a,b){this.f.C[3][(b>>1&7)+8]=a&65295};h.Te=function(a){return this.f.M[3][a>>1&7]};h.bg=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.C[3][b]&=65295};h.Re=function(a){return this.f.M[3][(a>>1&7)+8]};h.$f=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.C[3][b]&=65295};h.Eb=function(a){a&=7;return this.f.w&2048?this.f.oa[a]:this.f.g[a]};h.Ib=function(a,b){b&=7;this.f.w&2048?this.f.oa[b]=a:this.f.g[b]=a};
|
h.Ue=function(a){return this.f.C[3][(a>>1&7)+8]};h.cg=function(a,b){this.f.C[3][(b>>1&7)+8]=a&65295};h.Ve=function(a){return this.f.M[3][a>>1&7]};h.dg=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.C[3][b]&=65295};h.Te=function(a){return this.f.M[3][(a>>1&7)+8]};h.bg=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.C[3][b]&=65295};h.Fb=function(a){a&=7;return this.f.w&2048?this.f.pa[a]:this.f.g[a]};h.Jb=function(a,b){b&=7;this.f.w&2048?this.f.pa[b]=a:this.f.g[b]=a};
|
||||||
h.se=function(){return this.f.w&49152?this.f.X[0]:this.f.g[6]};h.Bf=function(a){this.f.w&49152?this.f.X[0]=a:this.f.g[6]=a};h.ve=function(){return this.f.g[7]};h.Ef=function(a){this.f.g[7]=a};h.Fb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.oa[a]};h.Jb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.oa[b]=a};h.te=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.X[1]};h.Cf=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.X[1]=a};
|
h.ue=function(){return this.f.w&49152?this.f.X[0]:this.f.g[6]};h.Df=function(a){this.f.w&49152?this.f.X[0]=a:this.f.g[6]=a};h.xe=function(){return this.f.g[7]};h.Gf=function(a){this.f.g[7]=a};h.Gb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.pa[a]};h.Kb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.pa[b]=a};h.ve=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.X[1]};h.Ef=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.X[1]=a};
|
||||||
h.ue=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.X[3]};h.Df=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.X[3]=a};h.de=function(a){return this.f.Yb[a-65504>>1]};h.nf=function(a,b){this.f.Yb[b-65504>>1]=a};h.ld=function(a){return 65520==a?(Vc(this.D)>>6)-1:0};h.qd=function(){};h.Qe=function(){return 1};h.Zf=function(){};h.ce=function(){return this.f.R};h.mf=function(){this.f.R=0};h.je=function(){return this.f.mc};h.uf=function(a,b){b&1||(a&=255);this.f.mc=a};
|
h.we=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.X[3]};h.Ff=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.X[3]=a};h.fe=function(a){return this.f.nc[a-65504>>1]};h.qf=function(a,b){this.f.nc[b-65504>>1]=a};h.nd=function(a){return 65520==a?(Uc(this.D)>>6)-1:0};h.sd=function(){};h.Se=function(){return 1};h.ag=function(){};h.ee=function(){return this.f.R};h.pf=function(){this.f.R=0};h.le=function(){return this.f.mc};h.wf=function(a,b){b&1||(a&=255);this.f.mc=a};
|
||||||
h.oe=function(a,b){return b?0:this.f.ab};h.xf=function(a){md(this.f,a)};h.Pe=function(a,b){return b?0:this.f.ya&65280};h.Yf=function(a){this.f.ya=a|255};h.re=function(){return nd(this.f)};h.Af=function(a){od(this.f,a)};h.pd=function(a,b){H(this)&&I(this,"writeIgnored("+q(b)+"): "+q(a),!0,!0)};
|
h.qe=function(a,b){return b?0:this.f.bb};h.zf=function(a){ld(this.f,a)};h.Re=function(a,b){return b?0:this.f.za&65280};h.$f=function(a){this.f.za=a|255};h.te=function(){return md(this.f)};h.Cf=function(a){nd(this.f,a)};h.rd=function(a,b){I(this)&&J(this,"writeIgnored("+q(b)+"): "+q(a),!0,!0)};
|
||||||
var Q={},dd=(Q[61568]=[null,null,P.prototype.Ve,P.prototype.dg,"UNIMAP",64,1170],Q[62592]=[null,null,P.prototype.Oe,P.prototype.Xf,"SIPDR",8,1145,64],Q[62608]=[null,null,P.prototype.Me,P.prototype.Vf,"SDPDR",8,1145,64],Q[62624]=[null,null,P.prototype.Ne,P.prototype.Wf,"SIPAR",8,1145,64],Q[62640]=[null,null,P.prototype.Le,P.prototype.Uf,"SDPAR",8,1145,64],Q[62656]=[null,null,P.prototype.he,P.prototype.sf,"KIPDR",8,1145,64],Q[62672]=[null,null,P.prototype.fe,P.prototype.qf,"KDPDR",8,1145,64],Q[62688]=
|
var Q={},cd=(Q[61568]=[null,null,P.prototype.Xe,P.prototype.fg,"UNIMAP",64,1170],Q[62592]=[null,null,P.prototype.Qe,P.prototype.Zf,"SIPDR",8,1145,64],Q[62608]=[null,null,P.prototype.Oe,P.prototype.Xf,"SDPDR",8,1145,64],Q[62624]=[null,null,P.prototype.Pe,P.prototype.Yf,"SIPAR",8,1145,64],Q[62640]=[null,null,P.prototype.Ne,P.prototype.Wf,"SDPAR",8,1145,64],Q[62656]=[null,null,P.prototype.je,P.prototype.uf,"KIPDR",8,1145,64],Q[62672]=[null,null,P.prototype.he,P.prototype.sf,"KDPDR",8,1145,64],Q[62688]=
|
||||||
[null,null,P.prototype.ge,P.prototype.rf,"KIPAR",8,1145,64],Q[62704]=[null,null,P.prototype.ee,P.prototype.pf,"KDPAR",8,1145,64],Q[62798]=[null,null,P.prototype.ne,P.prototype.wf,"MMR3",1,1145,64],Q[65382]=[null,null,P.prototype.ie,P.prototype.tf,"LKS"],Q[65402]=[null,null,P.prototype.ke,P.prototype.vf,"MMR0",1,1145,64],Q[65404]=[null,null,P.prototype.le,P.prototype.pd,"MMR1",1,1145,64],Q[65406]=[null,null,P.prototype.me,P.prototype.pd,"MMR2",1,1145,64],Q[65408]=[null,null,P.prototype.Ue,P.prototype.cg,
|
[null,null,P.prototype.ie,P.prototype.tf,"KIPAR",8,1145,64],Q[62704]=[null,null,P.prototype.ge,P.prototype.rf,"KDPAR",8,1145,64],Q[62798]=[null,null,P.prototype.pe,P.prototype.yf,"MMR3",1,1145,64],Q[65382]=[null,null,P.prototype.ke,P.prototype.vf,"LKS"],Q[65402]=[null,null,P.prototype.me,P.prototype.xf,"MMR0",1,1145,64],Q[65404]=[null,null,P.prototype.ne,P.prototype.rd,"MMR1",1,1145,64],Q[65406]=[null,null,P.prototype.oe,P.prototype.rd,"MMR2",1,1145,64],Q[65408]=[null,null,P.prototype.We,P.prototype.eg,
|
||||||
"UIPDR",8,1145,64],Q[65424]=[null,null,P.prototype.Se,P.prototype.ag,"UDPDR",8,1145,64],Q[65440]=[null,null,P.prototype.Te,P.prototype.bg,"UIPAR",8,1145,64],Q[65456]=[null,null,P.prototype.Re,P.prototype.$f,"UDPAR",8,1145,64],Q[65472]=[null,null,P.prototype.Eb,P.prototype.Ib,"R0SET0"],Q[65473]=[null,null,P.prototype.Eb,P.prototype.Ib,"R1SET0"],Q[65474]=[null,null,P.prototype.Eb,P.prototype.Ib,"R2SET0"],Q[65475]=[null,null,P.prototype.Eb,P.prototype.Ib,"R3SET0"],Q[65476]=[null,null,P.prototype.Eb,
|
"UIPDR",8,1145,64],Q[65424]=[null,null,P.prototype.Ue,P.prototype.cg,"UDPDR",8,1145,64],Q[65440]=[null,null,P.prototype.Ve,P.prototype.dg,"UIPAR",8,1145,64],Q[65456]=[null,null,P.prototype.Te,P.prototype.bg,"UDPAR",8,1145,64],Q[65472]=[null,null,P.prototype.Fb,P.prototype.Jb,"R0SET0"],Q[65473]=[null,null,P.prototype.Fb,P.prototype.Jb,"R1SET0"],Q[65474]=[null,null,P.prototype.Fb,P.prototype.Jb,"R2SET0"],Q[65475]=[null,null,P.prototype.Fb,P.prototype.Jb,"R3SET0"],Q[65476]=[null,null,P.prototype.Fb,
|
||||||
P.prototype.Ib,"R4SET0"],Q[65477]=[null,null,P.prototype.Eb,P.prototype.Ib,"R5SET0"],Q[65478]=[null,null,P.prototype.se,P.prototype.Bf,"R6KERNEL"],Q[65479]=[null,null,P.prototype.ve,P.prototype.Ef,"R7KERNEL"],Q[65480]=[null,null,P.prototype.Fb,P.prototype.Jb,"R0SET1",1,1145],Q[65481]=[null,null,P.prototype.Fb,P.prototype.Jb,"R1SET1",1,1145],Q[65482]=[null,null,P.prototype.Fb,P.prototype.Jb,"R2SET1",1,1145],Q[65483]=[null,null,P.prototype.Fb,P.prototype.Jb,"R3SET1",1,1145],Q[65484]=[null,null,P.prototype.Fb,
|
P.prototype.Jb,"R4SET0"],Q[65477]=[null,null,P.prototype.Fb,P.prototype.Jb,"R5SET0"],Q[65478]=[null,null,P.prototype.ue,P.prototype.Df,"R6KERNEL"],Q[65479]=[null,null,P.prototype.xe,P.prototype.Gf,"R7KERNEL"],Q[65480]=[null,null,P.prototype.Gb,P.prototype.Kb,"R0SET1",1,1145],Q[65481]=[null,null,P.prototype.Gb,P.prototype.Kb,"R1SET1",1,1145],Q[65482]=[null,null,P.prototype.Gb,P.prototype.Kb,"R2SET1",1,1145],Q[65483]=[null,null,P.prototype.Gb,P.prototype.Kb,"R3SET1",1,1145],Q[65484]=[null,null,P.prototype.Gb,
|
||||||
P.prototype.Jb,"R4SET1",1,1145],Q[65485]=[null,null,P.prototype.Fb,P.prototype.Jb,"R5SET1",1,1145],Q[65486]=[null,null,P.prototype.te,P.prototype.Cf,"R6SUPER",1,1145],Q[65487]=[null,null,P.prototype.ue,P.prototype.Df,"R6USER",1,1145],Q[65504]=[null,null,P.prototype.de,P.prototype.nf,"CTRL",8,1170],Q[65520]=[null,null,P.prototype.ld,P.prototype.qd,"LSIZE",1,1170],Q[65522]=[null,null,P.prototype.ld,P.prototype.qd,"HSIZE",1,1170],Q[65524]=[null,null,P.prototype.Qe,P.prototype.Zf,"SYSID",1,1170],Q[65526]=
|
P.prototype.Kb,"R4SET1",1,1145],Q[65485]=[null,null,P.prototype.Gb,P.prototype.Kb,"R5SET1",1,1145],Q[65486]=[null,null,P.prototype.ve,P.prototype.Ef,"R6SUPER",1,1145],Q[65487]=[null,null,P.prototype.we,P.prototype.Ff,"R6USER",1,1145],Q[65504]=[null,null,P.prototype.fe,P.prototype.qf,"CTRL",8,1170],Q[65520]=[null,null,P.prototype.nd,P.prototype.sd,"LSIZE",1,1170],Q[65522]=[null,null,P.prototype.nd,P.prototype.sd,"HSIZE",1,1170],Q[65524]=[null,null,P.prototype.Se,P.prototype.ag,"SYSID",1,1170],Q[65526]=
|
||||||
[null,null,P.prototype.ce,P.prototype.mf,"ERR",1,1170],Q[65528]=[null,null,P.prototype.je,P.prototype.uf,"MBR",1,1170],Q[65530]=[null,null,P.prototype.oe,P.prototype.xf,"PIR"],Q[65532]=[null,null,P.prototype.Pe,P.prototype.Yf,"SLR"],Q[65534]=[null,null,P.prototype.re,P.prototype.Af,"PSW"],Q);
|
[null,null,P.prototype.ee,P.prototype.pf,"ERR",1,1170],Q[65528]=[null,null,P.prototype.le,P.prototype.wf,"MBR",1,1170],Q[65530]=[null,null,P.prototype.qe,P.prototype.zf,"PIR"],Q[65532]=[null,null,P.prototype.Re,P.prototype.$f,"SLR"],Q[65534]=[null,null,P.prototype.te,P.prototype.Cf,"PSW"],Q);
|
||||||
Ta(function(){for(var a=D(document,B,"device"),b=0;b<a.length;b++){var c,d=a[b];c=pb(d);switch(c.type){case "default":c=new P(c);qb(c,d);break;case "pc11":c=new pd(c);qb(c,d);break;case "rl11":c=new qd(c);qb(c,d);break;case "rk11":c=new R(c),qb(c,d)}}});
|
Wa(function(){for(var a=G(document,D,"device"),b=0;b<a.length;b++){var c,d=a[b];c=B(d);switch(c.type){case "default":c=new P(c);pb(c,d);break;case "pc11":c=new od(c);pb(c,d);break;case "rl11":c=new pd(c);pb(c,d);break;case "rk11":c=new R(c),pb(c,d)}}});
|
||||||
function M(a,b,c,d,e,f){this.B=a;this.id=rd+=2;this.b=null;this.K=b;this.Gb=c;this.size=d||0;this.type=e||sd;this.I=e==td;this.f=this.controller=null;this.rb=this.j=this.Bc;this.ia=this.C=this.Cc;this.tb=this.D=this.Hb;this.ub=this.G=this.jc;this.F=this.i=0;Kc(this);this.Sa=this.Ld=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],ud(this,f.Fd);else if(wb)this.v=new ArrayBuffer(this.size),this.w=new DataView(this.v,0,this.size),this.g=new Uint8Array(this.v,0,this.size),this.H=new Uint16Array(this.v,
|
function M(a,b,c,d,e,f){this.B=a;this.id=qd+=2;this.b=null;this.K=b;this.Hb=c;this.size=d||0;this.type=e||rd;this.I=e==sd;this.f=this.controller=null;this.sb=this.j=this.Cc;this.ja=this.C=this.Dc;this.ub=this.D=this.Ib;this.vb=this.G=this.kc;this.F=this.i=0;Jc(this);this.Ta=this.Nd=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],td(this,f.Hd);else if(vb)this.v=new ArrayBuffer(this.size),this.w=new DataView(this.v,0,this.size),this.g=new Uint8Array(this.v,0,this.size),this.H=new Uint16Array(this.v,
|
||||||
0,this.size>>1),this.b=new Int32Array(this.v,0,this.size>>2),ud(this,vd?Ed:Fd);else{a=this.b=Array(this.size>>2);for(f=0;f<a.length;f++)a[f]=0;ud(this,Gd)}else ud(this)}h=M.prototype;h.save=function(){var a,b;if(this.controller)a=null;else if(wb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.w.getInt32(b<<2,!0);else a=this.b;return a};
|
0,this.size>>1),this.b=new Int32Array(this.v,0,this.size>>2),td(this,Cd?Dd:Ed);else{a=this.b=Array(this.size>>2);for(f=0;f<a.length;f++)a[f]=0;td(this,Fd)}else td(this)}h=M.prototype;h.save=function(){var a,b;if(this.controller)a=null;else if(vb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.w.getInt32(b<<2,!0);else a=this.b;return a};
|
||||||
h.restore=function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(wb)for(b=0;b<a.length;b++)this.w.setInt32(b<<2,a[b],!0);else this.b=a;return this.Sa=!0}return!1};function ud(a,b){b||(b=Hd);Id(a,b,void 0);Jd(a,b,void 0)}function Id(a,b,c){c&&a.F||(a.rb=b[0]||a.Bc,a.ia=b[2]||a.Cc);if(c||void 0===c)a.j=b[0]||a.Bc,a.C=b[2]||a.Cc}function Jd(a,b,c){c&&a.i||(a.tb=!a.I&&b[1]||a.Hb,a.ub=!a.I&&b[3]||a.jc);if(c||void 0===c)a.D=b[1]||a.Hb,a.G=b[3]||a.jc}
|
h.restore=function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(vb)for(b=0;b<a.length;b++)this.w.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ta=!0}return!1};function td(a,b){b||(b=Gd);Hd(a,b,void 0);Id(a,b,void 0)}function Hd(a,b,c){c&&a.F||(a.sb=b[0]||a.Cc,a.ja=b[2]||a.Dc);if(c||void 0===c)a.j=b[0]||a.Cc,a.C=b[2]||a.Dc}function Id(a,b,c){c&&a.i||(a.ub=!a.I&&b[1]||a.Ib,a.vb=!a.I&&b[3]||a.kc);if(c||void 0===c)a.D=b[1]||a.Ib,a.G=b[3]||a.kc}
|
||||||
h.nb=function(a,b){b?this.i++||Jd(this,Kd,!1):this.F++||Id(this,Kd,!1)};function Ld(a,b){b?--a.i||(a.tb=a.I?a.Hb:a.D,a.ub=a.I?a.jc:a.G):--a.F||(a.rb=a.j,a.ia=a.C)}function Kc(a,b,c){a.f=b;a.F=a.i=0;c&&((a.F=c.F)&&Id(a,Kd,!1),(a.i=c.i)&&Jd(a,Kd,!1))}h.Bc=function(a,b){this.f&&H(this.f,32)&&I(this.f,"attempt to read invalid address "+O(this.f,b),!0);this.B.Ia(b,32,2);return 255};
|
h.ob=function(a,b){b?this.i++||Id(this,Jd,!1):this.F++||Hd(this,Jd,!1)};function Kd(a,b){b?--a.i||(a.ub=a.I?a.Ib:a.D,a.vb=a.I?a.kc:a.G):--a.F||(a.sb=a.j,a.ja=a.C)}function Jc(a,b,c){a.f=b;a.F=a.i=0;c&&((a.F=c.F)&&Hd(a,Jd,!1),(a.i=c.i)&&Id(a,Jd,!1))}h.Cc=function(a,b){this.f&&I(this.f,32)&&J(this.f,"attempt to read invalid address "+O(this.f,b),!0);this.B.Ia(b,32,2);return 255};
|
||||||
h.Hb=function(a,b,c){this.f&&H(this.f,32)&&I(this.f,"attempt to write "+O(this.f,b)+" to invalid addresses "+O(this.f,c),!0);this.B.Ia(c,32,4)};h.Cc=function(a,b){return this.rb(a++,b++)|this.rb(a,b)<<8};h.jc=function(a,b,c){this.tb(a++,b&255,c++);this.tb(a,b>>8,c)};h.ae=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.af=function(a,b){Ab&&a&1&&this.B.Ia(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8};
|
h.Ib=function(a,b,c){this.f&&I(this.f,32)&&J(this.f,"attempt to write "+O(this.f,b)+" to invalid addresses "+O(this.f,c),!0);this.B.Ia(c,32,4)};h.Dc=function(a,b){return this.sb(a++,b++)|this.sb(a,b)<<8};h.kc=function(a,b,c){this.ub(a++,b&255,c++);this.ub(a,b>>8,c)};h.ce=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.cf=function(a,b){zb&&a&1&&this.B.Ia(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8};
|
||||||
h.kf=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Sa=!0};h.hg=function(a,b,c){Ab&&a&1&&this.B.Ia(c,64,4);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.Sa=!0};h.Zd=function(a,b){this.f&&null!=this.K&&Md(this.f,this.K+a);return this.j(a,b)};h.Xe=function(a,b){this.f&&null!=this.K&&Md(this.f,this.K+a,2);return this.C(a,b)};
|
h.mf=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Ta=!0};h.jg=function(a,b,c){zb&&a&1&&this.B.Ia(c,64,4);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.Ta=!0};h.ae=function(a,b){this.f&&null!=this.K&&Ld(this.f,this.K+a);return this.j(a,b)};h.Ze=function(a,b){this.f&&null!=this.K&&Ld(this.f,this.K+a,2);return this.C(a,b)};
|
||||||
h.hf=function(a,b,c){this.f&&null!=this.K&&Nd(this.f,this.K+a);this.I?this.Hb(0,b,c):this.D(a,b,c)};h.fg=function(a,b,c){this.f&&null!=this.K&&Nd(this.f,this.K+a,2);this.I?this.Hb(0,b,c):this.G(a,b,c)};h.Yd=function(a){return this.g[a]};h.$d=function(a,b){a=this.g[a];this.f&&H(this.f,32)&&I(this.f,"Memory.readByte("+O(this.f,b)+"): "+O(this.f,a),!0);return a};h.We=function(a,b){Ab&&a&1&&this.B.Ia(b,64,2);return this.w.getUint16(a,!0)};
|
h.kf=function(a,b,c){this.f&&null!=this.K&&Md(this.f,this.K+a);this.I?this.Ib(0,b,c):this.D(a,b,c)};h.hg=function(a,b,c){this.f&&null!=this.K&&Md(this.f,this.K+a,2);this.I?this.Ib(0,b,c):this.G(a,b,c)};h.$d=function(a){return this.g[a]};h.be=function(a,b){a=this.g[a];this.f&&I(this.f,32)&&J(this.f,"Memory.readByte("+O(this.f,b)+"): "+O(this.f,a),!0);return a};h.Ye=function(a,b){zb&&a&1&&this.B.Ia(b,64,2);return this.w.getUint16(a,!0)};
|
||||||
h.$e=function(a,b){Ab&&a&1&&this.B.Ia(b,64,2);a=!Bb&&a&1?this.g[a]|this.g[a+1]<<8:this.H[a>>1];this.f&&H(this.f,32)&&I(this.f,"Memory.readWord("+O(this.f,b)+"): "+O(this.f,a),!0);return a};h.gf=function(a,b){this.g[a]=b;this.Sa=!0};h.jf=function(a,b,c){this.g[a]=b;this.Sa=!0;this.f&&H(this.f,32)&&I(this.f,"Memory.writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0)};h.eg=function(a,b,c){Ab&&a&1&&this.B.Ia(c,64,4);this.w.setUint16(a,b,!0);this.Sa=!0};
|
h.bf=function(a,b){zb&&a&1&&this.B.Ia(b,64,2);a=!Ab&&a&1?this.g[a]|this.g[a+1]<<8:this.H[a>>1];this.f&&I(this.f,32)&&J(this.f,"Memory.readWord("+O(this.f,b)+"): "+O(this.f,a),!0);return a};h.jf=function(a,b){this.g[a]=b;this.Ta=!0};h.lf=function(a,b,c){this.g[a]=b;this.Ta=!0;this.f&&I(this.f,32)&&J(this.f,"Memory.writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0)};h.gg=function(a,b,c){zb&&a&1&&this.B.Ia(c,64,4);this.w.setUint16(a,b,!0);this.Ta=!0};
|
||||||
h.gg=function(a,b,c){Ab&&a&1&&this.B.Ia(c,64,4);!Bb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.H[a>>1]=b;this.Sa=!0;this.f&&H(this.f,32)&&I(this.f,"Memory.writeWord("+O(this.f,c)+","+O(this.f,b)+")",!0)};var sd=0,Wc=1,td=2,Mc=4,Qc=["NONE","RAM","ROM","VID","H/W"],rd=0,Hd=[],Gd=[M.prototype.ae,M.prototype.kf,M.prototype.af,M.prototype.hg],Kd=[M.prototype.Zd,M.prototype.hf,M.prototype.Xe,M.prototype.fg];
|
h.ig=function(a,b,c){zb&&a&1&&this.B.Ia(c,64,4);!Ab&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.H[a>>1]=b;this.Ta=!0;this.f&&I(this.f,32)&&J(this.f,"Memory.writeWord("+O(this.f,c)+","+O(this.f,b)+")",!0)};var rd=0,Vc=1,sd=2,Lc=4,Pc=["NONE","RAM","ROM","VID","H/W"],qd=0,Gd=[],Fd=[M.prototype.ce,M.prototype.mf,M.prototype.cf,M.prototype.jg],Jd=[M.prototype.ae,M.prototype.kf,M.prototype.Ze,M.prototype.hg];
|
||||||
if(wb)var Fd=[M.prototype.Yd,M.prototype.gf,M.prototype.We,M.prototype.eg],Ed=[M.prototype.$d,M.prototype.jf,M.prototype.$e,M.prototype.gg];var Od;if(wb){var Pd=new ArrayBuffer(2);(new DataView(Pd)).setUint16(0,256,!0);Od=256===(new Uint16Array(Pd))[0]}else Od=!1;var vd=Od;
|
if(vb)var Ed=[M.prototype.$d,M.prototype.jf,M.prototype.Ye,M.prototype.gg],Dd=[M.prototype.be,M.prototype.lf,M.prototype.bf,M.prototype.ig];var Nd;if(vb){var Od=new ArrayBuffer(2);(new DataView(Od)).setUint16(0,256,!0);Nd=256===(new Uint16Array(Od))[0]}else Nd=!1;var Cd=Nd;
|
||||||
function Qd(a,b){A.call(this,"CPU",a,0,1);b=a.cycles||b;var c=a.multiplier||1;this.nc=0;this.ic=b;this.Ya=c;this.uc=Math.round(this.ic/1E4)/100;this.gb=this.uc*this.Ya;this.vc=this.Rb=this.mb=this.kc=0;this.A.U=!1;this.A.fc=!1;this.A.Ra=a.autoStart;this.A.xb=!1;this.Pb=this.Ab=0;this.Qb=a.csStart;this.zb=a.csInterval;this.Bb=a.csStop;this.Aa=[];this.Sc=this.ef.bind(this);this.Za=this.Ea=this.Xa=this.b=this.aa=this.Da=this.Ob=this.Wa=this.Cb=this.wc=this.lb=0;this.sa=null;G(this)}p(Qd,A);h=Qd.prototype;
|
function Pd(a,b){A.call(this,"CPU",a,0,1);b=a.cycles||b;var c=a.multiplier||1;this.oc=0;this.ic=b;this.Za=c;this.vc=Math.round(this.ic/1E4)/100;this.nb=this.vc*this.Za;this.wc=this.Sb=this.hb=this.jc=0;this.A.U=!1;this.A.fc=!1;this.A.Sa=a.autoStart;this.A.zb=!1;this.Qb=this.Bb=0;this.Rb=a.csStart;this.Ab=a.csInterval;this.Cb=a.csStop;this.Ba=[];this.Tc=this.gf.bind(this);this.$a=this.Fa=this.Ya=this.b=this.da=this.Ea=this.Pb=this.Xa=this.Db=this.xc=this.mb=0;this.ta=null;H(this)}p(Pd,A);h=Pd.prototype;
|
||||||
h.pa=function(a,b,c,d){this.I=a;this.D=b;this.F=d;this.sa=a.i;for(a=0;a<Rd.length;a++)(b=this.B[Rd[a]])&&this.I.na(null,Rd[a],b);G(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};
|
h.qa=function(a,b,c,d){this.I=a;this.D=b;this.F=d;this.ta=a.i;for(a=0;a<Qd.length;a++)(b=this.B[Qd[a]])&&this.I.oa(null,Qd[a],b);H(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};
|
||||||
h.qa=function(a,b){var c=Sd(this.I,"autoStart");null!=c?this.A.Ra="true"==c?!0:"false"==c?!1:!!c:null==this.A.Ra&&(this.A.Ra=!this.F&&void 0===this.B.run);if(!b){if(a&&this.restore){Td(this);if(!this.restore(a))return!1;Ud(this)}else this.reset();this.F?(a=this.F,b=this.A.Ra,a.Ba=!0,a.u("Type ? for help with PDPjs Debugger commands"),Vd(a),b||Wd(a),a.ta&&(b=a.ta,a.ta=null,Xd(a,b))):this.u("No debugger detected");this.A.Ra||this.u("CPU will not be auto-started, click Run to start")}return!0};
|
h.ra=function(a,b){var c=Rd(this.I,"autoStart");null!=c?this.A.Sa="true"==c?!0:"false"==c?!1:!!c:null==this.A.Sa&&(this.A.Sa=!this.F&&void 0===this.B.run);if(!b){if(a&&this.restore){Sd(this);if(!this.restore(a))return!1;Td(this)}else this.reset();this.F?(a=this.F,b=this.A.Sa,a.Ba=!0,a.u("Type ? for help with PDPjs Debugger commands"),Ud(a),b||Vd(a),a.ua&&(b=a.ua,a.ua=null,Wd(a,b))):this.u("No debugger detected");this.A.Sa||this.u("CPU will not be auto-started, click Run to start")}return!0};
|
||||||
h.za=function(a){return a?this.save():!0};h.Ra=function(){return this.A.U?!0:this.A.Ra?(cc(this),!0):!1};h.ed=function(){return 0};function Ud(a){void 0===a.Qb&&(a.Qb=0);void 0===a.zb&&(a.zb=-1);void 0===a.Bb&&(a.Bb=-1);a.A.xb=0<=a.Qb&&0<a.zb;a.A.xb&&(a.Pb=0,a.Ab=a.Qb-a.Za)}function gc(a,b){if(a.A.xb){var c=!1;a.Pb=a.Pb+a.ed()|0;a.Ab-=b;0>=a.Ab&&(a.Ab+=a.zb,c=!0);0<=a.Bb&&a.Bb<=Yd(a)&&(a.zb=a.Bb=-1,Ud(a),J(a),c=!0);c&&a.u(Yd(a)+" cycles: checksum="+v(a.Pb))}}
|
h.Aa=function(a){return a?this.save():!0};h.Sa=function(){return this.A.U?!0:this.A.Sa?(bc(this),!0):!1};h.gd=function(){return 0};function Td(a){void 0===a.Rb&&(a.Rb=0);void 0===a.Ab&&(a.Ab=-1);void 0===a.Cb&&(a.Cb=-1);a.A.zb=0<=a.Rb&&0<a.Ab;a.A.zb&&(a.Qb=0,a.Bb=a.Rb-a.$a)}function fc(a,b){if(a.A.zb){var c=!1;a.Qb=a.Qb+a.gd()|0;a.Bb-=b;0>=a.Bb&&(a.Bb+=a.Ab,c=!0);0<=a.Cb&&a.Cb<=Xd(a)&&(a.Ab=a.Cb=-1,Td(a),a.Y(),c=!0);c&&a.u(Xd(a)+" cycles: checksum="+v(a.Qb))}}
|
||||||
h.na=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.B[b]=c,!0;case "run":return this.B[b]=c,c.onclick=function(){var a;if(a=d.I)if(a=d.I,a.A.ea)a=!0;else{var b=null,c,k=mb(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.A.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.A.ea);c++);c==k.length&&(b=a);y("The "+b.type+" component ("+b.id+") is not "+(b.A.ready?"powered yet":"ready yet"+(b.bc?" (waiting for notification)":""))+".");a=!1}a&&(d.A.U?J(d):cc(d))},!0;
|
h.oa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.B[b]=c,!0;case "run":return this.B[b]=c,c.onclick=function(){var a;if(a=d.I)if(a=d.I,a.A.fa)a=!0;else{var b=null,c,k=mb(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.A.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.A.fa);c++);c==k.length&&(b=a);y("The "+b.type+" component ("+b.id+") is not "+(b.A.ready?"powered yet":"ready yet"+(b.bc?" (waiting for notification)":""))+".");a=!1}a&&(d.A.U?d.Y():bc(d))},!0;
|
||||||
case "speed":return this.B[b]=c,!0;case "setSpeed":return this.B[b]=c,c.onclick=function(){Zd(d,d.Ya<<1,!0)},c.textContent=this.gb.toFixed(2)+"Mhz",!0}return!1};function fc(a,b,c){a.Za+=b;c&&(a.Xa=a.b=a.aa=0)}function $d(a,b){var c=1;b&&1<a.Ya&&a.lb&&(c=a.lb/a.uc);a.vc=Math.round(1E3/ae);a.Rb=Math.floor(a.ic/ae*c);b||(a.mb=a.Rb);a.kc=0}function Yd(a){return a.Za+a.Ea+a.Xa-a.b}function Td(a){a.lb=0;a.wc=0;a.Za=a.Ea=a.Xa=a.b=a.aa=0;Ud(a);Zd(a,1)}
|
case "speed":return this.B[b]=c,!0;case "setSpeed":return this.B[b]=c,c.onclick=function(){Yd(d,d.Za<<1,!0)},c.textContent=this.nb.toFixed(2)+"Mhz",!0}return!1};function ec(a,b,c){a.$a+=b;c&&(a.Ya=a.b=a.da=0)}function Zd(a,b){var c=1;b&&1<a.Za&&a.mb&&(c=a.mb/a.vc);a.wc=Math.round(1E3/$d);a.Sb=Math.floor(a.ic/$d*c);b||(a.hb=a.Sb);a.jc=0}function Xd(a){return a.$a+a.Fa+a.Ya-a.b}function Sd(a){a.mb=0;a.xc=0;a.$a=a.Fa=a.Ya=a.b=a.da=0;Td(a);Yd(a,1)}
|
||||||
function Zd(a,b,c){var d=!1;if(void 0!==b){.8>a.lb/a.gb?b=1:d=!0;a.Ya=b;b=a.uc*a.Ya;if(a.gb!=b){a.gb=b;b=a.gb.toFixed(2)+"Mhz";var e=a.B.setSpeed;e&&(e.textContent=b);a.u("target speed: "+b)}c&&a.I&&be(a.I)}fc(a,a.Ea);a.Ea=0;a.Da=ya();a.Wa=0;$d(a);return d}function $c(a,b){var c=a.Aa.length;a.Aa.push([-1,b]);return c}function bd(a,b,c,d){0<=b&&b<a.Aa.length&&(d||0>a.Aa[b][0])&&(c=a.ic*a.Ya/1E3*c|0,a.A.U&&(c+=ce(a)),a.Aa[b][0]=c)}
|
function Yd(a,b,c){var d=!1;if(void 0!==b){.8>a.mb/a.nb?b=1:d=!0;a.Za=b;b=a.vc*a.Za;if(a.nb!=b){a.nb=b;b=a.nb.toFixed(2)+"Mhz";var e=a.B.setSpeed;e&&(e.textContent=b);a.u("target speed: "+b)}c&&a.I&&ae(a.I)}ec(a,a.Fa);a.Fa=0;a.Ea=ya();a.Xa=0;Zd(a);return d}function Zc(a,b){var c=a.Ba.length;a.Ba.push([-1,b]);return c}function ad(a,b,c,d){0<=b&&b<a.Ba.length&&(d||0>a.Ba[b][0])&&(c=a.ic*a.Za/1E3*c|0,a.A.U&&(c+=be(a)),a.Ba[b][0]=c)}
|
||||||
function de(a,b){for(var c=a.Aa.length-1;0<=c;c--){var d=a.Aa[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function ec(a,b){for(var c=a.Aa.length-1;0<=c;c--){var d=a.Aa[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ce(a,b){var c=a.Xa-=a.b;a.b=a.aa=0;b&&(a.Xa=0);return c}
|
function ce(a,b){for(var c=a.Ba.length-1;0<=c;c--){var d=a.Ba[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function dc(a,b){for(var c=a.Ba.length-1;0<=c;c--){var d=a.Ba[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function be(a,b){var c=a.Ya-=a.b;a.b=a.da=0;b&&(a.Ya=0);return c}
|
||||||
h.ef=function(){if(this.A.U){this.kc>=this.ic&&$d(this,!0);this.Cb=0;this.Ob=ya();if(this.Wa){var a=this.Ob-this.Wa;a>this.vc&&(this.Da+=a,this.Da>this.Ob&&(this.Da=this.Ob))}try{do{var b=de(this,this.A.xb?1:this.Rb);try{this.$b(b)}catch(e){if("number"!=typeof e)throw e;}b=ce(this,!0);this.Cb+=b;this.Ea+=b;gc(this,b);ec(this,b);this.mb-=b;if(0>=this.mb){this.mb+=this.Rb;++this.wc>=ee&&(this.I&&L(this.I,void 0),this.wc=0);break}}while(this.A.U)}catch(e){J(this);this.I&&this.I.stop(ya(),Yd(this));rb(this,
|
h.gf=function(){if(this.A.U){this.jc>=this.ic&&Zd(this,!0);this.Db=0;this.Pb=ya();if(this.Xa){var a=this.Pb-this.Xa;a>this.wc&&(this.Ea+=a,this.Ea>this.Pb&&(this.Ea=this.Pb))}try{do{var b=ce(this,this.A.zb?1:this.Sb);try{this.$b(b)}catch(e){if("number"!=typeof e)throw e;}b=be(this,!0);this.Db+=b;this.Fa+=b;fc(this,b);dc(this,b);this.hb-=b;if(0>=this.hb){this.hb+=this.Sb;++this.xc>=de&&(this.I&&L(this.I,void 0),this.xc=0);break}}while(this.A.U)}catch(e){this.Y();this.I&&this.I.stop(ya(),Xd(this));
|
||||||
e.stack||e.message);return}if(this.A.U){a=setTimeout;b=this.Sc;this.Wa=ya();var c=this.vc;this.Cb&&(c=Math.round(c*this.Cb/this.Rb));var c=c-(this.Wa-this.Ob),d=this.Wa-this.Da;d&&(this.lb=Math.round(this.Ea/(10*d))/100,864E5<=d&&(this.Za=0,Zd(this)));if(0>c||this.lb<this.gb)-1E3>c&&(this.Da-=c),c=0;this.kc+=this.Cb;this.Wa+=c;a(b,c)}}};
|
qb(this,e.stack||e.message);return}if(this.A.U){a=setTimeout;b=this.Tc;this.Xa=ya();var c=this.wc;this.Db&&(c=Math.round(c*this.Db/this.Sb));var c=c-(this.Xa-this.Pb),d=this.Xa-this.Ea;d&&(this.mb=Math.round(this.Fa/(10*d))/100,864E5<=d&&(this.$a=0,Yd(this)));if(0>c||this.mb<this.nb)-1E3>c&&(this.Ea-=c),c=0;this.jc+=this.Db;this.Xa+=c;a(b,c)}}};
|
||||||
function cc(a,b){if(!sb(a))if(a.A.U)a.u(a.toString()+" busy");else{Zd(a);a.A.U=!0;a.A.fc=!0;var c=a.B.run;c&&(c.textContent="Halt");a.I&&(b&&be(a.I,!0),a.I.start(a.Da,Yd(a)));a.F||a.status("Started");setTimeout(a.Sc,0)}}h.$b=function(){return 0};function J(a,b){var c=!1;if(a.A.U){ce(a);fc(a,a.Ea);a.Ea=0;a.A.U=!1;if(c=a.B.run)c.textContent="Run";a.I&&a.I.stop(ya(),Yd(a));c=!0;a.F||a.status("Stopped")}a.A.complete=b;return c}var ae=30,ee=15,Rd=["power","reset"];
|
function bc(a,b){if(!rb(a))if(a.A.U)a.u(a.toString()+" busy");else{Yd(a);a.A.U=!0;a.A.fc=!0;var c=a.B.run;c&&(c.textContent="Halt");a.I&&(b&&ae(a.I,!0),a.I.start(a.Ea,Xd(a)));a.F||a.status("Started");setTimeout(a.Tc,0)}}h.$b=function(){return 0};h.Y=function(a){var b=!1;if(this.A.U){be(this);ec(this,this.Fa);this.Fa=0;this.A.U=!1;if(b=this.B.run)b.textContent="Run";this.I&&this.I.stop(ya(),Xd(this));b=!0;this.F||this.status("Stopped")}this.A.complete=a;return b};var $d=30,de=15,Qd=["power","reset"];
|
||||||
function fe(a){var b=+a.model||1170;Qd.call(this,a,6666667);this.xa=b;this.Pc=a.addrReset||0;this.w=this.G=this.H=this.L=this.J=0;this.g=this.oa=this.X=[];this.O=0;this.tc=[];this.C=this.M=this.Fa=this.Yb=[];this.lc=this.ib=this.P=this.Oc=this.Va=this.wb=this.yb=this.Ca=this.R=this.ab=this.ya=this.S=this.Vb=this.Wb=this.T=this.$a=this.v=this.j=this.hc=this.V=this.Y=this.i=this.mc=0;this.Rc=255;1120>=this.xa?(this.Nc=ge.bind(this),this.vb=this.Jd,this.lc=8,this.Rc=-1,this.Wc=255,this.Vc=0):(this.Nc=
|
function ee(a){var b=+a.model||1170;Pd.call(this,a,6666667);this.ya=b;this.Qc=a.addrReset||0;this.w=this.G=this.H=this.L=this.J=0;this.g=this.pa=this.X=[];this.O=0;this.uc=[];this.C=this.M=this.Ra=this.nc=[];this.lc=this.jb=this.P=this.Pc=this.Wa=this.xb=this.yb=this.Da=this.R=this.bb=this.za=this.S=this.Wb=this.Xb=this.T=this.ab=this.v=this.j=this.hc=this.V=this.Z=this.i=this.mc=0;this.Sc=255;1120>=this.ya?(this.Oc=fe.bind(this),this.wb=this.Ld,this.lc=8,this.Sc=-1,this.Xc=255,this.Uc=0):(this.Oc=
|
||||||
he.bind(this),this.vb=this.Kd,this.Wc=~(1792|(1145>this.xa?2048:0))&65535,this.Vc=1145<=this.xa?2048:0);this.la=0;this.ka=null;this.sc=[];this.A.complete=!1;this.Lb=this.oc=this.dd;this.Mb=this.pc=this.jd;this.gc=this.qc=this.nd;this.Nb=this.rc=this.od;this.Ba=this.hb=this.Tb=this.Ub=0;this.ta=this.hd;this.ia=this.Dc;this.ub=this.Gc;this.Yc=this.Xc=0}p(fe,Qd);h=fe.prototype;
|
ge.bind(this),this.wb=this.Md,this.Xc=~(1792|(1145>this.ya?2048:0))&65535,this.Uc=1145<=this.ya?2048:0);this.ma=0;this.la=null;this.tc=[];this.A.complete=!1;this.Mb=this.pc=this.fd;this.Nb=this.qc=this.ld;this.gc=this.rc=this.pd;this.Ob=this.sc=this.qd;this.Ca=this.ib=this.Tb=this.Vb=0;this.ua=this.kd;this.ja=this.Ec;this.vb=this.Hc;this.Zc=this.Yc=0}p(ee,Pd);h=ee.prototype;
|
||||||
h.pa=function(a,b,c,d){Qd.prototype.pa.call(this,a,b,c,d);this.oc=b.Ic.bind(b);this.pc=b.Zb.bind(b);this.qc=b.Jc.bind(b);this.rc=b.Kb.bind(b)};h.qa=function(a,b){for(var c=192,d=0;d<this.sc.length;d++){var e=this.sc[d];0>e.Xb&&(e.Xb=c,c+=4)}return Qd.prototype.qa.call(this,a,b)};
|
h.qa=function(a,b,c,d){Pd.prototype.qa.call(this,a,b,c,d);this.pc=b.Jc.bind(b);this.qc=b.Zb.bind(b);this.rc=b.Kc.bind(b);this.sc=b.Lb.bind(b)};h.ra=function(a,b){for(var c=192,d=0;d<this.tc.length;d++){var e=this.tc[d];0>e.Yb&&(e.Yb=c,c+=4)}return Pd.prototype.ra.call(this,a,b)};
|
||||||
h.reset=function(){this.status("Model "+this.xa);this.A.U&&J(this);this.G=65536;this.H=32768;this.L=65535;this.J=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Pc,-1,-2,-3,-4,-5,-6,-7,-8];this.oa=[0,0,0,0,0,0];this.X=[0,0,0,0];this.O=0;this.tc=[4,2,0,1];this.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,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
|
h.reset=function(){this.status("Model "+this.ya);this.A.U&&this.Y();this.G=65536;this.H=32768;this.L=65535;this.J=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Qc,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.X=[0,0,0,0];this.O=0;this.uc=[4,2,0,1];this.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,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||||
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Yb=[0,0,0,0,0,0,0,0];this.v=this.j=this.hc=this.V=this.Y=this.i=this.mc=0;this.$a=-1;ac(this);Td(this);this.A.error=!1;Qd.prototype.reset.call(this)};function ac(a){a.S=0;a.Vb=0;a.Wb=0;a.T=0;a.R=0;a.ab=0;a.ya=255;a.Va=0;a.wb=0;a.yb=0;a.Ca=262143;a.ib=a.g[7];a.P=0;a.ka=null;a.D&&(ie(a),a.Oc=Vc(a.D))}
|
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ra=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.nc=[0,0,0,0,0,0,0,0];this.v=this.j=this.hc=this.V=this.Z=this.i=this.mc=0;this.ab=-1;$b(this);Sd(this);this.A.error=!1;Pd.prototype.reset.call(this)};function $b(a){a.S=0;a.Wb=0;a.Xb=0;a.T=0;a.R=0;a.bb=0;a.za=255;a.Wa=0;a.xb=0;a.yb=0;a.Da=262143;a.jb=a.g[7];a.P=0;a.la=null;a.D&&(he(a),a.Pc=Uc(a.D))}
|
||||||
function ie(a){a.Lb=a.oc;a.Mb=a.pc;a.gc=a.qc;a.Nb=a.rc;a.Tb&&(a.Lb=a.dd,a.Mb=a.jd);a.Ub&&(a.gc=a.nd,a.Nb=a.od);a.Va?(a.Ba=65536,a.hb=a.T&16?4186112:253952,a.ta=a.hd,a.ia=a.Tb?a.Ze:a.Dc,a.ub=a.Ub?a.jg:a.Gc,Nc(a.D,a.T&16?22:18)):(a.Ba=0,a.hb=57344,a.ta=a.Md,a.ia=a.Tb?a.Ye:a.md,a.ub=a.Ub?a.ig:a.rd,Nc(a.D,16))}function hd(a){var b=a.S;b&57344||(b=b&-3199|a.wb<<5|a.yb<<1);return b}
|
function he(a){a.Mb=a.pc;a.Nb=a.qc;a.gc=a.rc;a.Ob=a.sc;a.Tb&&(a.Mb=a.fd,a.Nb=a.ld);a.Vb&&(a.gc=a.pd,a.Ob=a.qd);a.Wa?(a.Ca=65536,a.ib=a.T&16?4186112:253952,a.ua=a.kd,a.ja=a.Tb?a.af:a.Ec,a.vb=a.Vb?a.lg:a.Hc,Mc(a.D,a.T&16?22:18)):(a.Ca=0,a.ib=57344,a.ua=a.Od,a.ja=a.Tb?a.$e:a.od,a.vb=a.Vb?a.kg:a.td,Mc(a.D,16))}function gd(a){var b=a.S;b&57344||(b=b&-3199|a.xb<<5|a.yb<<1);return b}
|
||||||
function id(a,b){b&=-3073;if(a.S!=b){b&57344&&!(a.S&57344)&&(a.Vb=a.P>>16&65535,a.Wb=a.P&65535);a.S=b;a.wb=(b&96)>>5;a.yb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Va!=c&&(a.Va=c,ie(a))}}function jd(a){a.S&57344||(a.Vb=a.P>>16&65535);a=a.Vb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function kd(a){a.S&57344||(a.Wb=a.P&65535);return a.Wb}function ld(a,b){1170>a.xa&&(b&=-49);a.T!=b&&(a.T=b,a.Ca=b&16?4194303:262143,ie(a))}
|
function hd(a,b){b&=-3073;if(a.S!=b){b&57344&&!(a.S&57344)&&(a.Wb=a.P>>16&65535,a.Xb=a.P&65535);a.S=b;a.xb=(b&96)>>5;a.yb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Wa!=c&&(a.Wa=c,he(a))}}function id(a){a.S&57344||(a.Wb=a.P>>16&65535);a=a.Wb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function jd(a){a.S&57344||(a.Xb=a.P&65535);return a.Xb}function kd(a,b){1170>a.ya&&(b&=-49);a.T!=b&&(a.T=b,a.Da=b&16?4194303:262143,he(a))}
|
||||||
function je(a,b,c){a.Pc=b;a.D.reset();ac(a);ke(a,b);od(a,0);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.U||cc(a)}else a.F?J(a)||Vd(a.F):!1===c&&J(a);!a.A.U&&a.sa&&a.sa.stop()}h.ed=function(){return 0};h.save=function(){var a=new le(this);a.set(0,[this.g,this.oa,this.X,this.Fa,this.Yb,this.R,this.mc,this.ab,this.ya,nd(this),this.$a,this.O,this.i,this.S,this.Vb,this.Wb,this.T,this.wb,this.yb,this.C,this.M,this.Va,this.Ca,this.ib,this.P]);a.set(1,[this.Za,this.Ya]);a.set(2,Uc(this.D));return a.data()};
|
function ie(a,b,c){a.Qc=b;a.D.reset();$b(a);je(a,b);nd(a,0);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.U||bc(a)}else a.F?a.Y()||Ud(a.F):!1===c&&a.Y();!a.A.U&&a.ta&&a.ta.stop()}h.gd=function(){return 0};h.save=function(){var a=new ke(this);a.set(0,[this.g,this.pa,this.X,this.Ra,this.nc,this.R,this.mc,this.bb,this.za,md(this),this.ab,this.O,this.i,this.S,this.Wb,this.Xb,this.T,this.xb,this.yb,this.C,this.M,this.Wa,this.Da,this.jb,this.P]);a.set(1,[this.$a,this.Za]);a.set(2,Tc(this.D));return a.data()};
|
||||||
h.restore=function(a){var b=a[1];this.Za=b[1];Zd(this,b[3]);a:{b=this.D;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.S){for(var f=0,g=Array(b.S),k=0;k<e.length-1;)for(var l=e[k++],m=e[k++];l--;)g[f++]=m;e=g}f=b.b[d];if(!f||!f.restore(e)){y("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function me(a){return a.G&65536?1:0}function ne(a){return a.H&32768?2:0}function oe(a){return a.L&65535?0:4}function pe(a){return a.J&32768?8:0}
|
h.restore=function(a){var b=a[1];this.$a=b[1];Yd(this,b[3]);a:{b=this.D;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.S){for(var f=0,g=Array(b.S),k=0;k<e.length-1;)for(var l=e[k++],m=e[k++];l--;)g[f++]=m;e=g}f=b.b[d];if(!f||!f.restore(e)){y("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function le(a){return a.G&65536?1:0}function me(a){return a.H&32768?2:0}function ne(a){return a.L&65535?0:4}function oe(a){return a.J&32768?8:0}
|
||||||
function qe(a,b){var c=a.g[7];a.g[7]=c+b&65535;return c}function S(a,b,c){c&&(ke(a,a.g[7]+(b<<24>>23)),a.b-=2);a.b-=3}function ke(a,b){a.g[7]=b&65535}function cd(a,b,c,d){c={Xb:b,eb:c,message:d||0,next:null};c.name=Db[b];a.sc.push(c);return c}function re(a,b){var c=a.ka;if(c==b)a.ka=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.ka&&(a.i|=1)}
|
function pe(a,b){var c=a.g[7];a.g[7]=c+b&65535;return c}function S(a,b,c){c&&(je(a,a.g[7]+(b<<24>>23)),a.b-=2);a.b-=3}function je(a,b){a.g[7]=b&65535}function bd(a,b,c,d){c={Yb:b,fb:c,message:d||0,next:null};c.name=Cb[b];a.tc.push(c);return c}function qe(a,b){var c=a.la;if(c==b)a.la=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.la&&(a.i|=1)}
|
||||||
function ad(a,b){if(b){if(b!=a.ka){var c=a.ka;if(!c||c.eb<=b.eb)b.next=c,a.ka=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.i|=1;b.message&&H(a,b.message|8)&&I(a,"setIRQ(vector="+q(b.Xb)+",priority="+b.eb+")",!0,!0)}}function gd(a,b){b&&(re(a,b),b.message&&H(a,b.message|8)&&I(a,"clearIRQ(vector="+q(b.Xb)+",priority="+b.eb+")",!0,!0))}function se(a){return a.i&64?(a.ja(168,64,-6),!0):a.i&32?(a.ja(4,32,-5),!0):a.i&16?(a.ja(12,16,-7),!0):!1}
|
function $c(a,b){if(b){if(b!=a.la){var c=a.la;if(!c||c.fb<=b.fb)b.next=c,a.la=b;else{do{var d=c.next;if(!d||d.fb<=b.fb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&I(a,b.message|8)&&J(a,"setIRQ(vector="+q(b.Yb)+",priority="+b.fb+")",!0,!0)}}function fd(a,b){b&&(qe(a,b),b.message&&I(a,b.message|8)&&J(a,"clearIRQ(vector="+q(b.Yb)+",priority="+b.fb+")",!0,!0))}function re(a){return a.i&64?(a.ka(168,64,-6),!0):a.i&32?(a.ka(4,32,-5),!0):a.i&16?(a.ka(12,16,-7),!0):!1}
|
||||||
function nd(a){return a.w=a.w&63728|pe(a)|oe(a)|ne(a)|me(a)}function od(a,b){b&=a.Wc;a.J=b<<12;a.L=~b&4;a.H=b<<14;a.G=b<<16;if((b^a.w)&a.Vc)for(var c=a.oa.length;0<=--c;){var d=a.g[c];a.g[c]=a.oa[c];a.oa[c]=d}a.O=b>>14&3;c=a.w>>14&3;a.O!=c&&(a.X[c]=a.g[6],a.g[6]=a.X[a.O]);a.w=b;a.i&=-3;a.i|=a.ka?2:1}function md(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.ab=b}h.wa=function(a){this.J=this.L=a;this.H=0};h.fb=function(a,b){this.J=this.L=this.G=a;this.H=b||0};
|
function md(a){return a.w=a.w&63728|oe(a)|ne(a)|me(a)|le(a)}function nd(a,b){b&=a.Xc;a.J=b<<12;a.L=~b&4;a.H=b<<14;a.G=b<<16;if((b^a.w)&a.Uc)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.O=b>>14&3;c=a.w>>14&3;a.O!=c&&(a.X[c]=a.g[6],a.g[6]=a.X[a.O]);a.w=b;a.i&=-3;a.i|=a.la?2:1}function ld(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.bb=b}h.xa=function(a){this.J=this.L=a;this.H=0};h.gb=function(a,b){this.J=this.L=this.G=a;this.H=b||0};
|
||||||
function te(a,b){a.J=a.L=a.G=b;a.H=a.J^a.G>>1}function ue(a,b,c,d){a.J=a.L=a.G=b;a.H=(c^d)&(d^b)}
|
function se(a,b){a.J=a.L=a.G=b;a.H=a.J^a.G>>1}function te(a,b,c,d){a.J=a.L=a.G=b;a.H=(c^d)&(d^b)}
|
||||||
h.ja=function(a,b,c){if(!this.la){0>this.$a?this.$a=nd(this):this.O||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.R|=4,this.g[6]=a=4);if(-1!=c){this.P=a|4143316992;this.O=0;var d=this.ia(a|this.Ba),e=this.ia(a+2&65535|this.Ba);od(this,e&-12289|this.$a>>2&12288);ve(this,this.$a);ve(this,this.g[7]);ke(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.$a=-1;this.Yc=a;this.Xc=c;-1==c&&J(this);if(-4<=c)throw a;}};
|
h.ka=function(a,b,c){if(!this.ma){0>this.ab?this.ab=md(this):this.O||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.R|=4,this.g[6]=a=4);if(-1!=c){this.P=a|4143316992;this.O=0;var d=this.ja(a|this.Ca),e=this.ja(a+2&65535|this.Ca);nd(this,e&-12289|this.ab>>2&12288);ue(this,this.ab);ue(this,this.g[7]);je(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.ab=-1;this.Zc=a;this.Yc=c;-1==c&&this.Y();if(-4<=c)throw a;}};
|
||||||
function we(a){var b=xe(a),c=xe(a);a.w&49152&&(c=c&-225|a.w&63712);ke(a,b);od(a,c);a.i&=-17}function ye(a,b){var c=b>>13&31;31>c&&(b=a.T&32?a.Fa[c]+(b&8191)&4194303:b&-3932161);return b}
|
function ve(a){var b=we(a),c=we(a);a.w&49152&&(c=c&-225|a.w&63712);je(a,b);nd(a,c);a.i&=-17}function xe(a,b){var c=b>>13&31;31>c&&(b=a.T&32?a.Ra[c]+(b&8191)&4194303:b&-3932161);return b}
|
||||||
function ze(a,b,c){var d=[];if(c){c=ye(a,b);var e=b>>13&31;d.push(c);d.push(e);a.T&32&&(d.push(a.Fa[e]),d.push(b&8191))}else if(a.Va){var e=a.O<<1,f=b>>13;7<f&&(e|=1);a.T&a.tc[a.O]||(f&=7);b&=8191;var g=a.M[a.O][f]<<6;c=g+b&a.Ca;3932160<=c&&(c=ye(a,c));d.push(c);d.push(b);d.push(e);d.push(f&7);d.push(g);d.push(a.Ca)}else c=b&65535,57344<=c&&(c|=a.hb),d.push(c);return d}
|
function ye(a,b,c){var d=[];if(c){c=xe(a,b);var e=b>>13&31;d.push(c);d.push(e);a.T&32&&(d.push(a.Ra[e]),d.push(b&8191))}else if(a.Wa){var e=a.O<<1,f=b>>13;7<f&&(e|=1);a.T&a.uc[a.O]||(f&=7);b&=8191;var g=a.M[a.O][f]<<6;c=g+b&a.Da;3932160<=c&&(c=xe(a,c));d.push(c);d.push(b);d.push(e);d.push(f&7);d.push(g);d.push(a.Da)}else c=b&65535,57344<=c&&(c|=a.ib),d.push(c);return d}
|
||||||
function kc(a,b,c){var d,e,f;if(!(c&a.Va))return f=b&65535,57344<=f&&(f|=a.hb),f;d=b>>13;a.T&a.tc[a.O]||(d&=7);e=a.C[a.O][d];f=(a.M[a.O][d]<<6)+(b&8191)&a.Ca;3932160<=f&&(f=ye(a,f));if(a.la)return f;f>=a.Oc&&f<a.hb?(a.R|=32,a.ja(4,0,f)):f&1&&!(c&1)&&(a.R|=64,a.ja(4,0,f));var g=0;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)&&
|
function jc(a,b,c){var d,e,f;if(!(c&a.Wa))return f=b&65535,57344<=f&&(f|=a.ib),f;d=b>>13;a.T&a.uc[a.O]||(d&=7);e=a.C[a.O][d];f=(a.M[a.O][d]<<6)+(b&8191)&a.Da;3932160<=f&&(f=xe(a,f));if(a.ma)return f;f>=a.Pc&&f<a.ib?(a.R|=32,a.ka(4,0,f)):f&1&&!(c&1)&&(a.R|=64,a.ka(4,0,f));var g=0;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.C[a.O][d]=e;if(f!=(4194170&a.Ca)||a.O)a.wb=a.O,a.yb=d;g&&(g&57344&&(0<=a.$a&&(g|=128),a.S&57344||(g|=a.S&4096|a.wb<<5|a.yb<<1,id(a,a.S&-61695|g&61694)),a.ja(168,64,-2)),a.S&61440||!(f<(4191360&a.Ca)||f>(4194239&a.Ca))||(a.S|=4096,a.S&512&&(a.i|=64)));return f}function xe(a){var b=a.ia(a.g[6]|a.Ba);a.g[6]=a.g[6]+2&65535;return b}function ve(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.P=a.P&65535|(a.P&-65536)<<8|16121856;a.i&256||a.vb(4,-2,c);a.ub(c,b)}
|
(g|=16384));a.C[a.O][d]=e;if(f!=(4194170&a.Da)||a.O)a.xb=a.O,a.yb=d;g&&(g&57344&&(0<=a.ab&&(g|=128),a.S&57344||(g|=a.S&4096|a.xb<<5|a.yb<<1,hd(a,a.S&-61695|g&61694)),a.ka(168,64,-2)),a.S&61440||!(f<(4191360&a.Da)||f>(4194239&a.Da))||(a.S|=4096,a.S&512&&(a.i|=64)));return f}function we(a){var b=a.ja(a.g[6]|a.Ca);a.g[6]=a.g[6]+2&65535;return b}function ue(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.P=a.P&65535|(a.P&-65536)<<8|16121856;a.i&256||a.wb(4,-2,c);a.vb(c,b)}
|
||||||
function Ae(a,b,c,d){var e,f,g=d&8?0:a.Ba;switch(b){case 0:return a.ja(4,0,-3),0;case 1:return 6==c&&a.vb(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.vb(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.ia(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.vb(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.ia(e)|g;a.b-=8;break;case 6:return e=a.ia(qe(a,2)),e=e+a.g[c]&65535,6==c&&a.vb(d,
|
function ze(a,b,c,d){var e,f,g=d&8?0:a.Ca;switch(b){case 0:return a.ka(4,0,-3),0;case 1:return 6==c&&a.wb(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.wb(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.ja(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.wb(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.ja(e)|g;a.b-=8;break;case 6:return e=a.ja(pe(a,2)),e=e+a.g[c]&65535,6==c&&a.wb(d,
|
||||||
0,e),a.b-=6,e|g;case 7:return e=a.ia(qe(a,2)),e=e+a.g[c]&65535,e=a.ia(e|a.Ba),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.P=a.P&65535|(a.P&-65536)<<8|(f<<3&248|c)<<16;return e}h.Jd=function(a,b,c){!this.O&&0>=b&&c<=this.ya&&(this.i|=32)};h.Kd=function(a,b,c){this.O||(65534<=c&&(c|=-65536),a&4&&c<=this.ya&&(c<=this.ya-32?this.ja(4,0,-4):(this.R|=8,this.i|=32)))};h.dd=function(a){this.F&&Md(this.F,a,1);return this.oc(a)};h.jd=function(a){this.F&&Md(this.F,a,2);return this.pc(a)};
|
0,e),a.b-=6,e|g;case 7:return e=a.ja(pe(a,2)),e=e+a.g[c]&65535,e=a.ja(e|a.Ca),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.P=a.P&65535|(a.P&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ld=function(a,b,c){!this.O&&0>=b&&c<=this.za&&(this.i|=32)};h.Md=function(a,b,c){this.O||(65534<=c&&(c|=-65536),a&4&&c<=this.za&&(c<=this.za-32?this.ka(4,0,-4):(this.R|=8,this.i|=32)))};h.fd=function(a){this.F&&Ld(this.F,a,1);return this.pc(a)};h.ld=function(a){this.F&&Ld(this.F,a,2);return this.qc(a)};
|
||||||
h.nd=function(a,b){this.F&&Nd(this.F,a,1);this.qc(a,b)};h.od=function(a,b){this.F&&Nd(this.F,a,2);this.rc(a,b)};function mc(a,b){a.la++;b=a.D.Zb(kc(a,b,2));a.la--;return b}function Be(a,b){(b?--a.Ub:--a.Tb)||ie(a)}h.Md=function(a,b,c){return Ae(this,a,b,c)};h.hd=function(a,b,c){return kc(this,Ae(this,a,b,c),c)};h.md=function(a){return this.D.Zb(this.ib=a)};h.Ye=function(a){this.F&&Md(this.F,a,2);return this.md(a)};h.Dc=function(a){return this.D.Zb(this.ib=kc(this,a,2))};
|
h.pd=function(a,b){this.F&&Md(this.F,a,1);this.rc(a,b)};h.qd=function(a,b){this.F&&Md(this.F,a,2);this.sc(a,b)};function lc(a,b){a.ma++;b=a.D.Zb(jc(a,b,2));a.ma--;return b}function Ae(a,b){(b?--a.Vb:--a.Tb)||he(a)}h.Od=function(a,b,c){return ze(this,a,b,c)};h.kd=function(a,b,c){return jc(this,ze(this,a,b,c),c)};h.od=function(a){return this.D.Zb(this.jb=a)};h.$e=function(a){this.F&&Ld(this.F,a,2);return this.od(a)};h.Ec=function(a){return this.D.Zb(this.jb=jc(this,a,2))};
|
||||||
h.Ze=function(a){this.F&&Md(this.F,a,2);return this.Dc(a)};h.rd=function(a,b){this.D.Kb(this.ib=a,b)};h.ig=function(a,b){this.F&&Nd(this.F,a,2);this.rd(a,b)};h.Gc=function(a,b){this.D.Kb(this.ib=kc(this,a,4),b)};h.jg=function(a,b){this.F&&Nd(this.F,a,2);this.Gc(a,b)};function Ce(a,b,c){var d=a.j=b&7;(b=a.v=(b&56)>>3)?(d=Ae(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.O=a.w>>12&3,c=a.ia(d|c&a.Ba),a.O=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.X[a.w>>12&3];return c}
|
h.af=function(a){this.F&&Ld(this.F,a,2);return this.Ec(a)};h.td=function(a,b){this.D.Lb(this.jb=a,b)};h.kg=function(a,b){this.F&&Md(this.F,a,2);this.td(a,b)};h.Hc=function(a,b){this.D.Lb(this.jb=jc(this,a,4),b)};h.lg=function(a,b){this.F&&Md(this.F,a,2);this.Hc(a,b)};function Be(a,b,c){var d=a.j=b&7;(b=a.v=(b&56)>>3)?(d=ze(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.O=a.w>>12&3,c=a.ja(d|c&a.Ca),a.O=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.X[a.w>>12&3];return c}
|
||||||
function De(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=Ae(a,b,e,4),c&65536||(e&=65535),a.O=a.w>>12&3,e=kc(a,e|c&65536,4),a.O=a.w>>14&3,a.Nb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.X[a.w>>12&3]=d}function Ee(a,b){b>>=6;var c=a.Y=b&7;return(b=a.V=(b&56)>>3)?a.Lb(a.ta(b,c,3)):a.g[c+a.lc]&a.Rc}function Fe(a,b){var c;b>>=6;var d=a.Y=b&7;(b=a.V=(b&56)>>3)?c=a.Mb(a.ta(b,d,2)):c=a.g[d+a.lc];return c}function Ge(a,b){var c=a.j=b&7;b=a.v=(b&56)>>3;return Ae(a,b,c,8)}
|
function Ce(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=ze(a,b,e,4),c&65536||(e&=65535),a.O=a.w>>12&3,e=jc(a,e|c&65536,4),a.O=a.w>>14&3,a.Ob(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.X[a.w>>12&3]=d}function De(a,b){b>>=6;var c=a.Z=b&7;return(b=a.V=(b&56)>>3)?a.Mb(a.ua(b,c,3)):a.g[c+a.lc]&a.Sc}function Ee(a,b){var c;b>>=6;var d=a.Z=b&7;(b=a.V=(b&56)>>3)?c=a.Nb(a.ua(b,d,2)):c=a.g[d+a.lc];return c}function Fe(a,b){var c=a.j=b&7;b=a.v=(b&56)>>3;return ze(a,b,c,8)}
|
||||||
function He(a,b){var c=a.j=b&7;return(b=a.v=(b&56)>>3)?a.Lb(a.ta(b,c,3)):a.g[c]&255}function Ie(a,b){var c,d=a.j=b&7;(b=a.v=(b&56)>>3)?c=a.Mb(a.ta(b,d,2)):c=a.g[d];return c}function Je(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.hc=a.ta(b,e,7),c=0>c?a.g[-c-1]&255:c,a.gc(e,d.call(a,c,a.Lb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))}
|
function Ge(a,b){var c=a.j=b&7;return(b=a.v=(b&56)>>3)?a.Mb(a.ua(b,c,3)):a.g[c]&255}function He(a,b){var c,d=a.j=b&7;(b=a.v=(b&56)>>3)?c=a.Nb(a.ua(b,d,2)):c=a.g[d];return c}function Ie(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.hc=a.ua(b,e,7),c=0>c?a.g[-c-1]&255:c,a.gc(e,d.call(a,c,a.Mb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))}
|
||||||
function T(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.ta(b,e,6),a.Nb(e,d.call(a,0>c?a.g[-c-1]:c,a.Mb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function Ke(a,b,c,d,e){var f=a.j=b&7;(b=a.v=(b&56)>>3)?(d=a.ta(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.gc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))}
|
function T(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.ua(b,e,6),a.Ob(e,d.call(a,0>c?a.g[-c-1]:c,a.Nb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function Je(a,b,c,d,e){var f=a.j=b&7;(b=a.v=(b&56)>>3)?(d=a.ua(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.gc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))}
|
||||||
function Le(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.ta(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Nb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))}
|
function ef(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.ua(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Ob(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))}
|
||||||
h.$b=function(a){this.A.complete=!0;var b=this.F?gf(this.F)?1:this.A.fc?-1:0:0,c=a?this.A.fc?0:1:-1;this.A.fc=!1;this.Xa=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(hf(this.F,this.g[7],c)){J(this);break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.ab&224)>>5,f=this.ka&&this.ka.eb>e?this.ka:null;f&&(d=f.Xb,e=f.eb);e>(this.w&224)>>5?(this.i&8&&(qe(this,2),this.i&=-9),this.ja(d,0,-10),e=!0):e=!1;e&&(f&&re(this,f),a=!0);this.ka||this.ab||(this.i&=-3)}else this.i&
|
h.$b=function(a){this.A.complete=!0;var b=this.F?ff(this.F)?1:this.A.fc?-1:0:0,c=a?this.A.fc?0:1:-1;this.A.fc=!1;this.Ya=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(gf(this.F,this.g[7],c)){this.Y();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.bb&224)>>5,f=this.la&&this.la.fb>e?this.la:null;f&&(d=f.Yb,e=f.fb);e>(this.w&224)>>5?(this.i&8&&(pe(this,2),this.i&=-9),this.ka(d,0,-10),e=!0):e=!1;e&&(f&&qe(this,f),a=!0);this.la||this.bb||(this.i&=-3)}else this.i&
|
||||||
1&&this.i++;if(a){if(this.i&4&&hf(this.F,this.g[7],c)){J(this);break}if(0>c)break}if(this.i&112&&se(this)){if(this.i&4&&hf(this.F,this.g[7],c)){J(this);break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.ia(a);this.g[7]=a+2&65535;this.Nc(f)}while(0<this.b);return this.A.complete?this.Xa-this.b:void 0===this.A.complete?0:-1};Ta(function(){for(var a=D(document,B,"cpu"),b=0;b<a.length;b++){var c=a[b],d=pb(c),d=new fe(d);qb(d,c)}});
|
1&&this.i++;if(a){if(this.i&4&&gf(this.F,this.g[7],c)){this.Y();break}if(0>c)break}if(this.i&112&&re(this)){if(this.i&4&&gf(this.F,this.g[7],c)){this.Y();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.ja(a);this.g[7]=a+2&65535;this.Oc(f)}while(0<this.b);return this.A.complete?this.Ya-this.b:void 0===this.A.complete?0:-1};Wa(function(){for(var a=G(document,D,"cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new ee(d);pb(d,c)}});
|
||||||
function jf(a,b){var c=b+a;this.J=this.L=this.G=c;this.H=(a^c)&(b^c);return c&65535}function kf(a,b){var c=b+a,d=c<<8;this.J=this.L=this.G=d;this.H=(a<<8^d)&(b<<8^d);return c&255}function lf(a,b){a=b<<1;te(this,a);return a&65535}function mf(a,b){a=b<<1;te(this,a<<8);return a&255}function nf(a,b){a=b&32768|b>>1|b<<16;te(this,a);return a&65535}function of(a,b){a=b&128|b>>1|b<<8;te(this,a<<8);return a&255}function pf(a,b){a=b&~a;this.wa(a);return a}function qf(a,b){a=b&~a;this.wa(a<<8);return a}
|
function hf(a,b){var c=b+a;this.J=this.L=this.G=c;this.H=(a^c)&(b^c);return c&65535}function jf(a,b){var c=b+a,d=c<<8;this.J=this.L=this.G=d;this.H=(a<<8^d)&(b<<8^d);return c&255}function kf(a,b){a=b<<1;se(this,a);return a&65535}function lf(a,b){a=b<<1;se(this,a<<8);return a&255}function mf(a,b){a=b&32768|b>>1|b<<16;se(this,a);return a&65535}function nf(a,b){a=b&128|b>>1|b<<8;se(this,a<<8);return a&255}function of(a,b){a=b&~a;this.xa(a);return a}function pf(a,b){a=b&~a;this.xa(a<<8);return a}
|
||||||
function rf(a,b){a|=b;this.wa(a);return a}function sf(a,b){a|=b;this.wa(a<<8);return a}function tf(a,b){a=~b|65536;this.fb(a);return a&65535}function uf(a,b){a=~b|256;this.fb(a<<8);return a&255}function vf(a,b){this.J=this.L=a=b-a;this.H=b&(b^a);return a&65535}function wf(a,b){a=b-a;var c=a<<8;b<<=8;this.J=this.L=c;this.H=b&(b^c);return a&255}function xf(a,b){this.J=this.L=a=b+a;this.H=a&(b^a);return a&65535}function yf(a,b){a=b+a;var c=a<<8;this.J=this.L=c;this.H=c&(b<<8^c);return a&255}
|
function qf(a,b){a|=b;this.xa(a);return a}function rf(a,b){a|=b;this.xa(a<<8);return a}function sf(a,b){a=~b|65536;this.gb(a);return a&65535}function tf(a,b){a=~b|256;this.gb(a<<8);return a&255}function uf(a,b){this.J=this.L=a=b-a;this.H=b&(b^a);return a&65535}function vf(a,b){a=b-a;var c=a<<8;b<<=8;this.J=this.L=c;this.H=b&(b^c);return a&255}function wf(a,b){this.J=this.L=a=b+a;this.H=a&(b^a);return a&65535}function xf(a,b){a=b+a;var c=a<<8;this.J=this.L=c;this.H=c&(b<<8^c);return a&255}
|
||||||
function zf(a,b){a=-b;this.fb(a,a&b&32768);return a&65535}function Af(a,b){a=-b;this.fb(a<<8,(a&b&128)<<8);return a&255}function Bf(a,b){a=b<<1|this.G>>16&1;te(this,a);return a&65535}function Cf(a,b){a=b<<1|this.G>>16&1;te(this,a<<8);return a&255}function Df(a,b){a=(this.G&65536|b)>>1|b<<16;te(this,a);return a&65535}function Ef(a,b){a=((this.G&65536)>>8|b)>>1|b<<8;te(this,a<<8);return a&255}function Ff(a,b){var c=b-a;ue(this,c,a,b);return c&65535}
|
function yf(a,b){a=-b;this.gb(a,a&b&32768);return a&65535}function zf(a,b){a=-b;this.gb(a<<8,(a&b&128)<<8);return a&255}function Af(a,b){a=b<<1|this.G>>16&1;se(this,a);return a&65535}function Bf(a,b){a=b<<1|this.G>>16&1;se(this,a<<8);return a&255}function Cf(a,b){a=(this.G&65536|b)>>1|b<<16;se(this,a);return a&65535}function Df(a,b){a=((this.G&65536)>>8|b)>>1|b<<8;se(this,a<<8);return a&255}function Ef(a,b){var c=b-a;te(this,c,a,b);return c&65535}
|
||||||
function Gf(a,b){var c=b-a;ue(this,c<<8,a<<8,b<<8);return c&255}function Hf(a,b){this.J=this.L=b&65280;this.H=this.G=0;return(b<<8|b>>8)&65535}function If(a,b){a^=b;this.wa(a);return a&65535}function Jf(a){T(this,a,Fe(this,a),jf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}
|
function Ff(a,b){var c=b-a;te(this,c<<8,a<<8,b<<8);return c&255}function Gf(a,b){this.J=this.L=b&65280;this.H=this.G=0;return(b<<8|b>>8)&65535}function Hf(a,b){a^=b;this.xa(a);return a&65535}function If(a){T(this,a,Ee(this,a),hf);this.b-=this.v?9+(this.Z&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}
|
||||||
function Kf(a){var b=Ie(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.G=this.H=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.G=c<<17-b,c>>=b;else if(b)if(16<b)this.H=c,c=0;else{this.G=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.H=32768)}this.g[a]=c&65535;this.J=this.L=c;this.b-=(this.v?6:7)+b}
|
function Jf(a){var b=He(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.G=this.H=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.G=c<<17-b,c>>=b;else if(b)if(16<b)this.H=c,c=0;else{this.G=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.H=32768)}this.g[a]=c&65535;this.J=this.L=c;this.b-=(this.v?6:7)+b}
|
||||||
function Lf(a){var b=Ie(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.G=this.H=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.G=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.G=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.H=32768)):d=c;this.g[a]=d>>16&65535;this.g[a|1]=d&65535;this.J=d>>16;this.L=d>>16|d;this.b-=(this.v?6:7)+b}function Mf(a){S(this,a,!me(this))}function Nf(a){S(this,a,me(this))}
|
function Kf(a){var b=He(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.G=this.H=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.G=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.G=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.H=32768)):d=c;this.g[a]=d>>16&65535;this.g[a|1]=d&65535;this.J=d>>16;this.L=d>>16|d;this.b-=(this.v?6:7)+b}function Lf(a){S(this,a,!le(this))}function Mf(a){S(this,a,le(this))}
|
||||||
function Of(a){T(this,a,Fe(this,a),pf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Pf(a){Je(this,a,Ee(this,a),qf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Qf(a){T(this,a,Fe(this,a),rf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Rf(a){Je(this,a,Ee(this,a),sf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}
|
function Nf(a){T(this,a,Ee(this,a),of);this.b-=this.v?9+(this.Z&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Of(a){Ie(this,a,De(this,a),pf);this.b-=this.v?9+(this.Z&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Pf(a){T(this,a,Ee(this,a),qf);this.b-=this.v?9+(this.Z&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Qf(a){Ie(this,a,De(this,a),rf);this.b-=this.v?9+(this.Z&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}
|
||||||
function Sf(a){var b=Fe(this,a);a=Ie(this,a);this.wa((0>b?this.g[-b-1]:b)&a);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.V?4:3)+(7==this.j?2:0)}function Tf(a){var b=Ee(this,a);a=He(this,a);this.wa(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.V?4:3)+(7==this.j?2:0)}function Uf(a){S(this,a,oe(this))}function Vf(a){S(this,a,!pe(this)==!ne(this))}function Wf(a){S(this,a,!oe(this)&&!pe(this)==!ne(this))}function Xf(a){S(this,a,!me(this)&&!oe(this))}
|
function Rf(a){var b=Ee(this,a);a=He(this,a);this.xa((0>b?this.g[-b-1]:b)&a);this.b-=this.v?4+(this.Z&&6<=this.j?1:0):(this.V?4:3)+(7==this.j?2:0)}function Sf(a){var b=De(this,a);a=Ge(this,a);this.xa(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.v?4+(this.Z&&6<=this.j?1:0):(this.V?4:3)+(7==this.j?2:0)}function Tf(a){S(this,a,ne(this))}function Uf(a){S(this,a,!oe(this)==!me(this))}function Vf(a){S(this,a,!ne(this)&&!oe(this)==!me(this))}function Wf(a){S(this,a,!le(this)&&!ne(this))}
|
||||||
function Yf(a){S(this,a,oe(this)||!pe(this)!=!ne(this))}function Zf(a){S(this,a,me(this)||oe(this))}function $f(a){S(this,a,!pe(this)!=!ne(this))}function ag(a){S(this,a,pe(this))}function bg(a){S(this,a,!oe(this))}function cg(a){S(this,a,!pe(this))}function dg(){this.ja(12,0,-9)}function eg(a){S(this,a,!0)}function fg(a){S(this,a,!ne(this))}function gg(a){S(this,a,ne(this))}function hg(a){a&1&&(this.G=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.J=0);this.b-=5}
|
function Xf(a){S(this,a,ne(this)||!oe(this)!=!me(this))}function Yf(a){S(this,a,le(this)||ne(this))}function Zf(a){S(this,a,!oe(this)!=!me(this))}function $f(a){S(this,a,oe(this))}function ag(a){S(this,a,!ne(this))}function bg(a){S(this,a,!oe(this))}function cg(){this.ka(12,0,-9)}function dg(a){S(this,a,!0)}function eg(a){S(this,a,!me(this))}function fg(a){S(this,a,me(this))}function gg(a){a&1&&(this.G=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.J=0);this.b-=5}
|
||||||
function ig(a){var b=Fe(this,a);a=Ie(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;ue(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.V?4:3)+(7==this.j?2:0)}function jg(a){var b=Ee(this,a);a=He(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);ue(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.V?4:3)+(7==this.j?2:0)}
|
function hg(a){var b=Ee(this,a);a=He(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;te(this,c,a,b);this.b-=this.v?4+(this.Z&&6<=this.j?1:0):(this.V?4:3)+(7==this.j?2:0)}function ig(a){var b=De(this,a);a=Ge(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);te(this,c,a,b);this.b-=this.v?4+(this.Z&&6<=this.j?1:0):(this.V?4:3)+(7==this.j?2:0)}
|
||||||
function kg(a){var b=Ie(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.G=this.H=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.J=d>>16):(this.H=32768,this.L=d>>15|d,this.J=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.J=0,this.H=32768,this.G=65536,this.b-=7}function lg(){this.ja(24,0,-9);this.b-=20}
|
function jg(a){var b=He(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.G=this.H=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.J=d>>16):(this.H=32768,this.L=d>>15|d,this.J=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.J=0,this.H=32768,this.G=65536,this.b-=7}function kg(){this.ka(24,0,-9);this.b-=20}
|
||||||
function mg(){this.w&49152?(this.R|=128,this.ja(4,0,-8)):(this.sa&&1120==this.xa&&this.sa.setData(this.g[0],!0),this.F?ng(this.F):J(this));this.b-=7}function og(){this.ja(16,0,-9);this.b-=20}var pg=[0,7,7,10,7,11,9,13];function qg(a){this.aa=this.b;ke(this,Ge(this,a));this.b=this.aa-pg[this.v]}var rg=[0,14,14,17,14,18,16,20];function sg(a){this.aa=this.b;var b=Ge(this,a);a=a>>6&7;ve(this,this.g[a]);this.g[a]=this.g[7];ke(this,b);this.b=this.aa-rg[this.v]}
|
function lg(){this.w&49152?(this.R|=128,this.ka(4,0,-8)):(this.ta&&1120==this.ya&&this.ta.setData(this.g[0],!0),this.F?mg(this.F):this.Y());this.b-=7}function ng(){this.ka(16,0,-9);this.b-=20}var og=[0,7,7,10,7,11,9,13];function pg(a){this.da=this.b;je(this,Fe(this,a));this.b=this.da-og[this.v]}var qg=[0,14,14,17,14,18,16,20];function rg(a){this.da=this.b;var b=Fe(this,a);a=a>>6&7;ue(this,this.g[a]);this.g[a]=this.g[7];je(this,b);this.b=this.da-qg[this.v]}
|
||||||
var tg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function ug(a){var b=Fe(this,a);this.aa=this.b;Le(this,a,b,this.wa);this.b=this.aa-tg[(this.V?8:0)+this.v]+(7!=this.j||this.v?0:2)}function vg(a){var b=Ee(this,a);Ke(this,a,b,65535,this.wa);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}var wg=[7,13,13,17,14,18,17,21];
|
var sg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function tg(a){var b=Ee(this,a);this.da=this.b;ef(this,a,b,this.xa);this.b=this.da-sg[(this.V?8:0)+this.v]+(7!=this.j||this.v?0:2)}function ug(a){var b=De(this,a);Je(this,a,b,65535,this.xa);this.b-=this.v?9+(this.Z&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}var vg=[7,13,13,17,14,18,17,21];
|
||||||
function xg(a){var b=Ie(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.J=b>>16;this.L=this.J|b;this.H=0;this.G=-32768>b||32767<b?65536:0;this.b-=23}function yg(){this.b-=5}function zg(){this.w&49152||(this.D.reset(),ac(this),this.sa&&this.sa.setData(this.g[0],!0));this.b-=667}function Ag(a){if(a&8)U.call(this,a);else{var b=xe(this);a&=7;7==a?ke(this,b):(ke(this,this.g[a]),this.g[a]=b);this.b-=9}}
|
function wg(a){var b=He(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.J=b>>16;this.L=this.J|b;this.H=0;this.G=-32768>b||32767<b?65536:0;this.b-=23}function xg(){this.b-=5}function yg(){this.w&49152||(this.D.reset(),$b(this),this.ta&&this.ta.setData(this.g[0],!0));this.b-=667}function zg(a){if(a&8)U.call(this,a);else{var b=we(this);a&=7;7==a?je(this,b):(je(this,this.g[a]),this.g[a]=b);this.b-=9}}
|
||||||
function Bg(){we(this);this.b-=13}function Cg(a){a&1&&(this.G=65536);a&2&&(this.H=32768);a&4&&(this.L=0);a&8&&(this.J=32768);this.b-=5}function Dg(a){var b=(a&448)>>6;if(this.g[b]=this.g[b]-1&65535)ke(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Eg(a){T(this,a,Fe(this,a),Ff);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Fg(a){T(this,a,0,Hf);this.b-=this.v?9:3+(7==this.j?2:0)}function Gg(){this.ja(28,0,-9)}
|
function Ag(){ve(this);this.b-=13}function Bg(a){a&1&&(this.G=65536);a&2&&(this.H=32768);a&4&&(this.L=0);a&8&&(this.J=32768);this.b-=5}function Cg(a){var b=(a&448)>>6;if(this.g[b]=this.g[b]-1&65535)je(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Dg(a){T(this,a,Ee(this,a),Ef);this.b-=this.v?9+(this.Z&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Eg(a){T(this,a,0,Gf);this.b-=this.v?9:3+(7==this.j?2:0)}function Fg(){this.ka(28,0,-9)}
|
||||||
function Hg(){this.sa&&(this.sa.Ec(this.g[7],!0),this.sa.setData(this.g[0],!0));this.i|=8;qe(this,-2);this.b-=3}function Ig(a){T(this,a,this.g[(a>>6&7)+this.lc],If);this.b-=this.v?9:3+(7==this.j?2:0)}function U(a){var b;if(b=this.F)b=this.F,H(b,1)?(I(b,"undefined opcode "+O(b,a),!0,!0),b=ng(b)):b=!1;b||this.ja(8,0,-9)}function ge(a){Jg[a>>12].call(this,a)}function Kg(a){Lg[a>>6&3].call(this,a)}function Mg(a){Ng[a>>6&3].call(this,a)}function Og(a){Pg[a>>6&3].call(this,a)}
|
function Gg(){this.ta&&(this.ta.Fc(this.g[7],!0),this.ta.setData(this.g[0],!0));this.i|=8;pe(this,-2);this.b-=3}function Hg(a){T(this,a,this.g[(a>>6&7)+this.lc],Hf);this.b-=this.v?9:3+(7==this.j?2:0)}function U(a){var b;if(b=this.F)b=this.F,I(b,1)?(J(b,"undefined opcode "+O(b,a),!0,!0),b=mg(b)):b=!1;b||this.ka(8,0,-9)}function fe(a){Ig[a>>12].call(this,a)}function Jg(a){Kg[a>>6&3].call(this,a)}function Lg(a){Mg[a>>6&3].call(this,a)}function Ng(a){Og[a>>6&3].call(this,a)}
|
||||||
function Qg(a){Rg[a&15].call(this,a)}function Sg(a){Tg[a&15].call(this,a)}function Ug(a){Vg[a>>6&3].call(this,a)}function Wg(a){Xg[a>>6&3].call(this,a)}function Yg(a){Zg[a>>6&3].call(this,a)}
|
function Pg(a){Qg[a&15].call(this,a)}function Rg(a){Sg[a&15].call(this,a)}function Tg(a){Ug[a>>6&3].call(this,a)}function Vg(a){Wg[a>>6&3].call(this,a)}function Xg(a){Yg[a>>6&3].call(this,a)}
|
||||||
var Jg=[function(a){$g[a>>8&15].call(this,a)},ug,ig,Sf,Of,Qf,Jf,U,function(a){ah[a>>8&15].call(this,a)},vg,jg,Tf,Pf,Rf,Eg,U],$g=[function(a){bh[a>>4&15].call(this,a)},eg,bg,Uf,Vf,$f,Wf,Yf,sg,sg,Kg,Mg,Og,U,U,U],Lg=[function(a){Le(this,a,0,this.fb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,tf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,1,xf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,1,vf);this.b-=this.v?9:3+(7==this.j?2:0)}],Ng=[function(a){T(this,a,0,zf);
|
var Ig=[function(a){Zg[a>>8&15].call(this,a)},tg,hg,Rf,Nf,Pf,If,U,function(a){$g[a>>8&15].call(this,a)},ug,ig,Sf,Of,Qf,Dg,U],Zg=[function(a){ah[a>>4&15].call(this,a)},dg,ag,Tf,Uf,Zf,Vf,Xf,rg,rg,Jg,Lg,Ng,U,U,U],Kg=[function(a){ef(this,a,0,this.gb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,sf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,1,wf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,1,uf);this.b-=this.v?9:3+(7==this.j?2:0)}],Mg=[function(a){T(this,a,0,yf);
|
||||||
this.b-=this.v?11:6},function(a){T(this,a,me(this)?1:0,jf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,me(this)?1:0,Ff);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=Ie(this,a);this.fb(a);this.b-=this.v?4:3+(7==this.j?2:0)}],Pg=[function(a){T(this,a,0,Df);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,Bf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,nf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,lf);this.b-=this.v?9:3+(7==this.j?2:0)}],bh=
|
this.b-=this.v?11:6},function(a){T(this,a,le(this)?1:0,hf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,le(this)?1:0,Ef);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=He(this,a);this.gb(a);this.b-=this.v?4:3+(7==this.j?2:0)}],Og=[function(a){T(this,a,0,Cf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,Af);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,mf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,kf);this.b-=this.v?9:3+(7==this.j?2:0)}],ah=
|
||||||
[function(a){ch[a&15].call(this,a)},U,U,U,qg,qg,qg,qg,Ag,U,Qg,Sg,Fg,Fg,Fg,Fg],ch=[mg,Hg,Bg,dg,og,zg,U,U,U,U,U,U,U,U,U,U],Rg=[yg,function(){this.G=0;this.b-=5},function(){this.H=0;this.b-=5},hg,function(){this.L=1;this.b-=5},hg,hg,hg,function(){this.J=0;this.b-=5},hg,hg,hg,hg,hg,hg,hg],Tg=[yg,function(){this.G=65536;this.b-=5},function(){this.H=32768;this.b-=5},Cg,function(){this.L=0;this.b-=5},Cg,Cg,Cg,function(){this.J=32768;this.b-=5},Cg,Cg,Cg,Cg,Cg,Cg,Cg],ah=[cg,ag,Xf,Zf,fg,gg,Mf,Nf,lg,Gg,Ug,Wg,
|
[function(a){bh[a&15].call(this,a)},U,U,U,pg,pg,pg,pg,zg,U,Pg,Rg,Eg,Eg,Eg,Eg],bh=[lg,Gg,Ag,cg,ng,yg,U,U,U,U,U,U,U,U,U,U],Qg=[xg,function(){this.G=0;this.b-=5},function(){this.H=0;this.b-=5},gg,function(){this.L=1;this.b-=5},gg,gg,gg,function(){this.J=0;this.b-=5},gg,gg,gg,gg,gg,gg,gg],Sg=[xg,function(){this.G=65536;this.b-=5},function(){this.H=32768;this.b-=5},Bg,function(){this.L=0;this.b-=5},Bg,Bg,Bg,function(){this.J=32768;this.b-=5},Bg,Bg,Bg,Bg,Bg,Bg,Bg],$g=[bg,$f,Wf,Yf,eg,fg,Lf,Mf,kg,Fg,Tg,Vg,
|
||||||
Yg,U,U,U],Vg=[function(a){Ke(this,a,0,255,this.fb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Je(this,a,0,uf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Je(this,a,1,yf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Je(this,a,1,wf);this.b-=this.v?9:3+(7==this.j?2:0)}],Xg=[function(a){Je(this,a,0,Af);this.b-=this.v?11:6},function(a){Je(this,a,me(this)?1:0,kf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Je(this,a,me(this)?1:0,Gf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=He(this,
|
Xg,U,U,U],Ug=[function(a){Je(this,a,0,255,this.gb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Ie(this,a,0,tf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Ie(this,a,1,xf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Ie(this,a,1,vf);this.b-=this.v?9:3+(7==this.j?2:0)}],Wg=[function(a){Ie(this,a,0,zf);this.b-=this.v?11:6},function(a){Ie(this,a,le(this)?1:0,jf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Ie(this,a,le(this)?1:0,Ff);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=Ge(this,
|
||||||
a);this.fb(a<<8);this.b-=this.v?4:3+(7==this.j?2:0)}],Zg=[function(a){Je(this,a,0,Ef);this.b-=this.v?9+(this.hc&1):3+(7==this.j?2:0)},function(a){Je(this,a,0,Cf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Je(this,a,0,of);this.b-=this.v?9+(this.hc&1):3+(7==this.j?2:0)},function(a){Je(this,a,0,mf);this.b-=this.v?9:3+(7==this.j?2:0)}];function he(a){dh[a>>12].call(this,a)}
|
a);this.gb(a<<8);this.b-=this.v?4:3+(7==this.j?2:0)}],Yg=[function(a){Ie(this,a,0,Df);this.b-=this.v?9+(this.hc&1):3+(7==this.j?2:0)},function(a){Ie(this,a,0,Bf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Ie(this,a,0,nf);this.b-=this.v?9+(this.hc&1):3+(7==this.j?2:0)},function(a){Ie(this,a,0,lf);this.b-=this.v?9:3+(7==this.j?2:0)}];function ge(a){ch[a>>12].call(this,a)}
|
||||||
var dh=[function(a){eh[a>>8&15].call(this,a)},ug,ig,Sf,Of,Qf,Jf,function(a){fh[a>>8&15].call(this,a)},function(a){gh[a>>8&15].call(this,a)},vg,jg,Tf,Pf,Rf,Eg,U],eh=[function(a){hh[a>>4&15].call(this,a)},eg,bg,Uf,Vf,$f,Wf,Yf,sg,sg,Kg,Mg,Og,function(a){ih[a>>6&3].call(this,a)},U,U],ih=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.ia(a|this.Ba);ke(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Ce(this,a,0);this.wa(a);ve(this,a);this.b-=11},function(a){var b=xe(this);
|
var ch=[function(a){dh[a>>8&15].call(this,a)},tg,hg,Rf,Nf,Pf,If,function(a){eh[a>>8&15].call(this,a)},function(a){fh[a>>8&15].call(this,a)},ug,ig,Sf,Of,Qf,Dg,U],dh=[function(a){gh[a>>4&15].call(this,a)},dg,ag,Tf,Uf,Zf,Vf,Xf,rg,rg,Jg,Lg,Ng,function(a){hh[a>>6&3].call(this,a)},U,U],hh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.ja(a|this.Ca);je(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Be(this,a,0);this.xa(a);ue(this,a);this.b-=11},function(a){var b=we(this);
|
||||||
this.aa=this.b;this.wa(b);De(this,a,0,b);this.b=this.aa-wg[this.v]},function(a){Le(this,a,pe(this)?65535:0,this.wa);this.b-=this.v?9:3+(7==this.j?2:0)}],hh=[function(a){jh[a&15].call(this,a)},U,U,U,qg,qg,qg,qg,Ag,function(a){a&8?(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5):U.call(this,a)},Qg,Sg,Fg,Fg,Fg,Fg],jh=[mg,Hg,function(){we(this);this.i|=this.w&16;this.b-=13},dg,og,zg,Bg,function(){this.ja(8,0,-9)},U,U,U,U,U,U,U,U],fh=[xg,xg,kg,kg,Kf,Kf,Lf,Lf,Ig,Ig,U,U,U,U,Dg,
|
this.da=this.b;this.xa(b);Ce(this,a,0,b);this.b=this.da-vg[this.v]},function(a){ef(this,a,oe(this)?65535:0,this.xa);this.b-=this.v?9:3+(7==this.j?2:0)}],gh=[function(a){ih[a&15].call(this,a)},U,U,U,pg,pg,pg,pg,zg,function(a){a&8?(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5):U.call(this,a)},Pg,Rg,Eg,Eg,Eg,Eg],ih=[lg,Gg,function(){ve(this);this.i|=this.w&16;this.b-=13},cg,ng,yg,Ag,function(){this.ka(8,0,-9)},U,U,U,U,U,U,U,U],eh=[wg,wg,jg,jg,Jf,Jf,Kf,Kf,Hg,Hg,U,U,U,U,Cg,
|
||||||
Dg],gh=[cg,ag,Xf,Zf,fg,gg,Mf,Nf,lg,Gg,Ug,Wg,Yg,function(a){kh[a>>6&3].call(this,a)},U,U],kh=[U,function(a){a=Ce(this,a,65536);this.wa(a);ve(this,a);this.b-=11},function(a){var b=xe(this);this.aa=this.b;this.wa(b);De(this,a,65536,b);this.b=this.aa-wg[this.v]},U];
|
Cg],fh=[bg,$f,Wf,Yf,eg,fg,Lf,Mf,kg,Fg,Tg,Vg,Xg,function(a){jh[a>>6&3].call(this,a)},U,U],jh=[U,function(a){a=Be(this,a,65536);this.xa(a);ue(this,a);this.b-=11},function(a){var b=we(this);this.da=this.b;this.xa(b);Ce(this,a,65536,b);this.b=this.da-vg[this.v]},U];
|
||||||
function lh(a){A.call(this,"ROM",a,0,128);this.da=this.g=null;this.v=a.addr;this.b=a.size;this.w=!1;this.j=a.alias;this.i=a.file;this.C=x(this.i);if(this.i){a=this.i;var b=oa(this.C);"json"!=b&&"hex"!=b&&(a=Ca()+"/api/v1/dump?file="+this.i+"&format=bytes&decimal=true");var c=this;Aa(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.i=null):(eb(c.kb,a,b),(a=Ba(a,b))?(c.g=a.ba,c.da=a.da):c.i=null);mh(c)})}}p(lh,A);h=lh.prototype;
|
function kh(a){A.call(this,"ROM",a,0,128);this.ea=this.g=null;this.v=a.addr;this.b=a.size;this.w=!1;this.j=a.alias;this.i=a.file;this.C=x(this.i);if(this.i){a=this.i;var b=oa(this.C);"json"!=b&&"hex"!=b&&(a=Ca()+"/api/v1/dump?file="+this.i+"&format=bytes&decimal=true");var c=this;Aa(a,null,!0,function(a,b,f){f?(c.N("Unable to load ROM resource (error "+f+": "+a+")"),c.i=null):(fb(c.lb,a,b),(a=Ba(a,b))?(c.g=a.ba,c.ea=a.ea):c.i=null);lh(c)})}}p(kh,A);h=kh.prototype;
|
||||||
h.pa=function(a,b,c,d){this.D=b;this.f=c;this.F=d;mh(this)};h.qa=function(){this.da&&(this.F&&nh(this.F,this.id,this.v,this.b,this.da),delete this.da);return!0};h.za=function(){return!0};
|
h.qa=function(a,b,c,d){this.D=b;this.f=c;this.F=d;lh(this)};h.ra=function(){this.ea&&(this.F&&mh(this.F,this.id,this.v,this.b,this.ea),delete this.ea);return!0};h.Aa=function(){return!0};
|
||||||
function mh(a){if(!tb(a)){if(a.i){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)rb(a,"ROM size ("+v(a.g.length,8,!0)+") does not match specified size ("+v(a.b,8,!0)+")");else{var b;a:{b=a.v;a.status(a.b+"-byte ROM at "+q(b));if(57344<=b&&b<57344+Fc){var c={};b=(c[b]=[lh.prototype.Ke,lh.prototype.Tf,null,null,null,a.b>>1],c);if(Pb(a.D,a,b)){b=a.w=!0;break a}}else if(Lc(a.D,b,a.b,td)){for(c=0;c<a.g.length;c++)Tc(a.D,b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.j?b.push(a.j):
|
function lh(a){if(!sb(a)){if(a.i){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)qb(a,"ROM size ("+v(a.g.length,8,!0)+") does not match specified size ("+v(a.b,8,!0)+")");else{var b;a:{b=a.v;a.status(a.b+"-byte ROM at "+q(b));if(57344<=b&&b<57344+Ec){var c={};b=(c[b]=[kh.prototype.Me,kh.prototype.Vf,null,null,null,a.b>>1],c);if(Ob(a.D,a,b)){b=a.w=!0;break a}}else if(Kc(a.D,b,a.b,sd)){for(c=0;c<a.g.length;c++)Sc(a.D,b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.j?b.push(a.j):
|
||||||
null!=a.j&&a.j.length&&(b=a.j);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.D,g=d.b,k=[],l=d.v>>>f.g;0<g&&l<f.b.length;)k.push(f.b[l++]),g-=f.j;f=d.D;d=d.b;g=0;for(e>>>=f.g;0<d&&e<f.b.length;){l=k[g++];if(!l)break;f.b[e++]=l;d-=f.j}}a.w||delete a.g}}}G(a)}}h.Ke=function(a){return this.g[a-this.v]};h.Tf=function(){};Ta(function(){for(var a=D(document,B,"rom"),b=0;b<a.length;b++){var c=a[b],d=pb(c),d=new lh(d);qb(d,c)}});
|
null!=a.j&&a.j.length&&(b=a.j);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.D,g=d.b,k=[],l=d.v>>>f.g;0<g&&l<f.b.length;)k.push(f.b[l++]),g-=f.j;f=d.D;d=d.b;g=0;for(e>>>=f.g;0<d&&e<f.b.length;){l=k[g++];if(!l)break;f.b[e++]=l;d-=f.j}}a.w||delete a.g}}}H(a)}}h.Me=function(a){return this.g[a-this.v]};h.Vf=function(){};Wa(function(){for(var a=G(document,D,"rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new kh(d);pb(d,c)}});
|
||||||
function oh(a){A.call(this,"RAM",a);this.da=this.g=null;this.i=a.addr;this.j=a.size;this.La=a.load;this.Ka=a.exec;this.v=!1;this.b=a.file;this.w=x(this.b);if(this.b){a=this.b;var b=oa(this.w);"json"!=b&&"hex"!=b&&(a=Ca()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;Aa(a,null,!0,function(a,b,f){f?(c.N("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(eb(c.kb,a,b),(a=Ba(a,b))?(c.g=a.ba,c.da=a.da,null==c.La&&(c.La=a.La),null==c.Ka&&(c.Ka=a.Ka)):c.b=null);ph(c)})}}
|
function nh(a){A.call(this,"RAM",a);this.ea=this.g=null;this.i=a.addr;this.j=a.size;this.La=a.load;this.Ka=a.exec;this.v=!1;this.b=a.file;this.w=x(this.b);if(this.b){a=this.b;var b=oa(this.w);"json"!=b&&"hex"!=b&&(a=Ca()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;Aa(a,null,!0,function(a,b,f){f?(c.N("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(fb(c.lb,a,b),(a=Ba(a,b))?(c.g=a.ba,c.ea=a.ea,null==c.La&&(c.La=a.La),null==c.Ka&&(c.Ka=a.Ka)):c.b=null);oh(c)})}}
|
||||||
p(oh,A);oh.prototype.pa=function(a,b,c,d){this.D=b;this.f=c;this.F=d;ph(this)};oh.prototype.qa=function(){this.da&&(this.F&&nh(this.F,this.id,this.i,this.j,this.da),delete this.da);return!0};oh.prototype.za=function(){return!0};function ph(a){if(a.D&&(!a.v&&a.j&&(Lc(a.D,a.i,a.j,Wc)?a.v=!0:a.j=0),!tb(a))){if(!a.v)y("No RAM allocated");else if(a.b){if(!a.g||!a.D)return;qh(a,a.g,a.La,a.Ka,a.i)}G(a)}}
|
p(nh,A);nh.prototype.qa=function(a,b,c,d){this.D=b;this.f=c;this.F=d;oh(this)};nh.prototype.ra=function(){this.ea&&(this.F&&mh(this.F,this.id,this.i,this.j,this.ea),delete this.ea);return!0};nh.prototype.Aa=function(){return!0};function oh(a){if(a.D&&(!a.v&&a.j&&(Kc(a.D,a.i,a.j,Vc)?a.v=!0:a.j=0),!sb(a))){if(!a.v)y("No RAM allocated");else if(a.b){if(!a.g||!a.D)return;ph(a,a.g,a.La,a.Ka,a.i)}H(a)}}
|
||||||
oh.prototype.reset=function(){if(this.v){for(var a=this.D,b=this.i,c=this.j,d=b&a.i,b=b>>>a.g;0<c&&b<a.b.length;){var e=a.b[b],f=c,g=0,k,d=d||0,g=(g||0)&255;void 0===f&&(f=e.size);if(wb&&e.g)for(k=d;f--&&k<e.g.length;k++)e.g[k]=g;else for(k=d;f--&&k<e.size;k++)e.D(d,g,e.K+d);c-=a.j;b++;d=0}this.g&&qh(this,this.g,this.La,this.Ka,this.i,!0)}};
|
nh.prototype.reset=function(){if(this.v){for(var a=this.D,b=this.i,c=this.j,d=b&a.i,b=b>>>a.g;0<c&&b<a.b.length;){var e=a.b[b],f=c,g=0,k,d=d||0,g=(g||0)&255;void 0===f&&(f=e.size);if(vb&&e.g)for(k=d;f--&&k<e.g.length;k++)e.g[k]=g;else for(k=d;f--&&k<e.size;k++)e.D(d,g,e.K+d);c-=a.j;b++;d=0}this.g&&ph(this,this.g,this.La,this.Ka,this.i,!0)}};
|
||||||
function qh(a,b,c,d,e,f){var g=!1,k=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){var n=l;if(1!=m){I(a,"invalid signature ("+w(m)+") at offset "+w(n),4096);break}if(l+6>=b.length){I(a,"invalid block at offset "+w(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,E=r-=6;0<r&&l<b.length;)m+=b[l++]&255,r--;if(r||l>=b.length){I(a,"insufficient data for block at offset "+w(n),4096);break}m+=
|
function ph(a,b,c,d,e,f){var g=!1,k=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){var n=l;if(1!=m){J(a,"invalid signature ("+w(m)+") at offset "+w(n),4096);break}if(l+6>=b.length){J(a,"invalid block at offset "+w(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,E=r-=6;0<r&&l<b.length;)m+=b[l++]&255,r--;if(r||l>=b.length){J(a,"insufficient data for block at offset "+w(n),4096);break}m+=
|
||||||
b[l++]&255;if(m&255){I(a,"invalid checksum ("+v(m,2,!0)+") for block at offset "+w(n),4096);break}if(E)for(I(a,"loading "+w(E)+" bytes at "+w(u)+"-"+w(u+E),4096);E--;)Tc(a.D,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&I(a,"starting address: "+w(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)Tc(a.D,c+e,b[e]);k=!0}if(k){if(null==d||g)J(a.f),f=!1;null!=d&&je(a.f,d,f)}return k}
|
b[l++]&255;if(m&255){J(a,"invalid checksum ("+v(m,2,!0)+") for block at offset "+w(n),4096);break}if(E)for(J(a,"loading "+w(E)+" bytes at "+w(u)+"-"+w(u+E),4096);E--;)Sc(a.D,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&J(a,"starting address: "+w(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)Sc(a.D,c+e,b[e]);k=!0}if(k){if(null==d||g)a.f.Y(),f=!1;null!=d&&ie(a.f,d,f)}return k}
|
||||||
Ta(function(){for(var a=D(document,B,"ram"),b=0;b<a.length;b++){var c=a[b],d=pb(c),d=new oh(d);qb(d,c)}});function rh(a){A.call(this,"Keyboard",a,0,1024);G(this)}p(rh,A);rh.prototype.na=function(){return!1};rh.prototype.pa=function(a,b,c,d){this.I=a;this.f=c;this.F=d};Ta(function(){for(var a=D(document,B,"keyboard"),b=0;b<a.length;b++){var c=a[b],d=pb(c),d=new rh(d);qb(d,c)}});
|
Wa(function(){for(var a=G(document,D,"ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new nh(d);pb(d,c)}});function qh(a){A.call(this,"Keyboard",a,0,1024);H(this)}p(qh,A);qh.prototype.oa=function(){return!1};qh.prototype.qa=function(a,b,c,d){this.I=a;this.f=c;this.F=d};Wa(function(){for(var a=G(document,D,"keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new qh(d);pb(d,c)}});
|
||||||
function sh(a){A.call(this,"SerialPort",a,0,262144);this.J=a.adapter;this.S=a.baudReceive||9600;this.aa=a.baudTransmit||9600;this.Y=a.upperCase;this.i=this.w=null;this.V=a.tabSize;this.T=a.charBOL;this.C=0;this.H=!0;this.P=this.L=null;this.R=this.X=-1;this.G=this.b=this.g=0;this.j=[];var b=a.binding;if("console"==b)this.w="";else{var c;a=th;b&&(void 0===c&&(c="Panel"),(c=ob(c,this.id))&&(b=c.B[b])&&this.na(null,a,b))}this.v=this.M=this.O=null;this.exports={connect:this.kd,receiveData:this.cc,receiveStatus:this.df}}
|
function rh(a){A.call(this,"SerialPort",a,0,262144);this.J=a.adapter;this.S=a.baudReceive||9600;this.da=a.baudTransmit||9600;this.Z=a.upperCase;this.i=this.w=null;this.V=a.tabSize;this.T=a.charBOL;this.C=0;this.H=!0;this.P=this.L=null;this.R=this.X=-1;this.G=this.b=this.g=0;this.j=[];var b=a.binding;if("console"==b)this.w="";else{var c;a=sh;b&&(void 0===c&&(c="Panel"),(c=ob(c,this.id))&&(b=c.B[b])&&this.oa(null,a,b))}this.v=this.M=this.O=null;this.exports={connect:this.md,receiveData:this.cc,receiveStatus:this.ff}}
|
||||||
p(sh,A);h=sh.prototype;
|
p(rh,A);h=rh.prototype;
|
||||||
h.na=function(a,b,c){var d=this;switch(b){case th:return this.B[b]=this.i=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?ka.Kc:ka.vd:46==c?b=ka.Kc:a.ctrlKey&&c>=ka.Hc&&c<=ka.Ed&&(b=c-(ka.Hc-ka.sd));b&&(a.preventDefault&&a.preventDefault(),d.cc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ka.ud&&(b=ka.td);d.cc(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();
|
h.oa=function(a,b,c){var d=this;switch(b){case sh:return this.B[b]=this.i=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?ka.Lc:ka.xd:46==c?b=ka.Lc:a.ctrlKey&&c>=ka.Ic&&c<=ka.Gd&&(b=c-(ka.Ic-ka.ud));b&&(a.preventDefault&&a.preventDefault(),d.cc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ka.wd&&(b=ka.vd);d.cc(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();
|
||||||
a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.cc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};
|
a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.cc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};
|
||||||
h.pa=function(a,b,c,d){this.I=a;this.D=b;this.f=c;this.F=d;var e=this;this.P=cd(this.f,this.J?-1:48,4,262144);this.R=$c(this.f,function(){var a;a=-1;e.j.length&&(a=e.j.shift()&255,I(e,"receiveByte("+v(a,2,!0)+")"),e.Y&&97<=a&&122>a&&(a-=32),bd(e.f,e.R,1E3/Math.round(e.S/10)));0<=a&&(e.G=a,e.b&128?e.G|=49152:e.b|=128,e.b&64&&ad(c,e.P))});this.L=cd(this.f,this.J?-1:52,4,262144);this.X=$c(this.f,function(){e.g|=128;e.g&64&&ad(c,e.L)});Pb(b,this,uh,this.J?64832+8*(this.J-1)-65392:0);Rb(b,this.reset.bind(this));
|
h.qa=function(a,b,c,d){this.I=a;this.D=b;this.f=c;this.F=d;var e=this;this.P=bd(this.f,this.J?-1:48,4,262144);this.R=Zc(this.f,function(){var a;a=-1;e.j.length&&(a=e.j.shift()&255,J(e,"receiveByte("+v(a,2,!0)+")"),e.Z&&97<=a&&122>a&&(a-=32),ad(e.f,e.R,1E3/Math.round(e.S/10)));0<=a&&(e.G=a,e.b&128?e.G|=49152:e.b|=128,e.b&64&&$c(c,e.P))});this.L=bd(this.f,this.J?-1:52,4,262144);this.X=Zc(this.f,function(){e.g|=128;e.g&64&&$c(c,e.L)});Ob(b,this,th,this.J?64832+8*(this.J-1)-65392:0);Qb(b,this.reset.bind(this));
|
||||||
G(this)};h.kd=function(a){if(!this.v){var b=Sd(this.I,"connection");if(b){var c=b.split("->");if(2==c.length){var d=ua(c[0]);if(d!=this.jb)return;c=ua(c[1]);if(this.v=nb(c)){var e=this.v.exports;if(e){var f=e.connect;f&&f.call(this.v,this.H);if(this.M=e.receiveData){this.H=a;this.O=e.receiveStatus;this.status(this.kb+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
H(this)};h.md=function(a){if(!this.v){var b=Rd(this.I,"connection");if(b){var c=b.split("->");if(2==c.length){var d=ua(c[0]);if(d!=this.kb)return;c=ua(c[1]);if(this.v=nb(c)){var e=this.v.exports;if(e){var f=e.connect;f&&f.call(this.v,this.H);if(this.M=e.receiveData){this.H=a;this.O=e.receiveStatus;this.status(this.lb+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
||||||
h.qa=function(a,b){if(!b)if(this.kd(this.H),!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(){vh(this)};h.save=function(){var a=new le(this);a.set(0,[]);return a.data()};h.restore=function(){return vh(this)};function vh(a){a.G=0;a.b=8192;a.g=128;a.j=[];return!0}
|
h.ra=function(a,b){if(!b)if(this.md(this.H),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.Aa=function(a){return a?this.save():!0};h.reset=function(){uh(this)};h.save=function(){var a=new ke(this);a.set(0,[]);return a.data()};h.restore=function(){return uh(this)};function uh(a){a.G=0;a.b=8192;a.g=128;a.j=[];return!0}
|
||||||
h.cc=function(a){if("number"==typeof a)this.j.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.j.push(b)}else this.j=this.j.concat(a);bd(this.f,this.R,1E3/Math.round(this.S/10));return!0};h.df=function(a){var b=this.b;this.b&=-12289;a&32&&(this.b|=8192);a&256&&(this.b|=4096);b!=this.b&&(this.b|=32768,this.b&32&&ad(this.f,this.P))};h.xe=function(){var a=this.b&65534;this.b&=-32769;return a};
|
h.cc=function(a){if("number"==typeof a)this.j.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.j.push(b)}else this.j=this.j.concat(a);ad(this.f,this.R,1E3/Math.round(this.S/10));return!0};h.ff=function(a){var b=this.b;this.b&=-12289;a&32&&(this.b|=8192);a&256&&(this.b|=4096);b!=this.b&&(this.b|=32768,this.b&32&&$c(this.f,this.P))};h.ze=function(){var a=this.b&65534;this.b&=-32769;return a};
|
||||||
h.Gf=function(a){var b=a^this.b;this.b=this.b&-112|a&111;this.O&&b&6&&(b=0,b=this.H?b|(a&4?32:0)|(a&2?320:0):b|(a&4?16:0)|(a&2?1048576:0),this.O.call(this.v,b))};h.we=function(){this.b&=-129;return this.G};h.Ff=function(){};h.cf=function(){return this.g};h.lg=function(a){this.g&128&&(a&64?ad(this.f,this.L):gd(this.f,this.L));this.g=this.g&-70|a&69};h.bf=function(){return 0};
|
h.If=function(a){var b=a^this.b;this.b=this.b&-112|a&111;this.O&&b&6&&(b=0,b=this.H?b|(a&4?32:0)|(a&2?320:0):b|(a&4?16:0)|(a&2?1048576:0),this.O.call(this.v,b))};h.ye=function(){this.b&=-129;return this.G};h.Hf=function(){};h.ef=function(){return this.g};h.ng=function(a){this.g&128&&(a&64?$c(this.f,this.L):fd(this.f,this.L));this.g=this.g&-70|a&69};h.df=function(){return 0};
|
||||||
h.kg=function(a){a&=255;I(this,"transmitByte("+v(a,2,!0)+")");this.M&&this.M.call(this.v,a);a&=127;if(this.i)if(13==a)this.C=0;else if(8==a)this.i.value=this.i.value.slice(0,-1),0<this.C&&this.C--;else{if(a){var b;13!=a&&10!=a&&(b=va[a]);b=b?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.V||8,c=a-this.C%a,this.V&&(b=ta("",c)));this.T&&!this.C&&c&&(b=String.fromCharCode(this.T)+b);this.i.value+=b;this.i.scrollTop=this.i.scrollHeight;this.C+=c}}else if(null!=this.w){if(10==
|
h.mg=function(a){a&=255;J(this,"transmitByte("+v(a,2,!0)+")");this.M&&this.M.call(this.v,a);a&=127;if(this.i)if(13==a)this.C=0;else if(8==a)this.i.value=this.i.value.slice(0,-1),0<this.C&&this.C--;else{if(a){var b;13!=a&&10!=a&&(b=wa[a]);b=b?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.V||8,c=a-this.C%a,this.V&&(b=ta("",c)));this.T&&!this.C&&c&&(b=String.fromCharCode(this.T)+b);this.i.value+=b;this.i.scrollTop=this.i.scrollHeight;this.C+=c}}else if(null!=this.w){if(10==
|
||||||
a||1024<=this.w.length)this.u(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}bd(this.f,this.X,1E3/Math.round(this.aa/10));this.g&=-129};var th="buffer",wh={},uh=(wh[65392]=[null,null,sh.prototype.xe,sh.prototype.Gf,"RCSR"],wh[65394]=[null,null,sh.prototype.we,sh.prototype.Ff,"RBUF"],wh[65396]=[null,null,sh.prototype.cf,sh.prototype.lg,"XCSR"],wh[65398]=[null,null,sh.prototype.bf,sh.prototype.kg,"XBUF"],wh);
|
a||1024<=this.w.length)this.u(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}ad(this.f,this.X,1E3/Math.round(this.da/10));this.g&=-129};var sh="buffer",vh={},th=(vh[65392]=[null,null,rh.prototype.ze,rh.prototype.If,"RCSR"],vh[65394]=[null,null,rh.prototype.ye,rh.prototype.Hf,"RBUF"],vh[65396]=[null,null,rh.prototype.ef,rh.prototype.ng,"XCSR"],vh[65398]=[null,null,rh.prototype.df,rh.prototype.mg,"XBUF"],vh);
|
||||||
Ta(function(){for(var a=D(document,B,"serial"),b=0;b<a.length;b++){var c=a[b],d=pb(c),d=new sh(d);qb(d,c)}});function pd(a){A.call(this,"PC11",a);this.M=xh(this,a.autoMount);this.g=0;this.S=a.baudReceive||3600;this.C=this.G=this.b=0;this.w=[];this.v=yh;this.i=zh;this.L=this.j="";this.ba=this.La=this.Ka=null;this.P=-1;this.O=!Ma("Mobi")&&window&&"FileReader"in window;this.H=null;this.R=-1;this.J=null}p(pd,A);
|
Wa(function(){for(var a=G(document,D,"serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new rh(d);pb(d,c)}});function od(a){A.call(this,"PC11",a);this.M=wh(this,a.autoMount);this.g=0;this.S=a.baudReceive||3600;this.C=this.G=this.b=0;this.w=[];this.v=xh;this.i=yh;this.L=this.j="";this.ba=this.La=this.Ka=null;this.P=-1;this.O=!Ma("Mobi")&&window&&"FileReader"in window;this.H=null;this.R=-1;this.J=null}p(od,A);
|
||||||
function xh(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=pd.prototype;
|
function wh(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=od.prototype;
|
||||||
h.na=function(a,b,c){var d=this,e=zh;switch(b){case "listTapes":return this.B[b]=c,c.onchange=function(){var a=d.B.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){y("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.B[b]=c,!0;case "readTape":e=Ah;case "loadTape":return e||(e=Bh),this.B[b]=c,c.onclick=
|
h.oa=function(a,b,c){var d=this,e=yh;switch(b){case "listTapes":return this.B[b]=c,c.onchange=function(){var a=d.B.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){y("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.B[b]=c,!0;case "readTape":e=zh;case "loadTape":return e||(e=Ah),this.B[b]=c,c.onclick=
|
||||||
function(){var a=d.B.listTapes;a&&Ch(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.B[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;Ch(d,x(b,!0),b,Bh,a)}return!1};return!0;case Dh:return this.B[b]=c,!0}return!1};
|
function(){var a=d.B.listTapes;a&&Bh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.B[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;Bh(d,x(b,!0),b,Ah,a)}return!1};return!0;case Ch:return this.B[b]=c,!0}return!1};
|
||||||
h.pa=function(a,b,c,d){this.I=a;this.D=b;this.f=c;this.F=d;this.J=Eh(a);var e=this;if(a=xh(this,Sd(this.I,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.H=cd(this.f,56,4,4096);this.R=$c(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.C<e.w.length&&(e.G=e.w[e.C++]&255,Fh(e,e.C/e.w.length*100),e.b|=128,e.b&=-2049,e.b&64&&ad(e.f,e.H))});Pb(b,this,Gh);Rb(b,this.reset.bind(this));Hh(this,"None",yh,!0);this.O&&Hh(this,"Local Tape",Ih);Hh(this,"Remote Tape",Jh);Kh(this)||G(this)};
|
h.qa=function(a,b,c,d){this.I=a;this.D=b;this.f=c;this.F=d;this.J=Dh(a);var e=this;if(a=wh(this,Rd(this.I,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.H=bd(this.f,56,4,4096);this.R=Zc(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.C<e.w.length&&(e.G=e.w[e.C++]&255,Eh(e,e.C/e.w.length*100),e.b|=128,e.b&=-2049,e.b&64&&$c(e.f,e.H))});Ob(b,this,Fh);Qb(b,this.reset.bind(this));Gh(this,"None",xh,!0);this.O&&Gh(this,"Local Tape",Hh);Gh(this,"Remote Tape",Ih);Jh(this)||H(this)};
|
||||||
h.qa=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.b&=-2241;this.G=0};function Kh(a){a.g=0;var b=a.M.PTR;if(b){var c=b.path||"";if(!(b=b.name))a:{if((b=a.B.listTapes)&&b.options)for(var d=0;d<b.options.length;d++){var e=b.options[d];if(e.value==c){b=e.text;break a}}b=x(c,!0)}c&&b?Lh(a,b,c,Bh,!0):Mh(a)}return!!a.g}
|
h.ra=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.Aa=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.G=0};function Jh(a){a.g=0;var b=a.M.PTR;if(b){var c=b.path||"";if(!(b=b.name))a:{if((b=a.B.listTapes)&&b.options)for(var d=0;d<b.options.length;d++){var e=b.options[d];if(e.value==c){b=e.text;break a}}b=x(c,!0)}c&&b?Kh(a,b,c,Ah,!0):Lh(a)}return!!a.g}
|
||||||
function Ch(a,b,c,d,e){if(c)if(c==Ih)a.N('Use "Choose File" and "Mount" to select and load a local tape.');else{if(c==Jh){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=x(c);a.status("Attempting to load "+c+' as "'+b+'"');a.v=Jh}else a.v=c;Lh(a,b,c,d,!1,e)}else Nh(a,!1)}
|
function Bh(a,b,c,d,e){if(c)if(c==Hh)a.N('Use "Choose File" and "Mount" to select and load a local tape.');else{if(c==Ih){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=x(c);a.status("Attempting to load "+c+' as "'+b+'"');a.v=Ih}else a.v=c;Kh(a,b,c,d,!1,e)}else Mh(a,!1)}
|
||||||
function Lh(a,b,c,d,e,f){var g=-1;if(a.j.toLowerCase()!=c.toLowerCase()||a.i!=d)g++,Nh(a,!0),a.A.bb?a.N("PC11 busy"):(e&&(a.g++,H(a)&&I(a,"auto-loading tape: "+b)),Oh(a,b,c,d,f)?g++:a.A.bb=!0);g&&Ph(a,a.L,a.j,a.i,a.ba,a.La,a.Ka)}
|
function Kh(a,b,c,d,e,f){var g=-1;if(a.j.toLowerCase()!=c.toLowerCase()||a.i!=d)g++,Mh(a,!0),a.A.cb?a.N("PC11 busy"):(e&&(a.g++,I(a)&&J(a,"auto-loading tape: "+b)),Nh(a,b,c,d,f)?g++:a.A.cb=!0);g&&Oh(a,a.L,a.j,a.i,a.ba,a.La,a.Ka)}
|
||||||
function Oh(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),Ph(a,b,c,d,e),a.v=Ih);Mh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=oa(c),f="json"==e||"gz"==e?encodeURI(c):Ca()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Aa(f,null,!0,function(e,f,g){var k=0>g&&!!a.I&&!a.I.A.ea;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(eb(a.kb,e,f),(e=Ba(e,f))&&Ph(a,b,c,d,e.ba,e.La,
|
function Nh(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),Oh(a,b,c,d,e),a.v=Hh);Lh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=oa(c),f="json"==e||"gz"==e?encodeURI(c):Ca()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Aa(f,null,!0,function(e,f,g){var k=0>g&&!!a.I&&!a.I.A.fa;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(fb(a.lb,e,f),(e=Ba(e,f))&&Oh(a,b,c,d,e.ba,e.La,
|
||||||
e.Ka));a.A.bb=!1;a.g&&(a.g--,a.g||G(a));Mh(a)})}function Hh(a,b,c,d){if((a=a.B.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)}}
|
e.Ka));a.A.cb=!1;a.g&&(a.g--,a.g||H(a));Lh(a)})}function Gh(a,b,c,d){if((a=a.B.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)}}
|
||||||
function Mh(a){var b=a.B.listTapes;if(b&&b.options){a=a.v||a.j;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function Fh(a,b){b|=0;if(b!==a.P){var c=a.B[Dh];c&&(c=(c=D(c,Qh))&&c[0])&&c.style&&(c.style.width=b+"%");a.P=b}}
|
function Lh(a){var b=a.B.listTapes;if(b&&b.options){a=a.v||a.j;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function Eh(a,b){b|=0;if(b!==a.P){var c=a.B[Ch];c&&(c=(c=G(c,Ph))&&c[0])&&c.style&&(c.style.width=b+"%");a.P=b}}
|
||||||
function Ph(a,b,c,d,e,f,g){a.L=b;a.j=c;a.i=d;a.ba=e;a.La=f;a.Ka=g;d==Ah?a.J&&qh(a.J,e,f,g,null,!1)?a.status('Read tape "'+b+'"'):a.N('No valid memory address for tape "'+b+'"'):(a.C=0,a.w=e,a.status('Loaded tape "'+b+'"'),Fh(a,0))}function Nh(a,b){if(a.j||!1===b)a.L="",a.j="",b||(a.i&&a.status(a.i==Bh?"tape detached":"tape unloaded"),a.v=yh,a.i=zh,Mh(a))}h.save=function(){return(new le(this)).data()};h.restore=function(){return!0};h.qe=function(){return this.b&65534};
|
function Oh(a,b,c,d,e,f,g){a.L=b;a.j=c;a.i=d;a.ba=e;a.La=f;a.Ka=g;d==zh?a.J&&ph(a.J,e,f,g,null,!1)?a.status('Read tape "'+b+'"'):a.N('No valid memory address for tape "'+b+'"'):(a.C=0,a.w=e,a.status('Loaded tape "'+b+'"'),Eh(a,0))}function Mh(a,b){if(a.j||!1===b)a.L="",a.j="",b||(a.i&&a.status(a.i==Ah?"tape detached":"tape unloaded"),a.v=xh,a.i=yh,Lh(a))}h.save=function(){return(new ke(this)).data()};h.restore=function(){return!0};h.se=function(){return this.b&65534};
|
||||||
h.zf=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&ad(this.f,this.H)):(this.b&=-129,this.b|=2048,this.G=0,bd(this.f,this.R,1E3/Math.round(this.S/10))));this.b=this.b&-66|a&65};h.pe=function(){this.b&=-129;this.b|=2048;return this.G};h.yf=function(){};var yh="",Ih="?",Jh="??",zh=0,Bh=1,Ah=2,Dh="readProgress",Qh="pcjs-progress-bar",Rh={},Gh=(Rh[65384]=[null,null,pd.prototype.qe,pd.prototype.zf,"PRS"],Rh[65386]=[null,null,pd.prototype.pe,pd.prototype.yf,"PRB"],Rh);
|
h.Bf=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&$c(this.f,this.H)):(this.b&=-129,this.b|=2048,this.G=0,ad(this.f,this.R,1E3/Math.round(this.S/10))));this.b=this.b&-66|a&65};h.re=function(){this.b&=-129;this.b|=2048;return this.G};h.Af=function(){};var xh="",Hh="?",Ih="??",yh=0,Ah=1,zh=2,Ch="readProgress",Ph="pcjs-progress-bar",Qh={},Fh=(Qh[65384]=[null,null,od.prototype.se,od.prototype.Bf,"PRS"],Qh[65386]=[null,null,od.prototype.re,od.prototype.Af,"PRB"],Qh);
|
||||||
function Sh(a,b,c){A.call(this,"Disk",{id:a.kb+".disk"+v(++Th,4)},0,8192);this.controller=a;this.I=a.I;this.F=a.F;this.v=b;this.Ma=b.name;this.va=this.ec="";this.ac=b.ac;this.W=this.ca=this.Z=this.ma=this.mode=0;this.b=[];this.i=null;this.j=!1;Uh(this,c,b.W,b.ca,b.Z,b.ma);this.g=this.w=null;G(this)}p(Sh,A);h=Sh.prototype;h.pa=function(a,b,c,d){this.F=d};
|
function Rh(a,b,c){A.call(this,"Disk",{id:a.lb+".disk"+v(++Sh,4)},0,8192);this.controller=a;this.I=a.I;this.F=a.F;this.v=b;this.Ma=b.name;this.wa=this.ec="";this.ac=b.ac;this.W=this.ca=this.aa=this.na=this.mode=0;this.b=[];this.i=null;this.j=!1;Th(this,c,b.W,b.ca,b.aa,b.na);this.g=this.w=null;H(this)}p(Rh,A);h=Rh.prototype;h.qa=function(a,b,c,d){this.F=d};
|
||||||
function Uh(a,b,c,d,e,f){a.mode=b;a.W=c;a.ca=d;a.Z=e;a.ma=f;a.b=[];if("preload"!=a.mode){b=Array(a.W);for(c=0;c<b.length;c++){d=Array(a.ca);for(e=0;e<d.length;e++){f=Array(a.Z);for(var g=1;g<=f.length;g++)f[g-1]=Vh(null,c,e,g,a.ma,0);d[e]=f}b[c]=d}a.b=b}a.i=null}
|
function Th(a,b,c,d,e,f){a.mode=b;a.W=c;a.ca=d;a.aa=e;a.na=f;a.b=[];if("preload"!=a.mode){b=Array(a.W);for(c=0;c<b.length;c++){d=Array(a.ca);for(e=0;e<d.length;e++){f=Array(a.aa);for(var g=1;g<=f.length;g++)f[g-1]=Uh(null,c,e,g,a.na,0);d[e]=f}b[c]=d}a.b=b}a.i=null}
|
||||||
function Wh(a,b,c,d,e){var f=c;if(a.g)return!0;a.Ma=b;a.va=c;a.ec=x(c);a.g=e;a.w=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ja[d];if(e){a.W=e[0];a.ca=e[1];a.Z=e[2];a.ma=e[3]||512;c=a.ma>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.W);for(d=0;d<a.b.length;d++)for(var u=a.b[d]=Array(a.ca),t=0;t<u.length;t++)for(var E=u[t]=Array(a.Z),z=0;z<E.length;z++){for(var C=Vh(null,d,t,z+1,a.ma,0),F=C.data,fb=0;fb<c;fb++,f+=4)var W=F[fb]=b.getInt32(f,!0),
|
function Vh(a,b,c,d,e){var f=c;if(a.g)return!0;a.Ma=b;a.wa=c;a.ec=x(c);a.g=e;a.w=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ja[d];if(e){a.W=e[0];a.ca=e[1];a.aa=e[2];a.na=e[3]||512;c=a.na>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.W);for(d=0;d<a.b.length;d++)for(var u=a.b[d]=Array(a.ca),t=0;t<u.length;t++)for(var E=u[t]=Array(a.aa),z=0;z<E.length;z++){for(var C=Uh(null,d,t,z+1,a.na,0),F=C.data,eb=0;eb<c;eb++,f+=4)var V=F[eb]=b.getInt32(f,!0),
|
||||||
e=e+W&-1;C.Ga=c;E[z]=C}a.i=e;c=a}else a.N("Unrecognized disk format ("+d+" bytes)");a.g&&(a.g.call(a.controller,a.v,c,a.Ma,a.va),a.g=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=oa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):pa(c,"/")&&(d="dir"),f=Ca()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ac?"":e)+"&format=json"));return!!Aa(f,null,
|
e=e+V&-1;C.Ga=c;E[z]=C}a.i=e;c=a}else a.N("Unrecognized disk format ("+d+" bytes)");a.g&&(a.g.call(a.controller,a.v,c,a.Ma,a.wa),a.g=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=oa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):pa(c,"/")&&(d="dir"),f=Ca()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ac?"":e)+"&format=json"));return!!Aa(f,null,
|
||||||
!0,function(b,c,d){Xh(a,b,c,d)})}
|
!0,function(b,c,d){Wh(a,b,c,d)})}
|
||||||
function Xh(a,b,c,d){var e=null,f=0>d&&!!a.I&&!a.I.A.ea;a.j=!1;if(d)a.controller.N('Unable to load disk "'+a.Ma+'" (error '+d+": "+b+")",f);else{eb(a.controller.kb,b,c);try{if(0<x(a.ec,!0).toLowerCase().indexOf("-readonly"))a.j=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.j=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.Ma]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
function Wh(a,b,c,d){var e=null,f=0>d&&!!a.I&&!a.I.A.fa;a.j=!1;if(d)a.controller.N('Unable to load disk "'+a.Ma+'" (error '+d+": "+b+")",f);else{fb(a.controller.lb,b,c);try{if(0<x(a.ec,!0).toLowerCase().indexOf("-readonly"))a.j=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.j=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.Ma]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
||||||
c+")");if(k.length)if(1==k.length)y(k[0]);else{a.W=k.length;a.ca=k[0].length;a.Z=k[0][0].length;var l=k[0][0][0];a.ma=l&&l.length||512;for(d=c=0;d<a.W;d++)for(f=0;f<a.ca;f++)for(g=0;g<a.Z;g++)if(l=k[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;E<t;E++)u[E]=n;Yh(l,u)}else r=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=r;delete l.bytes}Vh(l,d,f);for(t=
|
c+")");if(k.length)if(1==k.length)y(k[0]);else{a.W=k.length;a.ca=k[0].length;a.aa=k[0][0].length;var l=k[0][0][0];a.na=l&&l.length||512;for(d=c=0;d<a.W;d++)for(f=0;f<a.ca;f++)for(g=0;g<a.aa;g++)if(l=k[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;E<t;E++)u[E]=n;Xh(l,u)}else r=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=r;delete l.bytes}Uh(l,d,f);for(t=
|
||||||
0;t<r.length;t++)c=c+r[t]&-1}a.b=k;a.i=c;e=a}else y("Empty disk image: "+a.Ma)}catch(z){y("Disk image error ("+b+"): "+z.message)}}a.g&&(a.g.call(a.w,a.v,e,a.Ma,a.va),a.g=null)}function Vh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.nh=b;a.oh=c;a.Qa=a.Ga=0;a.Sa=!1;return a}
|
0;t<r.length;t++)c=c+r[t]&-1}a.b=k;a.i=c;e=a}else y("Empty disk image: "+a.Ma)}catch(z){y("Disk image error ("+b+"): "+z.message)}}a.g&&(a.g.call(a.w,a.v,e,a.Ma,a.wa),a.g=null)}function Uh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.ph=b;a.qh=c;a.Qa=a.Ga=0;a.Ta=!1;return a}
|
||||||
h.seek=function(a,b,c,d,e){d=null;var f=this.v,g=this.b[a];if(g){var k=g[b];if(!k&&f.Hd&&b<f.ca)for(k=g[b]=Array(f.ad),g=0;g<k.length;g++)k[g]=Vh(null,a,b,g+1,f.Ac,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.Hd&&9==f.xc&&(d=k[g]=Vh(null,a,b,f.xc,f.Ac,0))}}e&&e(d,!1);return d};function Yh(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
|
h.seek=function(a,b,c,d,e){d=null;var f=this.v,g=this.b[a];if(g){var k=g[b];if(!k&&f.Jd&&b<f.ca)for(k=g[b]=Array(f.bd),g=0;g<k.length;g++)k[g]=Uh(null,a,b,g+1,f.Bc,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.Jd&&9==f.yc&&(d=k[g]=Uh(null,a,b,f.yc,f.Bc,0))}}e&&e(d,!1);return d};function Xh(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
|
||||||
h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ga?f<a.Qa?(a.Ga+=a.Qa-f,a.Qa=f):f>=a.Qa+a.Ga&&(a.Ga+=f-(a.Qa+a.Ga)+1):(a.Qa=f,a.Ga=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ga?f<a.Qa?(a.Ga+=a.Qa-f,a.Qa=f):f>=a.Qa+a.Ga&&(a.Ga+=f-(a.Qa+a.Ga)+1):(a.Qa=f,a.Ga=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
||||||
function Zh(a,b){var c=a.ca*a.Z,d=b/c|0;return d<a.W?(b%=c,a.seek(d,b/a.Z|0,b%a.Z+1)):null}function $h(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}function ai(a){for(var b="",c=0,d;d=Zh(a,c++);)for(var e=0,f=d.length;e<f;e++)b+=String.fromCharCode($h(a,d,e));return btoa(b)}
|
function Yh(a,b){var c=a.ca*a.aa,d=b/c|0;return d<a.W?(b%=c,a.seek(d,b/a.aa|0,b%a.aa+1)):null}function Zh(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}function $h(a){for(var b="",c=0,d;d=Yh(a,c++);)for(var e=0,f=d.length;e<f;e++)b+=String.fromCharCode(Zh(a,d,e));return btoa(b)}
|
||||||
h.save=function(){var a=0,b=[];b[a++]=[this.va,this.i,this.W,this.ca,this.Z,this.ma];if(!this.j)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Ga){for(var k=[],l=0,m=g.Qa,n=g.Qa+g.Ga;m<n;)k[l++]=g.data[m++];b[a++]=[d,e,f,g.Qa,k]}}return b};
|
h.save=function(){var a=0,b=[];b[a++]=[this.wa,this.i,this.W,this.ca,this.aa,this.na];if(!this.j)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Ga){for(var k=[],l=0,m=g.Qa,n=g.Qa+g.Ga;m<n;)k[l++]=g.data[m++];b[a++]=[d,e,f,g.Qa,k]}}return b};
|
||||||
h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?Uh(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.i&&e[1]!=this.i&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.i+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],m=g[f++];if(k>=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+
|
h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?Th(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.i&&e[1]!=this.i&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.i+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],m=g[f++];if(k>=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+
|
||||||
b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;l<e;)k.data[l++]=k.pattern;l=0;k.Qa=e;for(k.Ga=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.N("Unable to restore disk '"+this.Ma+": "+c);return b};
|
b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;l<e;)k.data[l++]=k.pattern;l=0;k.Qa=e;for(k.Ga=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.N("Unable to restore disk '"+this.Ma+": "+c);return b};
|
||||||
h.toJSON=function(){var a;a=0;for(var b;b=Zh(this,a++);)bi(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
|
h.toJSON=function(){var a;a=0;for(var b;b=Yh(this,a++);)ai(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
|
||||||
function bi(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var Th=0;function R(a){A.call(this,"RK11",a,0,65536);this.G=ci(this,a.autoMount);this.C=0;this.i=Array(8);this.H=!Ma("Mobi")&&window&&"FileReader"in window;this.cb=null;this.L=this.g=this.b=this.w=this.v=this.j=this.J=0}p(R,A);
|
function ai(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var Sh=0;function R(a){A.call(this,"RK11",a,0,65536);this.G=bi(this,a.autoMount);this.C=0;this.i=Array(8);this.H=!Ma("Mobi")&&window&&"FileReader"in window;this.eb=null;this.L=this.g=this.b=this.w=this.v=this.j=this.J=0}p(R,A);
|
||||||
function ci(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=R.prototype;
|
function bi(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=R.prototype;
|
||||||
h.na=function(a,b,c){var d=this;switch(b){case "listDisks":return this.B[b]=c,c.onchange=function(){var a=d.B.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){y("RK11 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 "descDisk":case "listDrives":return this.B[b]=c,c.onchange=function(){var a=la(c.value,10);null!=a&&di(d,
|
h.oa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.B[b]=c,c.onchange=function(){var a=d.B.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){y("RK11 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 "descDisk":case "listDrives":return this.B[b]=c,c.onchange=function(){var a=la(c.value,10);null!=a&&ci(d,
|
||||||
a)},!0;case "loadDisk":return this.B[b]=c,c.onclick=function(){var a=d.B.listDisks;a&&a.options&&ei(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.B[b]=c,c.onclick=function(){var a,b=d.B.listDrives,b=b&&la(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.N("Unable to boot the selected drive"):a.ga?(je(d.f,0,!0),(a=d.Tc(a,0,0,0,512,0,2))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.H){c.parentNode.removeChild(c);
|
a)},!0;case "loadDisk":return this.B[b]=c,c.onclick=function(){var a=d.B.listDisks;a&&a.options&&di(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.B[b]=c,c.onclick=function(){var a,b=d.B.listDrives,b=b&&la(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.N("Unable to boot the selected drive"):a.ha?(ie(d.f,0,!0),(a=d.Vc(a,0,0,0,512,0,2))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.H){c.parentNode.removeChild(c);
|
||||||
break}this.B[b]=c;c.onclick=function(){var a=d.B.listDrives;a&&a.options&&d.i&&((a=d.i[la(a.value,10)||0])?(a=a.ga)?(a=Pa(ai(a),a.ec.replace(".json",".img")),y(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.H)return this.B[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;ei(d,x(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
break}this.B[b]=c;c.onclick=function(){var a=d.B.listDrives;a&&a.options&&d.i&&((a=d.i[la(a.value,10)||0])?(a=a.ha)?(a=Pa($h(a),a.ec.replace(".json",".img")),y(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.H)return this.B[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;di(d,x(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||||
h.pa=function(a,b,c,d){this.I=a;this.D=b;this.f=c;this.F=d;if(a=ci(this,Sd(this.I,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.G[e]=a[e]);fi(this);this.cb=cd(this.f,144,5,65536);Pb(b,this,zi);Rb(b,this.reset.bind(this));Bi(this,"None",Ci,!0);this.H&&Bi(this,"Local Disk",Di);Bi(this,"Remote Disk",Ei);Fi(this)||G(this)};
|
h.qa=function(a,b,c,d){this.I=a;this.D=b;this.f=c;this.F=d;if(a=bi(this,Rd(this.I,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.G[e]=a[e]);xi(this);this.eb=bd(this.f,144,5,65536);Ob(b,this,zi);Qb(b,this.reset.bind(this));Ai(this,"None",Bi,!0);this.H&&Ai(this,"Local Disk",Ci);Ai(this,"Remote Disk",Di);Ei(this)||H(this)};
|
||||||
h.qa=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.I.w){for(a=0;a<this.i.length;a++)Gi(this,a,!0);Fi(this,!0)}}else if(!this.restore(a))return!1;if(a=this.B.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;8>b;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";di(this,0)}}return!0};h.za=function(a){return a?this.save():!0};h.reset=function(){fi(this)};h.save=function(){return(new le(this)).data()};
|
h.ra=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.I.w){for(a=0;a<this.i.length;a++)Fi(this,a,!0);Ei(this,!0)}}else if(!this.restore(a))return!1;if(a=this.B.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;8>b;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";ci(this,0)}}return!0};h.Aa=function(a){return a?this.save():!0};h.reset=function(){xi(this)};h.save=function(){return(new ke(this)).data()};
|
||||||
h.restore=function(a){return fi(this,a[0])};function Fi(a,b){b||(a.C=0);for(var c in a.G){var d=a.G[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.B.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=x(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.i.length)){!Hi(a,g,f,e,!0)&&b&&G(a,!1);continue}a.N("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.C}
|
h.restore=function(a){return xi(this,a[0])};function Ei(a,b){b||(a.C=0);for(var c in a.G){var d=a.G[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.B.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=x(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.i.length)){!Gi(a,g,f,e,!0)&&b&&H(a,!1);continue}a.N("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.C}
|
||||||
function ei(a,b,c,d){var e=a.B.listDrives,e=e&&la(e.value,10);if(void 0===e||0>e||e>=a.i.length)a.N("Unable to load the selected drive");else if(c)if(c==Di)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Ei){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=x(c);a.status("Attempting to load "+c+' as "'+b+'"')}Hi(a,e,b,c,!1,d)}else Gi(a,e)}
|
function di(a,b,c,d){var e=a.B.listDrives,e=e&&la(e.value,10);if(void 0===e||0>e||e>=a.i.length)a.N("Unable to load the selected drive");else if(c)if(c==Ci)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Di){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=x(c);a.status("Attempting to load "+c+' as "'+b+'"')}Gi(a,e,b,c,!1,d)}else Fi(a,e)}
|
||||||
function Hi(a,b,c,d,e,f){var g=-1,k=a.i[b];k.va.toLowerCase()!=d.toLowerCase()&&(g++,Gi(a,b,!0),k.pb?a.N("RK11 busy"):(k.pb=!0,e&&(k.ob=!0,a.C++,H(a)&&I(a,"auto-loading disk: "+c)),k.Ta=!!f,Wh(new Sh(a,k,"preload"),c,d,f,a.yd)&&g++));return g}
|
function Gi(a,b,c,d,e,f){var g=-1,k=a.i[b];k.wa.toLowerCase()!=d.toLowerCase()&&(g++,Fi(a,b,!0),k.qb?a.N("RK11 busy"):(k.qb=!0,e&&(k.pb=!0,a.C++,I(a)&&J(a,"auto-loading disk: "+c)),k.Ua=!!f,Vh(new Rh(a,k,"preload"),c,d,f,a.Ad)&&g++));return g}
|
||||||
h.yd=function(a,b,c,d,e){a.pb=!1;b&&(b.W>a.W||b.ca>a.ca)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.qb)),b=null);b?(a.ga=b,a.Ma=c,a.va=d,this.N('Loaded disk "'+c+'" in drive '+("RK"+a.qb),a.ob||e),this.I&&be(this.I)):a.Ta=!1;a.ob&&(a.ob=!1,--this.C||G(this));di(this,a.qb)};
|
h.Ad=function(a,b,c,d,e){a.qb=!1;b&&(b.W>a.W||b.ca>a.ca)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.rb)),b=null);b?(a.ha=b,a.Ma=c,a.wa=d,this.N('Loaded disk "'+c+'" in drive '+("RK"+a.rb),a.pb||e),this.I&&ae(this.I)):a.Ua=!1;a.pb&&(a.pb=!1,--this.C||H(this));ci(this,a.rb)};
|
||||||
function Bi(a,b,c,d){if((a=a.B.listDisks)&&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)}}
|
function Ai(a,b,c,d){if((a=a.B.listDisks)&&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)}}
|
||||||
function di(a,b){if(0<=b&&b<a.i.length){var c=a.i[b],d=a.B.listDisks;a=a.B.listDrives;if(d&&a&&d.options&&a.options&&(a=la(a.value,10),c=c.Ta?Di:c.va,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Gi(a,b,c){var d=a.i[b];if(d.ga||!1===c)d.Ma="",d.va="",d.ga=null,d.Ta=!1,c||(a.N("Drive RK"+b+" unloaded",c),di(a,b))}
|
function ci(a,b){if(0<=b&&b<a.i.length){var c=a.i[b],d=a.B.listDisks;a=a.B.listDrives;if(d&&a&&d.options&&a.options&&(a=la(a.value,10),c=c.Ua?Ci:c.wa,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Fi(a,b,c){var d=a.i[b];if(d.ha||!1===c)d.Ma="",d.wa="",d.ha=null,d.Ua=!1,c||(a.N("Drive RK"+b+" unloaded",c),ci(a,b))}
|
||||||
function fi(a,b){var c=0;b||(b=[]);a.L=b[c++]||2368;a.g=b[c++]||0;a.b=b[c++]||128;a.w=b[c++]||0;a.v=b[c++]||0;a.j=b[c++]||0;a.J=b[c]||0;for(b=0;b<a.i.length;b++){var d=a.i[b];void 0===d&&(d=a.i[b]={});c=a;d.qb=b;d.name=c.jb;d.pb=d.Ta=!1;d.W=203;d.ca=2;d.Z=12;d.ma=512;d.ac=!0;d.Id=0;d.Gd=0;d.xc=1;d.ad=d.Z;d.Ac=d.ma;d.Nd=0;d.ff=null;d.ga||(d.va="");d.status=2368}return!0}
|
function xi(a,b){var c=0;b||(b=[]);a.L=b[c++]||2368;a.g=b[c++]||0;a.b=b[c++]||128;a.w=b[c++]||0;a.v=b[c++]||0;a.j=b[c++]||0;a.J=b[c]||0;for(b=0;b<a.i.length;b++){var d=a.i[b];void 0===d&&(d=a.i[b]={});c=a;d.rb=b;d.name=c.kb;d.qb=d.Ua=!1;d.W=203;d.ca=2;d.aa=12;d.na=512;d.ac=!0;d.Kd=0;d.Id=0;d.yc=1;d.bd=d.aa;d.Bc=d.na;d.Pd=0;d.hf=null;d.ha||(d.wa="");d.status=2368}return!0}
|
||||||
h.Tc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ga;var n=null,r;a||(m=128,e=0);for(;e;){if(!n){if(b>=a.W){m=64;break}n=a.seek(b,c,d+1);if(!n){m=4096;break}r=0;++d>=a.Z&&(d=0,++c>=a.ca&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=32;break}if(!k&&(jc(this.D,ye(this.f,f),u|t<<8),Zc(this.D))){m=1024;break}r>=a.ma&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
h.Vc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ha;var n=null,r;a||(m=128,e=0);for(;e;){if(!n){if(b>=a.W){m=64;break}n=a.seek(b,c,d+1);if(!n){m=4096;break}r=0;++d>=a.aa&&(d=0,++c>=a.ca&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=32;break}if(!k&&(ic(this.D,xe(this.f,f),u|t<<8),Yc(this.D))){m=1024;break}r>=a.na&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||||
h.zd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ga;var n=null,r;a||(m=128,e=0);for(;e;){var u=lc(this.D,ye(this.f,f));if(Zc(this.D)){m=1024;break}if(!n){if(b>=a.W){m=64;break}n=a.seek(b,c,d+1,!0);if(!n){m=4096;break}r=0;++d>=a.Z&&(d=0,++c>=a.ca&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=32;break}if(u!=(t|E<<8)){m=1;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=32;break}r>=a.ma&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
h.Bd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ha;var n=null,r;a||(m=128,e=0);for(;e;){var u=kc(this.D,xe(this.f,f));if(Yc(this.D)){m=1024;break}if(!n){if(b>=a.W){m=64;break}n=a.seek(b,c,d+1,!0);if(!n){m=4096;break}r=0;++d>=a.aa&&(d=0,++c>=a.ca&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=32;break}if(u!=(t|E<<8)){m=1;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=32;break}r>=a.na&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||||
h.xd=function(a,b,c,d,e,f){this.v=f&65535;this.b=this.b&-49|f>>12&48;this.w=65536-e&65535;this.j=this.j&-16|d&15;this.g|=a;Ii(this);return!0};function Ii(a){a.b&=-32769;a.g&&(a.g|=32768,a.b|=32768,a.g&32736&&(a.b|=16384),H(a)&&I(a,a.type+": ERROR: "+q(a.g)))}h.Ce=function(){return this.L};h.Lf=function(){};h.De=function(){return this.g};h.Mf=function(){};h.ze=function(){return this.b&61438};
|
h.zd=function(a,b,c,d,e,f){this.v=f&65535;this.b=this.b&-49|f>>12&48;this.w=65536-e&65535;this.j=this.j&-16|d&15;this.g|=a;Hi(this);return!0};function Hi(a){a.b&=-32769;a.g&&(a.g|=32768,a.b|=32768,a.g&32736&&(a.b|=16384),I(a)&&J(a,a.type+": ERROR: "+q(a.g)))}h.Ee=function(){return this.L};h.Nf=function(){};h.Fe=function(){return this.g};h.Of=function(){};h.Be=function(){return this.b&61438};
|
||||||
h.If=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){a=!0;var b,c,d="",e=(this.j&57344)>>13,f=this.i[e],g,k,l,m,n,r;this.b&=-8321;this.g&=-4;switch(c=this.b&14){case 0:H(this)&&I(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=128;break;case 10:d="RCHK";case 4:d||(d="READ"),b=this.Tc;case 6:d||(d="WCHK");case 2:d||(d="WRITE");b||(b=this.zd);g=(this.j&8160)>>5;k=(this.j&16)>>4;l=this.j&15;m=65536-this.w&65535;n=(this.b&48)<<12|this.v;r=this.b&2048?0:2;H(this)&&I(this,this.type+": "+
|
h.Kf=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){a=!0;var b,c,d="",e=(this.j&57344)>>13,f=this.i[e],g,k,l,m,n,r;this.b&=-8321;this.g&=-4;switch(c=this.b&14){case 0:I(this)&&J(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=128;break;case 10:d="RCHK";case 4:d||(d="READ"),b=this.Vc;case 6:d||(d="WCHK");case 2:d||(d="WRITE");b||(b=this.Bd);g=(this.j&8160)>>5;k=(this.j&16)>>4;l=this.j&15;m=65536-this.w&65535;n=(this.b&48)<<12|this.v;r=this.b&2048?0:2;I(this)&&J(this,this.type+": "+
|
||||||
d+"("+g+":"+k+":"+l+") "+q(n)+"--"+q(n+(m<<1)),!0,!0);if(g>=f.W){this.g|=64;break}if(l>=f.Z){this.g|=32;break}a=b.call(this,f,g,k,l,m,n,r,6<=c,this.xd.bind(this));break;case 8:g=(this.j&8160)>>5;H(this)&&I(this,this.type+": SEEK("+g+")",!0);g<f.W?this.b|=8192:this.g|=64;break;case 12:H(this)&&I(this,this.type+": DRESET("+e+")");this.g=this.j=0;this.b=8320;break;default:H(this)&&I(this,this.type+": UNSUPPORTED("+c+")")}this.L=f.status|(f.ga?128:0)|e<<13|this.j&15;Ii(this);a&&(this.b&=-2,this.b|=128,
|
d+"("+g+":"+k+":"+l+") "+q(n)+"--"+q(n+(m<<1)),!0,!0);if(g>=f.W){this.g|=64;break}if(l>=f.aa){this.g|=32;break}a=b.call(this,f,g,k,l,m,n,r,6<=c,this.zd.bind(this));break;case 8:g=(this.j&8160)>>5;I(this)&&J(this,this.type+": SEEK("+g+")",!0);g<f.W?this.b|=8192:this.g|=64;break;case 12:I(this)&&J(this,this.type+": DRESET("+e+")");this.g=this.j=0;this.b=8320;break;default:I(this)&&J(this,this.type+": UNSUPPORTED("+c+")")}this.L=f.status|(f.ha?128:0)|e<<13|this.j&15;Hi(this);a&&(this.b&=-2,this.b|=128,
|
||||||
this.b&64&&ad(this.f,this.cb))}};h.Ee=function(){return this.w};h.Nf=function(a){this.w=a};h.ye=function(){return this.v};h.Hf=function(a){this.v=a};h.Ae=function(){return this.j};h.Jf=function(a){this.j=a};h.Be=function(){return this.J};h.Kf=function(a){this.J=a};
|
this.b&64&&$c(this.f,this.eb))}};h.Ge=function(){return this.w};h.Pf=function(a){this.w=a};h.Ae=function(){return this.v};h.Jf=function(a){this.v=a};h.Ce=function(){return this.j};h.Lf=function(a){this.j=a};h.De=function(){return this.J};h.Mf=function(a){this.J=a};
|
||||||
var Ci="",Di="?",Ei="??",Ji={},zi=(Ji[65280]=[null,null,R.prototype.Ce,R.prototype.Lf,"RKDS"],Ji[65282]=[null,null,R.prototype.De,R.prototype.Mf,"RKER"],Ji[65284]=[null,null,R.prototype.ze,R.prototype.If,"RKCS"],Ji[65286]=[null,null,R.prototype.Ee,R.prototype.Nf,"RKWC"],Ji[65288]=[null,null,R.prototype.ye,R.prototype.Hf,"RKBA"],Ji[65290]=[null,null,R.prototype.Ae,R.prototype.Jf,"RKDA"],Ji[65294]=[null,null,R.prototype.Be,R.prototype.Kf,"RKDB"],Ji);
|
var Bi="",Ci="?",Di="??",Ii={},zi=(Ii[65280]=[null,null,R.prototype.Ee,R.prototype.Nf,"RKDS"],Ii[65282]=[null,null,R.prototype.Fe,R.prototype.Of,"RKER"],Ii[65284]=[null,null,R.prototype.Be,R.prototype.Kf,"RKCS"],Ii[65286]=[null,null,R.prototype.Ge,R.prototype.Pf,"RKWC"],Ii[65288]=[null,null,R.prototype.Ae,R.prototype.Jf,"RKBA"],Ii[65290]=[null,null,R.prototype.Ce,R.prototype.Lf,"RKDA"],Ii[65294]=[null,null,R.prototype.De,R.prototype.Mf,"RKDB"],Ii);
|
||||||
function qd(a){A.call(this,"RL11",a,0,131072);this.H=Ki(this,a.autoMount);this.G=0;this.g=Array(4);this.J=!Ma("Mobi")&&window&&"FileReader"in window;this.cb=null;this.b=this.C=this.i=this.j=this.w=this.v=0}p(qd,A);function Ki(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=qd.prototype;
|
function pd(a){A.call(this,"RL11",a,0,131072);this.H=Ji(this,a.autoMount);this.G=0;this.g=Array(4);this.J=!Ma("Mobi")&&window&&"FileReader"in window;this.eb=null;this.b=this.C=this.i=this.j=this.w=this.v=0}p(pd,A);function Ji(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=pd.prototype;
|
||||||
h.na=function(a,b,c){var d=this;switch(b){case "listDisks":return this.B[b]=c,c.onchange=function(){var a=d.B.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){y("RL11 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 "descDisk":case "listDrives":return this.B[b]=c,c.onchange=function(){var a=la(c.value,10);null!=a&&Li(d,
|
h.oa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.B[b]=c,c.onchange=function(){var a=d.B.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){y("RL11 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 "descDisk":case "listDrives":return this.B[b]=c,c.onchange=function(){var a=la(c.value,10);null!=a&&Ki(d,
|
||||||
a)},!0;case "loadDisk":return this.B[b]=c,c.onclick=function(){var a=d.B.listDisks;a&&a.options&&Mi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.B[b]=c,c.onclick=function(){var a,b=d.B.listDrives,b=b&&la(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.N("Unable to boot the selected drive"):a.ga?(je(d.f,0,!0),(a=d.Uc(a,0,0,0,512,0))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.J){c.parentNode.removeChild(c);
|
a)},!0;case "loadDisk":return this.B[b]=c,c.onclick=function(){var a=d.B.listDisks;a&&a.options&&Li(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.B[b]=c,c.onclick=function(){var a,b=d.B.listDrives,b=b&&la(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.N("Unable to boot the selected drive"):a.ha?(ie(d.f,0,!0),(a=d.Wc(a,0,0,0,512,0))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.J){c.parentNode.removeChild(c);
|
||||||
break}this.B[b]=c;c.onclick=function(){var a=d.B.listDrives;a&&a.options&&d.g&&((a=d.g[la(a.value,10)||0])?(a=a.ga)?(a=Pa(ai(a),a.ec.replace(".json",".img")),y(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.J)return this.B[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;Mi(d,x(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
break}this.B[b]=c;c.onclick=function(){var a=d.B.listDrives;a&&a.options&&d.g&&((a=d.g[la(a.value,10)||0])?(a=a.ha)?(a=Pa($h(a),a.ec.replace(".json",".img")),y(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.J)return this.B[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;Li(d,x(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||||
h.pa=function(a,b,c,d){this.I=a;this.D=b;this.f=c;this.F=d;if(a=Ki(this,Sd(this.I,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.H[e]=a[e]);Ni(this);this.cb=cd(this.f,112,5,131072);Pb(b,this,Oi);Rb(b,this.reset.bind(this));Pi(this,"None",Qi,!0);this.J&&Pi(this,"Local Disk",Ri);Pi(this,"Remote Disk",Si);Ti(this)||G(this)};
|
h.qa=function(a,b,c,d){this.I=a;this.D=b;this.f=c;this.F=d;if(a=Ji(this,Rd(this.I,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.H[e]=a[e]);Mi(this);this.eb=bd(this.f,112,5,131072);Ob(b,this,Ni);Qb(b,this.reset.bind(this));Oi(this,"None",Pi,!0);this.J&&Oi(this,"Local Disk",Qi);Oi(this,"Remote Disk",Ri);Si(this)||H(this)};
|
||||||
h.qa=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.I.w){for(a=0;a<this.g.length;a++)Ui(this,a,!0);Ti(this,!0)}}else if(!this.restore(a))return!1;if(a=this.B.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Li(this,0)}}return!0};h.za=function(a){return a?this.save():!0};h.reset=function(){Ni(this)};h.save=function(){return(new le(this)).data()};
|
h.ra=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.I.w){for(a=0;a<this.g.length;a++)Ti(this,a,!0);Si(this,!0)}}else if(!this.restore(a))return!1;if(a=this.B.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Ki(this,0)}}return!0};h.Aa=function(a){return a?this.save():!0};h.reset=function(){Mi(this)};h.save=function(){return(new ke(this)).data()};
|
||||||
h.restore=function(a){return Ni(this,a[0])};function Ti(a,b){b||(a.G=0);for(var c in a.H){var d=a.H[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.B.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=x(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.g.length)){!Vi(a,g,f,e,!0)&&b&&G(a,!1);continue}a.N("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.G}
|
h.restore=function(a){return Mi(this,a[0])};function Si(a,b){b||(a.G=0);for(var c in a.H){var d=a.H[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.B.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=x(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.g.length)){!Ui(a,g,f,e,!0)&&b&&H(a,!1);continue}a.N("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.G}
|
||||||
function Mi(a,b,c,d){var e=a.B.listDrives,e=e&&la(e.value,10);if(void 0===e||0>e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if(c==Ri)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Si){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=x(c);a.status("Attempting to load "+c+' as "'+b+'"')}Vi(a,e,b,c,!1,d)}else Ui(a,e)}
|
function Li(a,b,c,d){var e=a.B.listDrives,e=e&&la(e.value,10);if(void 0===e||0>e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if(c==Qi)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Ri){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=x(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ui(a,e,b,c,!1,d)}else Ti(a,e)}
|
||||||
function Vi(a,b,c,d,e,f){var g=-1,k=a.g[b];k.va.toLowerCase()!=d.toLowerCase()&&(g++,Ui(a,b,!0),k.pb?a.N("RL11 busy"):(k.pb=!0,e&&(k.ob=!0,a.G++,H(a)&&I(a,"auto-loading disk: "+c)),k.Ta=!!f,Wh(new Sh(a,k,"preload"),c,d,f,a.Bd)&&g++));return g}
|
function Ui(a,b,c,d,e,f){var g=-1,k=a.g[b];k.wa.toLowerCase()!=d.toLowerCase()&&(g++,Ti(a,b,!0),k.qb?a.N("RL11 busy"):(k.qb=!0,e&&(k.pb=!0,a.G++,I(a)&&J(a,"auto-loading disk: "+c)),k.Ua=!!f,Vh(new Rh(a,k,"preload"),c,d,f,a.Dd)&&g++));return g}
|
||||||
h.Bd=function(a,b,c,d,e){a.pb=!1;b&&(b.W>a.W||b.ca>a.ca)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.qb)),b=null);b?(a.ga=b,a.Ma=c,a.va=d,this.N('Loaded disk "'+c+'" in drive '+("RL"+a.qb),a.ob||e),this.I&&be(this.I)):a.Ta=!1;a.ob&&(a.ob=!1,--this.G||G(this));Li(this,a.qb)};
|
h.Dd=function(a,b,c,d,e){a.qb=!1;b&&(b.W>a.W||b.ca>a.ca)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.rb)),b=null);b?(a.ha=b,a.Ma=c,a.wa=d,this.N('Loaded disk "'+c+'" in drive '+("RL"+a.rb),a.pb||e),this.I&&ae(this.I)):a.Ua=!1;a.pb&&(a.pb=!1,--this.G||H(this));Ki(this,a.rb)};
|
||||||
function Pi(a,b,c,d){if((a=a.B.listDisks)&&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)}}
|
function Oi(a,b,c,d){if((a=a.B.listDisks)&&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)}}
|
||||||
function Li(a,b){if(0<=b&&b<a.g.length){var c=a.g[b],d=a.B.listDisks;a=a.B.listDrives;if(d&&a&&d.options&&a.options&&(a=la(a.value,10),c=c.Ta?Ri:c.va,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Ui(a,b,c){var d=a.g[b];if(d.ga||!1===c)d.Ma="",d.va="",d.ga=null,d.Ta=!1,c||(a.N("Drive RL"+b+" unloaded",c),Li(a,b))}
|
function Ki(a,b){if(0<=b&&b<a.g.length){var c=a.g[b],d=a.B.listDisks;a=a.B.listDrives;if(d&&a&&d.options&&a.options&&(a=la(a.value,10),c=c.Ua?Qi:c.wa,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Ti(a,b,c){var d=a.g[b];if(d.ha||!1===c)d.Ma="",d.wa="",d.ha=null,d.Ua=!1,c||(a.N("Drive RL"+b+" unloaded",c),Ki(a,b))}
|
||||||
function Ni(a,b){var c=0;b||(b=[]);a.b=b[c++]||129;a.C=b[c++]||0;a.i=b[c++]||0;a.j=b[c++]||0;a.w=b[c++]||0;a.v=b[c]||0;for(b=0;b<a.g.length;b++){var d=a.g[b];void 0===d&&(d=a.g[b]={});c=a;d.qb=b;d.name=c.jb;d.pb=d.Ta=!1;d.W=512;d.ca=2;d.Z=40;d.ma=256;d.ac=!0;d.Id=0;d.Gd=0;d.xc=1;d.ad=d.Z;d.Ac=d.ma;d.Nd=0;d.ff=null;d.ga||(d.va="");d.status=29}return!0}
|
function Mi(a,b){var c=0;b||(b=[]);a.b=b[c++]||129;a.C=b[c++]||0;a.i=b[c++]||0;a.j=b[c++]||0;a.w=b[c++]||0;a.v=b[c]||0;for(b=0;b<a.g.length;b++){var d=a.g[b];void 0===d&&(d=a.g[b]={});c=a;d.rb=b;d.name=c.kb;d.qb=d.Ua=!1;d.W=512;d.ca=2;d.aa=40;d.na=256;d.ac=!0;d.Kd=0;d.Id=0;d.yc=1;d.bd=d.aa;d.Bc=d.na;d.Pd=0;d.hf=null;d.ha||(d.wa="");d.status=29}return!0}
|
||||||
h.Uc=function(a,b,c,d,e,f,g){var k=0;a=a.ga;var l=null,m;a||(k=5120,e=0);for(;e;){if(!l){l=a.seek(b,c,d+1);if(!l){k=5120;break}m=0}var n,r;if(0>(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}jc(this.D,ye(this.f,f),n|r<<8);if(Zc(this.D)){k=8192;break}f+=2;e--;if(m>=a.ma&&(l=null,++d>=a.Z&&(d=0,++c>=a.ca&&(c=0,++b>=a.W)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};
|
h.Wc=function(a,b,c,d,e,f,g){var k=0;a=a.ha;var l=null,m;a||(k=5120,e=0);for(;e;){if(!l){l=a.seek(b,c,d+1);if(!l){k=5120;break}m=0}var n,r;if(0>(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}ic(this.D,xe(this.f,f),n|r<<8);if(Yc(this.D)){k=8192;break}f+=2;e--;if(m>=a.na&&(l=null,++d>=a.aa&&(d=0,++c>=a.ca&&(c=0,++b>=a.W)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};
|
||||||
h.Cd=function(a,b,c,d,e,f,g){var k=0;a=a.ga;var l=null,m;a||(k=5120,e=0);for(;e;){var n=lc(this.D,ye(this.f,f));if(Zc(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.ma&&(l=null,++d>=a.Z&&(d=0,++c>=a.ca&&(c=0,++b>=a.W)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};
|
h.Ed=function(a,b,c,d,e,f,g){var k=0;a=a.ha;var l=null,m;a||(k=5120,e=0);for(;e;){var n=kc(this.D,xe(this.f,f));if(Yc(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.na&&(l=null,++d>=a.aa&&(d=0,++c>=a.ca&&(c=0,++b>=a.W)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};
|
||||||
h.Ad=function(a,b,c,d,e,f){this.C=f&65535;this.b=this.b&-49|f>>12&48;this.v=f>>16&63;this.j=this.i=b<<7|(c?64:0)|d&63;this.w=65536-e&65535;a&&(this.b=this.b|a|32768);return!0};h.He=function(){return this.b&65535};
|
h.Cd=function(a,b,c,d,e,f){this.C=f&65535;this.b=this.b&-49|f>>12&48;this.v=f>>16&63;this.j=this.i=b<<7|(c?64:0)|d&63;this.w=65536-e&65535;a&&(this.b=this.b|a|32768);return!0};h.Je=function(){return this.b&65535};
|
||||||
h.Qf=function(a){this.b=this.b&-1023|a&1022;this.v=this.v&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c="",d=this.g[(this.b&768)>>8],e=d.ga,f,g,k;this.b&=-2;switch(this.b&14){case 4:this.w&8&&(this.b&=63);this.w=d.status|this.j&64|(e&&512==e.W?128:0);break;case 6:1==(this.i&3)&&(b=this.i&65408,c=(this.i&16)<<2,this.j=this.i&4?this.j+b:this.j-b,this.i=this.j=this.j&65408|c);break;case 8:this.w=this.j;break;case 12:c="READ",b=this.Uc;case 10:c||(c="WRITE"),b||(b=this.Cd),f=this.i>>7,g=this.i&64?1:0,k=
|
h.Sf=function(a){this.b=this.b&-1023|a&1022;this.v=this.v&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c="",d=this.g[(this.b&768)>>8],e=d.ha,f,g,k;this.b&=-2;switch(this.b&14){case 4:this.w&8&&(this.b&=63);this.w=d.status|this.j&64|(e&&512==e.W?128:0);break;case 6:1==(this.i&3)&&(b=this.i&65408,c=(this.i&16)<<2,this.j=this.i&4?this.j+b:this.j-b,this.i=this.j=this.j&65408|c);break;case 8:this.w=this.j;break;case 12:c="READ",b=this.Wc;case 10:c||(c="WRITE"),b||(b=this.Ed),f=this.i>>7,g=this.i&64?1:0,k=
|
||||||
this.i&63,!e||f>=e.W||k>=e.Z?this.b|=37888:(a=65536-this.w&65535,e=(this.v&63)<<16|this.C,H(this)&&I(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+q(e)+"--"+q(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.Ad.bind(this)))}a&&(this.b|=129,this.b&64&&ad(this.f,this.cb))}};h.Fe=function(){return this.C};h.Of=function(a){this.C=a&65534};h.Ie=function(){return this.i};h.Rf=function(a){this.i=a};h.Je=function(){return this.w};h.Sf=function(a){this.w=a};h.Ge=function(){return this.v};
|
this.i&63,!e||f>=e.W||k>=e.aa?this.b|=37888:(a=65536-this.w&65535,e=(this.v&63)<<16|this.C,I(this)&&J(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+q(e)+"--"+q(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.Cd.bind(this)))}a&&(this.b|=129,this.b&64&&$c(this.f,this.eb))}};h.He=function(){return this.C};h.Qf=function(a){this.C=a&65534};h.Ke=function(){return this.i};h.Tf=function(a){this.i=a};h.Le=function(){return this.w};h.Uf=function(a){this.w=a};h.Ie=function(){return this.v};
|
||||||
h.Pf=function(a){this.v=a&63;this.b=this.b&-49|(this.v&3)<<4};var Qi="",Ri="?",Si="??",Wi={},Oi=(Wi[63744]=[null,null,qd.prototype.He,qd.prototype.Qf,"RLCS"],Wi[63746]=[null,null,qd.prototype.Fe,qd.prototype.Of,"RLBA"],Wi[63748]=[null,null,qd.prototype.Ie,qd.prototype.Rf,"RLDA"],Wi[63750]=[null,null,qd.prototype.Je,qd.prototype.Sf,"RLMP"],Wi[63752]=[null,null,qd.prototype.Ge,qd.prototype.Pf,"RLBE"],Wi);
|
h.Rf=function(a){this.v=a&63;this.b=this.b&-49|(this.v&3)<<4};var Pi="",Qi="?",Ri="??",Vi={},Ni=(Vi[63744]=[null,null,pd.prototype.Je,pd.prototype.Sf,"RLCS"],Vi[63746]=[null,null,pd.prototype.He,pd.prototype.Qf,"RLBA"],Vi[63748]=[null,null,pd.prototype.Ke,pd.prototype.Tf,"RLDA"],Vi[63750]=[null,null,pd.prototype.Le,pd.prototype.Uf,"RLMP"],Vi[63752]=[null,null,pd.prototype.Ie,pd.prototype.Rf,"RLBE"],Vi);
|
||||||
function Xi(a){A.call(this,"Debugger",a);this.ua=a.base||16;this.aa=!1;this.w=0;this.P=!1;this.v=-1;this.j=[];this.T={}}p(Xi,A);Xi.prototype.fd=function(){return-1};Xi.prototype.gd=function(){};
|
function Wi(a){A.call(this,"Debugger",a);this.va=a.base||16;this.da=!1;this.w=0;this.P=!1;this.v=-1;this.j=[];this.T={}}p(Wi,A);Wi.prototype.hd=function(){return-1};Wi.prototype.jd=function(){};
|
||||||
function Yi(a,b,c,d){if(c)if(b){0>a.v&&a.j.length&&(a.v=0);if(0>a.v||b!=a.j[a.v])a.j.splice(0,0,b),a.v=0;a.v--}else a.P?b="end":b=a.j[a.v+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ua(b.substring(c,f))),c=f+1}}return a}
|
function Xi(a,b,c,d){if(c)if(b){0>a.v&&a.j.length&&(a.v=0);if(0>a.v||b!=a.j[a.v])a.j.splice(0,0,b),a.v=0;a.v--}else a.P?b="end":b=a.j[a.v+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ua(b.substring(c,f))),c=f+1}}return a}
|
||||||
function Zi(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 Yi(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}
|
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 $i(a,b,c){var d;if(b){b=aj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],r=n.length,n=ua(n);if(!n){f=!0;break}n=bj(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}k.push(n);if(e==m.length)break;var n=m[e++],u=n.length;l.length&&cj[n]<cj[l[l.length-1]]&&Zi(k,l,1);l.push(n);b=b.substr(r+u)}Zi(k,l)&&1==k.length||(f=!0);f?c&&a.u("error parsing '"+g+"' at character "+(g.length-b.length)):(d=k.pop(),c&&dj(a,null,
|
function Zi(a,b,c){var d;if(b){b=$i(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],r=n.length,n=ua(n);if(!n){f=!0;break}n=aj(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}k.push(n);if(e==m.length)break;var n=m[e++],u=n.length;l.length&&bj[n]<bj[l[l.length-1]]&&Yi(k,l,1);l.push(n);b=b.substr(r+u)}Yi(k,l)&&1==k.length||(f=!0);f?c&&a.u("error parsing '"+g+"' at character "+(g.length-b.length)):(d=k.pop(),c&&cj(a,null,
|
||||||
d))}return d}function aj(a,b){for(var c,d=a.aa?"(":"{",e=a.aa?")":"}",f=new RegExp(a.aa?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=$i(a,c[1]);b=b.replace(d+c[1]+e,null!=g?O(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a}
|
d))}return d}function $i(a,b){for(var c,d=a.da?"(":"{",e=a.da?")":"}",f=new RegExp(a.da?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Zi(a,c[1]);b=b.replace(d+c[1]+e,null!=g?O(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a}
|
||||||
function bj(a,b,c,d){var e;null!=b?(e=a.fd(b),0<=e?e=a.gd(e):(e=a.T[b],null==e&&(e=la(b,a.ua))),null!=e||d||a.u("invalid "+(c?c:"value")+": "+b)):d||a.u("missing "+(c||"value"));return e}function dj(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=4,g="";if(!f||4<f)f=4;for(var k=0;k<f;k++)g&&(g=","+g),g=ma(d&255,8)+g,d>>=8;d=v(c,0,!0)+" "+c+". "+q(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.u((null!=b?b+": ":"")+d);return e}
|
function aj(a,b,c,d){var e;null!=b?(e=a.hd(b),0<=e?e=a.jd(e):(e=a.T[b],null==e&&(e=la(b,a.va))),null!=e||d||a.u("invalid "+(c?c:"value")+": "+b)):d||a.u("missing "+(c||"value"));return e}function cj(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=4,g="";if(!f||4<f)f=4;for(var k=0;k<f;k++)g&&(g=","+g),g=ma(d&255,8)+g,d>>=8;d=v(c,0,!0)+" "+c+". "+q(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.u((null!=b?b+": ":"")+d);return e}
|
||||||
function ej(a,b){if(b)return dj(a,b,a.T[b]);var c=0;for(b in a.T)dj(a,b,a.T[b]),c++;return 0<c}function O(a,b,c,d){switch(a.ua){case 8:a=q(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=v(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}var cj={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
|
function dj(a,b){if(b)return cj(a,b,a.T[b]);var c=0;for(b in a.T)cj(a,b,a.T[b]),c++;return 0<c}function O(a,b,c,d){switch(a.va){case 8:a=q(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=v(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}var bj={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
|
||||||
function fj(a){Xi.call(this,a);this.Ba=!1;this.aa=!0;this.H=V();this.Aa=V();this.O=V();this.C=[];this.g=this.L=this.G=[];gj(this);this.R=this.Y=0;this.i=[];this.oa=void 0;hj(this);this.F=this;this.ka={};this.fa=this.ya=0;this.S=null;this.M=[];ij(this,a.messages);this.ta=a.commands;this.Ea=jj;this.xa=[];this.J=0;this.Fa=this.sa=null;this.w=this.Da=this.Ca=this.X=this.la=0;this.b=this.V=null;var b=this;window?void 0===window[B]&&(window[B]=function(a){return Xd(b,a)}):void 0===global[B]&&(global[B]=
|
function ej(a){Wi.call(this,a);this.Ba=!1;this.da=!0;this.H=W();this.za=W();this.O=W();this.C=[];this.g=this.L=this.G=[];fj(this);this.R=this.Z=0;this.i=[];this.pa=void 0;gj(this);this.F=this;this.la={};this.ga=this.cd=0;this.S=null;this.M=[];hj(this,a.messages);this.ua=a.commands;this.Ea=ij;this.ya=[];this.J=0;this.Fa=this.ta=null;this.w=this.Da=this.Ca=this.X=this.ma=0;this.b=this.V=null;var b=this;window?void 0===window[D]&&(window[D]=function(a){return Wd(b,a)}):void 0===global[D]&&(global[D]=
|
||||||
function(a){return Xd(b,a)})}p(fj,Xi);function kj(a){a=a&&a.K;null==a&&(a=-1);return a}function V(a,b,c){return{K:a||null,Ha:b||!1,Pa:!1,ua:c}}h=fj.prototype;h.Ec=function(a,b){a.K=b;a.Pa=!1;a.ua=void 0;return a};function lj(a){return[a.K,a.Ha,a.ua,a.Pa,a.dc]}function mj(a,b){var c=V(b[0],b[1],b[2]);c.Pa=b[3];b[4]&&(c.Zc=Yi(a,c.dc=b[4]));return c}
|
function(a){return Wd(b,a)})}p(ej,Wi);function jj(a){a=a&&a.K;null==a&&(a=-1);return a}function W(a,b,c){return{K:a||null,Ha:b||!1,Pa:!1,va:c}}h=ej.prototype;h.Fc=function(a,b){a.K=b;a.Pa=!1;a.va=void 0;return a};function kj(a){return[a.K,a.Ha,a.va,a.Pa,a.dc]}function lj(a,b){var c=W(b[0],b[1],b[2]);c.Pa=b[3];b[4]&&(c.$c=Xi(a,c.dc=b[4]));return c}
|
||||||
h.pa=function(a,b,c,d){this.D=b;this.I=a;this.f=c;this.b=a.i;(a=Sd(a,"messages"))&&ij(this,a);1145>this.f.xa&&(this.xa=nj);ed(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=kj(oj(d,c));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.u("blockid physical blockaddr used size type");d.u("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.u("..."):(c=n.type,m=Qc[c],n&&d.u(v(n.id,8)+" %"+v(e<<d.D.g,8)+
|
h.qa=function(a,b,c,d){this.D=b;this.I=a;this.f=c;this.b=a.i;(a=Rd(a,"messages"))&&hj(this,a);1145>this.f.ya&&(this.ya=mj);dd(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=jj(nj(d,c));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.u("blockid physical blockaddr used size type");d.u("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.u("..."):(c=n.type,m=Pc[c],n&&d.u(v(n.id,8)+" %"+v(e<<d.D.g,8)+
|
||||||
" %"+v(n.K,8)+" "+w(n.Gb)+" "+w(n.size)+" "+m),c!=sd&&(c=-1),m=0);a+=d.D.j;e++}}});G(this)};
|
" %"+v(n.K,8)+" "+w(n.Hb)+" "+w(n.size)+" "+m),c!=rd&&(c=-1),m=0);a+=d.D.j;e++}}});H(this)};
|
||||||
h.na=function(a,b,c){var d=this;switch(b){case "debugInput":return this.V=this.B[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Xd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.v<d.j.length-1&&(b=d.j[++d.v])):40==a.keyCode&&(0<d.v?b=d.j[--d.v]:(b="",d.v=-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.B[b]=c,Ra(c,function(){if(d.V){var a=d.V.value;d.V.value=
|
h.oa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.V=this.B[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Wd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.v<d.j.length-1&&(b=d.j[++d.v])):40==a.keyCode&&(0<d.v?b=d.j[--d.v]:(b="",d.v=-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.B[b]=c,Ra(c,function(){if(d.V){var a=d.V.value;d.V.value=
|
||||||
"";Xd(d,a,!0);return!0}return!1}),!0;case "step":return this.B[b]=c,Ra(c,function(a){var b=!1;ub(d,!0)||(vb(d,!0),b=dc(d,a?1:0,null),vb(d,!1));return b}),!0}return!1};function Wd(a){if(a.V){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.V.focus();window&&window.scrollTo(b,c)}}h.Lc=function(a,b){var c=255,d=kj(a);-1!==d&&(a.Ha||65535<d?(c=this.D,d=ye(this.f,d),c.G=!1,c.ha++,d=Sc(c,d).j(d&c.i,d),c.ha--):(c=this.f,c.la++,d=c.D.Ic(kc(c,d,3)),c.la--),c=d,b&&pj(a,b));return c};
|
"";Wd(d,a,!0);return!0}return!1}),!0;case "step":return this.B[b]=c,Ra(c,function(a){var b=!1;tb(d,!0)||(ub(d,!0),b=cc(d,a?1:0,null),ub(d,!1));return b}),!0}return!1};function Vd(a){if(a.V){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.V.focus();window&&window.scrollTo(b,c)}}h.Mc=function(a,b){var c=255,d=jj(a);-1!==d&&(a.Ha||65535<d?(c=this.D,d=xe(this.f,d),c.G=!1,c.ia++,d=Rc(c,d).j(d&c.i,d),c.ia--):(c=this.f,c.ma++,d=c.D.Jc(jc(c,d,3)),c.ma--),c=d,b&&oj(a,b));return c};
|
||||||
h.Na=function(a,b){var c=65535,d=kj(a);-1!==d&&(c=a.Ha||65535<d?lc(this.D,ye(this.f,d)):mc(this.f,d),b&&pj(a,b));return c};h.Mc=function(a,b,c){var d=kj(a);if(-1!==d){if(a.Ha||65535<d)Tc(this.D,ye(this.f,d),b);else{var e=this.f;e.la++;e.D.Jc(kc(e,d,5),b);e.la--}c&&pj(a,c);L(this.I,-1)}};h.wd=function(a,b,c){var d=kj(a);if(-1!==d){if(a.Ha||65535<d)jc(this.D,ye(this.f,d),b);else{var e=this.f;e.la++;e.D.Kb(kc(e,d,4),b);e.la--}c&&pj(a,c);L(this.I,-1)}};
|
h.Na=function(a,b){var c=65535,d=jj(a);-1!==d&&(c=a.Ha||65535<d?kc(this.D,xe(this.f,d)):lc(this.f,d),b&&oj(a,b));return c};h.Nc=function(a,b,c){var d=jj(a);if(-1!==d){if(a.Ha||65535<d)Sc(this.D,xe(this.f,d),b);else{var e=this.f;e.ma++;e.D.Kc(jc(e,d,5),b);e.ma--}c&&oj(a,c);L(this.I,-1)}};h.yd=function(a,b,c){var d=jj(a);if(-1!==d){if(a.Ha||65535<d)ic(this.D,xe(this.f,d),b);else{var e=this.f;e.ma++;e.D.Lb(jc(e,d,4),b);e.ma--}c&&oj(a,c);L(this.I,-1)}};
|
||||||
function oj(a,b,c){var d;c=(c?a.H:a.Aa).K;var e,f;if(void 0!==b){b=aj(a,b);"%"==b.charAt(0)&&(e=!0,b=b.substr(1));d=b;var g,k;a:{c=a.D;var l;l=d.toUpperCase();for(k in c.Ja){var m=+k;if(c.Ja[m][4]==l){k=c.C+m;break a}}k=null}if(null==k&&d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c<a.C.length;c++)if(l=a.C[c].da[d],null!=l){k=l.o;break}null!=k&&(g=V(k));if(d=g)return d;0<=b.indexOf("0x")?f=16:0<=b.indexOf("0o")?f=8:0<=b.indexOf(".")&&(f=10);c=$i(a,b,void 0)}null!=c&&(d=V(c,e,f));return d}
|
function nj(a,b,c){var d;c=(c?a.H:a.za).K;var e,f;if(void 0!==b){b=$i(a,b);"%"==b.charAt(0)&&(e=!0,b=b.substr(1));d=b;var g,k;a:{c=a.D;var l;l=d.toUpperCase();for(k in c.Ja){var m=+k;if(c.Ja[m][4]==l){k=c.C+m;break a}}k=null}if(null==k&&d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c<a.C.length;c++)if(l=a.C[c].ea[d],null!=l){k=l.o;break}null!=k&&(g=W(k));if(d=g)return d;0<=b.indexOf("0x")?f=16:0<=b.indexOf("0o")?f=8:0<=b.indexOf(".")&&(f=10);c=Zi(a,b,void 0)}null!=c&&(d=W(c,e,f));return d}
|
||||||
function qj(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Zc=Yi(a,b.dc=c[2]))}function pj(a,b){null!=a.K&&(a.K+=b||1)}function rj(a,b){return(b.Ha?"%":"")+O(a,b.K)}
|
function pj(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.$c=Xi(a,b.dc=c[2]))}function oj(a,b){null!=a.K&&(a.K+=b||1)}function qj(a,b){return(b.Ha?"%":"")+O(a,b.K)}
|
||||||
function ij(a,b){a.F=a;a.fa=a.ya=536870912;a.S=null;a.M=[];b=Yi(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Eb){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.fa|=Eb[c],a.u(c+" messages enabled"))}}function ed(a,b,c){for(var d in Eb)if(b==Eb[d]){a.ka[d]=c;break}}
|
function hj(a,b){a.F=a;a.ga=a.cd=536870912;a.S=null;a.M=[];b=Xi(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Db){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.ga|=Db[c],a.u(c+" messages enabled"))}}function dd(a,b,c){for(var d in Db)if(b==Db[d]){a.la[d]=c;break}}
|
||||||
h.fd=function(a){a=a.toUpperCase();var b=sj[a];null==b&&(b=-1,"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b))&&(b=-1);return b};function tj(a){return 6>a?"R"+a:6==a?"SP":"PC"}
|
h.hd=function(a){a=a.toUpperCase();var b=rj[a];null==b&&(b=-1,"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b))&&(b=-1);return b};function sj(a){return 6>a?"R"+a:6==a?"SP":"PC"}
|
||||||
h.gd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.oa[a-8];else if(20>a)b=this.f.X[a-16];else{var c=this.f,d=this.b;switch(a){case uj:b=nd(this.f);break;case vj:b=c.ab;break;case wj:b=c.R;break;case xj:b=c.ya&65280;break;case yj:b=hd(c);break;case zj:b=jd(c);break;case Aj:b=kd(c);break;case Bj:b=c.T;break;case Cj:d&&(b=d.ra);break;case Dj:d&&(b=d.sb);break;case Ej:d&&qc(d)&&(b=d.Ua)}}return b};
|
h.jd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.X[a-16];else{var c=this.f,d=this.b;switch(a){case tj:b=md(this.f);break;case uj:b=c.bb;break;case vj:b=c.R;break;case wj:b=c.za&65280;break;case xj:b=gd(c);break;case yj:b=id(c);break;case zj:b=jd(c);break;case Aj:b=c.T;break;case Bj:d&&(b=d.sa);break;case Cj:d&&(b=d.tb);break;case Dj:d&&pc(d)&&(b=d.Va)}}return b};
|
||||||
h.message=function(a,b){b&&(a+=" @"+rj(this,V(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.fa&1073741824)this.M.push(a);else{var c;if(this.fa&-2147483648&&this.f&&(c=this.f.A.U)||ub(this,!0))Fj(this),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,ce(a),a.mb=0,a.I&&L(a.I,void 0))}};
|
h.message=function(a,b){b&&(a+=" @"+qj(this,W(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.ga&1073741824)this.M.push(a);else{var c;if(this.ga&-2147483648&&this.f&&(c=this.f.A.U)||tb(this,!0))this.Y(),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,be(a),a.hb=0,a.I&&L(a.I,void 0))}};
|
||||||
function hj(a){var b;if(!gf(a))a.i&&a.i.length&&a.u("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Gj);for(b=0;b<a.i.length;b++)a.i[b]=V();a.R=0;a.u("instruction history buffer allocated")}}function Hj(a,b,c){if(!Ij(a,c))return!1;cc(a.f,b);return!0}
|
function gj(a){var b;if(!ff(a))a.i&&a.i.length&&a.u("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Ej);for(b=0;b<a.i.length;b++)a.i[b]=W();a.R=0;a.u("instruction history buffer allocated")}}function Fj(a,b,c){if(!Gj(a,c))return!1;bc(a.f,b);return!0}
|
||||||
function dc(a,b,c,d){if(!Ij(a))return!1;null===c&&(c=!a.sa||"tr"==a.sa);a.w=0;b||gf(a)&&hf(a,a.f.g[7],0);try{b=de(a.f,b);var e=a.f.$b(b);0<e&&(ec(a.f,e),a.w+=e,fc(a.f,e,!0),gc(a.f,e),a.X++)}catch(f){"number"!=typeof f&&(a.w=0,rb(a.f,f.stack||f.message))}!1!==d&&(a.b&&a.b.stop(),L(a.I,-1));Vd(a,c||!1);return 0<a.w}function Fj(a,b){a.f&&J(a.f,b)}
|
function cc(a,b,c,d){if(!Gj(a))return!1;null===c&&(c=!a.ta||"tr"==a.ta);a.w=0;b||ff(a)&&gf(a,a.f.g[7],0);try{b=ce(a.f,b);var e=a.f.$b(b);0<e&&(dc(a.f,e),a.w+=e,ec(a.f,e,!0),fc(a.f,e),a.X++)}catch(f){"number"!=typeof f&&(a.w=0,qb(a.f,f.stack||f.message))}!1!==d&&(a.b&&a.b.stop(),L(a.I,-1));Ud(a,c||!1);return 0<a.w}h.Y=function(a){this.f&&this.f.Y(a)};
|
||||||
function Vd(a,b){if(a.Ba){void 0===b&&(b=!0);var c;c=a.f;if(c=c.i&128?c.Yc|c.Xc<<8:0){var d=c>>8;a.u("trapped to "+O(a,c&255,1)+" ("+(0>d?Cb[-d]:O(a,d))+")")}a.H=V(a.f.g[7]);b&&1!=a.J?Jj(a):Kj(a)}}function Ij(a,b){var c;(c=!a.f||!tb(a.f))||(c=a.f,c.A.ea?c=!0:(c.u(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.U?(b||a.u("cpu busy or unavailable, command ignored"),!1):!sb(a.f)}h.qa=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
|
function Ud(a,b){if(a.Ba){void 0===b&&(b=!0);var c;c=a.f;if(c=c.i&128?c.Zc|c.Yc<<8:0){var d=c>>8;a.u("trapped to "+O(a,c&255,1)+" ("+(0>d?Bb[-d]:O(a,d))+")")}a.H=W(a.f.g[7]);b&&1!=a.J?Hj(a):Ij(a)}}function Gj(a,b){var c;(c=!a.f||!sb(a.f))||(c=a.f,c.A.fa?c=!0:(c.u(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.U?(b||a.u("cpu busy or unavailable, command ignored"),!1):!rb(a.f)}h.ra=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
|
||||||
h.za=function(a,b){b&&this.u(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){hj(this);this.X=0;this.S=null;this.w=0;this.H=V(this.f.g[7]);this.A.U=!1;Lj(this);a||Vd(this)};h.save=function(){var a=new le(this);a.set(0,lj(this.H));a.set(1,lj(this.O));a.set(2,[this.j,this.P,this.fa]);a.set(3,this.C);return a.data()};
|
h.Aa=function(a,b){b&&this.u(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){gj(this);this.X=0;this.S=null;this.w=0;this.H=W(this.f.g[7]);this.A.U=!1;Jj(this);a||Ud(this)};h.save=function(){var a=new ke(this);a.set(0,kj(this.H));a.set(1,kj(this.O));a.set(2,[this.j,this.P,this.ga]);a.set(3,this.C);return a.data()};
|
||||||
h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=mj(this,a[b++]),this.O=mj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.fa|=a[b][2]);a[3]&&(this.C=a[3]);return!0};h.start=function(a,b){this.J||this.u("running");this.A.U=!0;this.Ca=a;this.Da=b};
|
h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=lj(this,a[b++]),this.O=lj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.ga|=a[b][2]);a[3]&&(this.C=a[3]);return!0};h.start=function(a,b){this.J||this.u("running");this.A.U=!0;this.Ca=a;this.Da=b};
|
||||||
h.stop=function(a,b){if(this.A.U){this.A.U=!1;this.w=b-this.Da;if(!this.J){b="stopped";if(this.w){a-=this.Ca;var c=0<a?Math.round(1E3*this.w/a):0;b+=" (";gf(this)&&(b+=this.X+" instructions, ",this.X=0);b+=this.w+" cycles, "+a+" ms, "+c+" hz)"}else H(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.u(b)}Vd(this,!0);Wd(this);Lj(this,this.f.g[7]);this.S=null}};function gf(a){return 1<a.g.length||!!a.Y}
|
h.stop=function(a,b){if(this.A.U){this.A.U=!1;this.w=b-this.Da;if(!this.J){b="stopped";if(this.w){a-=this.Ca;var c=0<a?Math.round(1E3*this.w/a):0;b+=" (";ff(this)&&(b+=this.X+" instructions, ",this.X=0);b+=this.w+" cycles, "+a+" ms, "+c+" hz)"}else I(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.u(b)}Ud(this,!0);Vd(this);Jj(this,this.f.g[7]);this.S=null}};function ff(a){return 1<a.g.length||!!a.Z}
|
||||||
function hf(a,b,c){var d=-1;c||(d=mc(a.f,b))||(a.f.P&65535)!=b||(b=qe(a.f,2));if(0<c&&(a.Y&&!--a.Y||Mj(a,b,1,a.g)))return!0;0<=c&&a.i.length&&(a.X++,0>d&&(d=mc(a.f,b)),65535!=(d&65535)&&(a.Ec(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function ng(a){var b=a.f;if(b.A.U)throw ke(b,a.f.P&65535),Fj(a),-1;return!1}function Md(a,b,c){Mj(a,b,c||1,a.L)&&Fj(a,!0)}function Nd(a,b,c){Mj(a,b,c||1,a.G)&&Fj(a,!0)}
|
function gf(a,b,c){var d=-1;c||(d=lc(a.f,b))||(a.f.P&65535)!=b||(b=pe(a.f,2));if(0<c&&(a.Z&&!--a.Z||Kj(a,b,1,a.g)))return!0;0<=c&&a.i.length&&(a.X++,0>d&&(d=lc(a.f,b)),65535!=(d&65535)&&(a.Fc(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function mg(a){var b=a.f;if(b.A.U)throw je(b,a.f.P&65535),a.Y(),-1;return!1}function Ld(a,b,c){Kj(a,b,c||1,a.L)&&a.Y(!0)}function Md(a,b,c){Kj(a,b,c||1,a.G)&&a.Y(!0)}
|
||||||
function gj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b<a.L.length;b++)c=a.L[b],d=kj(c),c.Ha?(c=a.D,Ld(c.b[d>>>c.g],!1)):Be(a.f,!1);a.L=["br"];if(a.G)for(b=1;b<a.G.length;b++)c=a.G[b],d=kj(c),c.Ha?(c=a.D,Ld(c.b[d>>>c.g],!0)):Be(a.f,!0);a.G=["bw"];a.la=0}
|
function fj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b<a.L.length;b++)c=a.L[b],d=jj(c),c.Ha?(c=a.D,Kd(c.b[d>>>c.g],!1)):Ae(a.f,!1);a.L=["br"];if(a.G)for(b=1;b<a.G.length;b++)c=a.G[b],d=jj(c),c.Ha?(c=a.D,Kd(c.b[d>>>c.g],!0)):Ae(a.f,!0);a.G=["bw"];a.ma=0}
|
||||||
h.nb=function(a,b,c){var d=!0;c||Nj(this,a,b,!1,!0);if(a!=this.g){var e=kj(b);if(-1===e)this.u("invalid address: "+rj(this,b)),d=!1;else{var f=a==this.G;65535<e&&(b.Ha=!0);if(b.Ha){var g=this.D;g.b[e>>>g.g].nb(e&g.i,f)}else e=this.f,(f?e.Ub++:e.Tb++)||ie(e)}}d&&(a.push(b),c?b.Pa=!0:(Oj(this,a,a.length-1,"set"),hj(this)));return d};
|
h.ob=function(a,b,c){var d=!0;c||Lj(this,a,b,!1,!0);if(a!=this.g){var e=jj(b);if(-1===e)this.u("invalid address: "+qj(this,b)),d=!1;else{var f=a==this.G;65535<e&&(b.Ha=!0);if(b.Ha){var g=this.D;g.b[e>>>g.g].ob(e&g.i,f)}else e=this.f,(f?e.Vb++:e.Tb++)||he(e)}}d&&(a.push(b),c?b.Pa=!0:(Mj(this,a,a.length-1,"set"),gj(this)));return d};
|
||||||
function Nj(a,b,c,d,e){var f=!1;c=kj(c);for(var g=1;g<b.length;g++){var k=b[g];if(c==kj(k)&&(!d||k.Pa)){f=!0;k.Pa||e||Oj(a,b,g,"cleared");b.splice(g,1);b!=a.g&&(b=b==a.G,k.Ha?(d=a.D,Ld(d.b[c>>>d.g],b)):Be(a.f,b));k.Pa||hj(a);break}}return f}function Pj(a,b){for(var c=1;c<b.length;c++)Oj(a,b,c);return b.length-1}function Oj(a,b,c,d){c=b[c];a.u(b[0]+" "+rj(a,c)+(d?" "+d:c.dc?' "'+c.dc+'"':""))}
|
function Lj(a,b,c,d,e){var f=!1;c=jj(c);for(var g=1;g<b.length;g++){var k=b[g];if(c==jj(k)&&(!d||k.Pa)){f=!0;k.Pa||e||Mj(a,b,g,"cleared");b.splice(g,1);b!=a.g&&(b=b==a.G,k.Ha?(d=a.D,Kd(d.b[c>>>d.g],b)):Ae(a.f,b));k.Pa||gj(a);break}}return f}function Nj(a,b){for(var c=1;c<b.length;c++)Mj(a,b,c);return b.length-1}function Mj(a,b,c,d){c=b[c];a.u(b[0]+" "+qj(a,c)+(d?" "+d:c.dc?' "'+c.dc+'"':""))}
|
||||||
function Lj(a,b){if(void 0!==b)Mj(a,b,1,a.g,!0),a.J=0;else for(b=1;b<a.g.length;b++){var c=a.g[b];if(c.Pa){if(!Nj(a,a.g,c,!0))break;b=0}}}
|
function Jj(a,b){if(void 0!==b)Kj(a,b,1,a.g,!0),a.J=0;else for(b=1;b<a.g.length;b++){var c=a.g[b];if(c.Pa){if(!Lj(a,a.g,c,!0))break;b=0}}}
|
||||||
function Mj(a,b,c,d,e){var f=!1;if(!a.la++)for(var g=1;!f&&g<d.length;g++){var k=d[g];if(!e||k.Pa)for(var l=kj(k)&(d==a.g?65535:-1),m=0;m<c;m++)if(b+m==l){var n,f=!0;k.Pa&&(Nj(a,d,k,!0),e=!0);if(n=k.Zc){for(var f=!1,r=0;r<n.length;r++)if(!Qj(a,n[r],!0)){if(n[r].indexOf("if")){f=!0;break}for(var u=r+1;u<n.length&&n[u].indexOf("else");u++)r++;if(u==n.length){f=!0;break}}a.f.A.U||(f=!0)}if(f){e||Oj(a,d,g,"hit");break}}}a.la--;return f}
|
function Kj(a,b,c,d,e){var f=!1;if(!a.ma++)for(var g=1;!f&&g<d.length;g++){var k=d[g];if(!e||k.Pa)for(var l=jj(k)&(d==a.g?65535:-1),m=0;m<c;m++)if(b+m==l){var n,f=!0;k.Pa&&(Lj(a,d,k,!0),e=!0);if(n=k.$c){for(var f=!1,r=0;r<n.length;r++)if(!Oj(a,n[r],!0)){if(n[r].indexOf("if")){f=!0;break}for(var u=r+1;u<n.length&&n[u].indexOf("else");u++)r++;if(u==n.length){f=!0;break}}a.f.A.U||(f=!0)}if(f){e||Mj(a,d,g,"hit");break}}}a.ma--;return f}
|
||||||
function Rj(a,b,c,d){var e=V(b.K),f=a.Na(b,2),g,k;for(k in a.Ea)if(g=a.Ea[k][f&k])break;g||(g=Sj);var l=g[0];0<=a.xa.indexOf(l)&&(g=Sj,l=g[0]);var m=k="",n=Tj[l],r=g.length-1;l||r||(k=O(a,f));for(l=1;l<=r;l++){var u=g[l];if(void 0!==u){var t;t=a;var E=u,u=b,z="",C=E&Uj;if(C==X)u=u.K+((f&255)<<24>>23)&65535,z=O(t,u);else if(C==Vj)u=u.K-((f&63)<<1)&65535,z=O(t,u);else if(C==Wj)z=O(t,f&7,1);else if(C==Xj)z=O(t,f&63,1);else if(C==Yj)z=O(t,f&255,1);else if(C=f&E,E&Zj&&(C>>=6,E>>=6),E&Y){var E=null,F=C&
|
function Pj(a,b,c,d){var e=W(b.K),f=a.Na(b,2),g,k;for(k in a.Ea)if(g=a.Ea[k][f&k])break;g||(g=Qj);var l=g[0];0<=a.ya.indexOf(l)&&(g=Qj,l=g[0]);var m=k="",n=Rj[l],r=g.length-1;l||r||(k=O(a,f));for(l=1;l<=r;l++){var u=g[l];if(void 0!==u){var t;t=a;var E=u,u=b,z="",C=E&Sj;if(C==X)u=u.K+((f&255)<<24>>23)&65535,z=O(t,u);else if(C==Tj)u=u.K-((f&63)<<1)&65535,z=O(t,u);else if(C==Uj)z=O(t,f&7,1);else if(C==Vj)z=O(t,f&63,1);else if(C==Wj)z=O(t,f&255,1);else if(C=f&E,E&Xj&&(C>>=6,E>>=6),E&Y){var E=null,F=C&
|
||||||
ak;switch(C&bk){case 0:z=tj(F);break;case 8:z="@"+tj(F);E=ck(t,t.f.g[F]);break;case 16:7>F?z="("+tj(F)+")+":(C=t.Na(u,2),z="#"+O(t,C,0,!0));break;case 24:7>F?z="@("+tj(F)+")+":(C=t.Na(u,2),z="@#"+O(t,C,0,!0),E=ck(t,C));break;case 32:z="-("+tj(F)+")";break;case 40:z="@-("+tj(F)+")";break;case 48:C=t.Na(u,2);z=O(t,C,0,!0)+"("+tj(F)+")";7==F&&(z=O(t,C=C+u.K&65535),E=ck(t,C));break;case 56:C=t.Na(u,2),z="@"+O(t,C)+"("+tj(F)+")",7==F&&(z="@"+O(t,C=C+u.K&65535),E=ck(t,mc(t.f,C)))}E&&(z=[z,E])}t=z;if(!t||
|
Yj;switch(C&Zj){case 0:z=sj(F);break;case 8:z="@"+sj(F);E=ak(t,t.f.g[F]);break;case 16:7>F?z="("+sj(F)+")+":(C=t.Na(u,2),z="#"+O(t,C,0,!0));break;case 24:7>F?z="@("+sj(F)+")+":(C=t.Na(u,2),z="@#"+O(t,C,0,!0),E=ak(t,C));break;case 32:z="-("+sj(F)+")";break;case 40:z="@-("+sj(F)+")";break;case 48:C=t.Na(u,2);z=O(t,C,0,!0)+"("+sj(F)+")";7==F&&(z=O(t,C=C+u.K&65535),E=ak(t,C));break;case 56:C=t.Na(u,2),z="@"+O(t,C)+"("+sj(F)+")",7==F&&(z="@"+O(t,C=C+u.K&65535),E=ak(t,lc(t.f,C)))}E&&(z=[z,E])}t=z;if(!t||
|
||||||
!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0<k.length&&(k+=",");k+=t||"???"}}f="";g=rj(a,e)+":";if(-1!==e.K&&-1!==b.K){do if(f+=" "+O(a,a.Na(e,2)),null==e.K)break;while(e.K!=b.K)}g+=ta(f,24);g+=ta(n,5);k&&(g+=" "+k);if(c||m)g=ta(g,60)+";"+(c||""),g=a.f.A.xb?g+("cycles="+Yd(a.f).toString()+" cs="+v(a.f.Pb)):g+(null!=d?"="+d.toString():""),m&&(";"!=g.slice(-1)&&(g+=" "),g+=m);return g}
|
!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0<k.length&&(k+=",");k+=t||"???"}}f="";g=qj(a,e)+":";if(-1!==e.K&&-1!==b.K){do if(f+=" "+O(a,a.Na(e,2)),null==e.K)break;while(e.K!=b.K)}g+=ta(f,24);g+=ta(n,5);k&&(g+=" "+k);if(c||m)g=ta(g,60)+";"+(c||""),g=a.f.A.zb?g+("cycles="+Xd(a.f).toString()+" cs="+v(a.f.Qb)):g+(null!=d?"="+d.toString():""),m&&(";"!=g.slice(-1)&&(g+=" "),g+=m);return g}
|
||||||
function ck(a,b){b=ze(a.f,b)[0];b>=a.f.hb&&b<a.D.C&&(b=b-a.f.hb+a.D.C);var c=a.D;a=null;b>=c.C&&(b=c.Ja[b&Yc])&&(a=b[4]);return a}function dk(a,b){switch(b){case "N":a=pe(a.f);break;case "Z":a=oe(a.f);break;case "V":a=ne(a.f);break;case "C":a=me(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
function ak(a,b){b=ye(a.f,b)[0];b>=a.f.ib&&b<a.D.C&&(b=b-a.f.ib+a.D.C);var c=a.D;a=null;b>=c.C&&(b=c.Ja[b&Xc])&&(a=b[4]);return a}function bk(a,b){switch(b){case "N":a=oe(a.f);break;case "Z":a=ne(a.f);break;case "V":a=me(a.f);break;case "C":a=le(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||||
function Z(a,b){var c="",d=a.f;if(8>b)c=tj(b),c+="="+O(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+O(a,d.oa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+O(a,d.X[b-16]);else switch(b){case uj:c="PS="+O(a,nd(d));break;case vj:c="PI="+O(a,d.ab);break;case wj:c="ER="+O(a,d.R);break;case xj:c="SL="+O(a,d.ya&65280);break;case yj:c="M0="+O(a,hd(d));break;case zj:c="M1="+O(a,jd(d));break;case Aj:c="M2="+O(a,kd(d));break;case Bj:c="M3="+O(a,d.T);break;case Cj:a.b&&(c="AR="+O(a,a.b.ra,3));break;case Dj:a.b&&(c="DR="+
|
function Z(a,b){var c="",d=a.f;if(8>b)c=sj(b),c+="="+O(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+O(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+O(a,d.X[b-16]);else switch(b){case tj:c="PS="+O(a,md(d));break;case uj:c="PI="+O(a,d.bb);break;case vj:c="ER="+O(a,d.R);break;case wj:c="SL="+O(a,d.za&65280);break;case xj:c="M0="+O(a,gd(d));break;case yj:c="M1="+O(a,id(d));break;case zj:c="M2="+O(a,jd(d));break;case Aj:c="M3="+O(a,d.T);break;case Bj:a.b&&(c="AR="+O(a,a.b.sa,3));break;case Cj:a.b&&(c="DR="+
|
||||||
O(a,a.b.sb));break;case Ej:a.b&&qc(a.b)&&(c="SR="+O(a,a.b.Ua,3))}c&&(c+=" ");return c}function ek(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,uj)+Z(a,vj)+Z(a,xj);d+=dk(a,"T")+dk(a,"N")+dk(a,"Z")+dk(a,"V")+dk(a,"C");b&&(b=d,c=""+(Z(a,yj)+Z(a,zj)),c+=Z(a,Aj)+Z(a,Bj)+Z(a,wj),c=c+"\n"+(Z(a,Ej)+Z(a,Cj)+Z(a,Dj)),d=b+("\n"+c));return d}h.bd=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
O(a,a.b.tb));break;case Dj:a.b&&pc(a.b)&&(c="SR="+O(a,a.b.Va,3))}c&&(c+=" ");return c}function ck(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,tj)+Z(a,uj)+Z(a,wj);d+=bk(a,"T")+bk(a,"N")+bk(a,"Z")+bk(a,"V")+bk(a,"C");b&&(b=d,c=""+(Z(a,xj)+Z(a,yj)),c+=Z(a,zj)+Z(a,Aj)+Z(a,vj),c=c+"\n"+(Z(a,Dj)+Z(a,Bj)+Z(a,Cj)),d=b+("\n"+c));return d}h.dd=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||||
function nh(a,b,c,d,e){var f=[],g;for(g in e){var k=e[g];"number"==typeof k&&(e[g]=k={o:k});var l=k.o,m=k.a;if(void 0!==l){var n=f,l=[l>>>0,g],r=xa(n,l,a.bd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.C.push({uh:b,K:c,Od:d,da:e,$c:f})}function fk(a,b,c){var d=[],e=kj(b)>>>0;for(b=0;b<a.C.length;b++){var f=a.C[b],g=f.K>>>0,k=f.Od;if(e>=g&&e<g+k){e=xa(f.$c,[e-g],a.bd);0<=e?gk(a,b,e,d):c&&(e=~e,gk(a,b,e-1,d),gk(a,b,e,d));break}}return d}
|
function mh(a,b,c,d,e){var f=[],g;for(g in e){var k=e[g];"number"==typeof k&&(e[g]=k={o:k});var l=k.o,m=k.a;if(void 0!==l){var n=f,l=[l>>>0,g],r=xa(n,l,a.dd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.C.push({wh:b,K:c,Qd:d,ea:e,ad:f})}function dk(a,b,c){var d=[],e=jj(b)>>>0;for(b=0;b<a.C.length;b++){var f=a.C[b],g=f.K>>>0,k=f.Qd;if(e>=g&&e<g+k){e=xa(f.ad,[e-g],a.dd);0<=e?ek(a,b,e,d):c&&(e=~e,ek(a,b,e-1,d),ek(a,b,e,d));break}}return d}
|
||||||
function gk(a,b,c,d){var e={},f=a.C[b].$c,g=0,k=null;0<=c&&c<f.length&&(g=f[c][0],k=f[c][1]);k&&(e=a.C[b].da[k],k="."==k.charAt(0)?null:e.l||k);d.push(k);d.push(g);d.push(e.a);d.push(e.c)}function hk(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return ej(a)||a.u("no variables"),!0;if(!c[2])return ej(a,c[1]);if(!c[3])return delete a.T[c[1]],!0;b=$i(a,c[3]);return void 0!==b?(a.T[c[1]]=b,!0):!1}a.u("invalid assignment:"+b);return!1}
|
function ek(a,b,c,d){var e={},f=a.C[b].ad,g=0,k=null;0<=c&&c<f.length&&(g=f[c][0],k=f[c][1]);k&&(e=a.C[b].ea[k],k="."==k.charAt(0)?null:e.l||k);d.push(k);d.push(g);d.push(e.a);d.push(e.c)}function fk(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return dj(a)||a.u("no variables"),!0;if(!c[2])return dj(a,c[1]);if(!c[3])return delete a.T[c[1]],!0;b=Zi(a,c[3]);return void 0!==b?(a.T[c[1]]=b,!0):!1}a.u("invalid assignment:"+b);return!1}
|
||||||
function ik(a,b,c){var d=null;if(b=oj(a,b,!0)){var e=fk(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.K-e[1])&&(g=" + "+w(f)),f=e[0]+" ("+O(a,e[1])+")"+g,c&&a.u(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.K)&&(g=" - "+w(f)),f=e[4]+" ("+O(a,e[5])+")"+g,c&&a.u(f),d||(d=f))}else c&&a.u("no symbols")}return d}
|
function gk(a,b,c){var d=null;if(b=nj(a,b,!0)){var e=dk(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.K-e[1])&&(g=" + "+w(f)),f=e[0]+" ("+O(a,e[1])+")"+g,c&&a.u(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.K)&&(g=" - "+w(f)),f=e[4]+" ("+O(a,e[5])+")"+g,c&&a.u(f),d||(d=f))}else c&&a.u("no symbols")}return d}
|
||||||
function Jj(a,b){var c;if(b&&"?"==b[1])a.u("register commands:"),a.u("\tr\tdump registers"),a.u("\trm\tdump misc registers"),a.u("\trx [#]\tset flag or register x to [#]");else{var d=!1,e=a.f;null==c&&(c=!0);if(b&&1<b.length){var f=b[1];if("m"==f)d=!0;else{var g=f.indexOf("=");if(0<g)b=f.substr(g+1),f=f.substr(0,g);else if(2<b.length)b=b[2];else{a.u("missing value for "+b[1]);return}g=$i(a,b);if(void 0===g)return;b=f.toUpperCase();switch(b){case "SP":case "R6":e.g[6]=g&65535;break;case "PC":case "R7":ke(e,
|
function Hj(a,b){var c;if(b&&"?"==b[1])a.u("register commands:"),a.u("\tr\tdump registers"),a.u("\trm\tdump misc registers"),a.u("\trx [#]\tset flag or register x to [#]");else{var d=!1,e=a.f;null==c&&(c=!0);if(b&&1<b.length){var f=b[1];if("m"==f)d=!0;else{var g=f.indexOf("=");if(0<g)b=f.substr(g+1),f=f.substr(0,g);else if(2<b.length)b=b[2];else{a.u("missing value for "+b[1]);return}g=Zi(a,b);if(void 0===g)return;b=f.toUpperCase();switch(b){case "SP":case "R6":e.g[6]=g&65535;break;case "PC":case "R7":je(e,
|
||||||
g);a.H=V(e.g[7]);break;case "N":e.J=g?32768:0;break;case "Z":e.L=g?0:1;break;case "V":e.H=g?32768:0;break;case "C":e.G=g?65536:0;break;case "PS":od(e,g);break;case "PI":md(e,g);break;case "ER":e.R=g;d=!0;break;case "SL":e.ya=g|255;break;case "M0":id(e,g);d=!0;break;case "M3":ld(e,g);d=!0;break;case "AR":a.b&&(d=a.b,nc(d,d.ra=g));d=!0;break;case "DR":a.b&&(d=a.b,ic(d,d.sb=g));d=!0;break;case "SR":if(a.b&&qc(a.b)){oc(a.b,g);d=!0;break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){e.g[b]=
|
g);a.H=W(e.g[7]);break;case "N":e.J=g?32768:0;break;case "Z":e.L=g?0:1;break;case "V":e.H=g?32768:0;break;case "C":e.G=g?65536:0;break;case "PS":nd(e,g);break;case "PI":ld(e,g);break;case "ER":e.R=g;d=!0;break;case "SL":e.za=g|255;break;case "M0":hd(e,g);d=!0;break;case "M3":kd(e,g);d=!0;break;case "AR":a.b&&(d=a.b,mc(d,d.sa=g));d=!0;break;case "DR":a.b&&(d=a.b,hc(d,d.tb=g));d=!0;break;case "SR":if(a.b&&pc(a.b)){nc(a.b,g);d=!0;break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){e.g[b]=
|
||||||
g&65535;break}a.u("unknown register: "+f);return}L(a.I);a.u("updated registers:")}}a.u(ek(a,d));c&&(a.H=V(e.g[7]),Kj(a,rj(a,a.H)))}}function jk(a,b){b=ua(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.u(c[2]):dj(a,null,c[2].charCodeAt(0)):$i(a,b,!0)}
|
g&65535;break}a.u("unknown register: "+f);return}L(a.I);a.u("updated registers:")}}a.u(ck(a,d));c&&(a.H=W(e.g[7]),Ij(a,qj(a,a.H)))}}function hk(a,b){b=ua(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.u(c[2]):cj(a,null,c[2].charCodeAt(0)):Zi(a,b,!0)}
|
||||||
function kk(a,b,c){if("?"==c)a.u("trace commands:"),a.u("\tt [#]\ttrace # instructions"),a.u("\ttr [#]\ttrace # instructions with register updates"),a.u("\ttc [#]\ttrace # cycles"),a.u("note: bn [#] breaks after # instructions without updates");else{var d="t"!=b;c=bj(a,c,null,!0)||1;var e=0;"tc"==b&&(e=c,c=1);a.sa=b;Qa(c,function(){return vb(a,!0)&&dc(a,e,d,!1)},function(){a.b&&a.b.stop();L(a.I,-1);vb(a,!1)})}}
|
function ik(a,b,c){if("?"==c)a.u("trace commands:"),a.u("\tt [#]\ttrace # instructions"),a.u("\ttr [#]\ttrace # instructions with register updates"),a.u("\ttc [#]\ttrace # cycles"),a.u("note: bn [#] breaks after # instructions without updates");else{var d="t"!=b;c=aj(a,c,null,!0)||1;var e=0;"tc"==b&&(e=c,c=1);a.ta=b;Qa(c,function(){return ub(a,!0)&&cc(a,e,d,!1)},function(){a.b&&a.b.stop();L(a.I,-1);ub(a,!1)})}}
|
||||||
function Kj(a,b,c,d){if(b=oj(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=bj(a,c.substr(1)),null!=c&&(d=c);else{d=oj(a,c,!0);if(!d||d.K<b.K)return;e=d.K-b.K;if(256<e){a.u("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=ub(a,!1)||a.J?a.w:null;var g=null!=f?"cycles":null,k=fk(a,b),l=b.K;if(k[0]&&d&&(!c&&d||0>k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.u(m)}k[3]&&(g=k[3],f=null);f=Rj(a,b,g,f);a.u(f);a.H=b;e-=b.K-l;c++}}}
|
function Ij(a,b,c,d){if(b=nj(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=aj(a,c.substr(1)),null!=c&&(d=c);else{d=nj(a,c,!0);if(!d||d.K<b.K)return;e=d.K-b.K;if(256<e){a.u("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=tb(a,!1)||a.J?a.w:null;var g=null!=f?"cycles":null,k=dk(a,b),l=b.K;if(k[0]&&d&&(!c&&d||0>k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.u(m)}k[3]&&(g=k[3],f=null);f=Pj(a,b,g,f);a.u(f);a.H=b;e-=b.K-l;c++}}}
|
||||||
function Qj(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(">> "+b):(a.P&&(a.u("ended assemble at "+rj(a,a.O)),a.H=a.O,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(tb(a)&&0<b.length){a.P&&(b="a "+rj(a,a.O)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var k=g[0],l=k.charAt(0),m=1;m<k.length;m++){var n=k.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=k.substr(m);g.unshift(k.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var r=
|
function Oj(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(">> "+b):(a.P&&(a.u("ended assemble at "+qj(a,a.O)),a.H=a.O,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(sb(a)&&0<b.length){a.P&&(b="a "+qj(a,a.O)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var k=g[0],l=k.charAt(0),m=1;m<k.length;m++){var n=k.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=k.substr(m);g.unshift(k.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var r=
|
||||||
oj(a,g[1],!0);if(r)if(a.O=r,void 0===g[2])a.u("begin assemble at "+rj(a,r)),a.P=!0,L(a.I);else{var u;a.u("not supported yet");u=[];if(u.length){for(var t=0;t<u.length;t++)a.Mc(r,u[t],1);a.u(Rj(a,a.O))}}break;case "b":a:{var E=g[0],z=g[1],C=b;if("?"==z)a.u("breakpoint commands:"),a.u("\tbp [#]\tset exec breakpoint at addr #"),a.u("\tbr [#]\tset read breakpoint at addr #"),a.u("\tbw [#]\tset write breakpoint at addr #"),a.u("\tbc [#]\tclear breakpoint at addr #"),a.u("\tbl\tlist all breakpoints"),a.u("\tbn [#]\tbreak after # instruction(s)");
|
nj(a,g[1],!0);if(r)if(a.O=r,void 0===g[2])a.u("begin assemble at "+qj(a,r)),a.P=!0,L(a.I);else{var u;a.u("not supported yet");u=[];if(u.length){for(var t=0;t<u.length;t++)a.Nc(r,u[t],1);a.u(Pj(a,a.O))}}break;case "b":a:{var E=g[0],z=g[1],C=b;if("?"==z)a.u("breakpoint commands:"),a.u("\tbp [#]\tset exec breakpoint at addr #"),a.u("\tbr [#]\tset read breakpoint at addr #"),a.u("\tbw [#]\tset write breakpoint at addr #"),a.u("\tbc [#]\tclear breakpoint at addr #"),a.u("\tbl\tlist all breakpoints"),a.u("\tbn [#]\tbreak after # instruction(s)");
|
||||||
else{var F=E.charAt(1);if("l"==F){var fb;fb=0+Pj(a,a.g);fb+=Pj(a,a.L);(fb+=Pj(a,a.G))||a.u("no breakpoints")}else if("n"==F)a.Y=bj(a,z),a.u("break after "+a.Y+" instruction(s)");else if(void 0===z)a.u("missing breakpoint address");else{var W=V();if("*"!=z&&(W=oj(a,z,!0),!W))break a;"c"==F?null==W.K?(gj(a),a.u("all breakpoints cleared")):Nj(a,a.g,W)||Nj(a,a.L,W)||Nj(a,a.G,W)||a.u("breakpoint missing: "+rj(a,W)):null!=W.K&&(qj(a,W,C),"p"==F?a.nb(a.g,W):"r"==F?a.nb(a.L,W):"w"==F?a.nb(a.G,W):a.u("unknown breakpoint command: "+
|
else{var F=E.charAt(1);if("l"==F){var eb;eb=0+Nj(a,a.g);eb+=Nj(a,a.L);(eb+=Nj(a,a.G))||a.u("no breakpoints")}else if("n"==F)a.Z=aj(a,z),a.u("break after "+a.Z+" instruction(s)");else if(void 0===z)a.u("missing breakpoint address");else{var V=W();if("*"!=z&&(V=nj(a,z,!0),!V))break a;"c"==F?null==V.K?(fj(a),a.u("all breakpoints cleared")):Lj(a,a.g,V)||Lj(a,a.L,V)||Lj(a,a.G,V)||a.u("breakpoint missing: "+qj(a,V)):null!=V.K&&(pj(a,V,C),"p"==F?a.ob(a.g,V):"r"==F?a.ob(a.L,V):"w"==F?a.ob(a.G,V):a.u("unknown breakpoint command: "+
|
||||||
F))}}}break;case "c":a.Oa&&(a.Oa.value="");break;case "d":a:{var Gb,Ua=g[0],Ga=g[1],Va=g[2],Kk=g[3];if("?"==Ga){var Hb="";for(Gb in Eb)a.ka[Gb]&&(Hb&&(Hb+=","),Hb+=Gb);Hb+=",state,symbols";a.u("dump memory commands:");a.u("\tda [a] dump info for address a");a.u("\tdb [a] [n] dump n bytes at address a");a.u("\tdw [a] [n] dump n words at address a");a.u("\tdd [a] [n] dump n dwords at address a");a.u("\tds [a] [n] dump n words at address a as JSON");a.u("\tdh [p] [n] dump n instructions from history position p");
|
F))}}}break;case "c":a.Oa&&(a.Oa.value="");break;case "d":a:{var Fb,Ta=g[0],Fa=g[1],Ua=g[2],Ik=g[3];if("?"==Fa){var Gb="";for(Fb in Db)a.la[Fb]&&(Gb&&(Gb+=","),Gb+=Fb);Gb+=",state,symbols";a.u("dump memory commands:");a.u("\tda [a] dump info for address a");a.u("\tdb [a] [n] dump n bytes at address a");a.u("\tdw [a] [n] dump n words at address a");a.u("\tdd [a] [n] dump n dwords at address a");a.u("\tds [a] [n] dump n words at address a as JSON");a.u("\tdh [p] [n] dump n instructions from history position p");
|
||||||
Hb.length&&a.u("dump extension commands:\n\t"+Hb)}else if("state"==Ga){var Me=lk(a.I,!0);"console"==Va?console.log(Me):(a.Oa&&(a.Oa.value=""),Me&&a.u(Me))}else if("symbols"==Ga)for(var Ne=0;Ne<a.C.length;Ne++){var Oe=a.C[Ne],Ib;for(Ib in Oe.da)if("."!=Ib.charAt(0)){var gi=Oe.da[Ib].o;if(void 0!==gi){var hi=Oe.da[Ib].l;hi&&(Ib=hi);a.u(O(a,gi)+" "+Ib)}}}else{if("d"==Ua){for(Gb in Eb)if(g[1]==Gb){var ii=a.ka[Gb];ii?(g.shift(),g.shift(),ii(g)):a.u("no dump registered for "+Ga);break a}Ga||(Ua=a.Fa||"dw")}else a.Fa=
|
Gb.length&&a.u("dump extension commands:\n\t"+Gb)}else if("state"==Fa){var Ke=jk(a.I,!0);"console"==Ua?console.log(Ke):(a.Oa&&(a.Oa.value=""),Ke&&a.u(Ke))}else if("symbols"==Fa)for(var Le=0;Le<a.C.length;Le++){var Me=a.C[Le],Hb;for(Hb in Me.ea)if("."!=Hb.charAt(0)){var ei=Me.ea[Hb].o;if(void 0!==ei){var fi=Me.ea[Hb].l;fi&&(Hb=fi);a.u(O(a,ei)+" "+Hb)}}}else{if("d"==Ta){for(Fb in Db)if(g[1]==Fb){var gi=a.la[Fb];gi?(g.shift(),g.shift(),gi(g)):a.u("no dump registered for "+Fa);break a}Fa||(Ta=a.Fa||"dw")}else a.Fa=
|
||||||
Ua;if("dh"==Ua){var ji=Ga,ki=Va,li="",mi=0,wa=a.R,Ha=a.i;if(Ha.length){var ra=+ji||a.oa,sc=+ki||10;isNaN(ra)?ra=sc:li="more ";ra>Ha.length&&(a.u("note: only "+Ha.length+" available"),ra=Ha.length);wa-=ra;0>wa&&(null==Ha[Ha.length-1].K?(ra=wa+ra,wa=0):wa+=Ha.length);var Pe=[];"call"==ki&&(sc=1E5,Pe=["CALL"]);for(void 0!==ji&&a.u(ra+" instructions earlier:");0<sc&&wa!=a.R;){var ni=Ha[wa++];if(null==ni.K)break;var tc=V(ni.K),Lk=ra--,oi=Rj(a,tc,"history",Lk);(!Pe.length||0<=oi.indexOf(Pe[0]))&&a.u(oi);
|
Ta;if("dh"==Ta){var hi=Fa,ii=Ua,ji="",ki=0,va=a.R,Ga=a.i;if(Ga.length){var qa=+hi||a.pa,qc=+ii||10;isNaN(qa)?qa=qc:ji="more ";qa>Ga.length&&(a.u("note: only "+Ga.length+" available"),qa=Ga.length);va-=qa;0>va&&(null==Ga[Ga.length-1].K?(qa=va+qa,va=0):va+=Ga.length);var Ne=[];"call"==ii&&(qc=1E5,Ne=["CALL"]);for(void 0!==hi&&a.u(qa+" instructions earlier:");0<qc&&va!=a.R;){var li=Ga[va++];if(null==li.K)break;var rc=W(li.K),Jk=qa--,mi=Pj(a,rc,"history",Jk);(!Ne.length||0<=mi.indexOf(Ne[0]))&&a.u(mi);
|
||||||
tc.zc&&(wa+=tc.zc,sc-=tc.zc,ra-=tc.zc);wa>=Ha.length&&(wa=0);a.oa=ra;mi++;sc--}}mi||(a.u("no "+li+"history available"),a.oa=void 0)}else{var ga=oj(a,Ga);if(ga)if("da"==Ua){var Qe=ga.Ha||65535<ga.K,K=ze(a.f,ga.K||0,Qe);a.u(ta("",Qe?12:19)+ma(ga.K,Qe?22:17,3)+" "+q(ga.K,8));6>K.length?(2<K.length&&(a.u(" OFFSET: "+ma(K[3],13,3)+" "+q(K[3],8)),a.u("UNIMAP["+na(K[1])+"]: "+ma(K[2],22,3)+" "+q(K[2],8))),a.u(" PHYSICAL: "+ma(K[0],22,3)+" "+q(K[0],8))):(a.u(" OFFSET: "+
|
rc.Ac&&(va+=rc.Ac,qc-=rc.Ac,qa-=rc.Ac);va>=Ga.length&&(va=0);a.pa=qa;ki++;qc--}}ki||(a.u("no "+ji+"history available"),a.pa=void 0)}else{var fa=nj(a,Fa);if(fa)if("da"==Ta){var Oe=fa.Ha||65535<fa.K,K=ye(a.f,fa.K||0,Oe);a.u(ta("",Oe?12:19)+ma(fa.K,Oe?22:17,3)+" "+q(fa.K,8));6>K.length?(2<K.length&&(a.u(" OFFSET: "+ma(K[3],13,3)+" "+q(K[3],8)),a.u("UNIMAP["+na(K[1])+"]: "+ma(K[2],22,3)+" "+q(K[2],8))),a.u(" PHYSICAL: "+ma(K[0],22,3)+" "+q(K[0],8))):(a.u(" OFFSET: "+
|
||||||
ma(K[1],13,3)+" "+q(K[1],8)),a.u("+ "+mk[K[2]]+"PAR"+K[3]+": "+ma(K[4],22,3)+" "+q(K[4],8)),a.u("& MMUMASK: "+ma(K[5],22,3)+" "+q(K[5],8)),a.u("= PHYSICAL: "+ma(K[0],22,3)+" "+q(K[0],8)))}else{var hb=0,Re="ds"==Ua;if(Va){if("l"==Va.charAt(0))Va=Va.substr(1)||Kk,hb=bj(a,Va);else{var pi=oj(a,Va);pi&&(hb=pi.K-ga.K)}0>hb&&(hb=0);65536<hb&&(hb=65536)}var Nk=a.ua;ga.ua&&(a.ua=ga.ua);for(var ib="dd"==Ua?4:"db"==Ua?1:2,wd=ib*hb||128,Se=Re?16:a.ua,Ok=(wd+Se-1)/Se|0||1,jb="";Ok--&&0<wd;){for(var kb=
|
ma(K[1],13,3)+" "+q(K[1],8)),a.u("+ "+kk[K[2]]+"PAR"+K[3]+": "+ma(K[4],22,3)+" "+q(K[4],8)),a.u("& MMUMASK: "+ma(K[5],22,3)+" "+q(K[5],8)),a.u("= PHYSICAL: "+ma(K[0],22,3)+" "+q(K[0],8)))}else{var gb=0,Pe="ds"==Ta;if(Ua){if("l"==Ua.charAt(0))Ua=Ua.substr(1)||Ik,gb=aj(a,Ua);else{var ni=nj(a,Ua);ni&&(gb=ni.K-fa.K)}0>gb&&(gb=0);65536<gb&&(gb=65536)}var Lk=a.va;fa.va&&(a.va=fa.va);for(var hb="dd"==Ta?4:"db"==Ta?1:2,ud=hb*gb||128,Qe=Pe?16:a.va,Mk=(ud+Qe-1)/Qe|0||1,ib="";Mk--&&0<ud;){for(var jb=
|
||||||
"",Te="",Ga=rj(a,ga),xd=Se,uc=0,vc=0;0<xd&&0<wd;){var Jb=1,yd=1==ib?a.Lc(ga,Jb):a.Na(ga,Jb=2),uc=uc|yd<<(vc<<3),vc=vc+Jb;vc==ib&&(Re?(kb&&(kb+=","),kb+="0x"+v(uc,2*ib)):(kb+=O(a,uc,ib),kb+=1==ib?9==xd?"-":" ":" "),uc=vc=0);xd-=Jb;for(wd-=Jb;1==ib&&Jb--;)var Ue=yd&255,Te=Te+(32<=Ue&&128>Ue?String.fromCharCode(Ue):"."),yd=yd>>8}jb&&(jb+="\n");jb=Re?jb+(kb+","):jb+(Ga+": "+kb+(0==xd?" "+Te:""))}jb&&a.u(jb);a.Aa=ga;a.ua=Nk}}}}break;case "e":if("else"==g[0])break;var Kb,Ve,We,Xe,Ye=g[0],Ze=g[1];"eb"==
|
"",Re="",Fa=qj(a,fa),vd=Qe,sc=0,tc=0;0<vd&&0<ud;){var Ib=1,wd=1==hb?a.Mc(fa,Ib):a.Na(fa,Ib=2),sc=sc|wd<<(tc<<3),tc=tc+Ib;tc==hb&&(Pe?(jb&&(jb+=","),jb+="0x"+v(sc,2*hb)):(jb+=O(a,sc,hb),jb+=1==hb?9==vd?"-":" ":" "),sc=tc=0);vd-=Ib;for(ud-=Ib;1==hb&&Ib--;)var Se=wd&255,Re=Re+(32<=Se&&128>Se?String.fromCharCode(Se):"."),wd=wd>>8}ib&&(ib+="\n");ib=Pe?ib+(jb+","):ib+(Fa+": "+jb+(0==vd?" "+Re:""))}ib&&a.u(ib);a.za=fa;a.va=Lk}}}}break;case "e":if("else"==g[0])break;var Jb,Te,Ue,Ve,We=g[0],Xe=g[1];"eb"==
|
||||||
Ye?(Kb=1,Ve=255,We=a.Lc,Xe=a.Mc):"e"==Ye||"ew"==Ye?(Kb=2,Ve=65535,We=a.Na,Xe=a.wd):Ze=null;if(null==Ze)a.u("edit memory commands:"),a.u("\teb [a] [...] edit bytes at address a"),a.u("\tew [a] [...] edit words at address a");else{var zd=oj(a,Ze);if(zd)for(var Ad=2;Ad<g.length;Ad++){var wc=$i(a,g[Ad]);if(void 0===wc){a.u("unrecognized value: "+g[Ad]);break}wc&~Ve&&a.u("warning: "+v(wc)+" exceeds "+Kb+"-byte value");a.u("changing "+rj(a,zd)+(H(a,16)?"":" from "+O(a,We.call(a,zd),Kb))+" to "+O(a,wc,
|
We?(Jb=1,Te=255,Ue=a.Mc,Ve=a.Nc):"e"==We||"ew"==We?(Jb=2,Te=65535,Ue=a.Na,Ve=a.yd):Xe=null;if(null==Xe)a.u("edit memory commands:"),a.u("\teb [a] [...] edit bytes at address a"),a.u("\tew [a] [...] edit words at address a");else{var xd=nj(a,Xe);if(xd)for(var yd=2;yd<g.length;yd++){var uc=Zi(a,g[yd]);if(void 0===uc){a.u("unrecognized value: "+g[yd]);break}uc&~Te&&a.u("warning: "+v(uc)+" exceeds "+Jb+"-byte value");a.u("changing "+qj(a,xd)+(I(a,16)?"":" from "+O(a,Ue.call(a,xd),Jb))+" to "+O(a,uc,
|
||||||
Kb));Xe.call(a,zd,wc,Kb)}}break;case "g":a:{var qi=g[1],Pk=b;if(void 0!==qi){var $e=oj(a,qi,!0);if(!$e)break a;qj(a,$e,Pk);a.nb(a.g,$e,!0)}Hj(a,!0,c)}break;case "h":a.A.U?(c||a.u("halting"),Fj(a)):ub(a,!0)||c||a.u("already halted");break;case "i":if("if"==g[0]){var af;var xc=b.substr(2),xc=ua(xc);$i(a,xc)?(c||a.u("true: "+xc),af=!0):(c||a.u("false: "+xc),af=!1);af||(d=!1);break}f=!0;break;case "k":var Qk=g[0];if("?"==g[1])a.u("stack trace commands:"),a.u("\tk\tshow frame addresses"),a.u("\tks\tshow symbol information");
|
Jb));Ve.call(a,xd,uc,Jb)}}break;case "g":a:{var oi=g[1],Nk=b;if(void 0!==oi){var Ye=nj(a,oi,!0);if(!Ye)break a;pj(a,Ye,Nk);a.ob(a.g,Ye,!0)}Fj(a,!0,c)}break;case "h":a.A.U?(c||a.u("halting"),a.Y()):tb(a,!0)||c||a.u("already halted");break;case "i":if("if"==g[0]){var Ze;var vc=b.substr(2),vc=ua(vc);Zi(a,vc)?(c||a.u("true: "+vc),Ze=!0):(c||a.u("false: "+vc),Ze=!1);Ze||(d=!1);break}f=!0;break;case "k":var Ok=g[0];if("?"==g[1])a.u("stack trace commands:"),a.u("\tk\tshow frame addresses"),a.u("\tks\tshow symbol information");
|
||||||
else{var bf=0,cf=V(),yc=V(a.f.g[6]);for(a.u("stack trace for "+rj(a,yc));10>bf;){for(var lb=null,Rk=256;65536>yc.K>>>0;){cf.K=a.Na(yc,2);if(null==yc.K||!Rk--)break;if(!(cf.K&1)){for(var Sk=a,Bd=cf,ri=null,zc=Bd.K,si=zc,df=1;6>=df&&zc;df++){if(2<df){Bd.K=zc;var Cd=Rj(Sk,Bd);if(0<=Cd.indexOf("JSR")){var ti=Cd.indexOf(" ");if(zc+(Cd.indexOf(" ",ti+1)-ti-1)/2==si){ri=Cd;break}}}zc-=2}Bd.K=si;if(lb=ri)break}}if(!lb||null==lb)break;var ui=null;if("ks"==Qk){var vi=lb.match(/[0-9A-F]+$/);vi&&(ui=ik(a,vi[0]))}lb=
|
else{var $e=0,af=W(),wc=W(a.f.g[6]);for(a.u("stack trace for "+qj(a,wc));10>$e;){for(var kb=null,Pk=256;65536>wc.K>>>0;){af.K=a.Na(wc,2);if(null==wc.K||!Pk--)break;if(!(af.K&1)){for(var Qk=a,zd=af,pi=null,xc=zd.K,qi=xc,bf=1;6>=bf&&xc;bf++){if(2<bf){zd.K=xc;var Ad=Pj(Qk,zd);if(0<=Ad.indexOf("JSR")){var ri=Ad.indexOf(" ");if(xc+(Ad.indexOf(" ",ri+1)-ri-1)/2==qi){pi=Ad;break}}}xc-=2}zd.K=qi;if(kb=pi)break}}if(!kb||null==kb)break;var si=null;if("ks"==Ok){var ti=kb.match(/[0-9A-F]+$/);ti&&(si=gk(a,ti[0]))}kb=
|
||||||
ta(lb,50)+" ;"+(ui||"stack="+rj(a,yc));a.u(lb);bf++}bf||a.u("no return addresses found")}break;case "l":if("ln"==g[0]){ik(a,g[1],!0);break}f=!0;break;case "m":a:{var Ia,Ja=null,N=g[1];"?"==N&&(N=void 0);if(void 0!==N){var Wa=0;if("all"==N)Wa=1879046143,N=null;else if("on"==N)Ja=!0,N=null;else if("off"==N)Ja=!1,N=null;else{"keys"==N&&(N="key");"kbd"==N&&(N="keyboard");for(Ia in Eb)if(N==Ia){Wa=Eb[Ia];Ja=!!(a.fa&Wa);break}if(!Wa){a.u("unknown message category: "+N);break a}}if(Wa)if("on"==g[2])a.fa|=
|
ta(kb,50)+" ;"+(si||"stack="+qj(a,wc));a.u(kb);$e++}$e||a.u("no return addresses found")}break;case "l":if("ln"==g[0]){gk(a,g[1],!0);break}f=!0;break;case "m":a:{var Ha,Ia=null,N=g[1];"?"==N&&(N=void 0);if(void 0!==N){var Va=0;if("all"==N)Va=1879046143,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 Db)if(N==Ha){Va=Db[Ha];Ia=!!(a.ga&Va);break}if(!Va){a.u("unknown message category: "+N);break a}}if(Va)if("on"==g[2])a.ga|=
|
||||||
Wa,Ja=!0;else if("off"==g[2]&&(a.fa&=~Wa,Ja=!1,1073741824==Wa)){for(var wi=1E3<=a.M.length?a.M.length-1E3:0;wi<a.M.length;)a.u(a.M[wi++]);a.M=[]}}var Tk=0,Ac="";for(Ia in Eb)if(!N||N==Ia){var Uk=!!(a.fa&Eb[Ia]);if(null===Ja||Ja==Uk)Ac&&(Ac+=","),++Tk%10||(Ac+="\n\t"),"key"==Ia&&(Ia="keys"),Ac+=Ia}void 0===N&&a.u("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.u((null!==Ja?Ja?"messages on: ":"messages off: ":"message categories:\n\t")+(Ac||"none"));hj(a)}break;case "p":if("print"==
|
Va,Ia=!0;else if("off"==g[2]&&(a.ga&=~Va,Ia=!1,1073741824==Va)){for(var ui=1E3<=a.M.length?a.M.length-1E3:0;ui<a.M.length;)a.u(a.M[ui++]);a.M=[]}}var Rk=0,yc="";for(Ha in Db)if(!N||N==Ha){var Sk=!!(a.ga&Db[Ha]);if(null===Ia||Ia==Sk)yc&&(yc+=","),++Rk%10||(yc+="\n\t"),"key"==Ha&&(Ha="keys"),yc+=Ha}void 0===N&&a.u("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.u((null!==Ia?Ia?"messages on: ":"messages off: ":"message categories:\n\t")+(yc||"none"));gj(a)}break;case "p":if("print"==
|
||||||
g[0]){jk(a,b.substr(5));break}var Vk=g[0];if("?"==g[1])a.u("step commands:"),a.u("\tp\tstep over instruction"),a.u("\tpr\tstep over instruction with register update");else{var xi="pr"==Vk?1:0,yi=1+xi;if(a.J)a.u("step in progress");else{var Dd=V(a.f.g[7]),Lb=a.Na(Dd);3==Lb||4==Lb||34816==(Lb&65280)||32256==(Lb&65024)||35072==(Lb&65280)?(a.J=yi,pj(Dd,2)):2048==(Lb&65024)&&(Rj(a,Dd),a.J=yi);a.J?(a.nb(a.g,Dd,!0),Hj(a)||(a.I&&be(a.I),a.J=0)):kk(a,xi?"tr":"t")}}break;case "r":if("reset"==b){a.I&&a.I.reset();
|
g[0]){hk(a,b.substr(5));break}var Tk=g[0];if("?"==g[1])a.u("step commands:"),a.u("\tp\tstep over instruction"),a.u("\tpr\tstep over instruction with register update");else{var vi="pr"==Tk?1:0,wi=1+vi;if(a.J)a.u("step in progress");else{var Bd=W(a.f.g[7]),Kb=a.Na(Bd);3==Kb||4==Kb||34816==(Kb&65280)||32256==(Kb&65024)||35072==(Kb&65280)?(a.J=wi,oj(Bd,2)):2048==(Kb&65024)&&(Pj(a,Bd),a.J=wi);a.J?(a.ob(a.g,Bd,!0),Fj(a)||(a.I&&ae(a.I),a.J=0)):ik(a,vi?"tr":"t")}}break;case "r":if("reset"==b){a.I&&a.I.reset();
|
||||||
break}Jj(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Bc=+g[2];if(8==Bc||10==Bc||16==Bc)a.ua=Bc;else{a.u("invalid base: "+Bc);break}}a.u("default base: "+a.ua);break;case "cs":var Cc;void 0!==g[3]&&(Cc=+g[3]);switch(g[2]){case "int":a.f.zb=Cc;break;case "start":a.f.Qb=Cc;break;case "stop":a.f.Bb=Cc;break;default:a.u("unknown cs option");break a}void 0!==Cc&&Ud(a.f);a.u("checksums "+(a.f.A.xb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Zd(a.f,+g[2])||a.u("warning: using 1x multiplier, previous target not reached"));
|
break}Hj(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var zc=+g[2];if(8==zc||10==zc||16==zc)a.va=zc;else{a.u("invalid base: "+zc);break}}a.u("default base: "+a.va);break;case "cs":var Ac;void 0!==g[3]&&(Ac=+g[3]);switch(g[2]){case "int":a.f.Ab=Ac;break;case "start":a.f.Rb=Ac;break;case "stop":a.f.Cb=Ac;break;default:a.u("unknown cs option");break a}void 0!==Ac&&Td(a.f);a.u("checksums "+(a.f.A.zb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Yd(a.f,+g[2])||a.u("warning: using 1x multiplier, previous target not reached"));
|
||||||
a.u("target speed: "+(a.f.gb.toFixed(2)+"Mhz")+" ("+a.f.Ya+"x)");break;default:if(g[1]){a.u("unknown option: "+g[1]);break}case "?":a.u("debugger options:"),a.u("\tbase #\t\tset default base to #"),a.u("\tcs int #\tset checksum cycle interval to #"),a.u("\tcs start #\tset checksum cycle start count to #"),a.u("\tcs stop #\tset checksum cycle stop count to #"),a.u("\tsp #\t\tset speed multiplier to #")}break;case "t":kk(a,g[0],g[1]);break;case "u":Kj(a,g[1],g[2],8);break;case "v":if("var"==g[0]){hk(a,
|
a.u("target speed: "+(a.f.nb.toFixed(2)+"Mhz")+" ("+a.f.Za+"x)");break;default:if(g[1]){a.u("unknown option: "+g[1]);break}case "?":a.u("debugger options:"),a.u("\tbase #\t\tset default base to #"),a.u("\tcs int #\tset checksum cycle interval to #"),a.u("\tcs start #\tset checksum cycle start count to #"),a.u("\tcs stop #\tset checksum cycle stop count to #"),a.u("\tsp #\t\tset speed multiplier to #")}break;case "t":ik(a,g[0],g[1]);break;case "u":Ij(a,g[1],g[2],8);break;case "v":if("var"==g[0]){fk(a,
|
||||||
b.substr(3))||(d=!1);break}if("ver"==g[0]){a.u((xb||"PDP11")+" version 1.31.1 ("+a.f.xa+",RELEASE"+(zb?",TYPEDARRAYS":yb?",BYTEARRAYS":",LONGARRAYS")+")");a.u(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){jk(a,b.substr(1));break}var ef="commands:",ff;for(ff in nk)ef+="\n"+ta(ff,9)+nk[ff];gf(a)||(ef+="\nnote: history disabled if no exec breakpoints");a.u(ef);break;default:f=!0}f&&(a.u("unknown command: "+b),d=!1)}}catch(Ai){a.u("debugger error: "+(Ai.stack||Ai.message)),
|
b.substr(3))||(d=!1);break}if("ver"==g[0]){a.u((wb||"PDP11")+" version 1.31.1 ("+a.f.ya+",RELEASE"+(yb?",TYPEDARRAYS":xb?",BYTEARRAYS":",LONGARRAYS")+")");a.u(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){hk(a,b.substr(1));break}var cf="commands:",df;for(df in lk)cf+="\n"+ta(df,9)+lk[df];ff(a)||(cf+="\nnote: history disabled if no exec breakpoints");a.u(cf);break;default:f=!0}f&&(a.u("unknown command: "+b),d=!1)}}catch(yi){a.u("debugger error: "+(yi.stack||yi.message)),
|
||||||
d=!1}return d}function Xd(a,b,c){b=Yi(a,b,c);for(var d in b)if(!Qj(a,b[+d]))return!1;return!0}
|
d=!1}return d}function Wd(a,b,c){b=Xi(a,b,c);for(var d in b)if(!Oj(a,b[+d]))return!1;return!0}
|
||||||
var nk={"?":"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"},Tj=".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(" "),
|
var lk={"?":"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"},Rj=".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(" "),
|
||||||
uj=20,vj=21,wj=22,xj=23,yj=24,zj=25,Aj=26,Bj=27,Cj=28,Dj=29,Ej=30,sj={SP:6,PC:7,PS:uj,PI:vj,ER:wj,SL:xj,M0:yj,M1:zj,M2:Aj,M3:Bj,AR:Cj,DR:Dj,SR:Ej},mk="KI KD SI SD ?? ?? UI UD".split(" "),ak=7,bk=56,Y=bk|ak,Zj=4032,X=4096,Vj=8192,Wj=12288,Xj=24576,Yj=32768,Uj=61440,jj={61440:{4096:[62,Zj,Y],8192:[47,Zj,Y],12288:[18,Zj,Y],16384:[14,Zj,Y],20480:[16,Zj,Y],24576:[3,Zj,Y],36864:[63,Zj,Y],40960:[48,Zj,Y],45056:[19,Zj,Y],49152:[15,Zj,Y],53248:[17,Zj,Y],57344:[94,Zj,Y]},65024:{2048:[57,448,Y],28672:[100,Y,
|
tj=20,uj=21,vj=22,wj=23,xj=24,yj=25,zj=26,Aj=27,Bj=28,Cj=29,Dj=30,rj={SP:6,PC:7,PS:tj,PI:uj,ER:vj,SL:wj,M0:xj,M1:yj,M2:zj,M3:Aj,AR:Bj,DR:Cj,SR:Dj},kk="KI KD SI SD ?? ?? UI UD".split(" "),Yj=7,Zj=56,Y=Zj|Yj,Xj=4032,X=4096,Tj=8192,Uj=12288,Vj=24576,Wj=32768,Sj=61440,ij={61440:{4096:[62,Xj,Y],8192:[47,Xj,Y],12288:[18,Xj,Y],16384:[14,Xj,Y],20480:[16,Xj,Y],24576:[3,Xj,Y],36864:[63,Xj,Y],40960:[48,Xj,Y],45056:[19,Xj,Y],49152:[15,Xj,Y],53248:[17,Xj,Y],57344:[94,Xj,Y]},65024:{2048:[57,448,Y],28672:[100,Y,
|
||||||
448],29184:[101,Y,448],29696:[102,Y,448],30208:[103,Y,448],30720:[104,448,Y],32256:[105,448,Vj]},65280:{256:[27,X],512:[24,X],768:[10,X],1024:[11,X],1280:[22,X],1536:[12,X],1792:[20,X],32768:[25,X],33024:[23,X],33280:[13,X],33536:[21,X],33792:[28,X],34048:[29,X],34304:[8,X],34560:[9,X],34816:[106,Yj],35072:[107,Yj]},65472:{64:[56,Y],192:[95,Y],2560:[39,Y],2624:[49,Y],2688:[53,Y],2752:[51,Y],2816:[67,Y],2880:[1,Y],2944:[77,Y],3008:[97,Y],3072:[73,Y],3136:[71,Y],3200:[6,Y],3264:[4,Y],3328:[58,Xj],3392:[60,
|
448],29184:[101,Y,448],29696:[102,Y,448],30208:[103,Y,448],30720:[104,448,Y],32256:[105,448,Tj]},65280:{256:[27,X],512:[24,X],768:[10,X],1024:[11,X],1280:[22,X],1536:[12,X],1792:[20,X],32768:[25,X],33024:[23,X],33280:[13,X],33536:[21,X],33792:[28,X],34048:[29,X],34304:[8,X],34560:[9,X],34816:[106,Wj],35072:[107,Wj]},65472:{64:[56,Y],192:[95,Y],2560:[39,Y],2624:[49,Y],2688:[53,Y],2752:[51,Y],2816:[67,Y],2880:[1,Y],2944:[77,Y],3008:[97,Y],3072:[73,Y],3136:[71,Y],3200:[6,Y],3264:[4,Y],3328:[58,Vj],3392:[60,
|
||||||
Y],3456:[65,Y],3520:[96,Y],35328:[40,Y],35392:[50,Y],35456:[54,Y],35520:[52,Y],35584:[68,Y],35648:[2,Y],35712:[78,Y],35776:[98,Y],35840:[74,Y],35904:[72,Y],35968:[7,Y],36032:[5,Y],36096:[66,Y],36160:[59,Y],36224:[64,Y],36288:[61,Y]},65528:{128:[76,ak],152:[108,Wj]},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],
|
Y],3456:[65,Y],3520:[96,Y],35328:[40,Y],35392:[50,Y],35456:[54,Y],35520:[52,Y],35584:[68,Y],35648:[2,Y],35712:[78,Y],35776:[98,Y],35840:[74,Y],35904:[72,Y],35968:[7,Y],36032:[5,Y],36096:[66,Y],36160:[59,Y],36224:[64,Y],36288:[61,Y]},65528:{128:[76,Yj],152:[108,Uj]},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]}},Sj=[0],nj=[58,60,65,96,108,110,100,101,102,103,104,105,59,64],Gj=1E3;Ta(function(){for(var a=D(document,B,"debugger"),b=0;b<a.length;b++){var c=a[b],d=pb(c),d=new fj(d);qb(d,c)}});
|
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]}},Qj=[0],mj=[58,60,65,96,108,110,100,101,102,103,104,105,59,64],Ej=1E3;Wa(function(){for(var a=G(document,D,"debugger"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new ej(d);pb(d,c)}});
|
||||||
function ok(a,b,c){A.call(this,"Computer",a,0,33554432);this.A.ea=!1;this.O=null;pk(this,b);this.L=Sd(this,"autoPower",a);this.j=0;this.T=a.busWidth||a.buswidth;this.b=qk;this.H=null;this.R=this.w=this.M=this.C=this.S=!1;this.v=null;this.V=Sd(this,"url")||"";(Math.random()+.1).toString(36);this.g=rk(this);if(this.f=ob("CPU",this.id)){this.F=ob("Debugger",this.id);this.D=new Ec({id:this.kb+".bus",busWidth:this.T},this.f,this.F);var d,e=mb(this.id);if((this.i=ob("Panel",this.id))&&this.i.Oa)for(b=0;b<
|
function mk(a,b,c){A.call(this,"Computer",a,0,33554432);this.A.fa=!1;this.O=null;nk(this,b);this.L=Rd(this,"autoPower",a);this.j=0;this.T=a.busWidth||a.buswidth;this.b=ok;this.H=null;this.R=this.w=this.M=this.C=this.S=!1;this.v=null;this.V=Rd(this,"url")||"";(Math.random()+.1).toString(36);this.g=pk(this);if(this.f=ob("CPU",this.id)){this.F=ob("Debugger",this.id);this.D=new Dc({id:this.lb+".bus",busWidth:this.T},this.f,this.F);var d,e=mb(this.id);if((this.i=ob("Panel",this.id))&&this.i.Oa)for(b=0;b<
|
||||||
e.length;b++)d=e[b],d.N=this.i.N,d.u=this.i.u,d.Oa=this.i.Oa;this.u(xb+" v1.31.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.u("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.pa&&d.pa(this,this.D,this.f,this.F);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.G=d:this.b=parseInt(d,10));var f;if(a=Sd(this,"state")||(f=!0,a.state))b=this.P=
|
e.length;b++)d=e[b],d.N=this.i.N,d.u=this.i.u,d.Oa=this.i.Oa;this.u(wb+" v1.31.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.u("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.qa&&d.qa(this,this.D,this.f,this.F);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.G=d:this.b=parseInt(d,10));var f;if(a=Rd(this,"state")||(f=!0,a.state))b=this.P=
|
||||||
a,f||(this.C=!0,this.b=qk),this.b&&(this.J=new le(this,"1.31.1"),sk(this.J)?b=null:delete this.J);!b&&this.b&&(b=tk(this))&&(this.C=!0);if(b){var g=this;Aa(b,null,!0,function(a,b,c){c?(g.G=null,g.C=!1,g.N("Unable to load machine state from server (error "+c+(b?": "+ua(b):"")+")")):(g.H=b,g.S=!0);G(g)})}else G(this);this.B.power||(this.L=!0);!c&&this.L&&uk(this,this.Sb)}else y("Unable to find CPU component")}p(ok,A);
|
a,f||(this.C=!0,this.b=ok),this.b&&(this.J=new ke(this,"1.31.1"),qk(this.J)?b=null:delete this.J);!b&&this.b&&(b=rk(this))&&(this.C=!0);if(b){var g=this;Aa(b,null,!0,function(a,b,c){c?(g.G=null,g.C=!1,g.N("Unable to load machine state from server (error "+c+(b?": "+ua(b):"")+")")):(g.H=b,g.S=!0);H(g)})}else H(this);this.B.power||(this.L=!0);!c&&this.L&&sk(this,this.Ub)}else y("Unable to find CPU component")}p(mk,A);
|
||||||
function pk(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){y(d.message+" ("+c+")")}}a.O=b}function Sd(a,b,c){var d=b.toLowerCase(),d=Na(b)||Na(d);void 0===d&&a.O&&(d=a.O[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function uk(a,b,c){for(var d=mb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!tb(f)){tb(f,function(){uk(a,b,c)});return}}b.call(a,c)}
|
function nk(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){y(d.message+" ("+c+")")}}a.O=b}function Rd(a,b,c){var d=b.toLowerCase(),d=Na(b)||Na(d);void 0===d&&a.O&&(d=a.O[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function sk(a,b,c){for(var d=mb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!sb(f)){sb(f,function(){sk(a,b,c)});return}}b.call(a,c)}
|
||||||
function vk(a,b){var c=new le(a,"1.31.1",wk);if(sk(c)&&xk(c)){var d=c.get(yk),e=b?b.get(yk):"unknown";d!=e&&(a.N("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=ok.prototype;
|
function tk(a,b){var c=new ke(a,"1.31.1",uk);if(qk(c)&&vk(c)){var d=c.get(wk),e=b?b.get(wk):"unknown";d!=e&&(a.N("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=mk.prototype;
|
||||||
h.Sb=function(a){void 0===a&&(a=this.b||(this.H?zk:qk));if(!this.j){this.j++;var b=!1,c=!1;this.M=!1;var d=this.J||new le(this,"1.31.1");if(a==Ak)b=!0;else if(a>qk){if(sk(d,this.H)){this.v=new le(this,"1.31.1",Bk);sk(this.v)&&(Ck(this,d),a=Dk,Ek(this.v));this.v.set(yk,za());Fk(this.v);var e=this.b&&!this.C;if(a==zk||Da("Click OK to restore the previous "+xb+" machine state, or CANCEL to reset the machine.")){if(c=xk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?sk(d,g):("error"==f&&"no machine state"!=
|
h.Ub=function(a){void 0===a&&(a=this.b||(this.H?xk:ok));if(!this.j){this.j++;var b=!1,c=!1;this.M=!1;var d=this.J||new ke(this,"1.31.1");if(a==yk)b=!0;else if(a>ok){if(qk(d,this.H)){this.v=new ke(this,"1.31.1",zk);qk(this.v)&&(Ak(this,d),a=Bk,Ck(this.v));this.v.set(wk,za());Dk(this.v);var e=this.b&&!this.C;if(a==xk||Da("Click OK to restore the previous "+wb+" machine state, or CANCEL to reset the machine.")){if(c=vk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?qk(d,g):("error"==f&&"no machine state"!=
|
||||||
g?(this.N("Error: "+g),"unable to verify user"==g&&(La(Gk,""),this.g=null)):this.u(f+": "+g),Ek(d),sk(d)?(c=xk(d),e=!0):c=!1))}e&&vk(this,c?d:null)}else a==Dk&&d.clear()}else vk(this);delete this.H;delete this.J}e=mb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.f&&(c=Hk(this,g,d,b,c));b=[d,a,c];a!=Ak?uk(this,this.cd,b):this.cd(b)}};
|
g?(this.N("Error: "+g),"unable to verify user"==g&&(La(Ek,""),this.g=null)):this.u(f+": "+g),Ck(d),qk(d)?(c=vk(d),e=!0):c=!1))}e&&tk(this,c?d:null)}else a==Bk&&d.clear()}else tk(this);delete this.H;delete this.J}e=mb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.f&&(c=Fk(this,g,d,b,c));b=[d,a,c];a!=yk?sk(this,this.ed,b):this.ed(b)}};
|
||||||
function Hk(a,b,c,d,e){if(!b.A.ea){b.A.ea=!0;if(b.qa){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.qa(f,d)&&f&&(y("Unable to restore state for "+b.type),a.P&&!a.S?(c.clear(),a.b=qk,window&&window.location.reload()):a.M=!0,b.qa(null),e=!1)}if(!d&&b.Qc)for(a=b.Qc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
function Fk(a,b,c,d,e){if(!b.A.fa){b.A.fa=!0;if(b.ra){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.ra(f,d)&&f&&(y("Unable to restore state for "+b.type),a.P&&!a.S?(c.clear(),a.b=ok,window&&window.location.reload()):a.M=!0,b.ra(null),e=!1)}if(!d&&b.Rc)for(a=b.Rc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||||
h.cd=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.A.ea=!0;var d=this.B.power;d&&(d.textContent="Shutdown");this.f&&(Hk(this,this.f,b,c,a),L(this),this.f.Ra());this.M&&(Ck(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0};
|
h.ed=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.A.fa=!0;var d=this.B.power;d&&(d.textContent="Shutdown");this.f&&(Fk(this,this.f,b,c,a),L(this),this.f.Sa());this.M&&(Ak(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0};
|
||||||
function Ck(a,b){if(Da("There may be a problem with your "+xb+" machine.\n\nTo help us diagnose it, click OK to send this "+xb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=xb;d.ver="1.31.1";d.url=c;d.user=a;d.type="bug";d.data=b;Aa("http://www.pcjs.org/api/v1/report",d,!0)}}
|
function Ak(a,b){if(Da("There may be a problem with your "+wb+" machine.\n\nTo help us diagnose it, click OK to send this "+wb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=wb;d.ver="1.31.1";d.url=c;d.user=a;d.type="bug";d.data=b;Aa("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||||
function lk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new le(a,"1.31.1"),g=new le(a,"1.31.1",wk),k=za();g.set(yk,k);f.set(yk,k);f.set(Ik,"1.31.1");f.set(Jk,window?window.location.href:null);f.set(Mk,window?window.navigator.userAgent:"");a.f&&a.f.za&&(c&&J(a.f),d=a.f.za(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.ea=!1,!1===d&&(e=null)));for(var k=mb(a.id),l=0;l<k.length;l++){var m=k[l];m.A.ea&&(m.za&&(d=m.za(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.A.ea=!1,!1===d&&(e=null)))}e&&
|
function jk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new ke(a,"1.31.1"),g=new ke(a,"1.31.1",uk),k=za();g.set(wk,k);f.set(wk,k);f.set(Gk,"1.31.1");f.set(Hk,window?window.location.href:null);f.set(Kk,window?window.navigator.userAgent:"");a.f&&a.f.Aa&&(c&&a.f.Y(),d=a.f.Aa(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.fa=!1,!1===d&&(e=null)));for(var k=mb(a.id),l=0;l<k.length;l++){var m=k[l];m.A.fa&&(m.Aa&&(d=m.Aa(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.A.fa=!1,!1===d&&(e=null)))}e&&
|
||||||
(c?(k=d=!1,b?(a.g&&Wk(a,a.g,f.toString()),Fk(g)&&Fk(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=a.b==Xk),d&&f.clear(k)):e=f.toString());c&&(a.A.ea=!1,b=a.B.power)&&(b.textContent="Power");a.j=0;return e}h.reset=function(){this.D&&this.D.reset&&(I(this,"Resetting "+this.D.type),this.D.reset());this.f&&this.f.reset&&(I(this,"Resetting "+this.f.type),this.f.reset());for(var a=mb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.D&&c!==this.f&&c.reset&&(I(this,"Resetting "+c.type),c.reset())}L(this,-1)};
|
(c?(k=d=!1,b?(a.g&&Uk(a,a.g,f.toString()),Dk(g)&&Dk(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=a.b==Vk),d&&f.clear(k)):e=f.toString());c&&(a.A.fa=!1,b=a.B.power)&&(b.textContent="Power");a.j=0;return e}h.reset=function(){this.D&&this.D.reset&&(J(this,"Resetting "+this.D.type),this.D.reset());this.f&&this.f.reset&&(J(this,"Resetting "+this.f.type),this.f.reset());for(var a=mb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.D&&c!==this.f&&c.reset&&(J(this,"Resetting "+c.type),c.reset())}L(this,-1)};
|
||||||
h.start=function(a,b){for(var c=mb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}L(this,-1)};h.stop=function(a,b){for(var c=mb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}L(this,-1)};
|
h.start=function(a,b){for(var c=mb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}L(this,-1)};h.stop=function(a,b){for(var c=mb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}L(this,-1)};
|
||||||
function L(a,b){if(a.f){var c=a.f,d=b||0,e=c.B.speed;e&&(0>=d||30<=(c.nc+=d))&&(e.textContent=c.A.U?c.lb.toFixed(2)+"Mhz":"Stopped",c.nc=0)}if(a.i&&(a=a.i,b=b||0,a.v)){c=a.f.A.U;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;e<a.f.g.length;e++)Xb(a,"R"+e,a.f.g[e]);e=nd(a.f);Xb(a,"PS",e);Xb(a,"NF",e&8?1:0,1);Xb(a,"ZF",e&4?1:0,1);Xb(a,"VF",e&2?1:0,1);Xb(a,"CF",e&1?1:0,1);a.j=0}nc(a,0<b&&c&&!d?a.f.ib:a.ra);ic(a,a.sb);b=a.f;b=b.Va?b.T&16?1:2:4;pc(a,"B22",b&1);pc(a,"B18",b&2);pc(a,"B16",b&4)}}
|
function L(a,b){if(a.f){var c=a.f,d=b||0,e=c.B.speed;e&&(0>=d||30<=(c.oc+=d))&&(e.textContent=c.A.U?c.mb.toFixed(2)+"Mhz":"Stopped",c.oc=0)}if(a.i&&(a=a.i,b=b||0,a.v)){c=a.f.A.U;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;e<a.f.g.length;e++)Wb(a,"R"+e,a.f.g[e]);e=md(a.f);Wb(a,"PS",e);Wb(a,"NF",e&8?1:0,1);Wb(a,"ZF",e&4?1:0,1);Wb(a,"VF",e&2?1:0,1);Wb(a,"CF",e&1?1:0,1);a.j=0}mc(a,0<b&&c&&!d?a.f.jb:a.sa);hc(a,a.tb);b=a.f;b=b.Wa?b.T&16?1:2:4;oc(a,"B22",b&1);oc(a,"B18",b&2);oc(a,"B16",b&4)}}
|
||||||
h.na=function(a,b,c){var d=this;switch(b){case "power":return this.B[b]=c,c.onclick=function(){d.j||(d.A.ea?lk(d,!1,!0):uk(d,d.Sb))},!0;case "reset":return this.B[b]=c,c.onclick=function(){if(d.A.ea&&!d.j)if(d.b&&!d.G){var a=Da("Click OK to save changes to this "+xb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");lk(d,a,!0);!a&&d.P?window&&window.location.reload():(a||(d.w=!0),d.Sb(qk),d.w=!1)}else d.reset(),d.f&&d.f.Ra()},!0;case "save":if(pa(Ca(),"pcjs.org"))c.parentNode.removeChild(c);
|
h.oa=function(a,b,c){var d=this;switch(b){case "power":return this.B[b]=c,c.onclick=function(){d.j||(d.A.fa?jk(d,!1,!0):sk(d,d.Ub))},!0;case "reset":return this.B[b]=c,c.onclick=function(){if(d.A.fa&&!d.j)if(d.b&&!d.G){var a=Da("Click OK to save changes to this "+wb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");jk(d,a,!0);!a&&d.P?window&&window.location.reload():(a||(d.w=!0),d.Ub(ok),d.w=!1)}else d.reset(),d.f&&d.f.Sa()},!0;case "save":if(pa(Ca(),"pcjs.org"))c.parentNode.removeChild(c);
|
||||||
else return this.B[b]=c,c.onclick=function(){var a=rk(d,!0);if(a){var b=!!(d.b&&!d.G||d.P),c=lk(d,b);b?Wk(d,a,c):d.N("Resume disabled, machine state not saved")}},!0}return!1};
|
else return this.B[b]=c,c.onclick=function(){var a=pk(d,!0);if(a){var b=!!(d.b&&!d.G||d.P),c=jk(d,b);b?Uk(d,a,c):d.N("Resume disabled, machine state not saved")}},!0}return!1};
|
||||||
function rk(a,b){var c=a.g;c||((c=Ka(Gk),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=Yk(a,c))||a.N("The user ID is invalid.")):b&&a.N("Browser local storage is not available"));return c}
|
function pk(a,b){var c=a.g;c||((c=Ka(Ek),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=Wk(a,c))||a.N("The user ID is invalid.")):b&&a.N("Browser local storage is not available"));return c}
|
||||||
function Yk(a,b){a.g=null;b=Aa(Ca()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(La(Gk,b.data),a.g=b.data)}catch(d){y(d.message+" ("+c+")")}return a.g}function tk(a){var b=null;a.g&&(b=Ca()+"/api/v1/user?req=load&user="+a.g+"&state="+Zk(a,"1.31.1"));return b}
|
function Wk(a,b){a.g=null;b=Aa(Ca()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(La(Ek,b.data),a.g=b.data)}catch(d){y(d.message+" ("+c+")")}return a.g}function rk(a){var b=null;a.g&&(b=Ca()+"/api/v1/user?req=load&user="+a.g+"&state="+Xk(a,"1.31.1"));return b}
|
||||||
function Wk(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Zk(a,"1.31.1");d.data=c;b=Aa(Ca()+"/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.N("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.N(c),La(Gk,""),a.g=null)}}
|
function Uk(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Xk(a,"1.31.1");d.data=c;b=Aa(Ca()+"/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.N("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.N(c),La(Ek,""),a.g=null)}}
|
||||||
function Eh(a){var b;a=mb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function be(a,b){if(a.Oa){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a.Oa.focus();!b&&window&&window.scrollTo(c,d)}}var Bk="failsafe",wk="validate",yk="timestamp",Ik="version",Jk="url",Mk="browser",Gk="user",Ak=-1,qk=0,zk=1,Dk=2,Xk=3;
|
function Dh(a){var b;a=mb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function ae(a,b){if(a.Oa){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a.Oa.focus();!b&&window&&window.scrollTo(c,d)}}var zk="failsafe",uk="validate",wk="timestamp",Gk="version",Hk="url",Kk="browser",Ek="user",yk=-1,ok=0,xk=1,Bk=2,Vk=3;
|
||||||
Ta(function(){for(var a=D(document,B+"-machine"),b=0;b<a.length;b++)for(var c=a[b],d=pb(c),c=D(c,B,"computer"),e=0;e<c.length;e++){var f=c[e],g=pb(f),g=new ok(g,d,!0);qb(g,f);g.L&&uk(g,g.Sb)}});Xa.show.push(function(){for(var a=D(document,B,"computer"),b=0;b<a.length;b++){var c=pb(a[b]);(c=ob("Computer",c.id))&&c.R&&!c.A.ea&&c.Sb(Ak)}});Xa.exit.push(function(){for(var a=D(document,B,"computer"),b=0;b<a.length;b++){var c=pb(a[b]);(c=ob("Computer",c.id))&&c.A.ea&&lk(c,!(!c.b||c.G),!0)}});
|
Wa(function(){for(var a=G(document,D+"-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=G(c,D,"computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new mk(g,d,!0);pb(g,f);g.L&&sk(g,g.Ub)}});Xa.show.push(function(){for(var a=G(document,D,"computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=ob("Computer",c.id))&&c.R&&!c.A.fa&&c.Ub(yk)}});Xa.exit.push(function(){for(var a=G(document,D,"computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=ob("Computer",c.id))&&c.A.fa&&jk(c,!(!c.b||c.G),!0)}});
|
||||||
function le(a,b,c){this.id=a.id;this.b="";this.f={};this.g=this.B=!1;this.key=Zk(a,b,c);Ek(this,a.Dd)}h=le.prototype;h.set=function(a,b){try{this.f[a]=b}catch(c){}};h.get=function(a){return this.f[a]||null};h.data=function(){return this.f};function sk(a,b){return b?(a.b=b,a.g=!0,a.B=!1,!0):a.g?!0:Ea()&&(b=Ka(a.key))?(a.b=b,a.g=!0):!1}function xk(a){var b=!0;if(!a.B)try{a.f=JSON.parse(a.b),a.B=!0}catch(c){y(c.message||c),b=!1}return b}
|
function ke(a,b,c){this.id=a.id;this.b="";this.f={};this.g=this.B=!1;this.key=Xk(a,b,c);Ck(this,a.Fd)}h=ke.prototype;h.set=function(a,b){try{this.f[a]=b}catch(c){}};h.get=function(a){return this.f[a]||null};h.data=function(){return this.f};function qk(a,b){return b?(a.b=b,a.g=!0,a.B=!1,!0):a.g?!0:Ea()&&(b=Ka(a.key))?(a.b=b,a.g=!0):!1}function vk(a){var b=!0;if(!a.B)try{a.f=JSON.parse(a.b),a.B=!0}catch(c){y(c.message||c),b=!1}return b}
|
||||||
function Fk(a){var b=!0;if(Ea()){var c=JSON.stringify(a.f);La(a.key,c)||(y("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}h.toString=function(){return this.f?JSON.stringify(this.f):this.b};function Ek(a,b){a.b="";a.f={};a.g=a.B=!1;b&&a.set("parms",b)}
|
function Dk(a){var b=!0;if(Ea()){var c=JSON.stringify(a.f);La(a.key,c)||(y("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}h.toString=function(){return this.f?JSON.stringify(this.f):this.b};function Ck(a,b){a.b="";a.f={};a.g=a.B=!1;b&&a.set("parms",b)}
|
||||||
h.clear=function(a){Ek(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 Zk(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}var $k=0;
|
h.clear=function(a){Ck(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 Xk(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}var Yk=0;
|
||||||
function al(a,b,c,d,e,f){e("Loading "+a+"...");Aa(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):bl(k,a,b,c,d,e,f)})}
|
function Zk(a,b,c,d,e,f){e("Loading "+a+"...");Aa(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):$k(k,a,b,c,d,e,f)})}
|
||||||
function bl(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(eb(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"),
|
function $k(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(fb(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(n){f=null,a=n.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?cl(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
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(n){f=null,a=n.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?al(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||||
function cl(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Aa(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
function al(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Aa(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||||
"");a=a.replace(d[0],g);cl(a,b,c)}})}else c(a,null)}
|
"");a=a.replace(d[0],g);al(a,b,c)}})}else c(a,null)}
|
||||||
function dl(a,b,c,d){function e(a){if(void 0===k){var b=g&&D(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=qa(a))}function f(a){e("Error: "+a);l&&(--$k||$a(!0));l=!1}var g,k,l=!0;$k++;gb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c||
|
function bl(a,b,c,d){function e(a){if(void 0===k){var b=g&&G(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=ra(a))}function f(a){e("Error: "+a);l&&(--Yk||$a(!0));l=!1}var g,k,l=!0;Yk++;lb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c||
|
||||||
(c="/versions/pdpjs/1.31.1/components.xsl");m=function(d,k){k?al(c,null,null,!1,e,function(d,l){l?(eb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--$k||$a(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--$k||$a(!0)):f("invalid machine element: "+
|
(c="/versions/pdpjs/1.31.1/components.xsl");m=function(d,k){k?Zk(c,null,null,!1,e,function(d,l){l?(fb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--Yk||$a(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Yk||$a(!0)):f("invalid machine element: "+
|
||||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?al(b,a,d,!0,e,m):bl(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){$a(!1);return dl(a,b,c,d)};window.enableEvents=$a;window.sendEvent=bb;})();//# sourceMappingURL=/tmp/pdpjs/1.31.1/pdp11-dbg.map
|
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Zk(b,a,d,!0,e,m):$k(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){$a(!1);return bl(a,b,c,d)};window.enableEvents=$a;window.sendEvent=bb;})();//# sourceMappingURL=/tmp/pdpjs/1.31.1/pdp11-dbg.map
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue